aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-01-13 21:40:58 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-08-07 02:12:14 +0200
commit18ab4f38f5bb22f9eec09954f25a2bf4d607ed38 (patch)
treecb4b9f5c82bd1589d936cb185de922370f7190b7
parentfc893266a4e1cd316c4c4006204a533d5e083083 (diff)
MT call: init codecs filter with BSS codec list and SDP
-rw-r--r--src/libmsc/gsm_04_08_cc.c27
-rw-r--r--tests/msc_vlr/msc_vlr_test_call.err4
2 files changed, 31 insertions, 0 deletions
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 60a7d0458..0e9b7b459 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -672,6 +672,33 @@ static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg)
gsm48_start_cc_timer(trans, 0x303, GSM48_T303);
+ /* MT call leg is starting. Gather all codecs information so far known.
+ * (Usually) paging has succeeded, and now we're processing the MNCC Setup from the remote MO call leg.
+ * Initialize the codecs filter with this side's BSS' codec list, received at Complete Layer 3.
+ * We must not pass bearer_cap to codec_filter_init(), because we haven't received the MT MS's Bearer
+ * Capabilities yet; the Bearer Capabilities handled here are actually the remote call leg's Bearer
+ * Capabilities. */
+ codec_filter_init(&trans->cc.codecs);
+ codec_filter_set_ran(&trans->cc.codecs, trans->msc_a->c.ran->type);
+ codec_filter_set_bss(&trans->cc.codecs, &trans->msc_a->cc.compl_l3_codec_list_bss_supported);
+ /* sdp.remote: if SDP is included in the MNCC, take that as definitive list of remote audio codecs. */
+ if (setup->sdp[0]) {
+ rc = sdp_msg_from_sdp_str(&trans->cc.codecs.remote, setup->sdp);
+ if (rc)
+ LOG_TRANS(trans, LOGL_ERROR, "Failed to parse remote call leg SDP: %d\n", rc);
+ }
+ /* sdp.remote: if there is no SDP information or we failed to parse it, try using the Bearer Capability from
+ * MNCC, if any. */
+ if (!trans->cc.codecs.remote.audio_codecs.count && (setup->fields & MNCC_F_BEARER_CAP)) {
+ trans->cc.codecs.remote = (struct sdp_msg){};
+ sdp_audio_codecs_from_bearer_cap(&trans->cc.codecs.remote.audio_codecs,
+ &setup->bearer_cap);
+ }
+ LOG_TRANS(trans, LOGL_DEBUG, "codecs: %s\n", codec_filter_to_str(&trans->cc.codecs));
+ if (!trans->cc.codecs.remote.audio_codecs.count)
+ LOG_TRANS(trans, LOGL_ERROR,
+ "Got no information of remote audio codecs: neither SDP nor Bearer Capability. Trying anyway.\n");
+
/* bearer capability */
if (setup->fields & MNCC_F_BEARER_CAP) {
/* Create a copy of the bearer capability in the transaction struct, so we
diff --git a/tests/msc_vlr/msc_vlr_test_call.err b/tests/msc_vlr/msc_vlr_test_call.err
index 33d749c3c..e1c276741 100644
--- a/tests/msc_vlr/msc_vlr_test_call.err
+++ b/tests/msc_vlr/msc_vlr_test_call.err
@@ -761,6 +761,8 @@ DREF msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RES
DMSC msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_AUTHENTICATED}: Received Event MSC_A_EV_TRANSACTION_ACCEPTED
DMSC msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_AUTHENTICATED}: state_chg to MSC_A_ST_COMMUNICATING
DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) starting timer T303 with 30 seconds
+DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) codecs: RAN={AMR:octet-align=1#112,AMR-WB:octet-align=1#113} result=:0{(no-codecs)}
+DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) Got no information of remote audio codecs: neither SDP nor Bearer Capability. Trying anyway.
DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) new state NULL -> CALL_PRESENT
DIUCS msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: Sending DTAP: CC GSM48_MT_CC_SETUP
DMSC msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: RAN encode: DTAP on UTRAN-Iu
@@ -1231,6 +1233,8 @@ DREF msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RES
DMSC msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_AUTHENTICATED}: Received Event MSC_A_EV_TRANSACTION_ACCEPTED
DMSC msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_AUTHENTICATED}: state_chg to MSC_A_ST_COMMUNICATING
DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) starting timer T303 with 30 seconds
+DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) codecs: RAN={AMR:octet-align=1#112,AMR-WB:octet-align=1#113} result=:0{(no-codecs)}
+DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) Got no information of remote audio codecs: neither SDP nor Bearer Capability. Trying anyway.
DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) new state NULL -> CALL_PRESENT
DIUCS msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: Sending DTAP: CC GSM48_MT_CC_SETUP
DMSC msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: RAN encode: DTAP on UTRAN-Iu