pespin submitted this change.
hnbgw: mgcp: Support running CS RAB ConnHdlr concurrently
Use Mutex to serialize CRCX wildcard endpoint, in order to be able
to properly steer the message to the good ConnHdlr.
Change-Id: Ibd97a37d98abfa746b58db0ea8bb591e7c8dc638
---
M hnbgw/ConnHdlr.ttcn
M hnbgw/HNBGW_Tests.ttcn
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/hnbgw/ConnHdlr.ttcn b/hnbgw/ConnHdlr.ttcn
index 7ba5b94..44e4cce 100644
--- a/hnbgw/ConnHdlr.ttcn
+++ b/hnbgw/ConnHdlr.ttcn
@@ -687,6 +687,15 @@
var template RAB_SetupOrModifyList rab_sml;
timer T := 5.0;
+ /* This code block cannot be executed by more than one component at a time because the
+ * RANAP RAB Ass Request triggers the IUT to send MGCP CRCX PDU(s), which needs to be
+ * routed to the respective ConnHdlr component (us). This is why we need to ensure that
+ * one ConnHdlr is triggering MGCP CRCX wildcard at the given moment of time.
+ */
+ f_Mutex_lock(__BFILE__, __LINE__);
+
+ f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
+
/* Send RAB Assignment Request */
rab_sml := ts_RAB_SML(t_RAB_id(23), f_ts_RAB_TLA(g_pars.mgcp_pars.cn_rtp_ip), t_RAB_binding_port(g_pars.mgcp_pars.cn_rtp_port));
tx := valueof(ts_RANAP_RabAssReq(rab_sml));
@@ -697,11 +706,15 @@
alt {
[] MGCP.receive(tr_CRCX) -> value mgcp_cmd {
log("CRCX1", mgcp_cmd);
+ /* Unregister and unlock the mutex, enabling other components to
+ * establish MGCP sessions after us. */
+ f_Mutex_unlock(__BFILE__, __LINE__);
var template MgcpResponse mgcp_rsp := f_handle_crcx(g_pars.mgcp_pars, mgcp_cmd);
MGCP.send(valueof(mgcp_rsp));
}
[] T.timeout {
- setverdict(fail, "Timeout waiting for MGCP");
+ /* No need to f_Mutex_unlock since we are exiting anyway... */
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for MGCP");
}
}
T.stop;
diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index 6441cef..e367666 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -1070,8 +1070,6 @@
var RANAP_PDU tx;
timer T := 5.0;
- f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
-
f_statsd_reset();
tx := f_build_initial_ue(g_pars);
@@ -1114,8 +1112,6 @@
var RANAP_PDU tx;
timer T := 5.0;
- f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
-
f_statsd_reset();
tx := f_build_initial_ue(g_pars);
@@ -1170,8 +1166,6 @@
var RANAP_PDU tx;
timer T := 15.0;
- f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
-
f_statsd_reset();
tx := f_build_initial_ue(g_pars);
@@ -1407,8 +1401,6 @@
var RANAP_PDU tx;
timer T := 5.0;
- f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
-
tx := f_build_initial_ue(g_pars);
f_iuh2iu_connect(tx);
@@ -2329,8 +2321,6 @@
var RANAP_PDU tx;
timer T := 5.0;
- f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
-
tx := f_build_initial_ue(g_pars);
f_iuh2iu_connect(tx);
To view, visit change 38678. To unsubscribe, or for help writing mail filters, visit settings.