[PATCH] osmo-bsc[master]: bssmap_handle_assignm_req(): Decode channel type as first step

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Jan 28 02:09:28 UTC 2018


Review at  https://gerrit.osmocom.org/6147

bssmap_handle_assignm_req(): Decode channel type as first step

The decision on how to further process the request depends significantly
on the contents of the only mandatory IE of the ASSIGNMENT REQ.  Let's
decode it first.

Change-Id: I030b5ad6f4fc33da9155c8a6061fd982312b20fb
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 16 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/47/6147/1

diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 586657f..9bd3fe9 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -761,6 +761,22 @@
 		goto reject;
 	}
 
+	/* Decode Channel Type element */
+	rc = gsm0808_dec_channel_type(&ct,  TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE),
+				      TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE));
+	if (rc < 0) {
+		LOGP(DMSC, LOGL_ERROR, "unable to decode channel type.\n");
+		goto reject;
+	}
+
+	/* Currently we only support a limited subset of all
+	 * possible channel types. The limitation ends by not using
+	 * multi-slot, limiting the channel coding to speech */
+	if (ct.ch_indctr != GSM0808_CHAN_SPEECH) {
+		LOGP(DMSC, LOGL_ERROR, "Unsupported channel type, currently only speech is supported!\n");
+		goto reject;
+	}
+
 	/* Detect if a CIC code is present, if so, we use the classic ip.access
 	 * method to calculate the RTP port */
 	if (TLVP_PRESENT(&tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)) {
@@ -801,23 +817,6 @@
 			goto reject;
 		}
 		scl_ptr = &scl;
-	}
-
-	/* Decode Channel Type element */
-	rc = gsm0808_dec_channel_type(&ct,  TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE),
-				      TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE));
-	if (rc < 0) {
-		LOGP(DMSC, LOGL_ERROR, "unable to decode channel type.\n");
-		goto reject;
-	}
-
-	/* Currently we only support a limited subset of all
-	 * possible channel types. The limitation ends by not using
-	 * multi-slot, limiting the channel coding to speech */
-	if (ct.ch_indctr != GSM0808_CHAN_SPEECH) {
-		LOGP(DMSC, LOGL_ERROR,
-		     "Unsupported channel type, currently only speech is supported!\n");
-		goto reject;
 	}
 
 	/* Match codec information from the assignment command against the

-- 
To view, visit https://gerrit.osmocom.org/6147
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I030b5ad6f4fc33da9155c8a6061fd982312b20fb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list