pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41723?usp=email )
Change subject: RAN_Emulation: Support Tx RESET retries in RANAP ......................................................................
RAN_Emulation: Support Tx RESET retries in RANAP
As already done in BSSAP in the same module.
Change-Id: I84553ae7aee19efa007bae060d7f7ca218a5f306 --- M library/RAN_Emulation.ttcnpp 1 file changed, 20 insertions(+), 11 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/23/41723/1
diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp index 167bfa9..563fa0c 100644 --- a/library/RAN_Emulation.ttcnpp +++ b/library/RAN_Emulation.ttcnpp @@ -799,26 +799,35 @@ SCCP_PAR_Address own, template (omit) GlobalRNC_ID grnc_id := omit) runs on RAN_Emulation_CT { timer T := 5.0; + var integer attempts := g_ran_ops.bssap_reset_retries; var CN_DomainIndicator dom; + if (g_ran_ops.ps_domain) { dom := ps_domain; } else { dom := cs_domain; }
- RANAP.send(ts_RANAP_UNITDATA_req(peer, own, f_ts_RANAP_Reset(ts_RanapCause_om_intervention, dom, grnc_id))); - T.start; - alt { - [] RANAP.receive(tr_RANAP_UNITDATA_ind(own, peer, tr_RANAP_ResetAck)) { - log("RANAP: Received RESET-ACK in response to RESET, we're ready to go!"); - } - [] as_reset_ack(); - [] RANAP.receive { repeat }; - [] T.timeout { - setverdict(fail, "RANAP: Timeout waiting for RESET-ACK after sending RESET"); - mtc.stop; + while (attempts > 0) { + attempts := attempts - 1; + + RANAP.send(ts_RANAP_UNITDATA_req(peer, own, f_ts_RANAP_Reset(ts_RanapCause_om_intervention, dom, grnc_id))); + T.start; + alt { + [] RANAP.receive(tr_RANAP_UNITDATA_ind(own, peer, tr_RANAP_ResetAck)) { + log("RANAP: Received RESET-ACK in response to RESET, we're ready to go!"); + return; + } + [] as_reset_ack(); + [] RANAP.receive { repeat }; + [] T.timeout { + continue; + } } } + + setverdict(fail, "BSSMAP: Timeout waiting for RESET-ACK after sending RESET"); + mtc.stop; } #endif