MSC_ConnectionHandler: Fix E1 timeslots to be monotonically incrementing
diff --git a/ipa/MSC_ConnectionHandler.ttcn b/ipa/MSC_ConnectionHandler.ttcn
index 3af62a2..3cb9adb 100644
--- a/ipa/MSC_ConnectionHandler.ttcn
+++ b/ipa/MSC_ConnectionHandler.ttcn
@@ -15,8 +15,6 @@
* There is a 1:1 mapping between SCCP connections and BSSAP_ConnHdlr components.
* We inherit all component variables, ports, functions, ... from BSSAP_ConnHdlr */
type component MSC_ConnHdlr extends BSSAP_ConnHdlr {
- /* E1 timeslot that is allocated to this component/connection */
- var uint5_t g_e1_timeslot;
/* SCCP Connecction Identifier for the underlying SCCP connection */
var integer g_sccp_conn_id;
@@ -36,7 +34,9 @@
/* connect it to the port */
connect(vc_conn:BSSAP, self:CLIENT);
/* start it */
- vc_conn.start(MSC_ConnectionHandler.main(conn_ind.connectionId, conn_ind.connectionId));
+ vc_conn.start(MSC_ConnectionHandler.main(conn_ind.connectionId, g_next_e1_ts));
+ /* increment next E1 timeslot */
+ g_next_e1_ts := g_next_e1_ts + 1;
return vc_conn;
}
@@ -68,14 +68,12 @@
}
/* main function processing various incoming events */
-function main(integer connection_id, integer timeslot) runs on MSC_ConnHdlr {
+function main(integer connection_id, integer e1_timeslot) runs on MSC_ConnHdlr {
var MgcpResponse mgcp_rsp;
- g_e1_timeslot := 1; /* FIXME */
-
g_sccp_conn_id := connection_id;
g_call_id := f_mgcp_alloc_call_id();
- g_ep_name := hex2str(int2hex(g_e1_timeslot, 1)) & "@mgw";
+ g_ep_name := hex2str(int2hex(e1_timeslot, 1)) & "@mgw";
while (true) {
var PDU_BSSAP bssap;
@@ -84,7 +82,7 @@
[g_state == MSC_STATE_NONE] BSSAP.receive(tr_BSSMAP_ComplL3) -> value bssap {
/* respond with ASSIGNMENT CMD */
g_state := MSC_STATE_WAIT_ASS_COMPL;
- BSSAP.send(ts_BSSMAP_AssignmentReq(0, g_e1_timeslot));
+ BSSAP.send(ts_BSSMAP_AssignmentReq(0, e1_timeslot));
}
[g_state == MSC_STATE_WAIT_ASS_COMPL] BSSAP.receive(tr_BSSMAP_AssignmentComplete) {
/* FIXME: Send MGCP CRCX */