Internal connection SDP Contact URI gives external address

FreePBX 14.0.13.23
Distro install on bare metal.

I have a Laptop with Bria 5 Softphone, which VPNs into another network (and given an example IP of 100.100.100.1) which has access to the phone server dmz (for example is 200.200.200.1). The VPN vlan is listed as one of the local networks on FreePBX portal / Settings / Asterisk SIP Settings / General SIP Settings. I am using PJSIP. If I examine pjsip.conf and pjsip.transports.conf, I see 100.100.100.0/24 listed for each transport (udp, tcp and tls).

But when a new call is placed by the softphone (for example 9925550000), it has one-way audio (from phone server to softphone only).

A tcpdump in phone server terminal shows the phone traffic is not natting or doing anything strange with the traffic… server is sending tcp SIP/SDP and RTP just fine… but the softphone just isn’t sending any RTP back.

I wireshark on the laptop and find it is sending RTP to the public IP (example 111.111.111.111) of the phone server instead of the internal 200.200.200.1. So I inspect the SDP traffic at beginning of call and find the third, and last, SDP (going from phone server to softphone) with a “Contact URI [email protected]”. So of course the softphone/laptop is sending RTP to the public IP.

As far as I know, asterisk/FreePBX will only do this if the invite came from an IP that doesn’t fall in the “local networks” listed in General SIP Settings (which then populates pjsip.transports.conf).

Anyone know what the cause/debug could be?

Some softphones do this, you could try with Zoiper. If the issue persists, set the parameter nat=yes for the remote extensions.

Naw. I already dug deep into wireshark and tcpdump and found the phone server is originating the public IP in the Contact URI of the SDP (from phone server to softphone). So switching the softphone won’t effect this.

I also tried every setting I could on the Bria 5 softphone and can’t get it to ignore the Contact URI.

Turns out Asterisk needs a restart, not just a reload to add local networks… :roll_eyes: So Asterisk continued to treat it as an outside extension, giving it the external_ip in Contact URI.

For everyone’s benefit, I’m relaying what Joshua C. Colp from Asterisk informed me:
As well - the Contact URI is not used for media. It's used for SIP signaling. The "c=" line in the SDP is used for media and the IP address placed into it is dependent upon the underlying configuration and where traffic is sent to.
Sure enough, I was only looking at “Message Header”… because in the third SDP wireshark “183. Session Progress / Message Body / Session Description Protocol” I see:
Connection Information (c): IN IP4 111.111.111.111

It would be really nice if both FreePBX and Asterisk could display a warning for this. I wasted hours debugging when it just required an Asterisk restart after hours (I know this is free software, but I have a right to whine… I’ve bought several FreePBX modules and Sangoma SBCs)

Cheers. I hope my post helps others.

1 Like

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