neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34416?usp=email )

 (

1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: sip: pass CallPars into f_TC_*()
......................................................................

sip: pass CallPars into f_TC_*()

Move composition of CallPars out of all f_* functions into their TC_*
functions, so that future tests can reuse the f_* functions with
different CallPars.

An upcoming patch wants to call f_TC_mo_success_rel_sip() with different
CallPars.

Change-Id: Icdcaa7a8a0fadcd6f5715ad052e286b904ded570
---
M sip/SIP_Tests.ttcn
1 file changed, 22 insertions(+), 3 deletions(-)

Approvals:
  pespin: Looks good to me, approved
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve




diff --git a/sip/SIP_Tests.ttcn b/sip/SIP_Tests.ttcn
index 935eed3..67e7818 100644
--- a/sip/SIP_Tests.ttcn
+++ b/sip/SIP_Tests.ttcn
@@ -410,7 +410,7 @@

 /* Successful MT Call, which is subsequently released by SIP side */
 private function f_TC_mt_success_rel_sip(charstring id) runs on ConnHdlr {
-       var CallPars cp := valueof(t_CallPars(false));
+       var CallPars cp := g_pars.g_cp;
        f_CallPars_compute(cp);
        cp.comp.sip_body := "v=0\r\no=Osmocom 0 0 IN IP4 1.1.1.1\r\ns=GSM 
Call\r\nc=IN " &
                            f_mgcp_addr2addrtype(cp.sip_rtp_addr) & " " & 
cp.sip_rtp_addr &
@@ -429,6 +429,7 @@
        var ConnHdlr vc_conn;
        f_init();
        pars := valueof(t_Pars);
+       pars.g_cp := valueof(t_CallPars(false));
        vc_conn := f_start_handler(refers(f_TC_mt_success_rel_sip), pars);
        vc_conn.done;
 }
@@ -473,7 +474,7 @@

 /* Successful MO Call, which is subsequently released by SIP side */
 private function f_TC_mo_success_rel_sip(charstring id) runs on ConnHdlr {
-       var CallPars cp := valueof(t_CallPars(true));
+       var CallPars cp := g_pars.g_cp;
        f_CallPars_compute(cp);
        cp.comp.sip_body := "v=0\r\no=Osmocom 0 0 IN IP4 1.1.1.1\r\ns=GSM 
Call\r\nc=IN " &
                            f_mgcp_addr2addrtype(cp.sip_rtp_addr) & " " & 
cp.sip_rtp_addr &
@@ -492,13 +493,14 @@
        var ConnHdlr vc_conn;
        f_init();
        pars := valueof(t_Pars);
+       pars.g_cp := valueof(t_CallPars(is_mo := true));
        vc_conn := f_start_handler(refers(f_TC_mo_success_rel_sip), pars);
        vc_conn.done;
 }

 /* SETUP followed by DISC results in lingering B-leg (OS#3518)*/
 private function f_TC_mo_setup_disc_late_rtp(charstring id) runs on ConnHdlr {
-       var CallPars cp := valueof(t_CallPars(true));
+       var CallPars cp := g_pars.g_cp;
        f_CallPars_compute(cp);
        cp.comp.sip_body := "v=0\r\no=Osmocom 0 0 IN IP4 1.1.1.1\r\ns=GSM 
Call\r\nc=IN " &
                            f_mgcp_addr2addrtype(cp.sip_rtp_addr) & " " & 
cp.sip_rtp_addr &
@@ -546,6 +548,7 @@
        var ConnHdlr vc_conn;
        f_init();
        pars := valueof(t_Pars);
+       pars.g_cp := valueof(t_CallPars(is_mo := true));
        vc_conn := f_start_handler(refers(f_TC_mo_setup_disc_late_rtp), pars);
        vc_conn.done;
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34416?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icdcaa7a8a0fadcd6f5715ad052e286b904ded570
Gerrit-Change-Number: 34416
Gerrit-PatchSet: 3
Gerrit-Owner: neels <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to