I got Asterisk 16 up and running on Ubuntu 18.04 using chan_sip in the office and everything is working great. I was hoping to take a handset home to use and at first things looked fine.
I got the phone registered and was able to make an outbound call. I then noticed that while they can hear me, I can’t hear them (one way audio). I had the same issue using Zoiper on my cell phone (which uses dynamic IPv4), but I set up a STUN server for it and it worked after that, but with the home handset I am confused. Before I get into it any further, let me describe the topology.
Asterisk 16 server public IP: 64.75.53.11
Port 5060
Home ISP: Comcast
Router: Linksys WRT1200AC
Home Public IPv4: 67.46.3.0 (Yes, it ends with a 0 when I check whatismyip)
Home Public IPv6: 2001:0db8:0000:0000:0000:8a2e:0370:7334
Port Forwarding configured sending port 5060 => 192.168.1.125
Phone: Cisco 7960
Phone IP: 192.168.1.125
While my phone does get registered, when I issue the command sip show peers
I get:
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
10/10 192.168.1.148 D No No A 5060 Unmonitored
115/115 192.168.1.125 D No No 5060 Unmonitored
Line 10 is in the office, line 115 is at home and yet to the Asterisk server, they are both on the same network. With that knowledge, a STUN server didn’t seem like the right solution since the Asterisk server would be sending those UDP packets to our internal office network.
In looking into how to solve it I found externip
and externhost
, but since it is a dynamic one then I don’t think that is the solution. Next I looked into using dynamic DNS, but my router only supports noip.com and ddns.com, and their “dynamic” ipv6 is manually assigned, so I might as well do that myself using a subdomain of my own. I believe that the IPv6 address changes anytime the cable modem or router gets rebooted, which in our area is not infrequent.
Here is my sip.conf for 115:
[115]
type=friend
host=dynamic
dtmfmode=rfc2833
nat=no
defaultuser=115
secret=neverguess
context=Local
canreinvite=no