From FreeSWITCH Wiki
Jump to: navigation, search

FreeSwitch, Networking and NAT

I have elected to resolve the problem with SipExcs It includes CentOS + FreeSwitch + NAT traversal plugins. It might not please everyone, as this solution creates a PBX only computer, i.e. it's NOT designed to run on YOUR linux installation.
Also note that I was not able to get SipExcs to work with the 3CX as an external client either, but the X-Lite from CounterPath does work.
So if you want to stick with a standalone FreeSwitch install, I suggest to try using the X-Lite softphone. I hate the interface, but it gets across the NATs...

References internal to this site:


I was looking for a Networking section because I'm trying to use my Linux-FreeSwitch box behind my home NAT router and it does not work (yet!).

With a vanilla installation of FreeSwitch, I was able to get the 3CX soft phones to work inside my network but I had mixed results when the 3CX soft phone was behind another NAT router (my brother's).
I had the remote 3CX phone configured to be a client to my Freeswitch using extension 1019. In the configuration used, this should make his phone part of "My PBX".
The SIP signaling worked fine, the phones were connecting, authenticating and ringing, but no voice.
I read that the voice is trying to go peer-to-peer using RTP so then we port forwarded, using router configs, the RTP ports (40000-40049) to the PCs with the soft phones on both ends.
The voice from my network would reach the remote softphone behind the NAT, but I would not receive any voice stream from my brother's phone.

I figured that if I'd understand the networking behind VoIP, I could figure out a way to make it work.
I don't even know if FreeSwitch acts or does not act as a proxy for the 'Voice stream' when the connection is from internal to external.
This could simplify my port forwarding and allow connections to multiple softphones behind my NAT.
One thing I just thought about, I don't know if my brother has UPnP enabled on his router, mine is enabled.
But I have no idea if the 3CX phones takes advantage of UPnP.

This is what is happening at the console (but from a different location and the external extension was 1000 this time):

I know I could create a simple solution by providing VPN access to my network, but I wanted to provide VoIP to my close family without granting them full access to my network.
But also I've also heard that Voip can crap out on VPN, but I've not tried or experienced it.

This is the description of my network infrastructure, probably similar to many of you:

Then I have configured my router to do port forwarding as described in the FreeSwitch Firewall and NAT: