Dynamic IPv6 on Remote Handset - Out of Luck?

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:
Port 5060

Home ISP: Comcast
Router: Linksys WRT1200AC
Home Public IPv4: (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 =>
Phone: Cisco 7960
Phone IP:

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                                       D  No         No          A  5060     Unmonitored                                          
115/115                                     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:

externip and externhost are settings for the PBX if the PBX is behind nat.

You didn’t give us the network information for the server at the office, does it have that IP address on one of it’s ethernet interfaces or is it natted?

In your peer definition, why do you have nat=no when the client is behind nat on it’s ipv4 address?
Try nat=nat=force_rport,comedia for the peer.

Does the phone have a public ipv6 address on your network or are you doing nat there too?

I recommend stop using chan_sip and start using chan_pjsip.

Thanks John, my Asterisk server has a local ip of, but I am doing port forwarding there for the tftp and SIP.

When I was starting my proof of concept I was setting it up on a Raspberry Pi 3, using RasPBX and was getting errors on pjsip. I then tried a fresh RPi install and installed Asterisk from source and still had errors loading pjsip. Since I had already worked with chan_sip on a different server, I just copied my configuration and it worked.

nat=no was clearly a mistake, I was thinking that I should leave it because of my port forwarding but upon further reflection that was stupid. I will fix that, is there anything relating to this that chan_pjsip would address?

Here is my modules.conf:

; Codecs
load = codec_gsm.so
load = codec_resample.so
load = codec_ulaw.so
load = codec_g722.so

; Formats
load = format_gsm.so
load = format_pcm.so
load = format_wav_gsm.so
load = format_wav.so

; Functions
load = func_callerid.so
load = func_cdr.so
load = func_sorcery.so
load = func_devstate.so
load = func_strings.so
load = func_timeout.so
load = func_dialgroup.so
load = func_global.so
load = func_shell.so
load = func_cut.so

; Core/PBX
load = pbx_config.so

; Resources
load = app_read.so
load = app_record.so
load = app_mixmonitor.so
load = app_dumpchan.so
load = app_sms.so
load = app_sendtext.so
load = res_http_websocket.so
load = res_musiconhold.so
load = res_pjproject.so
load = chan_sip.so
load = res_rtp_asterisk.so
load = res_sorcery_astdb.so
load = res_sorcery_config.so
load = res_sorcery_memory.so
load = res_sorcery_realtime.so
load = res_timing_timerfd.so

noload = res_hep.so
noload = res_hep_pjsip.so
noload = res_hep_rtcp.so
noload = chan_pjsip.so


So on the PBX in the [general] setting of sip.conf
set externip=

do you have the RTP ports forwarded to your PBX in addition to 5060?

I recommend chan_pjsip because it’s the current SIP channel driver that is being supported and developed for, chan_sip has been deprecated and is not receiving any development by the Asterisk team.

I can’t work out the address of the Asterisk daemon, but I see no evidence that it is not local to the phones. If one phone is local, the other would seem to be.

Also, the standard recipe for nat is overused. It is mainly intended for when Asterisk is on the public side of of NAT and the phone is both on the private side, and not fully aware that it is. In many cases the default should work if Asterisk is on the private side and all its external peers are correctly presenting public addresses.

comedia is a work around for when the peer is sending a private address or port number, when it should be sending public ones.

force_rport is a workaround for incorrect signaling address information, although I forget the exact details.

Generally with this sort of problem it is easiest if you provide the Asteriski’s SIP protocol trace for the completed INVITE exchange, so one can see the Contact and Via headers,and hte m= and c= lines in the SDP.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.