[asterisk-users] PJSIP Losing knowledge of external_media_address

Joshua C. Colp jcolp at sangoma.com
Fri Aug 18 11:41:16 CDT 2023


On Fri, Aug 18, 2023 at 1:09 PM Mark Murawski <markm-lists at intellasoft.net>
wrote:

> I've seen this happen three times in the wild now.  I've been trying to
> isolate the source of the issue, but so far it seems like there's not
> enough debug output to know why this occurs.
>
> Long story short:
> - Start Asterisk
> - PJSIP Handles receiving INVITE from ITSP via WAN (Asterisk is behind
> NAT).  SIP is handled correctly, Asterisk responds OK with RTP media
> address of external_media_address
> - After 30 minutes to an hour or sometimes months later after startup,
> upon receiving INVITE from ITSP via WAN, Asterisk responds OK with
> INTERNAL LAN IP instead of external_media_address
> - I've observed this occur after 30 minutes from startup with no
> configuration changes that were made or any pjsip reloads done during
> this period
>
>
<snip>


>
>
> Attached sip sessions and debug log... the only thing I found
> interesting was finding a lack of a log item
> We SHOULD be seeing:
> DEBUG[XXXXX] res_pjsip_session.c: (null session): Setting external media
> address to 152.X.Y.Z
> This message is clearly lacking from the debug session where the
> incorrect media address is sent.  But there's not enough detail in the
> debugs to see why this decision was not made to use external_media_address
>

Can't you just extend the debug and add further logging to understand the
choices being made and why?


>
> By default we use nat settings for all our endpoints, but obviously it's
> not required here for an ITSP that has trustworthy media ports in the
> SDP.  Maybe a bandaid is turning off rewrite_contact for this endpoint?
> Going to try that as soon as possible.
>

I believe I've stated this once or twice when you've brought this issue up
on IRC but rewrite_contact has no influence or impact on this. It rewrites
incoming Contact headers to the source IP address and port of the SIP
message. You can turn it on if you wish, but it is unlikely to do anything.


>
> Why is external_media_address not being used all of a sudden?  Has
> anyone else seen this... is this a bug?--
>

With the limited insight into things it could be a bug. I haven't seen any
other reports, and haven't received any reports from other Sangoma
products. Is this with a mainline Asterisk, or is it your patched version
of Asterisk? It should be confirmed on normal Asterisk.

-- 
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-users/attachments/20230818/6e6830ec/attachment.html>


More information about the asterisk-users mailing list