<div dir="ltr"><div dir="ltr">On Fri, Aug 18, 2023 at 1:09 PM Mark Murawski <<a href="mailto:markm-lists@intellasoft.net">markm-lists@intellasoft.net</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">I've seen this happen three times in the wild now. I've been trying to <br>
isolate the source of the issue, but so far it seems like there's not <br>
enough debug output to know why this occurs.<br>
<br>
Long story short:<br>
- Start Asterisk<br>
- PJSIP Handles receiving INVITE from ITSP via WAN (Asterisk is behind <br>
NAT). SIP is handled correctly, Asterisk responds OK with RTP media <br>
address of external_media_address<br>
- After 30 minutes to an hour or sometimes months later after startup, <br>
upon receiving INVITE from ITSP via WAN, Asterisk responds OK with <br>
INTERNAL LAN IP instead of external_media_address<br>
- I've observed this occur after 30 minutes from startup with no <br>
configuration changes that were made or any pjsip reloads done during <br>
this period<br><br></blockquote><div><br></div><div><snip></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Attached sip sessions and debug log... the only thing I found <br>
interesting was finding a lack of a log item<br>
We SHOULD be seeing:<br>
DEBUG[XXXXX] res_pjsip_session.c: (null session): Setting external media <br>
address to 152.X.Y.Z<br>
This message is clearly lacking from the debug session where the <br>
incorrect media address is sent. But there's not enough detail in the <br>
debugs to see why this decision was not made to use external_media_address<br></blockquote><div><br></div><div>Can't you just extend the debug and add further logging to understand the choices being made and why?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
By default we use nat settings for all our endpoints, but obviously it's <br>
not required here for an ITSP that has trustworthy media ports in the <br>
SDP. Maybe a bandaid is turning off rewrite_contact for this endpoint? <br>
Going to try that as soon as possible.<br></blockquote><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Why is external_media_address not being used all of a sudden? Has <br>
anyone else seen this... is this a bug?--<br></blockquote><div><br></div><div>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.</div><div><br></div></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>