Issues with Dynamic IP in SIP settings

Hello,

I’m setting up a FreePBX system for home use. I’m fairly experienced with FreePBX at this point as I run several other servers at other locations. This, however, is the first one I’ve deployed where I don’t have (and can’t get) a static IP address.

Under Asterisk SIP Settings, I’ve configured my LAN and set the IP Configuration to Dynamic IP, and entered the dynamic Host. This gets updated from my firewall (which by the way has the necessary NATs and rules for SIP and RTP traffic), and resolving the host returns the correct IP address both internally and externally (internally it resolves to the internal IP of the FreePBX system, but that’s irrelevant).

Things work fine from within the LAN, and a SIP phone out on the Internet is able to register. When the external phone tries to place a call however the RTP traffic from the phone is destined to the server’s internal IP and not the external address. I’ve confirmed this by performing a packet capture on the external host while placing the call, and I see the control channel traffic going to port 5060 as expected but the RTP traffic being sent to the LAN address.

If I change the configuration on the server to Static IP and enter the (current) external IP everything works fine. It would appear that the Dynamic IP option just isn’t working correctly.

I’m running version 2.10.1.4 on the PBX Distro, from the latest stable release (i think 2.210.62.2).

Any input is appreciated.

It’s because the hostname resolves to the internal address from within your network (I’m assuming you have the internal DNS server defined for your PBX)

Maybe if you point the PBX to some external DNS servers it would solve the issue. Either that, or make a different dynamic hostname that always resolves to the public IP and point your SIP settings to that.

… I’m an idiot.

Thanks!