I have a an asterisk server hosted on address 70.40.180.100/. When I type this on the web-browser, I can open the freePBX web-front to access the application. I now want to connect client devices to this server. When I hosted the server on my local system, I gave my local ip-address as my host-address on my client device(android phone) and I was able to make voip calls. Here the ip-address of the server is not available to connect ans the server address also does not work. I know, the problem is because the ip-address is not public and I need to do something like port forwarding. But, I would like some direction here.
My server is a Ubuntu-1404-trusty-64-minimal and ifconfig gives
docker0 Link encap:Ethernet HWaddr 02:42:32:c1:87:5f
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:32ff:fec1:875f/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:76 (76.0 B) TX bytes:360 (360.0 B)
eth0 Link encap:Ethernet HWaddr 52:54:a2:01:1f:d7
inet addr:172.31.1.100 Bcast:172.31.1.255 Mask:255.255.255.0
inet6 addr: 2a01:4f8:c17:19fb::2/64 Scope:Global
inet6 addr: fe80::5054:a2ff:fe01:1fd7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1118766 errors:0 dropped:0 overruns:0 frame:0
TX packets:40869980 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1310353426 (1.3 GB) TX bytes:2943301636 (2.9 GB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:189405 errors:0 dropped:0 overruns:0 frame:0
TX packets:189405 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:31714766 (31.7 MB) TX bytes:31714766 (31.7 MB)
The port forwarding you'll need, assuming you didn't change any other default settings, is:
UDP 5060
UDP 10000-20000
So in your router/firewall you'll need all of those forwarded to your local IP.
Keep in mind that this creates a large security issue. You don't want to allow open access. Make sure you whitelist the IPs that need to connect only. A better alternative is to configure a VPN between your server and your clients. NAT and VoIP don't play nice, so the VPN will resolve those issues for you as well before they start.