msc: Unify channel establishment for CM SERV REQ + PAGING

Change-Id: I24e3dfa1ef88c48c39bf0248074e88e682bc8404
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 4f50b70..1d39ab4 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -186,11 +186,23 @@
 	}
 }
 
+type enumerated EstablishType {
+	EST_TYPE_MO_CALL,
+	EST_TYPE_PAG_RESP
+};
+
 /* helper function to fully establish a dedicated channel */
-function f_establish_fully(MobileIdentityLV mi)
+function f_establish_fully(MobileIdentityLV mi, EstablishType etype := EST_TYPE_MO_CALL)
 runs on BSC_ConnHdlr {
-	var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi));
-	var PDU_DTAP_MT dtap_mt;
+	var PDU_ML3_MS_NW l3_info;
+	select (etype) {
+	case (EST_TYPE_MO_CALL) {
+		l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi));
+		}
+	case (EST_TYPE_PAG_RESP) {
+		l3_info := valueof(ts_PAG_RESP(mi));
+		}
+	}
 
 	/* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */
 	f_bssap_compl_l3(l3_info);
@@ -199,24 +211,13 @@
 	if (g_pars.net.expect_ciph) {
 		/* implicit CM SERVICE ACCEPT? */
 	} else {
-		/* explicit CM SERVICE ACCEPT */
-		BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC));
+		if (etype == EST_TYPE_MO_CALL) {
+			/* explicit CM SERVICE ACCEPT */
+			BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC));
+		}
 	}
 }
 
-/* helper function to fully establish a dedicated channel */
-function f_establish_fully_pag(MobileIdentityLV mi)
-runs on BSC_ConnHdlr {
-	var PDU_ML3_MS_NW l3_info := valueof(ts_PAG_RESP(mi));
-	var PDU_DTAP_MT dtap_mt;
-
-	/* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */
-	f_bssap_compl_l3(l3_info);
-
-	f_mm_common();
-}
-
-
 /* build a PDU_ML3_MS_NW containing a Location Update by IMSI */
 function f_build_lu_imsi(hexstring imsi) runs on BSC_ConnHdlr return PDU_ML3_MS_NW
 {