aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/handover_fsm.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-03-03 23:26:38 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-03-04 00:32:56 +0100
commit770674a5e027b45dac5420434cb1277c7c84055a (patch)
tree5e7dfa84b9024c75fd811fdfca85b5ee87ba0174 /src/osmo-bsc/handover_fsm.c
parentcda1441e843c1c66de3011c7362ae5bc4e8caa46 (diff)
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
Diffstat (limited to 'src/osmo-bsc/handover_fsm.c')
-rw-r--r--src/osmo-bsc/handover_fsm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index 487135b89..75a3497c8 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -604,6 +604,23 @@ static bool parse_ho_request(struct gsm_subscriber_connection *conn, const struc
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;