pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37298?usp=email )
Change subject: SIP_Templates: Allow setting Session-Expires and Min_SE in INVITE
templates
......................................................................
SIP_Templates: Allow setting Session-Expires and Min_SE in INVITE templates
Related: SYS#6987
Change-Id: Ib2bc6258c072e88539ccc852d057b517822936bd
---
M asterisk/SIP_ConnectionHandler.ttcn
M library/SIP_Templates.ttcn
2 files changed, 55 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/98/37298/1
diff --git a/asterisk/SIP_ConnectionHandler.ttcn b/asterisk/SIP_ConnectionHandler.ttcn
index 892f5a3..da4328c 100644
--- a/asterisk/SIP_ConnectionHandler.ttcn
+++ b/asterisk/SIP_ConnectionHandler.ttcn
@@ -573,7 +573,7 @@
tr_From(tr_Addr_Union_from_val(g_pars.cp.calling.addr), *),
tr_To(tr_Addr_Union_from_val(g_pars.cp.called.addr), *),
tr_Via_from(f_tr_HostPort(g_pars.remote_sip_host, g_pars.remote_sip_port)),
- ?, ?);
+ ?, body := ?);
var charstring sip_expect_str := log2str(exp_req);
[] SIP.receive(exp_req) -> value g_rx_sip_req {
diff --git a/library/SIP_Templates.ttcn b/library/SIP_Templates.ttcn
index 26f7ea8..374fe32 100644
--- a/library/SIP_Templates.ttcn
+++ b/library/SIP_Templates.ttcn
@@ -251,6 +251,21 @@
deltaSec := deltaSec
}
+// [RFC draft-ietf-sip-session-timer-15]
+template (value) Min_SE ts_Min_SE(template (value) DeltaSec deltaSec :=
"800000",
+ template (omit) SemicolonParam_List params := omit) := {
+ fieldName := MIN_SE_E,
+ deltaSec := deltaSec,
+ params := params
+}
+template (present) Min_SE tr_Min_SE(template (present) DeltaSec deltaSec := ?,
+ template SemicolonParam_List params := *) := {
+ fieldName := MIN_SE_E,
+ deltaSec := deltaSec,
+ params := params
+}
+
+
// [RFC3455 5.4] + 3GPP 24.229 V8.7.0
template (present) Access_net_spec tr_Access_net_spec(template (present) charstring
access_type := ?,
template SemicolonParam_List access_info := *) := {
@@ -334,6 +349,14 @@
response_num := response_num
}
+// [RFC draft-ietf-sip-session-timer-15]
+template (value) Session_expires ts_Session_expires(template (value) DeltaSec deltaSec,
+ template (omit) SemicolonParam_List se_params := omit) := {
+ fieldName := SESSION_EXPIRES_E,
+ deltaSec := deltaSec,
+ se_params := se_params
+}
+
// [20.35 RFC2616 14.38]
template (value) Server ts_Server(template (value) ServerVal_List serverBody := {}) := {
fieldName := SERVER_E,
@@ -692,6 +715,7 @@
template (omit) Allow allow := ts_Allow(c_SIP_defaultMethods),
template (omit) Expires expires := omit,
template (omit) MinExpires minExpires := omit,
+ template (omit) Min_SE min_SE := omit,
template (omit) P_Associated_Uri p_associated_uri := omit,
template (omit) RAck rack := omit,
template (omit) Require require := omit,
@@ -699,6 +723,7 @@
template (omit) Security_client security_client := omit,
template (omit) Security_server security_server := omit,
template (omit) Server server := omit,
+ template (omit) Session_expires session_expires := omit,
template (omit) Supported supported := omit,
template (omit) UserAgent userAgent := ts_UserAgent({ "osmo-ttcn3-hacks/0.23"
}),
template (omit) WwwAuthenticate wwwAuthenticate := omit
@@ -720,6 +745,7 @@
expires := expires,
fromField := from_addr,
minExpires := minExpires,
+ min_SE := min_SE,
p_associated_uri := p_associated_uri,
rack := rack,
require := require,
@@ -727,6 +753,7 @@
security_client := security_client,
security_server := security_server,
server := server,
+ session_expires := session_expires,
supported := supported,
toField := to_addr,
userAgent := userAgent,
@@ -747,12 +774,14 @@
template Allow allow := *,
template Authorization authorization := *,
template Expires expires := *,
+ template Min_SE min_SE := *,
template P_Associated_Uri p_associated_uri := *,
template RAck rack := *,
template Require require := *,
template RSeq rseq := *,
template Security_client security_client := *,
template Security_server security_server := *,
+ template Session_expires session_expires := *,
template Server server := *,
template Supported supported := *,
template UserAgent userAgent := *,
@@ -774,12 +803,14 @@
},
expires := expires,
fromField := from_addr,
+ min_SE := min_SE,
p_associated_uri := p_associated_uri,
rack := rack,
require := require,
rseq := rseq,
security_client := security_client,
security_server := security_server,
+ session_expires := session_expires,
server := server,
supported := supported,
toField := to_addr,
@@ -849,6 +880,8 @@
template (value) Via via,
template (value) Contact contact,
integer seq_nr,
+ template (omit) Min_SE min_SE := omit,
+ template (omit) Session_expires session_expires := omit,
template (omit) Supported supported := omit,
template (omit) charstring body := omit) := {
requestLine := ts_SIP_ReqLine(INVITE_E, to_addr.addressField.nameAddr.addrSpec),
@@ -857,6 +890,8 @@
via,
content_length := f_ContentLength(body),
content_type := f_ContentTypeOrOmit(ts_CT_SDP, body),
+ min_SE := min_SE,
+ session_expires := session_expires,
supported := supported),
messageBody := body,
payload := omit
@@ -868,10 +903,15 @@
template To to_addr,
template Via via := tr_Via_from(f_tr_HostPort_opt_defport(?)),
template integer seq_nr,
- template charstring body) := {
+ template Min_SE min_SE := *,
+ template Session_expires session_expires := *,
+ template Supported supported := *,
+ template charstring body := *) := {
requestLine := tr_SIP_ReqLine(INVITE_E, uri),
msgHeader := tr_SIP_msgh_std(call_id, from_addr, to_addr, ?,
- via, "INVITE", seq_nr),
+ via, "INVITE", seq_nr,
+ min_SE := min_SE,
+ session_expires := session_expires),
messageBody := body,
payload := omit
}
@@ -1044,6 +1084,7 @@
template (omit) P_Associated_Uri p_associated_uri := omit,
template (omit) Require require := omit,
template (omit) Server server := omit,
+ template (omit) Session_expires session_expires := omit,
template (omit) Supported supported := omit,
template (omit) UserAgent userAgent := omit,
template (omit) charstring body := omit) := {
@@ -1056,6 +1097,7 @@
p_associated_uri := p_associated_uri,
require := require,
server := server,
+ session_expires := session_expires,
supported := supported,
userAgent := userAgent),
messageBody := body,
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37298?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: Ib2bc6258c072e88539ccc852d057b517822936bd
Gerrit-Change-Number: 37298
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange