MSC_Tests: Support wildcarded endpoints (follow up)

The following tests still lack support for wildcarded endpoints:

MSC_Tests.TC_lu_and_mo_call
MSC_Tests.TC_emerg_call_imsi
MSC_Tests.TC_mo_crcx_ran_reject
MSC_Tests.TC_mt_crcx_ran_reject

- Also add support for wildcarded endpoints for those tests.

This is a follow up patch for:
Change-Id I0efeae0f8a6e98deb843e79648f84a262f1d98f8

Change-Id: I16cb2582b9d1764d7cb7e4b787368a4dd5ddf69c
Related: OS#2710
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index e7ee9e7..485fd37 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -556,6 +556,7 @@
 	cpars.bss_rtp_port := 1110;
 	cpars.mgcp_connection_id_bss := '22222'H;
 	cpars.mgcp_connection_id_mss := '33333'H;
+	cpars.mgcp_ep := "rtpbridge/1@mgw";
 
 	f_perform_lu();
 	f_mo_call(cpars);
@@ -848,6 +849,7 @@
 private function f_emerg_call(MobileIdentityLV mi) runs on BSC_ConnHdlr {
 	var CallParameters cpars := valueof(t_CallParams('112'H, 0));
 	cpars.emergency := true;
+	cpars.mgcp_ep := "rtpbridge/1@mgw";
 
 	f_mo_call(cpars);
 }
@@ -1196,8 +1198,18 @@
 	BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id)));
 
 	MGCP.receive(tr_CRCX) -> value mgcp_cmd;
+
+	/* Detect if the received CRCX is a wildcarded CRCX request. If yes,
+	 * set an endpoint name that fits the pattern. If not, just use the
+	 * endpoint name from the request */
+	if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) {
+		cpars.mgcp_ep := "rtpbridge/1@mgw";
+	} else {
+		cpars.mgcp_ep := mgcp_cmd.line.ep;
+	}
+
 	cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd);
-	cpars.mgcp_ep := mgcp_cmd.line.ep;
+
 	/* Respond to CRCX with error */
 	var MgcpResponse mgcp_rsp := {
 		line := {
@@ -1205,9 +1217,13 @@
 			trans_id := mgcp_cmd.line.trans_id,
 			string := "FORCED_FAIL"
 		},
-		params := omit,
 		sdp := omit
 	}
+	var MgcpParameter mgcp_rsp_param := {
+		code := "Z",
+		val := cpars.mgcp_ep
+	};
+	mgcp_rsp.params[0] := mgcp_rsp_param;
 	MGCP.send(mgcp_rsp);
 
 	timer T := 30.0;
@@ -1291,7 +1307,16 @@
 
 	MGCP.receive(tr_CRCX) -> value mgcp_cmd;
 	cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd);
-	cpars.mgcp_ep := mgcp_cmd.line.ep;
+
+	/* Detect if the received CRCX is a wildcarded CRCX request. If yes,
+	 * set an endpoint name that fits the pattern. If not, just use the
+	 * endpoint name from the request */
+	if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) {
+		cpars.mgcp_ep := "rtpbridge/1@mgw";
+	} else {
+		cpars.mgcp_ep := mgcp_cmd.line.ep;
+	}
+
 	/* Respond to CRCX with error */
 	var MgcpResponse mgcp_rsp := {
 		line := {
@@ -1299,9 +1324,13 @@
 			trans_id := mgcp_cmd.line.trans_id,
 			string := "FORCED_FAIL"
 		},
-		params := omit,
 		sdp := omit
 	}
+	var MgcpParameter mgcp_rsp_param := {
+		code := "Z",
+		val := cpars.mgcp_ep
+	};
+	mgcp_rsp.params[0] := mgcp_rsp_param;
 	MGCP.send(mgcp_rsp);
 
 	timer T := 30.0;