ran_msg: use full gsm0808_speech_codec

Change-Id: I8429e40f2d04ee9e2bc408b2b2182aa636c308ba
This commit is contained in:
Neels Hofmeyr 2022-09-12 03:40:42 +02:00
parent 8d962f9a1d
commit 1b4667820e
3 changed files with 4 additions and 5 deletions

View File

@ -240,7 +240,7 @@ struct ran_msg {
struct { struct {
struct osmo_sockaddr_str remote_rtp; struct osmo_sockaddr_str remote_rtp;
bool codec_present; bool codec_present;
enum mgcp_codecs codec; struct gsm0808_speech_codec codec;
const struct gsm0808_speech_codec_list *codec_list_bss_supported; const struct gsm0808_speech_codec_list *codec_list_bss_supported;
bool osmux_present; bool osmux_present;
uint8_t osmux_cid; uint8_t osmux_cid;

View File

@ -1392,7 +1392,7 @@ static void msc_a_up_call_assignment_complete(struct msc_a *msc_a, const struct
{ {
struct gsm_trans *cc_trans = msc_a->cc.active_trans; struct gsm_trans *cc_trans = msc_a->cc.active_trans;
struct rtp_stream *rtps_to_ran = msc_a->cc.call_leg ? msc_a->cc.call_leg->rtp[RTP_TO_RAN] : NULL; struct rtp_stream *rtps_to_ran = msc_a->cc.call_leg ? msc_a->cc.call_leg->rtp[RTP_TO_RAN] : NULL;
const enum mgcp_codecs *codec_if_known = ac->assignment_complete.codec_present ? struct gsm0808_speech_codec *codec_if_known = ac->assignment_complete.codec_present ?
&ac->assignment_complete.codec : NULL; &ac->assignment_complete.codec : NULL;
if (!rtps_to_ran) { if (!rtps_to_ran) {

View File

@ -276,7 +276,6 @@ static int ran_a_decode_assignment_complete(struct ran_dec *ran_dec, struct msgb
struct tlv_p_entry *ie_codec_list_bss_supported = TLVP_GET(tp, GSM0808_IE_SPEECH_CODEC_LIST); struct tlv_p_entry *ie_codec_list_bss_supported = TLVP_GET(tp, GSM0808_IE_SPEECH_CODEC_LIST);
struct tlv_p_entry *ie_osmux_cid = TLVP_GET(tp, GSM0808_IE_OSMO_OSMUX_CID); struct tlv_p_entry *ie_osmux_cid = TLVP_GET(tp, GSM0808_IE_OSMO_OSMUX_CID);
struct sockaddr_storage rtp_addr; struct sockaddr_storage rtp_addr;
struct gsm0808_speech_codec sc;
struct gsm0808_speech_codec_list codec_list_bss_supported; struct gsm0808_speech_codec_list codec_list_bss_supported;
int rc; int rc;
struct ran_msg ran_dec_msg = { struct ran_msg ran_dec_msg = {
@ -309,14 +308,14 @@ static int ran_a_decode_assignment_complete(struct ran_dec *ran_dec, struct msgb
if (ie_speech_codec) { if (ie_speech_codec) {
/* Decode Speech Codec (Chosen) element */ /* Decode Speech Codec (Chosen) element */
rc = gsm0808_dec_speech_codec(&sc, ie_speech_codec->val, ie_speech_codec->len); rc = gsm0808_dec_speech_codec(&ran_dec_msg.assignment_complete.codec,
ie_speech_codec->val, ie_speech_codec->len);
if (rc < 0) { if (rc < 0) {
LOG_RAN_A_DEC_MSG(LOGL_ERROR, "Assignment Complete: unable to decode IE Speech Codec (Chosen)" LOG_RAN_A_DEC_MSG(LOGL_ERROR, "Assignment Complete: unable to decode IE Speech Codec (Chosen)"
" (rc=%d).\n", rc); " (rc=%d).\n", rc);
return -EINVAL; return -EINVAL;
} }
ran_dec_msg.assignment_complete.codec_present = true; ran_dec_msg.assignment_complete.codec_present = true;
ran_dec_msg.assignment_complete.codec = ran_a_mgcp_codec_from_sc(&sc);
} }
if (ie_codec_list_bss_supported) { if (ie_codec_list_bss_supported) {