BSSAP_LE_Emulation: on register_imsi, make sure to wait for RESET ACK
Change-Id: Id0d087a90394369ef60846baa4d02289e9d0be1e
This commit is contained in:
parent
ffd2ef1de4
commit
6ea71cda5a
|
@ -115,6 +115,7 @@ type component BSSAP_LE_Emulation_CT {
|
|||
var charstring g_ran_id;
|
||||
var integer g_next_e1_ts := 1;
|
||||
var BssapLeOps g_ran_ops;
|
||||
var boolean g_reset_ack_ready := false;
|
||||
};
|
||||
|
||||
private function f_conn_id_known(integer sccp_conn_id)
|
||||
|
@ -315,6 +316,7 @@ private function f_bssap_le_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) r
|
|||
alt {
|
||||
[] BSSAP_LE.receive(tr_BSSAP_LE_UNITDATA_ind(own, peer, tr_BSSMAP_LE_ResetAck)) {
|
||||
log("Received RESET-ACK in response to RESET, we're ready to go!");
|
||||
g_reset_ack_ready := true;
|
||||
}
|
||||
[] as_reset_ack();
|
||||
[] BSSAP_LE.receive { repeat };
|
||||
|
@ -349,6 +351,7 @@ private altstep as_reset_ack() runs on BSSAP_LE_Emulation_CT {
|
|||
log("Responding to inbound RESET with RESET-ACK");
|
||||
BSSAP_LE.send(ts_BSSAP_LE_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress,
|
||||
ts_BSSMAP_LE_ResetAck));
|
||||
g_reset_ack_ready := true;
|
||||
repeat;
|
||||
}
|
||||
}
|
||||
|
@ -553,6 +556,29 @@ function main(BssapLeOps ops, charstring id) runs on BSSAP_LE_Emulation_CT {
|
|||
|
||||
[] PROC.getcall(BSSAP_LE_register_imsi:{?,?,?}) -> param(imsi, tmsi, vc_hdlr) {
|
||||
f_create_imsi(imsi, tmsi, vc_hdlr);
|
||||
|
||||
/* Wait for RESET-ACK if not received yet */
|
||||
if (not g_reset_ack_ready) {
|
||||
var integer wait_seconds := 10;
|
||||
timer T_reset_ack := 1.0;
|
||||
T_reset_ack.start;
|
||||
alt {
|
||||
[wait_seconds > 0] T_reset_ack.timeout {
|
||||
if (g_reset_ack_ready) {
|
||||
break;
|
||||
}
|
||||
wait_seconds := wait_seconds - 1;
|
||||
T_reset_ack.start;
|
||||
repeat;
|
||||
}
|
||||
|
||||
[wait_seconds == 0] T_reset_ack.timeout {
|
||||
setverdict(fail, "Timeout waiting for BSSMAP-LE RESET-ACK");
|
||||
mtc.stop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PROC.reply(BSSAP_LE_register_imsi:{imsi, tmsi, vc_hdlr}) to vc_hdlr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue