neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27405 )
Change subject: inter-BSC incoming HO: store Codec List (MSC Preferred) ......................................................................
inter-BSC incoming HO: store Codec List (MSC Preferred)
So far we completely ignore the codec list from the MSC in Handover Request messages. This leads to error messages in subsequent handovers because there is no Codec List stored on the conn:
DHODEC ERROR handover_decision_2.c:390 [...] No Speech Codec List present, accepting all codecs
Besides the error log, in hodec2 we may subsequently take bogus or unexpected codec decisions, ignoring the MSC's choice of codecs, or in the worst case picking an unsupported codec.
This also has implications on what type of lchan we choose for handover target in hodec2: say, if no half rate codec is supported as per the MSC's request, we normally avoid handover to a TCH/H, etc.
Intra-BSC HO after an Inter-BSC incoming HO is the only case where this problem occurs, in every other scenario there is an Assignment Request from the MSC, from which we properly store the MSC's codec list.
3GPP TS 48.008 does indicate that on AoIP this codec list shall be included. So reject HO Request with missing Codec List, as we already do for Assignment Request on AoIP.
This makes TTCN3 BSC_Tests for inter-BSC incoming HO fail, because our tests so far omit the Codec List (MSC Preferred) on AoIP. The related fix of the tests is If06de9c9b43d79f749447a4e2a340176eef75c79.
Related: SYS#5839 Depends: If06de9c9b43d79f749447a4e2a340176eef75c79 (osmo-ttcn3-hacks) Change-Id: I117cc29d6d11db77d160de654f43f5993db6ee21 --- M src/osmo-bsc/handover_fsm.c 1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/27405/1
diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index c25e061..e957a96 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -604,6 +604,23 @@ parse_old2new_bss_info(conn, e->val, e->len, req); }
+ /* Decode "Codec List (MSC Preferred)". First set len = 0 to empty the list. (For inter-BSC incoming handover, + * there can't possibly be a list here already, because the conn has just now been created; just do ensure + * sanity.) */ + conn->codec_list = (struct gsm0808_speech_codec_list){}; + if ((e = TLVP_GET(tp, GSM0808_IE_SPEECH_CODEC_LIST))) { + if (gsm0808_dec_speech_codec_list(&conn->codec_list, e->val, e->len) < 0) { + LOG_HO(conn, LOGL_ERROR, "incoming inter-BSC Handover: HO Request:" + " Unable to decode Codec List (MSC Preferred)\n"); + return false; + } + } + if (aoip && !conn->codec_list.len) { + LOG_HO(conn, LOGL_ERROR, "incoming inter-BSC Handover: HO Request:" + " Invalid or empty Codec List (MSC Preferred)\n"); + return false; + } + /* A lot of IEs remain ignored... */
return true;