cosmetic: move check for CSD further above

Currently the CSD check is in the middle of figuring out the voice codec
for normal voice calls. Rather do the CSD check first, and then do voice
in one coherent section.

(prep for upcoming change in this code, to support AMR rate selection.)

Change-Id: Ibd21f0bb46c66a406904105564ce961a8760cbe7
This commit is contained in:
Neels Hofmeyr 2024-01-19 06:38:11 +01:00
parent 1a07bcd1bb
commit bd8ac51b60
1 changed files with 9 additions and 9 deletions

View File

@ -1464,6 +1464,15 @@ static void msc_a_up_call_assignment_complete(struct msc_a *msc_a, const struct
if (codec_if_known) {
const struct codec_mapping *codec_assigned;
/* Check for unexpected codec with CSD */
if (cc_trans->bearer_cap.transfer == GSM48_BCAP_ITCAP_UNR_DIG_INF &&
codec_if_known->type != GSM0808_SCT_CSD) {
LOG_TRANS(cc_trans, LOGL_ERROR, "Unexpected codec in Assignment Complete for CSD: %s\n",
gsm0808_speech_codec_type_name(codec_if_known->type));
call_leg_release(msc_a->cc.call_leg);
return;
}
/* For 2G:
* - The Assignment Complete has returned a specific codec (e.g. FR3 for AMR FR).
* - Set this codec at the MGW endpoint facing the RAN.
@ -1486,15 +1495,6 @@ static void msc_a_up_call_assignment_complete(struct msc_a *msc_a, const struct
return;
}
/* Check for unexpected codec with CSD */
if (cc_trans->bearer_cap.transfer == GSM48_BCAP_ITCAP_UNR_DIG_INF &&
codec_if_known->type != GSM0808_SCT_CSD) {
LOG_TRANS(cc_trans, LOGL_ERROR, "Unexpected codec in Assignment Complete for CSD: %s\n",
gsm0808_speech_codec_type_name(codec_if_known->type));
call_leg_release(msc_a->cc.call_leg);
return;
}
/* Update RAN-side endpoint CI from Assignment result -- unless it is forced by the ran_infra, in which
* case it remains unchanged as passed to the earlier call of call_leg_ensure_ci(). */
if (msc_a->c.ran->force_mgw_codecs_to_ran.count == 0)