PJSIP NAT Trouble

So, I’m testing out Asterisk 13 / FreePBX 13 latest build everything up to date.

I can register with both SIP_CHAN and PJSIP no issues. I can also dial an the PBX answers.

I have a PBX on a 10.0.0.0/24 network.
I have a laptop with softphone on a 192.168.1.0/24 network
I have I firewall forwarding from an external ip of say 1.2.3.4

I ran tcpdump and get 10.0.0.2 -> 1.2.3.4 for RTP

With SIP_CHAN everything works fine and I get audio and can send audio.
RTP Packets Look as follows in wireshark.

192.168.1.x -> 1.2.3.4 to PBX
1.2.3.4 -> 192.168.1.x from PBX
192.168.1.x -> 1.2.3.4 to PBX
1.2.3.4 -> 192.168.1.x from
PBX192.168.1.x -> 1.2.3.4 to PBX
1.2.3.4 -> 192.168.1.x from
PBX192.168.1.x -> 1.2.3.4 to PBX
1.2.3.4 -> 192.168.1.x from PBX

but

When I use PJSIP I get from wireshark

192.168.1.x -> 10.0.0.2
192.168.1.x -> 10.0.0.2
192.168.1.x -> 10.0.0.2

I’ve tried entering my external IP, my network ob both the General SIP and PJSIP Pages.
I also changed setting default SIP type to “YES” under Advanced settings. I also tried turning off CHAN_SIP.

I see in the documentation that Asterisk recommends settings of local_net, external_signaling_address, and external_signaling_port. Are these being set somewhere I can’t seem to find it.

Amartin13

Where you able to figure this out. I am running into the same issue

Thx Levi

These settings are set automatically by freepbx. You can check it via ssh:

/etc/asterisk/pjsip.transports.conf

like this:

[0.0.0.0-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
external_media_address=your public ip
external_signaling_address=your public ip
allow_reload=yes
local_net=192.168.100.0/24

I think you should do this:
Go to Advanced Settings–>General SIP Settings and under NAT settings section, “External Address”.
and run “Detect Network Settings” to renew this settings.

… but be careful with the “Detect Network Settings” tab.

I often remotely administer customer systems, and I did this to one of my customers and it set the external IP address for the PBX in their network to MY external address.

The tools are nice, but always remember that you need to make sure that the answer you get isn’t just “A” right answer, but “THE” right answer.

Yeah, I noticed that too. I haven’t had time to fix this yet.

I struggled with this too for remote clients behind nat. I ended up putting my box as a DMZ to get around it… After all this time the fix was so simple.

Go to settings -> asterisk Sip Settings

Select Chan PJSIP

under UDP - 0.0.0.0 -All set to YES… It worked perfect after this.