From 03d015e786cac082432e7c5309829c209869c19d Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 1 Feb 2024 05:15:30 +0100 Subject: [PATCH] pass dynamically configured AMR rates to BSS and RNC [1/3] These changes will allow dynamically negotiating AMR rates between 2G and 3G, and between full-rate and half-rate, spanning from 2G and 3G RAN all the way across to SDP over MNCC / SIP and back. To ran_msg_assignment, add a full codecs list (sdp_audio_codecs). So far, there was only the gsm0808_channel_type with a list of permitted-speech entries, which is not a complete representation. This patch only adds the list, the two users of this are added in separate patches: [2/3] In ran_msg_a.c for 2G: Before this, we pass a gsm0808_channel_type to ran_msg_assignment, and from *that* we derive a gsm0808_speech_codec_list -- this loses the AMR rate config bits. So far, we always transmitted the default cfg bits defined in gsm0808_speech_codec_defaults, enabling all supported S0-S15 AMR rate combinations. Instead, we'll directly derive the available AMR rates from the list of SDP codecs resulting from the codecs filter. [3/3] In ran_msg_iu.c for 3G: Before this, we compose a fixed set of RAB SDU subflows, i.e. for exactly and only AMR 12k2. Now, we'll ask for RAB subflows corresponding to the AMR codec's mode-set fmtp present in the codec list. Change-Id: Ia9f4ad7f3646556aadc632bc5ffa477941626c5f --- include/osmocom/msc/ran_msg.h | 1 + src/libmsc/msc_a.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/osmocom/msc/ran_msg.h b/include/osmocom/msc/ran_msg.h index dc1483cb5..7df6564ef 100644 --- a/include/osmocom/msc/ran_msg.h +++ b/include/osmocom/msc/ran_msg.h @@ -103,6 +103,7 @@ struct ran_clear_command { struct ran_assignment_command { const struct osmo_sockaddr_str *cn_rtp; const struct gsm0808_channel_type *channel_type; + const struct sdp_audio_codecs *codecs; enum nsap_addr_enc rab_assign_addr_enc; bool osmux_present; uint8_t osmux_cid; diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c index 991661c55..084d04fcd 100644 --- a/src/libmsc/msc_a.c +++ b/src/libmsc/msc_a.c @@ -700,6 +700,7 @@ void msc_a_tx_assignment_cmd(struct msc_a *msc_a) .assignment_command = { .cn_rtp = &msc_a->cc.call_leg->rtp[RTP_TO_RAN]->local, .channel_type = &channel_type, + .codecs = &cc_trans->cc.local.audio_codecs, .osmux_present = msc_a->cc.call_leg->rtp[RTP_TO_RAN]->use_osmux, .osmux_cid = msc_a->cc.call_leg->rtp[RTP_TO_RAN]->local_osmux_cid, .call_id_present = true,