diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index fe9187c82..d96ae0b2d 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -1349,6 +1349,33 @@ runs on BSC_ConnHdlr { setverdict(pass); } +function f_call_keep_open(inout CallParameters cpars, float open_time := 5.0) +runs on BSC_ConnHdlr { + log("Hold the call for some time"); + + timer T := open_time; + T.start; + alt { + [] MNCC.receive(tr_MNCC_DISC_ind(cpars.mncc_callref)); + [] MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref)); + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + [] BSSAP.receive(tr_BSSMAP_ClearCommand); + [] BSSAP.receive(tr_BSSMAP_ClearCommandCSFB); + [] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)); + + [] T.timeout { + log("Call stayed open for ", open_time, " seconds, all is well.") + setverdict(pass); + return; + } + } + + setverdict(fail, "An unexpected release event disconnected the active call prematurely"); + mtc.stop; +} + /* Reply to a received CRCX with an OK (or the reply configured in cpars), using the given parameters. * Return true when an OK reply was sent, false otherwise. * Count occurence of Osmux, include Osmux parameters in the reply if necessary. */ @@ -1797,8 +1824,7 @@ runs on BSC_ConnHdlr { f_mt_call_establish(cpars); - log("Hold the call for some time"); - f_sleep(3.0); + f_call_keep_open(cpars); log("Hangup"); f_call_hangup(cpars, true); @@ -1811,8 +1837,7 @@ runs on BSC_ConnHdlr { f_mo_call_establish(cpars); - log("Hold the call for some time"); - f_sleep(3.0); + f_call_keep_open(cpars); log("Hangup"); f_call_hangup(cpars, false); diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 0490901b6..8fc212c8d 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -324,6 +324,10 @@ function f_init(integer num_bsc := 1, boolean sgsap := false, boolean gsup := tr f_vty_config(MSCVTY, "msc", "osmux off"); } + /* Configure the MGCP timeout so that a failure to set up all RTP streams triggers within the time that we keep + * an otherwise established call open. */ + f_vty_config(MSCVTY, "msc", "timer mgw X2 3"); + for (var integer i := 0; i < num_bsc; i := i + 1) { if (isbound(mp_bssap_cfg[i])) { var RanOps ranops := BSC_RanOps;