diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2017-11-07 17:19:25 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-02-05 22:28:43 +0000 |
commit | 621ba032bdf60383f5431ca936040c620551a3d5 (patch) | |
tree | 0fd222b08503b64e6d4109a7f3c0b678b16bf1ec /include | |
parent | 64dbc5464c7ef8f0ba2acbb1c924d4eef3e6e72e (diff) |
mgcp: use osmo-mgw to switch rtp streams
in the current implementation we still use osmo-bsc_mgcp, which
has many problems and is also obsoleted by osmo-mgw.
integrate osmo-mgw and re-implement the current switching using
an osmo fsm.
Depends: osmo-mgw Iab6a6038e7610c62f34e642cd49c93d11151252c
Depends: osmo-iuh I3c1a0455c5f25cae41ee19229d6daf299e023062
Closes: OS#2605
Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/msc/Makefile.am | 1 | ||||
-rw-r--r-- | include/osmocom/msc/gsm_data.h | 12 | ||||
-rw-r--r-- | include/osmocom/msc/iucs.h | 3 | ||||
-rw-r--r-- | include/osmocom/msc/msc_ifaces.h | 4 | ||||
-rw-r--r-- | include/osmocom/msc/msc_mgcp.h | 56 |
5 files changed, 70 insertions, 6 deletions
diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 88305dbb4..d31883ac4 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -20,6 +20,7 @@ noinst_HEADERS = \ mncc.h \ mncc_int.h \ msc_ifaces.h \ + msc_mgcp.h \ oap_client.h \ openbscdefines.h \ a_reset.h \ diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 2cddd2548..3f322b3d8 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -188,9 +188,17 @@ struct gsm_subscriber_connection { uint8_t n_sd_next[4]; struct { + struct mgcp_ctx *mgcp_ctx; unsigned int mgcp_rtp_endpoint; - uint16_t port_subscr; - uint16_t port_cn; + + uint16_t local_port_ran; + char local_addr_ran[INET_ADDRSTRLEN]; + uint16_t remote_port_ran; + char remote_addr_ran[INET_ADDRSTRLEN]; + uint16_t local_port_cn; + char local_addr_cn[INET_ADDRSTRLEN]; + uint16_t remote_port_cn; + char remote_addr_cn[INET_ADDRSTRLEN]; } rtp; /* which Iu-CS connection, if any. */ diff --git a/include/osmocom/msc/iucs.h b/include/osmocom/msc/iucs.h index b7d60645d..a48a31650 100644 --- a/include/osmocom/msc/iucs.h +++ b/include/osmocom/msc/iucs.h @@ -1,7 +1,10 @@ #pragma once +#include <osmocom/msc/transaction.h> + int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg, uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, struct ranap_ue_conn_ctx *ue); +int iu_rab_act_cs(struct gsm_trans *trans); diff --git a/include/osmocom/msc/msc_ifaces.h b/include/osmocom/msc/msc_ifaces.h index 0592c0701..ca25e9ddf 100644 --- a/include/osmocom/msc/msc_ifaces.h +++ b/include/osmocom/msc/msc_ifaces.h @@ -37,7 +37,3 @@ int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, enum gsm48_reject_value value); int msc_tx_common_id(struct gsm_subscriber_connection *conn); -int msc_call_assignment(struct gsm_trans *trans); -int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2); -void msc_call_release(struct gsm_trans *trans); -int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip); diff --git a/include/osmocom/msc/msc_mgcp.h b/include/osmocom/msc/msc_mgcp.h new file mode 100644 index 000000000..ac3283c75 --- /dev/null +++ b/include/osmocom/msc/msc_mgcp.h @@ -0,0 +1,56 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de> + * All Rights Reserved + * + * Author: Philipp Maier + * + * 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/>. + * + */ + +#pragma once + +#include <osmocom/mgcp_client/mgcp_client.h> +#include <osmocom/msc/gsm_data.h> + +/* MGCP state handler context. This context information stores all information + * to handle the direction of the RTP streams via MGCP. There is one instance + * of this context struct per subscriber connection. + * (see also struct gsm_subscriber_connection) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* RTP endpoint number. This number identifies the endpoint + * on the MGW on which the RAN and CN connection is created. This + * endpoint number is assigned and released automatically. */ + uint16_t rtp_endpoint; + + /* Set to true, when the context information is no longer needed */ + bool free_ctx; + + /* RTP connection identifiers */ + char conn_id_ran[MGCP_CONN_ID_LENGTH]; + char conn_id_cn[MGCP_CONN_ID_LENGTH]; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct mgcp_client *mgcp; + struct gsm_trans *trans; + mgcp_trans_id_t mgw_pending_trans; +}; + +int msc_mgcp_call_assignment(struct gsm_trans *trans); +int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr); +int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr); +int msc_mgcp_call_release(struct gsm_trans *trans); |