diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-11 16:35:01 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-16 12:10:26 +0100 |
commit | d04011abc17f298714213b970cbdf034a1ac2d0d (patch) | |
tree | a160070210c42f47d212d5a16db6c825c347a152 /include | |
parent | 2df07d549db99e8aeb829308311f420bd7ee2f85 (diff) |
stp: Extract the MGCP forwarding code out of the msc_connection
For the ISUP/MGCP handling we will need the same code, extract it
from the msc_connection. For the reading code callback is introduced
that will pass the MGCP message to the higher layer.
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 2 | ||||
-rw-r--r-- | include/mgcp_callagent.h | 35 | ||||
-rw-r--r-- | include/msc_connection.h | 5 |
3 files changed, 39 insertions, 3 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index c923515..c46e698 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -2,6 +2,6 @@ noinst_HEADERS = mtp_level3.h mtp_data.h ipaccess.h thread.h mtp_pcap.h \ mgcp_ss7.h bss_patch.h bssap_sccp.h bsc_data.h udp_input.h \ snmp_mtp.h cellmgr_debug.h bsc_sccp.h bsc_ussd.h sctp_m2ua.h \ isup_types.h counter.h msc_connection.h ss7_application.h \ - mgcp_patch.h ss7_vty.h dtmf_scheduler.h + mgcp_patch.h ss7_vty.h dtmf_scheduler.h mgcp_callagent.h SUBDIRS = mgcp diff --git a/include/mgcp_callagent.h b/include/mgcp_callagent.h new file mode 100644 index 0000000..8260daa --- /dev/null +++ b/include/mgcp_callagent.h @@ -0,0 +1,35 @@ +/* + * (C) 2012 by Holger Hans Peter Freyther + * (C) 2012 by On-Waves + * All Rights Reserved + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#ifndef mgcp_callagent_h +#define mgcp_callagent_h + +#include <osmocom/core/write_queue.h> + +struct mgcp_callagent { + struct osmo_wqueue queue; + void (*read_cb)(struct mgcp_callagent *, struct msgb *msg); +}; + +int mgcp_create_port(struct mgcp_callagent *agent); +void mgcp_forward(struct mgcp_callagent *agent, const uint8_t *data, + unsigned int length); + +#endif diff --git a/include/msc_connection.h b/include/msc_connection.h index 94754d7..74319b3 100644 --- a/include/msc_connection.h +++ b/include/msc_connection.h @@ -20,8 +20,9 @@ #ifndef MSC_CONNECTION_H #define MSC_CONNECTION_H +#include "mgcp_callagent.h" + #include <osmocom/core/linuxlist.h> -#include <osmocom/core/write_queue.h> #include <osmocom/core/timer.h> #include <osmocom/sccp/sccp.h> @@ -57,7 +58,7 @@ struct msc_connection { struct osmo_timer_list pong_timeout; /* mgcp messgaes */ - struct osmo_wqueue mgcp_agent; + struct mgcp_callagent mgcp_agent; /* application pointer */ struct ss7_application *app; |