Connecting phone to FreePBX using public up address for both outside and inside the local network?

I have a FreePBX server running on my home local network. I would like to use my cell phone using a softphone app as an extension while I am at home and not at home. I want to connect the softphone to FreePBX using my homes public IP address or in my case the dynamic dns I have setup.

Everything works perfect outside my home network. I can make and receive calls and have two way audio using the public ip as expected. But when I connect back to my homes wifi, I can make and receive calls but I only hear audio and I am not sending out audio. This can be resolved by changing the sip settings to the servers internal private IP address. However, I would like to connect to the server using one IP address so I can come and go from my home without changing settings everytime.

Is this possible to setup?

I’m just wondering if it’s not working because of conflicts with the ports being used for the audio connection with two devices on the same network but traveling over the internet with the same public IP. Because you can’t have one port open to two devices at the same time.

I know I can use a vpn outside the network which does work I tried but that’s a hassle and don’t want to be connected to a VPN all the time outside my home. I tried changing NAT settings and other settings on FreePBX and my softphone app. But the current configuration is the best I’ve gotten so far.

I appreciate any feedback thanks!

Use URL not IP and have your internal name service return your pbx’ address.

1 Like

I am using the hostname URL from NO-IP which redirects to my routers IP address. I suppose I could setup a local dns server to point my router to which would redirect that domain to the local pbx ip address. But is there a simpler way to do this or alternative method to get two way audio to work with the domain name.

I would like to add also that two way audio seems to be working on outgoing calls but incoming calls nobody can hear me. Remember this is only while connected to the local networking using the domain url instead of local ip address.

If you want https redirection (and you do) and generally a well rounded system add the local resolution, Many routers have that facility built into their DHCP service. The one way audio probabbly needs forwarding udp 10000-20000 to your FPBX on that same router.

I am not getting any luck fixing the one way audio issue forwarding ports 10000-20000. I tried setting up BIND dns server to help with redirection as my router does not have that capability. However, I couldn’t get BIND setup and operating. So I think I eventually will setup freepbx on its own public network with firewall or find another dns server.

The way I was able to handle my first vpbx while in testing was by using the openvpn server built in to the pbx. That requires you to buy the sysadmin pro module but 25 bucks is well worth it IMO. Then all you have to do is have your phones resolve to the ‘local’ openvpn gateway once your tunnel is connected.

For a home PBX, I generally recommend a cloud server anyhow, because it is usually more robust. If your power or internet fails, the system remains operational and any extensions that can fail over to mobile data are fully functional. If the hardware fails, the cloud service provides a replacement. If the software fails, you can quickly restore from a snapshot or backup. You have a static public IP address, so no issues with dynamic DNS.

However, if you have local trunking resources (POTS, GSM gateway, etc.), you should be using an on-site server.

Connecting to the public IP from your own LAN is often problematic, because many routers don’t handle “hairpinning” properly. This can often be fixed by changing a router setting, or there may be a workaround in FreePBX or in the mobile app. If you would like to troubleshoot this, at the Asterisk command prompt type
pjsip set logger on
assuming that the extension is using pjsip. If using chan_sip, please explain why and instead issue
sip set debug on
then make a failing incoming call, paste the Asterisk log for the call at and post the link here. If you are too new to post links, just post the last eight hex characters of the URL. Also, post router/firewall make/model and any VoIP-related settings.

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