aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/msc_a.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmsc/msc_a.c')
-rw-r--r--src/libmsc/msc_a.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index c022ee2d4..e8dc58b8a 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -1389,7 +1389,6 @@ static void msc_a_up_call_assignment_complete(struct msc_a *msc_a, const struct
struct rtp_stream *rtps_to_ran = msc_a->cc.call_leg ? msc_a->cc.call_leg->rtp[RTP_TO_RAN] : NULL;
const struct gsm0808_speech_codec *codec_if_known = ac->assignment_complete.codec_present ?
&ac->assignment_complete.codec : NULL;
- const struct codec_mapping *codec_cn;
if (!rtps_to_ran) {
LOG_MSC_A(msc_a, LOGL_ERROR, "Rx Assignment Complete, but no RTP stream is set up\n");
@@ -1408,27 +1407,27 @@ static void msc_a_up_call_assignment_complete(struct msc_a *msc_a, const struct
}
if (codec_if_known) {
- if (ac->assignment_complete.codec_with_iuup) {
- /* FUTURE: soon, we want to tell the MGW to decapsulate IuUP to plain AMR-FR/RTP. So far,
- * continue to forward IuUP to the CN.
- *
- * ran_msg_iu now returns AMR-FR as the assigned codec. If we use that directly, that will
- * instruct the MGW to decapsulate IuUP into plain RTP. Let's keep this change to an explicit
- * patch, while various codecs patches are still being applied.
- *
- * So instruct MGW to forward IuUP to CN:
- */
- codec_cn = codec_mapping_by_subtype_name("VND.3GPP.IUFP");
- OSMO_ASSERT(codec_cn);
- } else {
- codec_cn = codec_mapping_by_gsm0808_speech_codec_type(codec_if_known->type);
- /* TODO: use codec_mapping_by_gsm0808_speech_codec() to also match on codec_if_known->cfg */
- if (!codec_cn) {
- LOG_TRANS(cc_trans, LOGL_ERROR, "Unknown codec in Assignment Complete: %s\n",
- gsm0808_speech_codec_type_name(codec_if_known->type));
- call_leg_release(msc_a->cc.call_leg);
- return;
- }
+ const struct codec_mapping *codec_cn;
+ /* For 2G:
+ * - The Assignment Complete has returned a specific codec (e.g. FR3 for AMR FR).
+ * - Set this codec at the MGW endpoint facing the RAN.
+ * - Also set this codec at the MGW endpoint facing the CN -- we require an exact match on both call
+ * legs.
+ * - TODO: be aware of transcoding that the MGW is capable of, e.g. AMR octet-aligned to AMR
+ * bandwidth-efficient...
+ *
+ * For 3G:
+ * - ran_infra->force_mgw_codecs_to_ran sets VND.3GPP.IUFP as single codec at the MGW towards RAN.
+ * - ran_msg_iu.c always returns FR3 (AMR FR) for the assigned codec. Set that at the MGW towards CN.
+ * - So the MGW decapsulates IuUP <-> AMR
+ */
+ codec_cn = codec_mapping_by_gsm0808_speech_codec_type(codec_if_known->type);
+ /* TODO: use codec_mapping_by_gsm0808_speech_codec() to also match on codec_if_known->cfg */
+ if (!codec_cn) {
+ LOG_TRANS(cc_trans, LOGL_ERROR, "Unknown codec in Assignment Complete: %s\n",
+ gsm0808_speech_codec_type_name(codec_if_known->type));
+ call_leg_release(msc_a->cc.call_leg);
+ return;
}
/* Update RAN-side endpoint CI from Assignment result -- unless it is forced by the ran_infra, in which