ran_msg: use full gsm0808_speech_codec

Change-Id: I8429e40f2d04ee9e2bc408b2b2182aa636c308ba
neels/codecs_fmtp
Neels Hofmeyr 3 months ago
parent 8d962f9a1d
commit 1b4667820e
  1. 2
      include/osmocom/msc/ran_msg.h
  2. 2
      src/libmsc/msc_a.c
  3. 5
      src/libmsc/ran_msg_a.c

@ -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;

@ -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) {

@ -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) {

Loading…
Cancel
Save