As the title suggests, I am trying to use several SIP phones behind a NAT router to connect to asterisk on an external network, i.e. all the phones have the same external IP address. Individually, the phones work fine, I can make and receive calls. However, they can’t call each other, or rather they can, but there is no audio. On the asterisk side, I have set NAT=yes in sip.conf (I have tried other values, but it makes no difference) and I have set the phones to use different RTP port ranges. RTP debug output from asterisk suggests that asterisk is using the correct IP address, but only two RTP ports - I would have thought that four were necessary, two for each phone:
Got RTP packet from 188.8.131.52:13000 (type 00, seq 026986, ts 003840, len 000160)
Sent RTP packet to 184.108.40.206:16422 (type 00, seq 001408, ts 003840, len 000160)
Got RTP packet from 220.127.116.11:13000 (type 00, seq 026987, ts 004000, len 000160)
Sent RTP packet to 18.104.22.168:16422 (type 00, seq 001409, ts 004000, len 000160)
Got RTP packet from 22.214.171.124:16422 (type 00, seq 011237, ts 466542103, l en 000160)
Sent RTP packet to 126.96.36.199:13000 (type 00, seq 058280, ts 466542096, l en 000160)
‘sip show peers’ for the two phones in question:
60/60 188.8.131.52 D N 6060 OK (342 ms)
41/41 184.108.40.206 D N 5060 OK (147 ms)
Check to see if you have externip set in sip.conf as well as see if you have set localnet ? Try putting this in under the general section of sip.conf
localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks
localnet=10.0.0.0/255.0.0.0 ; Also RFC1918
localnet=172.16.0.0/12 ; Another RFC1918 with CIDR notation
I think it’s ok:
disallow=all ; disallow all codecs
externip=xx.xx.xx.xx ; Florida IP
subscribemwi=yes ; Maybe necessary for Siemens C470IP, may break other phones!
checkmwi=60 ; seconds between checks for voicemail
You failed to specify CoDec(s) to use.
I do this for each phone:
phonesets ;Defaults for all extention phones
What exactly did you mean by connect to asterisk on an external network?
Network F (Florida) has the asterisk machine. It’s behind a NAT router, but that does not seem to pose a problem since I can connect to it quite happily from Network C (Chicago), which is another NATed network, or for that matter from Network P (Paris). The problem is that two phones in network C or P cannot call each other via asterisk in F, at least with audio.
OK. Now, I understand better.
externip=xx.xx.xx.xx ; Florida IP[/quote]
Shouldn’t the realm line contain your FQDN? Also, despite not being recommended for production environments, I prefer to use externhost over externip mainly because I can have my router automatically updated the FQDN of my new IP Address, instead of having me to keep changing the IP Address pointed to by externip. In your case, make sure your externip value matches with the external IP Address on net F. When you said On the asterisk side, I have set NAT=yes in sip.conf, did you mean you have specified each extension with NAT=yes?
I have set the realm to the FQDN, although this doesn’t seem to help. However, setting the infamous ‘canreinvite’ to ‘no’ does the trick.
Thanks for your suggestions,
Who is your ISP in FL ? I know that Bright House has lots of issues with VOIP in general.