osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/33357 )
Change subject: ran_a_channel_type_to_speech_codec_list: add CSD ......................................................................
ran_a_channel_type_to_speech_codec_list: add CSD
Related: OS#4394 Change-Id: I336e6aa735f894aa35b2ccfe24a54eb171d7ad10 --- M src/libmsc/ran_msg_a.c 1 file changed, 28 insertions(+), 6 deletions(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve
diff --git a/src/libmsc/ran_msg_a.c b/src/libmsc/ran_msg_a.c index a371e65..c49adf4 100644 --- a/src/libmsc/ran_msg_a.c +++ b/src/libmsc/ran_msg_a.c @@ -901,12 +901,24 @@ int rc;
memset(scl, 0, sizeof(*scl)); - for (i = 0; i < ct->perm_spch_len; i++) { - rc = gsm0808_speech_codec_from_chan_type(&scl->codec[i], ct->perm_spch[i]); - if (rc != 0) - return -EINVAL; + + switch (ct->ch_indctr) { + case GSM0808_CHAN_DATA: + scl->codec[0].type = GSM0808_SCT_CSD; + scl->len = 1; + break; + case GSM0808_CHAN_SPEECH: + for (i = 0; i < ct->perm_spch_len; i++) { + rc = gsm0808_speech_codec_from_chan_type(&scl->codec[i], ct->perm_spch[i]); + if (rc != 0) + return -EINVAL; + } + scl->len = i; + break; + default: + OSMO_ASSERT(0); + break; } - scl->len = i;
return 0; } @@ -937,7 +949,7 @@ return NULL; }
- if (ac->channel_type->ch_indctr == GSM0808_CHAN_SPEECH) { + if (ac->channel_type->ch_indctr == GSM0808_CHAN_SPEECH || ac->channel_type->ch_indctr == GSM0808_CHAN_DATA) { rc = ran_a_channel_type_to_speech_codec_list(&scl, ac->channel_type); if (rc < 0) { LOG_RAN_A_ENC(log_fi, LOGL_ERROR, "Assignment Command: Cannot translate Channel Type to Speech Codec List\n");