bsc: Start MGCP_Emulation and extend MSC_ConnectionHandler for MGCP
forward-ported by Harald Welte
Change-Id: I1f316a9ed5859670348ea7aa352604020d6b09f5
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 6b5ce24..8766503 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -31,6 +31,7 @@
import from IPA_Types all;
import from RSL_Types all;
import from RSL_Emulation all;
+import from MGCP_Emulation all;
import from Osmocom_CTRL_Functions all;
import from Osmocom_CTRL_Types all;
@@ -59,6 +60,8 @@
/* array of per-BTS RSL test ports */
port IPA_RSL_PT IPA_RSL[NUM_BTS];
+ var MGCP_Emulation_CT vc_MGCP;
+
/* are we initialized yet */
var boolean g_initialized := false;
@@ -74,6 +77,8 @@
integer mp_bsc_rsl_port := 3003;
/* port number to which to establish the IPA CTRL connection */
integer mp_bsc_ctrl_port := 4249;
+ /* IP address at which the test binds */
+ charstring mp_test_ip := "127.0.0.1";
}
type record IPA_Client {
@@ -176,6 +181,24 @@
}
}
+function f_init_mgcp(charstring id) runs on test_CT {
+ id := id & "-MGCP";
+
+ var MGCPOps ops := {
+ create_cb := refers(MGCP_Emulation.ExpectedCreateCallback),
+ unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback)
+ };
+ var MGCP_conn_parameters mgcp_pars := {
+ callagent_ip := mp_bsc_ip,
+ callagent_udp_port := 2727,
+ mgw_ip := mp_test_ip,
+ mgw_udp_port := 2427
+ };
+
+ vc_MGCP := MGCP_Emulation_CT.create(id);
+ vc_MGCP.start(MGCP_Emulation.main(ops, mgcp_pars, id));
+}
+
/* global initialization function
* \param nr_bts Number of BTSs we should start/bring up
* \param handler_mode Start an RSL_Emulation_CT component (true) or not (false) */
@@ -196,6 +219,8 @@
}
f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port);
+ f_init_mgcp("VirtMSC");
+
for (i := 0; i < nr_bts; i := i+1) {
/* wait until osmo-bts-omldummy has respawned */
f_wait_oml(i, "degraded", 5.0);
@@ -1197,8 +1222,10 @@
vc_conn := MSC_ConnHdlr.create(id);
connect(vc_conn:BSSMAPEM, vc_BSSMAP:PROC);
+ connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC);
connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT);
connect(vc_conn:BSSAP, vc_BSSMAP:CLIENT);
+ connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT);
vc_conn.start(derefers(fn)(id));
return vc_conn;
}