SIP_Templates: Rework templates to make them more extensible
The existing template system in SIP_Templates made it difficult to craft
specific templates, since it was usually skipping several layers of
fields when passing parameters.
This commit reworks some of those templates, adds news templates, and
cleans formatting for others, as a preparation for further work which
will be done when adding Asterisk_Tests testsuite.
Change-Id: Ifd14213e9c2b8f5061f828a63ef47844828d94ea
diff --git a/sip/SIP_Tests.ttcn b/sip/SIP_Tests.ttcn
index ab33af7..aee1a82 100644
--- a/sip/SIP_Tests.ttcn
+++ b/sip/SIP_Tests.ttcn
@@ -99,12 +99,16 @@
private function f_CallPars_compute(inout CallPars cp) {
if (cp.is_mo) {
- cp.comp.sip_url_ext := valueof(ts_SipAddr(cp.called, mp_local_host, 5060));
- cp.comp.sip_url_gsm := valueof(ts_SipAddr(cp.calling, mp_osmosip_host, 5060));
+ cp.comp.sip_url_ext := valueof(ts_SipAddr(ts_HostPort(mp_local_host, 5060),
+ ts_UserInfo(cp.called)));
+ cp.comp.sip_url_gsm := valueof(ts_SipAddr(ts_HostPort(mp_osmosip_host, 5060),
+ ts_UserInfo(cp.calling)));
cp.mncc_call_id := f_sip_rand_seq_nr();
} else {
- cp.comp.sip_url_ext := valueof(ts_SipAddr(cp.calling, mp_local_host, 5060));
- cp.comp.sip_url_gsm := valueof(ts_SipAddr(cp.called, mp_osmosip_host, 5060));
+ cp.comp.sip_url_ext := valueof(ts_SipAddr(ts_HostPort(mp_local_host, 5060),
+ ts_UserInfo(cp.calling)));
+ cp.comp.sip_url_gsm := valueof(ts_SipAddr(ts_HostPort(mp_osmosip_host, 5060),
+ ts_UserInfo(cp.called)));
cp.comp.sip_call_id := hex2str(f_rnd_hexstring(15));
}
cp.comp.sip_seq_nr := f_sip_rand_seq_nr();
@@ -338,7 +342,7 @@
}
/* OSC -> SIP: OSC confirms call establishment to SIP side */
- as_SIP_expect_resp(tr_SIP_Response(cp.comp.sip_call_id, sip_addr_ext, sip_addr_gsm, contact_addr := ?,
+ as_SIP_expect_resp(tr_SIP_Response(cp.comp.sip_call_id, sip_addr_ext, sip_addr_gsm, contact := ?,
method := "INVITE", status_code := 200,
seq_nr := ?, reason := "OK",
body := expect_sdp_to_sip));