msc: derive altsteps from f_expect_paging() and use them

Change-Id: Ia0e787fc376acec09e8985a63862872eb89b53a4
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 5714fbf..a979953 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -1357,19 +1357,37 @@
 	log("f_mt_call_complete DONE");
 }
 
+/* expect BSSMAP/RANAP Paging for any IMSI and/or TMSI */
+altstep as_paging_any()
+runs on BSC_ConnHdlr {
+	[g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(?, *));
+	[not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(?, ?));
+}
+
+/* expect BSSMAP/RANAP Paging for registered IMSI and the given TMSI */
+altstep as_paging_tmsi(template OCT4 tmsi := *)
+runs on BSC_ConnHdlr {
+	[g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi, tmsi));
+	[not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi)));
+}
+
+/* convenience wrapper for as_paging_tmsi() using g_pars.tmsi */
+altstep as_paging()
+runs on BSC_ConnHdlr {
+	[] as_paging_tmsi(g_pars.tmsi);
+}
+
+/* expect BSSMAP/RANAP Paging for registered IMSI and the given TMSI
+ * fail on BSSMAP/RANAP Paging for non-matching IMSI/TMSI
+ * wait up to Tval seconds before declaring timeout */
 function f_expect_paging_tmsi(template OCT4 tmsi := *, float Tval := 4.0)
 runs on BSC_ConnHdlr {
 	timer T;
 
 	T.start(Tval);
 	alt {
-	[g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi, tmsi));
-	[g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(?, *)) {
-		setverdict(fail, "Paging message doesn't match expectations");
-		mtc.stop;
-		}
-	[not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi)));
-	[not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(?, ?)) {
+	[] as_paging_tmsi(tmsi) { setverdict(pass); }
+	[] as_paging_any() {
 		setverdict(fail, "Paging message doesn't match expectations");
 		mtc.stop;
 		}
@@ -1380,6 +1398,7 @@
 	}
 }
 
+/* convenience wrapper for f_expect_paging_tmsi() using g_pars.tmsi */
 function f_expect_paging(float Tval := 4.0)
 runs on BSC_ConnHdlr {
 	f_expect_paging_tmsi(g_pars.tmsi, Tval);