pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36780?usp=email )
Change subject: SIP_Templates: Allow setting transport in Via templates ......................................................................
SIP_Templates: Allow setting transport in Via templates
This is needed when using IMS, since TCP is used.
Change-Id: Id45491615bcb5c074ef4fc298cbb24b2e034972d --- M asterisk/SIP_ConnectionHandler.ttcn M library/SIP_Templates.ttcn 2 files changed, 17 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/80/36780/1
diff --git a/asterisk/SIP_ConnectionHandler.ttcn b/asterisk/SIP_ConnectionHandler.ttcn index 13b5f04..9c7cca5 100644 --- a/asterisk/SIP_ConnectionHandler.ttcn +++ b/asterisk/SIP_ConnectionHandler.ttcn @@ -178,6 +178,7 @@ { id := "received", paramValue := g_pars.remote_sip_host } }; */ return tr_Via_from(via_req.viaBody[0].sentBy, + via_req.viaBody[0].sentProtocol.transport, via_resp_params); }
diff --git a/library/SIP_Templates.ttcn b/library/SIP_Templates.ttcn index 3492dc4..e22646c 100644 --- a/library/SIP_Templates.ttcn +++ b/library/SIP_Templates.ttcn @@ -372,22 +372,24 @@ mediaType := "application/sdp" };
-template (value) Via ts_Via_from(template (value) HostPort addr) := { +template (value) Via ts_Via_from(template (value) HostPort addr, + template (value) charstring transport := "UDP") := { fieldName := VIA_E, viaBody := { { - sentProtocol := { "SIP", "2.0", "UDP" }, + sentProtocol := { "SIP", "2.0", transport }, sentBy := addr, viaParams := omit } } } template (present) Via tr_Via_from(template (present) HostPort host_port := ?, + template (present) charstring transport := ?, template SemicolonParam_List viaParams := *) := { fieldName := VIA_E, viaBody := { { - sentProtocol := { "SIP", "2.0", "UDP" }, + sentProtocol := { "SIP", "2.0", ? }, sentBy := host_port, viaParams := viaParams }