0

I have an asterisk setup on a server. The local IP address is 172.22.9.200 and extenal IP address is 75.45.185.100. My client device is an android phone that is connected to a router and it which has NAT enabled in it. My router address is 27.770.345.670. I want to connect my client device to my server. I think setting up a STUN server would do it, but can I setup a STUN server on the same server where Asterisk is or is there any way to connect the client to the server without a STUN or TURN server ?

If I try to connect with my mobile internet, the connection is perfect. It is only that I cannot connect with my wifi connection.

Dinesh
  • 111
  • 2

2 Answers2

2

On the server side you have to set up port-forwarding from the router to the server where asterisk is listen to connections. On the client side you have to do nothing.

Kondybas
  • 6,964
  • 2
  • 20
  • 24
  • The server is a publicly bought one, I am not sure if I will have the privileges to expose ports on the server. Is there any other way to connect ? When I try to create client instances for IAX (using port 457) users and not SIP, the connection is created. It is only SIP that has this problem with NAT. – Dinesh Dec 02 '15 at 14:28
0

Without using a firewall traversal protocol (like STUN) you have no choice but to forward your ports. First, your firewall will have to forward port 5060 to the internet PBX IP. (Assuming you are using the default SIP port).

Next, your firewall might have a SIP helper installed. Even some inexpensive routers (like Mikrotik) offer this capability. If so, this will listen to the SIP traffic and open & forward the necessary RTP ports to your PBX.

If your firewall does not have a SIP helper, then you will also have to forward your RTP ports to your PBX. The default Asterisk RTP ports are 10000-20000 (yes that's a BIG block) so forward those.

Finally, you will have to tell Asterisk that SIP is using NAT, and to use the an external IP address in the SIP headers. (not the internal IP).

TSG
  • 1,674
  • 7
  • 32
  • 51
  • I have setup a STUN server on the same virtual system where I have setup the asterisk server and I have given my host address as the STUN address. (net=host). It's running now, and on my softphone I have given the STUN address as 75.45.185.100 and port as 3478. But still I am not able to register my extensions on the server. – Dinesh Dec 03 '15 at 10:22
  • You might want to open a new question, and post full details of the STUN server type, settings, and symptoms. Very different from the original how to question. Happy to help but will need a lot more info – TSG Dec 03 '15 at 14:09
  • I have setup a new question with the image of the architecture. Please let me know: http://serverfault.com/questions/740575/how-to-connect-extensions-of-remote-voip-over-remote-stun-server – Dinesh Dec 03 '15 at 15:36