bsc: Move BSSAP handling of emergency call to helper function

Change-Id: I3a88efeae6710ba005496067ecb0c8f4035404ab
This commit is contained in:
Pau Espin 2023-01-03 17:05:27 +01:00
parent 3560979cf8
commit 39bd33c72c
1 changed files with 14 additions and 44 deletions

View File

@ -9156,15 +9156,13 @@ private function f_assignment_emerg_setup() runs on MSC_ConnHdlr {
RSL.send(emerg_setup_data_ind);
}
/* Test if the EMERGENCY SETUP gets passed on to the MSC via A when EMERGENCY
* CALLS are permitted by the BSC config. */
private function f_TC_assignment_emerg_setup_allow(charstring id) runs on MSC_ConnHdlr {
/* expect EmergencySetup on BSSAP after calling f_assignment_emerg_setup() */
private function f_assignment_emerg_setup_exp_bssap()
runs on MSC_ConnHdlr {
var PDU_BSSAP emerg_setup_data_ind_bssap;
var PDU_ML3_MS_NW emerg_setup;
timer T := 3.0;
f_assignment_emerg_setup()
T.start;
alt {
[] BSSAP.receive(tr_BSSAP_DTAP) -> value emerg_setup_data_ind_bssap {
@ -9180,6 +9178,14 @@ private function f_TC_assignment_emerg_setup_allow(charstring id) runs on MSC_Co
setverdict(fail, "timout waiting for EMERGENCY SETUP!");
}
}
}
/* Test if the EMERGENCY SETUP gets passed on to the MSC via A when EMERGENCY
* CALLS are permitted by the BSC config. */
private function f_TC_assignment_emerg_setup_allow(charstring id) runs on MSC_ConnHdlr {
f_assignment_emerg_setup();
f_assignment_emerg_setup_exp_bssap();
setverdict(pass);
f_perform_clear();
@ -9191,7 +9197,7 @@ private function f_TC_assignment_emerg_setup_deny(charstring id) runs on MSC_Con
var PDU_BSSAP emerg_setup_data_ind_bssap;
timer T := 3.0;
f_assignment_emerg_setup()
f_assignment_emerg_setup();
T.start;
alt {
@ -10468,25 +10474,7 @@ private function f_tc_emerg_call_and_lcs_loc_req(charstring id) runs on MSC_Conn
* another lchan. */
g_pars.ra := f_rnd_ra_emerg();
f_assignment_emerg_setup();
var PDU_BSSAP emerg_setup_data_ind_bssap;
timer T := 3.0;
T.start;
alt {
[] BSSAP.receive(tr_BSSAP_DTAP) -> value emerg_setup_data_ind_bssap {
var PDU_ML3_MS_NW verify_emerg_setup;
verify_emerg_setup := dec_PDU_ML3_MS_NW(emerg_setup_data_ind_bssap.pdu.dtap);
if (not isbound(verify_emerg_setup.msgs.cc.emergencySetup)) {
setverdict(fail, "no emergency setup");
}
}
[] BSSAP.receive {
setverdict(fail, "unexpected BSSAP message!");
}
[] T.timeout {
setverdict(fail, "timeout waiting for EMERGENCY SETUP!");
}
}
f_assignment_emerg_setup_exp_bssap();
/* Here would usually be a CC Call Proceeding from the MSC, but what does the BSC care about DTAP. */
@ -10576,25 +10564,7 @@ private function f_emerg_call_and_lcs_loc_req_early_lchan_release(RslRel rsl_rel
{
g_pars.ra := f_rnd_ra_emerg();
f_assignment_emerg_setup();
var PDU_BSSAP emerg_setup_data_ind_bssap;
timer T := 3.0;
T.start;
alt {
[] BSSAP.receive(tr_BSSAP_DTAP) -> value emerg_setup_data_ind_bssap {
var PDU_ML3_MS_NW verify_emerg_setup;
verify_emerg_setup := dec_PDU_ML3_MS_NW(emerg_setup_data_ind_bssap.pdu.dtap);
if (not ischosen(verify_emerg_setup.msgs.cc.emergencySetup)) {
setverdict(fail, "no emergency setup");
}
}
[] BSSAP.receive {
setverdict(fail, "unexpected BSSAP message!");
}
[] T.timeout {
setverdict(fail, "timeout waiting for EMERGENCY SETUP!");
}
}
f_assignment_emerg_setup_exp_bssap();
/* Start a Location Request to locate the emergency */
f_bssap_le_register_imsi(g_pars.imsi, omit);