Hi,
I am fairly new to VoIP and Asterisk, but I have been tinkering with mixed success.
The problem I currently face is that when asterisk receives an incoming call from my VoIP provider (GalaxyVoice), asterisk never receives a hangup signal (BYE command) when the caller hangs up. However, if asterisk initiates the call, and the callee hangs up, asterisk does indeed register the BYE and hangs up properly.
The baseline setup:
- GalaxyVoice (GV) is my provider
- Asterisk 1.07 is running on a Debian Linux machine, which is
not behind a NAT or firewall (open network)
I tried a few tests, and I've attached the output log for the first test. Here's a summary:
I turned on *CLI> sip debug, and did a test call from GV to the asterisk console (OSS). When GV inititates the call, asterisk receives the proper INVITE message, and Asterisk replies with the usual SIP/2.0 100 Trying message. The Console automatically picks up, and Asterisk sends its SDP payload:
Code:
Reliably Transmitting (no NAT):
SIP/2.0 200 OK
Via: SIP/2.0/UDP 216.143.130.36;branch=z9hG4bK31b9.62c6f1.0
Via: SIP/2.0/UDP 216.143.130.48:5060;branch=z9hG4bK5f57fc89
Record-Route: <sip:216.143.130.36;ftag=as3e832bcb;lr=on>
From: "outside_number" <sip:outside_number@216.143.130.48>;tag=as3e832bcb
To: <sip:gv_username@216.143.130.36>;tag=as0429021d
Call-ID: 77040d307776deb274f5717319ba5477@216.143.130.48
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:6174532599@128.30.64.200>
Content-Type: application/sdp
Content-Length: 263
v=0
o=root 3172 3172 IN IP4 128.30.64.200
s=session
c=IN IP4 128.30.64.200
t=0 0
m=audio 12650 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
to 216.143.130.36:5060
This all makes sense, but this is as far as things go. Asterisk attempts to send this message 5 more times:
Code:
Retransmitting #1 (no NAT): <snip>
Retransmitting #2 (no NAT): <snip>
Retransmitting #3 (no NAT): <snip>
Retransmitting #4 (no NAT): <snip>
Retransmitting #5 (no NAT): <snip>
And finally gives up:
Code:
Aug 24 14:56:23 WARNING[3172]: chan_sip.c:694 retrans_pkt: Maximum retries exceeded on call 77040d307776deb274f5717319ba5477@216.143.130.48 for seqno 102 (Non-critical Response)
Afterwards, no further messages (e.g., ACK, BYE, etc) are exchanged between GV and Asterisk for this particular call, but Asterisk does not destroy the call (until I type 'hangup'). However, sometimes the connection quickly degrades to 1-way or no-audio. What's interesting is that later onward, as shown in the attached log, Asterisk successfully registers with GV (as it does periodically), using "Reliably Transmitting".
In a different test, I tried using a softphone (X-Lite) to register and connect with GV directly (i.e., no Asterisk). This setup works perfectly. That is, after X-Lite sends the SIP/2.0 200 OK with the SDP payload, GV responds right away with an ACK, and when GV hangs up, I see a BYE.
Code:
SEND TIME: 151417816
SEND >> 216.143.130.36:5060
SIP/2.0 200 Ok
Via: SIP/2.0/UDP 216.143.130.36;branch=z9hG4bKe025.24c1aa54.0
Via: SIP/2.0/UDP 216.143.130.83:5060;branch=z9hG4bK68696e1d;rport=5060
From: "outside_number" <sip:outside_number@216.143.130.83>;tag=as0801d615
To: <sip:gv_username@216.143.130.36>;tag=1006777125
Contact: <sip:gv_username@67.161.42.133:33143>
Record-Route: <sip:216.143.130.36;ftag=as0801d615;lr=on>
Call-ID: 606c6ca97c988258628539d11e208d4d@216.143.130.83
CSeq: 102 INVITE
Content-Type: application/sdp
Server: X-Lite release 1103m
Content-Length: 201
v=0
o=gv_username 151413797 151417815 IN IP4 67.161.42.133
s=X-Lite
c=IN IP4 67.161.42.133
t=0 0
m=audio 33564 RTP/AVP 0 101
a=rtpmap:0 pcmu/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
RECEIVE TIME: 151418751
RECEIVE << 216.143.130.36:5060
ACK sip:gv_username@67.161.42.133:33143 SIP/2.0
Max-Forwards: 10
Record-Route: <sip:216.143.130.36;ftag=as0801d615;lr=on>
Via: SIP/2.0/UDP 216.143.130.36;branch=0
Via: SIP/2.0/UDP 216.143.130.83:5060;branch=z9hG4bK5621732f;rport=5060
Route: <sip:gv_username@67.161.42.133:33143>
From: "outside_number" <sip:outside_number@216.143.130.83>;tag=as0801d615
To: <sip:gv_username@216.143.130.36>;tag=1006777125
Contact: <sip:outside_number@216.143.130.83:5060>
Call-ID: 606c6ca97c988258628539d11e208d4d@216.143.130.83
CSeq: 102 ACK
User-Agent: Asterisk PBX
Content-Length: 0
One last bit of information: if Asterisk initiates the call, then everything works perfectly as well. There are no retransmissions, and ultimately, I do see a BYE message when the callee hangs up.
Can anybody help shed some light on why Asterisk is not seeing the proper BYE messages when an incoming GV caller initiates and later hangs up? It seems correlated to Asterisk unsuccessfully (re)sending its SDP payload.
Thanks so much in advance.
(Here's my sip.conf entry for galaxy voice, which I've twiddled to no end)
Code:
[general]
context=from-sip
register => username:pass:username@216.143.130.36/617453xxxx ; galaxyvoice account
[galaxyvoice]
;nat=no ; flipping this bit didn't seem to do much; maybe it enables symmetric RTP, FWIW?
fromuser=617453xxxx
fromdomain=216.143.130.36
defaultip=216.143.130.36
host=dynamic
port=5060
fromuser=username
username=username
type=friend
secret=password
auth=md5
reinvite=no
canreinvite=no
dtmfmode=inband ; they don't support rfc2833 yet. need ulaw.
context=from-sip
disallow=all
allow=ulaw