HO Req: include IE Codec List (MSC Preferred)
Related: OS#5529 Change-Id: Ifcf719c5fc9e11749aafbd97bafda7f6f50973ea
This commit is contained in:
parent
737a9b6c5d
commit
352c88d537
|
@ -60,6 +60,7 @@ struct sdp_audio_codec *sdp_audio_codecs_add_speech_ver(struct sdp_audio_codecs
|
|||
struct sdp_audio_codec *sdp_audio_codecs_add_mgcp_codec(struct sdp_audio_codecs *ac, enum mgcp_codecs mgcp_codec);
|
||||
void sdp_audio_codecs_from_bearer_cap(struct sdp_audio_codecs *ac, const struct gsm_mncc_bearer_cap *bc);
|
||||
|
||||
void sdp_audio_codecs_to_speech_codec_list(struct gsm0808_speech_codec_list *cl, const struct sdp_audio_codecs *ac);
|
||||
void sdp_audio_codecs_from_speech_codec_list(struct sdp_audio_codecs *ac, const struct gsm0808_speech_codec_list *cl);
|
||||
|
||||
int sdp_audio_codecs_to_gsm0808_channel_type(struct gsm0808_channel_type *ct, const struct sdp_audio_codecs *ac);
|
||||
|
|
|
@ -380,6 +380,25 @@ void sdp_audio_codecs_from_bearer_cap(struct sdp_audio_codecs *ac, const struct
|
|||
}
|
||||
}
|
||||
|
||||
void sdp_audio_codecs_to_speech_codec_list(struct gsm0808_speech_codec_list *scl, const struct sdp_audio_codecs *ac)
|
||||
{
|
||||
const struct sdp_audio_codec *codec;
|
||||
|
||||
*scl = (struct gsm0808_speech_codec_list){};
|
||||
|
||||
foreach_sdp_audio_codec(codec, ac) {
|
||||
const struct codec_mapping *m = codec_mapping_by_subtype_name(codec->subtype_name);
|
||||
if (!m)
|
||||
continue;
|
||||
if (!m->has_gsm0808_speech_codec)
|
||||
continue;
|
||||
if (scl->len >= ARRAY_SIZE(scl->codec))
|
||||
break;
|
||||
scl->codec[scl->len] = m->gsm0808_speech_codec;
|
||||
scl->len++;
|
||||
}
|
||||
}
|
||||
|
||||
void sdp_audio_codecs_from_speech_codec_list(struct sdp_audio_codecs *ac, const struct gsm0808_speech_codec_list *cl)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -380,6 +380,7 @@ static void msc_ho_send_handover_request(struct msc_a *msc_a)
|
|||
struct vlr_subscr *vsub = msc_a_vsub(msc_a);
|
||||
struct gsm_network *net = msc_a_net(msc_a);
|
||||
struct gsm0808_channel_type channel_type;
|
||||
struct gsm0808_speech_codec_list scl;
|
||||
struct gsm_trans *cc_trans = msc_a->cc.active_trans;
|
||||
struct ran_msg ran_enc_msg = {
|
||||
.msg_type = RAN_MSG_HANDOVER_REQUEST,
|
||||
|
@ -421,6 +422,14 @@ static void msc_ho_send_handover_request(struct msc_a *msc_a)
|
|||
return;
|
||||
}
|
||||
ran_enc_msg.handover_request.geran.channel_type = &channel_type;
|
||||
|
||||
sdp_audio_codecs_to_speech_codec_list(&scl, &cc_trans->cc.codecs.result.audio_codecs);
|
||||
if (!scl.len) {
|
||||
msc_ho_failed(msc_a, GSM0808_CAUSE_EQUIPMENT_FAILURE, "Failed to compose"
|
||||
" Codec List (MSC Preferred) for Handover Request message\n");
|
||||
return;
|
||||
}
|
||||
ran_enc_msg.handover_request.codec_list_msc_preferred = &scl;
|
||||
}
|
||||
|
||||
gsm0808_cell_id_from_cgi(&ran_enc_msg.handover_request.cell_id_serving, CELL_IDENT_WHOLE_GLOBAL, &vsub->cgi);
|
||||
|
|
Loading…
Reference in New Issue