Send "BSSMAP CommonID" to tell BSC about the IMSI

We're already sending the RANAP CommonID message to the RNC,
let's do the same using BSSMAP CommonId towards the BSC.  This
way the BSC knows about the IMSI of the served subscriber, which
is very useful for logging/debugging.

Change-Id: I2552736477663adb250c55728093500e8ae83ebb
Closes: OS#2969
Depends: libosmocore.git I353adc1aa72377f7d4b3336d2ff47791fb73d62c
diff --git a/src/libmsc/ran_msg_a.c b/src/libmsc/ran_msg_a.c
index 1fa8ccb..8158e91 100644
--- a/src/libmsc/ran_msg_a.c
+++ b/src/libmsc/ran_msg_a.c
@@ -1223,6 +1223,9 @@
 	case RAN_MSG_ASSIGNMENT_COMMAND:
 		return ran_a_make_assignment_command(caller_fi, &ran_enc_msg->assignment_command);
 
+	case RAN_MSG_COMMON_ID:
+		return gsm0808_create_common_id(ran_enc_msg->common_id.imsi, NULL, NULL);
+
 	case RAN_MSG_CIPHER_MODE_COMMAND:
 		return ran_a_make_cipher_mode_command(caller_fi, &ran_enc_msg->cipher_mode_command);
 
diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c
index 73f3435..b3660ff 100644
--- a/src/libvlr/vlr_access_req_fsm.c
+++ b/src/libvlr/vlr_access_req_fsm.c
@@ -246,16 +246,13 @@
 {
 	struct proc_arq_priv *par = fi->priv;
 	struct vlr_subscr *vsub = par->vsub;
+	int rc;
 
 	LOGPFSM(fi, "%s()\n", __func__);
 
-	if (par->is_utran) {
-		int rc;
-		rc = par->vlr->ops.tx_common_id(par->msc_conn_ref);
-		if (rc)
-			LOGPFSML(fi, LOGL_ERROR,
-				 "Error while sending Common ID (%d)\n", rc);
-	}
+	rc = par->vlr->ops.tx_common_id(par->msc_conn_ref);
+	if (rc)
+		LOGPFSML(fi, LOGL_ERROR, "Error while sending Common ID (%d)\n", rc);
 
 	vsub->conf_by_radio_contact_ind = true;
 	if (vsub->loc_conf_in_hlr_ind == false) {
diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c
index d5425e7..53e614d 100644
--- a/src/libvlr/vlr_lu_fsm.c
+++ b/src/libvlr/vlr_lu_fsm.c
@@ -818,18 +818,15 @@
 {
 	struct lu_fsm_priv *lfp = lu_fsm_fi_priv(fi);
 	struct vlr_subscr *vsub = lfp->vsub;
+	int rc;
 
 	LOGPFSM(fi, "%s()\n", __func__);
 
 	OSMO_ASSERT(vsub);
 
-	if (lfp->is_utran) {
-		int rc;
-		rc = lfp->vlr->ops.tx_common_id(lfp->msc_conn_ref);
-		if (rc)
-			LOGPFSML(fi, LOGL_ERROR,
-				 "Error while sending Common ID (%d)\n", rc);
-	}
+	rc = lfp->vlr->ops.tx_common_id(lfp->msc_conn_ref);
+	if (rc)
+		LOGPFSML(fi, LOGL_ERROR, "Error while sending Common ID (%d)\n", rc);
 
 	vsub->conf_by_radio_contact_ind = true;
 	/* Update LAI */