pespin has submitted this change. ( 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, 21 insertions(+), 11 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved osmith: Looks good to me, but someone else must approve
diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp index 167bfa9..7ea1578 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, "RANAP: Timeout waiting for RESET-ACK after sending RESET"); + mtc.stop; } #endif
@@ -939,6 +948,7 @@ dom := rud_ind.userData.initiatingMessage.value_.Reset.protocolIEs[1].value_.cN_DomainIndicator; RANAP.send(ts_RANAP_UNITDATA_req(rud_ind.callingAddress, rud_ind.calledAddress, f_ts_RANAP_ResetAck(dom, g_ran_ops.grnc_id))); + repeat; } #endif }