From 06c9ca49273e738c24592b5f6343ce98b6188e0b Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 5 Sep 2022 16:03:27 +0200 Subject: [PATCH] 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 --- src/libmsc/msc_a.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c index f99fbf02f..fedbead5b 100644 --- a/src/libmsc/msc_a.c +++ b/src/libmsc/msc_a.c @@ -1428,6 +1428,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){};