External SIP media being told internal IP of PBX

Hello All,

Running pjsip on trunk, PBX is in cloud, client is on prem.
When a media packet goes out, it contains the internal ip address of the cloud server instead of the external.
Traditionally this is a quick fix using SIP Settings External address, but thats not working.
I also tried adding external ip under Sip Settings [chan_pjsip] with the same results.

Any suggestions?

Thanks!

Next step, investigate the router that forwards that connection.

Since thats in cloud (AWS) we would say its from that side, agree?
Of course thats an issue but at least a direction.

What does “media packet” mean?

Sip invite I believe contains the ip to send media to on the request, media being audio.
Traditionally SIP Ip address is placed in that information, but somehow getting internal IP

Okay, you’re referring to the SDP. I can’t comment on how that is specifically configured in FreePBX for PJSIP, but depending on Asterisk version any changes to that may require a restart of Asterisk before they apply.

Having mentioned the version which was the latest 15, let me switch to 16 and do a quick test and report back.
Sorry for the different lingo :slight_smile:

sngrep would make this short work, ip addresses are apparent on the points of egress/ingress

Did you set a local network?

Note that this and related changes require you to restart (not just reload) Asterisk.

If you still have trouble, post output of pjsip show transport, pjsip show endpoint, and pjsip logger for a failed call.

local network is set to the local server (10.x) network on AWS.
I also set the 192.168.1.x which is technically on site, and probably not necessary.

There have recently been three other threads describing a similar problem; I suspect that there may be a pjsip-related bug common to all of them. Unfortunately, I’m failing to find one of the threads. The others are


So far noone has reported an Asterisk issue with logs for anything along these lines, and unless configuration changes the transport is untouched. If dnsmgr is enabled, however, then it will regularly re-resolve a configured hostname - if that resolved down to local IP address for some reason then it’d change. Such things do appear in full Asterisk logs, including for IP address replacement stuff.

Really need logs for this or the other ones.

1 Like

As I mentioned above, I switched to asterisk 16 and the issue went away, I did use the pjsip logger information to confirm both the wrong info as well as the correct info after the switch.

The PJSIP logger shows the result, but it doesn’t show the information as to why that full logs show. That’s what hasn’t been shown from what I’ve tracked.

Sorry, yes I didnt share logging but it was confirmed that somehow we were advertising the Internal IP vs the External.
Since I needed to upgrade to Asterisk 16, I figured now was the time since I was troubleshooting, and it did advertise the right number.
( Sorry if advertise the right IP address in the sip header wasnt the right term )
Thanks all!

@jcolp Which logs are you interested in? In the thread I opened, I provided all logs I was asked for. I’m glad about anyone who has an idea what the issue could be.

The Asterisk instructions are here[1]. I don’t know if there’s FreePBX specific ways of doing things.

[1] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

You are speed! I will check that out. Thank you!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.