diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index fe524dcf5..991a69337 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -675,8 +675,25 @@ return boolean { } /* establish a channel fully, expecting an assignment matching 'exp' */ -function f_establish_fully_ret(PDU_BSSAP ass_cmd, template PDU_BSSAP exp_ass_cpl) -runs on MSC_ConnHdlr return PDU_BSSAP { +function f_establish_fully(template (omit) PDU_BSSAP ass_tpl, template PDU_BSSAP exp_ass_cpl) +runs on MSC_ConnHdlr { + f_MscConnHdlr_init(1, "127.0.0.2", "127.0.0.3"); + + f_create_chan_and_exp(); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + /* start ciphering, if requested */ + if (ispresent(g_pars.encr)) { + f_cipher_mode(g_pars.encr.enc_alg, g_pars.encr.enc_key); + } + + /* bail out early if no assignment requested */ + if (istemplatekind(ass_tpl, "omit")) { + return; + } + + var PDU_BSSAP ass_cmd := valueof(ass_tpl); var PDU_BSSAP bssap; timer T := 10.0; var boolean exp_compl := ischosen(exp_ass_cpl.pdu.bssmap.assignmentComplete); @@ -696,17 +713,6 @@ runs on MSC_ConnHdlr return PDU_BSSAP { st.is_assignment := true; } - f_MscConnHdlr_init(1, "127.0.0.2", "127.0.0.3"); - - f_create_chan_and_exp(); - /* we should now have a COMPL_L3 at the MSC */ - BSSAP.receive(tr_BSSMAP_ComplL3); - - /* start ciphering, if requested */ - if (ispresent(g_pars.encr)) { - f_cipher_mode(g_pars.encr.enc_alg, g_pars.encr.enc_key); - } - f_create_mgcp_expect(mgcpcrit); BSSAP.send(ass_cmd); @@ -751,12 +757,6 @@ runs on MSC_ConnHdlr return PDU_BSSAP { if (not isbound(bssap)) { self.stop; } - return bssap; -} - -function f_establish_fully(PDU_BSSAP ass_cmd, template PDU_BSSAP exp_ass_cpl) -runs on MSC_ConnHdlr { - var PDU_BSSAP unused := f_establish_fully_ret(ass_cmd, exp_ass_cpl); } type record HandoverState {