<div dir="ltr"><div dir="ltr">On Tue, Jun 27, 2023 at 7:18 PM <<a href="mailto:asterisk@phreaknet.org">asterisk@phreaknet.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 6/27/2023 6:07 PM, Joshua C. Colp wrote:<br>
><br>
> I'm not sure what exactly you are referring to with "using the <br>
> transport used for registration". If "rewrite_contact" is set to yes <br>
> then the existing active connection should get used. If you are <br>
> referring to Asterisk establishing a new outgoing connection to the <br>
> registered Contact, then as long as it is optional and doesn't break <br>
> other behavior fine.<br>
<br>
Basically, suppose a device registers on a port, associated with some <br>
configured transport.<br>
<br>
The reason I'm doing this now is that initially, calls out *to* devices <br>
would just use the default transport (the first one configured, or <br>
something like that). Specifying a transport= in the endpoint explicitly <br>
ensured they'd only use the appropriate one. The problem still remains <br>
though that we don't necessarily know what transport a device is going <br>
to use in advance, and it could also change at any time.<br>
<br>
I don't know if this would be a "new" outgoing connection to the <br>
contact or not... I was noticing this issue with outbound calls to <br>
devices using the wrong transport (e.g. an ATA registered using TLS, and <br>
Asterisk would call the device using UDP, on a different port). The <br>
description for "rewrite_contact" says "Allow Contact header to be <br>
rewritten with the source IP address-port" which doesn't really clarify <br>
that, but if that means it'll always use the same transport out to the <br>
device that the device initiated a connection on, no matter what, then I <br>
think that will do the trick. I just want Asterisk to go along with <br>
whatever the device wants to do. If there's a gap with "rewrite_contact" <br>
then I guess a new option is still needed to do the other half.<br>
</blockquote></div><div><br></div>The source IP address, port, and transport type become the Contact. The Contact target is used for requests, and PJSIP looks for an existing active connection meeting that criteria. If such a connection is found then it is reused.<br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><font color="#073763">Joshua C. Colp</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Asterisk Project Lead</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Sangoma Technologies</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Check us out at <a href="http://www.sangoma.com" target="_blank">www.sangoma.com</a> and <a href="http://www.asterisk.org" target="_blank">www.asterisk.org</a></font><br></div></div></div></div></div></div></div></div></div></div></div>