aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-09-05 16:03:27 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-10-13 16:12:26 +0200
commit21aaae7abb9305b21d7e8d58ff9baf0576ac952a (patch)
tree3c3da3561dc6330691339931079aad0d58dca284
parentff112a55a5ca3422e671e6cbcfdcf9819d8d0593 (diff)
codecs: for IuUP, use AMR for codec matching
For finding usable codecs / matching codecs with remote call leg, use AMR in place of IUFP. On Iu, to the MGW we need to set the codec VND.3GPP.IUFP on the RAN facing side. On the CN facing side, we indicate AMR instead, so that the MGW decapsulates the IuUP into plain AMR RTP. Related: SYS#5092 Change-Id: I752505dd8e2360665417cdba6a93cfa1490e4b70
-rw-r--r--src/libmsc/msc_a.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index d63e8bd74..18233b0ae 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -1440,6 +1440,17 @@ static void msc_a_up_call_assignment_complete(struct msc_a *msc_a, const struct
rtp_stream_set_one_codec(rtps_to_ran, &m->sdp);
/* Update codecs filter with the codec chosen by Assignment */
+ if (*codec_if_known == CODEC_IUFP) {
+ /* For IuUP, the MGW decapsulates it to plain AMR RTP. So for the purpose of matching to the
+ * other call leg / figuring out codecs, set to AMR instead. */
+ m = codec_mapping_by_mgcp_codec(CODEC_AMR_8000_1);
+ if (!m) {
+ /* this should never happen, CODEC_AMR_8000_1 is definitely present in codec_map[]. */
+ LOG_TRANS(cc_trans, LOGL_ERROR, "Error setting codec to AMR\n");
+ call_leg_release(msc_a->cc.call_leg);
+ return;
+ }
+ }
cc_trans->cc.codecs.assignment = m->sdp;
} else {
cc_trans->cc.codecs.assignment = (struct sdp_audio_codec){};