Change in osmo-bsc[master]: bssap: Parse Osmux CID on BSSAP Assign Req recv and use it in MGCP

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun May 19 22:36:18 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13925 )

Change subject: bssap: Parse Osmux CID on BSSAP Assign Req recv and use it in MGCP
......................................................................

bssap: Parse Osmux CID on BSSAP Assign Req recv and use it in MGCP

The Osmux CID obtained from the MSC is passed to the co-located BSC MGW
to configure the MSC-side MGW conn of a call leg.

Depends on: osmo-mgw.git I73b4c62baf39050da81d65553cbea07bc51163de
Change-Id: I86e7e13fc7921e3209fb764c0e7797e7ec09b79e
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/osmo_bsc_bssap.c
3 files changed, 33 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index dc686c3..68c95e1 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -33,6 +33,7 @@
 #include <osmocom/bsc/bsc_msg_filter.h>
 #include <osmocom/bsc/acc_ramp.h>
 #include <osmocom/bsc/neighbor_ident.h>
+#include <osmocom/bsc/osmux.h>
 
 #define GSM_T3122_DEFAULT 10
 
@@ -120,6 +121,8 @@
 
 	char msc_rtp_addr[INET_ADDRSTRLEN];
 	uint16_t msc_rtp_port;
+	bool use_osmux;
+	uint8_t osmux_cid;
 
 	/* Rate/codec setting in preference order (need at least 1 !) */
 	int n_ch_mode_rate;
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index f944431..87ad567 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -519,6 +519,8 @@
 		.port = port,
 		.call_id = conn->sccp.conn_id,
 		.ptime = 20,
+		.x_osmo_osmux_use = conn->assignment.req.use_osmux,
+		.x_osmo_osmux_cid = conn->assignment.req.osmux_cid,
 	};
 	mgcp_pick_codec(&mgw_info, for_lchan, false);
 
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 9dee265..dcd06f3 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -776,6 +776,8 @@
 	struct tlv_parsed tp;
 	uint16_t cic = 0;
 	bool aoip = false;
+	bool use_osmux = false;
+	uint8_t osmux_cid = 0;
 	struct sockaddr_storage rtp_addr;
 	struct gsm0808_channel_type ct;
 	uint8_t cause;
@@ -853,6 +855,30 @@
 			goto reject;
 		}
 
+		if (TLVP_PRESENT(&tp, GSM0808_IE_OSMO_OSMUX_CID)) {
+			if (conn->sccp.msc->use_osmux == OSMUX_USAGE_OFF) {
+				LOGP(DMSC, LOGL_ERROR, "MSC using Osmux but we have it disabled.\n");
+				cause = GSM0808_CAUSE_INCORRECT_VALUE;
+				goto reject;
+			}
+			use_osmux = true;
+			rc = gsm0808_dec_osmux_cid(&osmux_cid,
+						   TLVP_VAL(&tp, GSM0808_IE_OSMO_OSMUX_CID),
+						   TLVP_LEN(&tp, GSM0808_IE_OSMO_OSMUX_CID));
+			if (rc < 0) {
+				LOGP(DMSC, LOGL_ERROR, "Unable to decode Osmux CID.\n");
+				cause = GSM0808_CAUSE_INCORRECT_VALUE;
+				goto reject;
+			}
+		} else {
+			if (conn->sccp.msc->use_osmux == OSMUX_USAGE_ONLY) {
+				LOGP(DMSC, LOGL_ERROR, "MSC not using Osmux but we are forced to use it.\n");
+				cause = GSM0808_CAUSE_INCORRECT_VALUE;
+				goto reject;
+			} else if (conn->sccp.msc->use_osmux == OSMUX_USAGE_ON)
+				LOGP(DMSC, LOGL_NOTICE, "MSC not using Osmux but we have Osmux enabled.\n");
+		}
+
 		/* Decode speech codec list. First set len = 0. */
 		conn->codec_list = (struct gsm0808_speech_codec_list){};
 		/* Check for speech codec list element */
@@ -878,6 +904,8 @@
 		req = (struct assignment_request){
 			.aoip = aoip,
 			.msc_assigned_cic = cic,
+			.use_osmux = use_osmux,
+			.osmux_cid = osmux_cid,
 		};
 
 		/* Match codec information from the assignment command against the

-- 
To view, visit https://gerrit.osmocom.org/13925
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I86e7e13fc7921e3209fb764c0e7797e7ec09b79e
Gerrit-Change-Number: 13925
Gerrit-PatchSet: 3
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190519/abce2013/attachment.html>


More information about the gerrit-log mailing list