aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/osmo-bsc/osmo_bsc_bssap.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 586657f41..9bd3fe9a1 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -761,6 +761,22 @@ static int bssmap_handle_assignm_req(struct osmo_bsc_sccp_con *conn,
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)) {
@@ -803,23 +819,6 @@ static int bssmap_handle_assignm_req(struct osmo_bsc_sccp_con *conn,
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
* local preferences of the BSC */
rc = match_codec_pref(&full_rate, &chan_mode, &ct, scl_ptr, msc);