<p></p>
<p dir="auto">UDP is not a valid transport for SIPS based on <a href="https://datatracker.ietf.org/doc/html/rfc3261#section-26.2.2" rel="nofollow">RFC 3261</a> but it doesn't mean that it's TCP.</p>
<blockquote>
<p dir="auto">Note that in the SIPS URI scheme, transport is independent of TLS,<br>
and thus "sips:<a href="mailto:alice@atlanta.com">alice@atlanta.com</a>;transport=tcp" and<br>
"sips:<a href="mailto:alice@atlanta.com">alice@atlanta.com</a>;transport=sctp" are both valid (although<br>
note that UDP is not a valid transport for SIPS).  The use of<br>
"transport=tls" has consequently been deprecated, partly because<br>
it was specific to a single hop of the request.  This is a change<br>
since <a href="https://datatracker.ietf.org/doc/html/rfc2543" rel="nofollow">RFC 2543</a>.</p>
</blockquote>
<p dir="auto">I think we have a few options to get the transport.</p>
<p dir="auto">We could get the transport by calling fix_nated_register() to set <code class="notranslate">received</code> but that seems silly to have to include the nathelper module.  On my test, that's set to <code class="notranslate">sip:10.15.5.117:36557;transport=tls</code> (which also doesn't seem possible to have the scheme set to "sip" when the transport is TLS.).   Probably doesn't work for other transports.  This seems ugly.</p>
<p dir="auto">We could determine the transport based on the scheme and the tcpconn-id.</p>
<ul dir="auto">
<li>If scheme=sip and tcpconn_id is 0, then transport is UDP</li>
<li>If scheme=sip and tcpconn_id is not 0, then transport is TCP</li>
<li>If scheme=sips and tcpconn_id is not 0, then transport is TLS</li>
</ul>
<p dir="auto">Won't work for SCTP.  Not sure about WSS.</p>
<p dir="auto">We could store the transport on the ucontact struct.  Probably the cleanest solution to have an explicit storage of the transport but some of the same problems might be pushed upstream to determine the correct transport to save in the first place.</p>
<p dir="auto">Any thoughts on a go forward direction?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/3178#issuecomment-1183387544">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZKOTBOUNO5QN26UDATVT3QCRANCNFSM53CLIALQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZKFYH6CLEAZTOLH4KLVT3QCRA5CNFSM53CLIAL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOI2EQ7GA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/issues/3178/1183387544</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/3178#issuecomment-1183387544",
"url": "https://github.com/kamailio/kamailio/issues/3178#issuecomment-1183387544",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>