I have an asterisk setup on a server. The local IP address is and extenal IP address is 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.

Note : Since my server is on a remote location, I cannot do port forwarding on it.


You can use external stun or turn server

See public STUN list


But in your case you not need stun, you just need forward ports and inform asterisk about external ip.


Please note, you are reponsible for security of your setup. Firewall and iptables-based fail2ban setup is highly recommended.

  • 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 and port as 3478. But still I am not able to register my extensions on the server. – Dinesh VG Dec 3 '15 at 10:23
  • Use external stun. You still needed setup NAT (see other link) on asterisk. – arheops Dec 3 '15 at 13:39
  • this is what I've setup : i.stack.imgur.com/Ufb8J.png Does this make sense to work ? – Dinesh VG Dec 3 '15 at 15:38
  • Sorry, debug is offtopic on SO. you have debug your NAT'ed environment yourself or hire expert. Correct setup of asterisk is on second link. – arheops Dec 3 '15 at 18:01

VPN to your asterisk server - the best 'safe' route.

Bear in mind that allowing an asterisk box to be 'open' to the web is NOT a good idea. Search for "$10,000 VOIP phone bill" if this is unclear to you...

Can your router VPN onto your server's network?

If you don't have access to either VPN or port forwarding on the remote server's end, there's really not a good alternative for a safe connection setup.

  • On the remote server when I tried to check for firewall : iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination DOCKER all -- anywhere anywhere ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ... So, I think, I have access to my server ? – Dinesh VG Dec 2 '15 at 16:10
  • so, I think the problem could be with my router. I can add port forwarding to my router here, But what will happen when I try to connect to my device outside my wifi area ? – Dinesh VG Dec 2 '15 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.