Hello
I’m a bit in the dark to understand why an IP phone that can authenticate with Asterisk over the Net is then listed as UNREACHABLE:
slast*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
203/203 82.237.x.y D N 46838 OK (180 ms)
201/201 82.244.x.y D N 5060 UNREACHABLE
FWIW, those two hosts are located in different networks, each set up to use STUN (ie. no ports open on the router) behind the exact same NAT router. 203 is an SJPhone softphone, while 201 is a GrandStream GXP-2000 phone.
I have a couple of questions:
-
What are the known reasons for a host being marked as UNREACHABLE? Opening UDP5060 and UDP5004-5005 didn’t help. I wonder if it’s not some problem with negotiating options like codecs, etc.
-
Can TCPDump help to investigate SIP-related issues? Otherwise, is there another text-mode tool that I should use (I’m running the Slast live CD, which doesn’t have X)?
Thank you.
are you using ‘qualify=yes’ for that peer? a lot of people have had issues with this causing spurious UNREACHABLE issues.
OK, found what it was: Asterisk is sitting in a private network, behind a NAT router, and must be told this because it doesn’t support something like STUN:
;sip.conf
[general]
context=invalid
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=ilbc
language=fr
externip = 82.224.x.y
localnet=192.168.0.0/255.255.0.0
nat=yes
;canreinvite=no ; Asterisk by default tries to redirect the
; RTP media stream (audio) to go directly from
; the caller to the callee. Some devices do not
; support this (especially if one of them is
; behind a NAT).
The reason I was looking at some issue in that IP phone, is that the X-Lite softphone that I have at home was connecting and ringing OK. I have no idea why it was OK while the phone wasn’t.
BTW, I’m using a Linksys VoIP gateway to connect Asterisk to POTS line: When a call comes in, do RTP packets go from that box to the remote IP phone directly, or do they go thru Asterisk?
If the latter…
-
can I configure things so that the Linksys and the IP phone talk to each other directly (Asterisk is running on a cheap PC, so I’d rather avoid any sound-related heavy calculations; The Linksys supports STUN, so I shouldn’t have to open ports statically on the router)?
-
if it’s not possible, I guess I must edit rtp.conf and the NAT firewall accordingly so that Asterisk receives incoming RTP packets correctly?
Thank you 
Depending on your setup, ‘canreinvite=yes’ will cause asterisk to remove itself from the audio path.
I’ve done this, but so far, no luck. Looks like something else is needed on either the VoIP gateway and/or Asterisk so that the gateway will TX/RX voice packets successfully with a remote phone.