From 1b4667820e4fce1556730697e9455e5f793801a6 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 12 Sep 2022 03:40:42 +0200 Subject: [PATCH] ran_msg: use full gsm0808_speech_codec Change-Id: I8429e40f2d04ee9e2bc408b2b2182aa636c308ba --- include/osmocom/msc/ran_msg.h | 2 +- src/libmsc/msc_a.c | 2 +- src/libmsc/ran_msg_a.c | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/osmocom/msc/ran_msg.h b/include/osmocom/msc/ran_msg.h index 32b24a01f..86bf63a5b 100644 --- a/include/osmocom/msc/ran_msg.h +++ b/include/osmocom/msc/ran_msg.h @@ -240,7 +240,7 @@ struct ran_msg { struct { struct osmo_sockaddr_str remote_rtp; bool codec_present; - enum mgcp_codecs codec; + struct gsm0808_speech_codec codec; const struct gsm0808_speech_codec_list *codec_list_bss_supported; bool osmux_present; uint8_t osmux_cid; diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c index fedbead5b..cb98df9d2 100644 --- a/src/libmsc/msc_a.c +++ b/src/libmsc/msc_a.c @@ -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 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; if (!rtps_to_ran) { diff --git a/src/libmsc/ran_msg_a.c b/src/libmsc/ran_msg_a.c index 1357324d7..6af229041 100644 --- a/src/libmsc/ran_msg_a.c +++ b/src/libmsc/ran_msg_a.c @@ -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_osmux_cid = TLVP_GET(tp, GSM0808_IE_OSMO_OSMUX_CID); struct sockaddr_storage rtp_addr; - struct gsm0808_speech_codec sc; struct gsm0808_speech_codec_list codec_list_bss_supported; int rc; 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) { /* 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) { LOG_RAN_A_DEC_MSG(LOGL_ERROR, "Assignment Complete: unable to decode IE Speech Codec (Chosen)" " (rc=%d).\n", rc); return -EINVAL; } 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) {