bsc: Test MGCP-over-IPA forwarding in SCCPlite tests

* MGCP-over-IPA handling in MSC_ConnectionHandler means we need to use
the new MGCP_CLIENT_MULTI port since we'll be managing MGCP messages
from 2 different UDP connections, and we need to be able to route
answers correctly. As a result, parameter multi_conn_mode is enabled for
SCCPlite and all code adapted to use that port in that type of scenario.
* iDuring calls when on SCCPlite, send a full (all-required-params-in)
CRCX through the MGCP-over-IPA connection towards the BSC in order to
emulate the MSC, and expect the correct answer back. This way we test
BSC funcionality to forward MGCP messages coming from MSC works as
expected.

Related: OS#2536
Depends: osmo-bsc.git I38ad8fa645c08900e0e1f1b4b96136bc6d96b3ab
Change-Id: I31fed700772dd0b063f913b1e1639fd428c46e7d
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 4c86e51..ec1be13 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -38,6 +38,7 @@
 import from MGCP_Emulation all;
 import from MGCP_Templates all;
 import from MGCP_Types all;
+import from MGCP_CodecPort all;
 
 import from Osmocom_CTRL_Functions all;
 import from Osmocom_CTRL_Types all;
@@ -295,7 +296,9 @@
 		callagent_udp_port := -1,
 		mgw_ip := mp_test_ip,
 		mgw_udp_port := 2427,
-		multi_conn_mode := false
+		/* Enable it for SCCPlite, since we have 2 MGCP sockets towards MGW (UDP one +
+		   the on  with MGCP over IPA forwarded from MSC one) */
+		multi_conn_mode := (mp_bssap_cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER)
 	};
 
 	vc_MGCP := MGCP_Emulation_CT.create(id);
@@ -1718,6 +1721,7 @@
 	}
 	connect(vc_conn:BSSAP, g_bssap.vc_RAN:CLIENT);
 	connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT);
+	connect(vc_conn:MGCP_MULTI, vc_MGCP:MGCP_CLIENT_MULTI);
 }
 
 function f_start_handler(void_fn fn, template (omit) TestHdlrParams pars := omit)
@@ -2891,18 +2895,32 @@
 /* Expecting MGCP to DLCX the endpoint's two connections: towards BTS and towards MSC */
 private function f_expect_dlcx_conns(boolean exp_clear_cmpl := true) runs on MSC_ConnHdlr {
 	var MgcpCommand mgcp;
+	var template MgcpResponse mgcp_resp;
+	var MGCP_RecvFrom mrf;
+	var template MgcpMessage msg_resp;
+	var template MgcpMessage msg_dlcx := {
+		command := tr_DLCX()
+	}
 
-	MGCP.receive(tr_DLCX()) -> value mgcp {
+	if (g_pars.aoip) {
+		MGCP.receive(tr_DLCX()) -> value mgcp {
 				log("Got first DLCX: ", mgcp);
 				MGCP.send(ts_DLCX_ACK2(mgcp.line.trans_id));
-		};
+			};
 
-	/* For SCCPLite, BSC doesn't handle the MSC-side */
-	if (g_pars.aoip) {
 		MGCP.receive(tr_DLCX()) -> value mgcp {
 				log("Got second DLCX: ", mgcp);
 				MGCP.send(ts_DLCX_ACK2(mgcp.line.trans_id));
 			};
+	} else  {
+		/* For SCCPLite, BSC doesn't handle the MSC-side */
+		MGCP_MULTI.receive(tr_MGCP_RecvFrom_any(msg_dlcx)) -> value mrf {
+			log("Got first DLCX: ", mrf.msg.command);
+			msg_resp := {
+				response := ts_DLCX_ACK2(mrf.msg.command.line.trans_id)
+			}
+			MGCP_MULTI.send(t_MGCP_SendToMrf(mrf, msg_resp));
+		};
 	}
 
 	if (exp_clear_cmpl) {