Only check for intersecting AMR codec support on matching TS rate

Only check for intersecting full rate AMR codec, if the BTS has at least
one full rate or dynamic time slot configured.

Only check for intersecting half rate AMR codec, if the BTS has at least
one half rate or dynamic time slot configured.

Related: OS#5926
Change-Id: Ia4a8e7f22dc652655ee7c5458624df8ae136dd95
This commit is contained in:
Andreas Eversberg 2023-11-27 15:28:48 +01:00 committed by jolly
parent 510a868168
commit 5dee672e96
1 changed files with 20 additions and 14 deletions

View File

@ -481,22 +481,28 @@ int check_codec_pref(struct llist_head *mscs)
rc = -1;
}
bts_gsm48_ie = (struct gsm48_multi_rate_conf *)&bts->mr_full.gsm48_ie;
rc_rate = calc_amr_rate_intersection(NULL, &msc->amr_conf, bts_gsm48_ie);
if (rc_rate < 0) {
LOGP(DMSC, LOGL_FATAL,
"network amr tch-f mode config of BTS %u does not intersect with amr-config of MSC %u\n",
bts->nr, msc->nr);
rc = -1;
/* Full rate codec check, only if any full rate TS is configured. */
if (test_codec_support_bts_rate(bts, true)) {
bts_gsm48_ie = (struct gsm48_multi_rate_conf *)&bts->mr_full.gsm48_ie;
rc_rate = calc_amr_rate_intersection(NULL, &msc->amr_conf, bts_gsm48_ie);
if (rc_rate < 0) {
LOGP(DMSC, LOGL_FATAL,
"network amr tch-f mode config of BTS %u does not intersect with amr-config of MSC %u\n",
bts->nr, msc->nr);
rc = -1;
}
}
bts_gsm48_ie = (struct gsm48_multi_rate_conf *)&bts->mr_half.gsm48_ie;
rc_rate = calc_amr_rate_intersection(NULL, &msc->amr_conf, bts_gsm48_ie);
if (rc_rate < 0) {
LOGP(DMSC, LOGL_FATAL,
"network amr tch-h mode config of BTS %u does not intersect with amr-config of MSC %u\n",
bts->nr, msc->nr);
rc = -1;
/* Half rate codec check, only if any half rate TS is configured. */
if (test_codec_support_bts_rate(bts, false)) {
bts_gsm48_ie = (struct gsm48_multi_rate_conf *)&bts->mr_half.gsm48_ie;
rc_rate = calc_amr_rate_intersection(NULL, &msc->amr_conf, bts_gsm48_ie);
if (rc_rate < 0) {
LOGP(DMSC, LOGL_FATAL,
"network amr tch-h mode config of BTS %u does not intersect with amr-config of MSC %u\n",
bts->nr, msc->nr);
rc = -1;
}
}
}
}