Change in osmo-bsc[master]: SRVCC: Parse Last Used E-UTRAN PLMN Id in Handover Request

laforge gerrit-no-reply at
Sat Apr 24 08:49:08 UTC 2021

laforge has submitted this change. ( )

Change subject: SRVCC: Parse Last Used E-UTRAN PLMN Id in Handover Request

SRVCC: Parse Last Used E-UTRAN PLMN Id in Handover Request

Whenever SRVCC EUTRAN->GERAN is performed by the CN, it will set the
Last Used E-UTRAN PLMN Id in order for the BSS to inform the MS
about EUTRAN neighbors once the call is over.
The last part (sending EUTRAN neighs) is already implemented, since same
thing is done as per CSFB. However, we lacked the first part, where the
EUTRAN PLMN Id is recorded for later use.

Actually, in both cases, we end up building the list of neighbors
without taking into accound the PLMN value (hence no filtering of
configured neighs), but it only sends such a list if any PLMN was stored
there, which means this patch is still necessary for a quick fallback to
4G after the call is over.

Related: SYS#5337
Depends: libosmocore.git Change-Id I0e55e947b6fef6dad0cf1a6c16b781bef4cc76c5
Change-Id: Ia5008f11a4c36ef8085a2037d4abddd131086e6e
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/handover_fsm.c
3 files changed, 39 insertions(+), 0 deletions(-)

  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

index 1a72401..de9e62c 100644
@@ -8,3 +8,4 @@
 # If any interfaces have been removed or changed since the last public release: c:r:0.
 #library	what		description / commit summary line
 libosmocore	>1.5.1		needs osmo_bts_features_name(), osmo_bts_features_desc()
+libosmogsm    >1.5.1            enum entry GSM0808_FE_IE_LAST_USED_EUTRAN_PLMN_ID
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 448098b..0bc881b 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -202,6 +202,8 @@
 	uint16_t msc_assigned_cic;
 	char msc_assigned_rtp_addr[INET6_ADDRSTRLEN];
 	uint16_t msc_assigned_rtp_port;
+	bool last_eutran_plmn_valid;
+	struct osmo_plmn_id last_eutran_plmn;
 struct handover {
diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index f6dad9d..53cafed 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -417,6 +417,32 @@
 	lchan_activate(ho->new_lchan, &info);
+/* 3GPP TS 48.008 §  Old BSS to New BSS Information */
+static void parse_old2new_bss_info(struct gsm_subscriber_connection *conn,
+				   const uint8_t* data, uint16_t len,
+				   struct handover_in_req *req)
+	/* § Information contained here shall take precedence over
+	   duplicate information from Information Elements in the HANDOVER
+	   REQUEST  as long as the coding is understood by the new BSS */
+	/* § <<Reception of an erroneous "Old BSS to New BSS
+	   information" shall not cause a rejection of the HANDOVER REQUEST
+	   message; the "Old BSS to New BSS information" information element
+	   shall be discarded and the handover resource allocation procedure
+	   shall continue>>. See also */
+	struct tlv_parsed tp;
+	if (tlv_parse(&tp, &gsm0808_old_bss_to_new_bss_info_att_tlvdef, data, len, 0, 0) <= 0) {
+		LOG_HO(conn, LOGL_NOTICE, "Failed to parse IE \"Old BSS to New BSS information\"\n");
+		return;
+	}
+		req->last_eutran_plmn_valid = true;
+		osmo_plmn_from_bcd(TLVP_VAL(&tp, GSM0808_FE_IE_LAST_USED_EUTRAN_PLMN_ID),
+				   &req->last_eutran_plmn);
+	}
 /* 3GPP TS 48.008 § Handover Request */
 static bool parse_ho_request(struct gsm_subscriber_connection *conn, const struct msgb *msg,
 			     struct handover_in_req *req)
@@ -557,6 +583,10 @@
 		return false;
+		parse_old2new_bss_info(conn, e->val, e->len, req);
+	}
 	/* A lot of IEs remain ignored... */
 	return true;
@@ -691,6 +721,12 @@
 		info.encr.key_len = req->ei.key_len;
+	if (req->last_eutran_plmn_valid) {
+		conn->last_eutran_plmn_valid = true;
+		memcpy(&conn->last_eutran_plmn, &req->last_eutran_plmn,
+		       sizeof(conn->last_eutran_plmn));
+	}
 	lchan_activate(ho->new_lchan, &info);

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ia5008f11a4c36ef8085a2037d4abddd131086e6e
Gerrit-Change-Number: 23753
Gerrit-PatchSet: 8
Gerrit-Owner: pespin <pespin at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at>
Gerrit-Reviewer: fixeria <vyanitskiy at>
Gerrit-Reviewer: laforge <laforge at>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list