[asterisk-dev] Issue with PJSIP contacts being "unavailable"

Joshua C. Colp jcolp at sangoma.com
Tue Jun 27 17:22:53 CDT 2023


On Tue, Jun 27, 2023 at 7:18 PM <asterisk at phreaknet.org> wrote:

> On 6/27/2023 6:07 PM, Joshua C. Colp wrote:
> >
> > I'm not sure what exactly you are referring to with "using the
> > transport used for registration". If "rewrite_contact" is set to yes
> > then the existing active connection should get used. If you are
> > referring to Asterisk establishing a new outgoing connection to the
> > registered Contact, then as long as it is optional and doesn't break
> > other behavior fine.
>
> Basically, suppose a device registers on a port, associated with some
> configured transport.
>
> The reason I'm doing this now is that initially, calls out *to* devices
> would just use the default transport (the first one configured, or
> something like that). Specifying a transport= in the endpoint explicitly
> ensured they'd only use the appropriate one. The problem still remains
> though that we don't necessarily know what transport a device is going
> to use in advance, and it could also change at any time.
>
>   I don't know if this would be a "new" outgoing connection to the
> contact or not... I was noticing this issue with outbound calls to
> devices using the wrong transport (e.g. an ATA registered using TLS, and
> Asterisk would call the device using UDP, on a different port). The
> description for "rewrite_contact" says "Allow Contact header to be
> rewritten with the source IP address-port" which doesn't really clarify
> that, but if that means it'll always use the same transport out to the
> device that the device initiated a connection on, no matter what, then I
> think that will do the trick. I just want Asterisk to go along with
> whatever the device wants to do. If there's a gap with "rewrite_contact"
> then I guess a new option is still needed to do the other half.
>

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.

-- 
Joshua C. Colp
Asterisk Project Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20230627/675f83d4/attachment.html>


More information about the asterisk-dev mailing list