[RESOLVED] Incomming calls Hungup when trying to answer

When I make a call from regular phone to my asterisk via terminaison provider (connected in IAX), my phone rings, but when I try to answer the call, it is hunged up.

Debug shows (see below for SIP and IAX2 debug messages) :

asterisk -vvvvvvvr
== Parsing ‘/etc/asterisk/asterisk.conf’: Found
== Parsing ‘/etc/asterisk/extconfig.conf’: Not found (No such file or directory)
Asterisk 1.0.9, Copyright © 1999-2004 Digium.
Written by Mark Spencer markster@digium.com

Connected to Asterisk 1.0.9 currently running on asterisk1 (pid = 1690)
Verbosity is at least 7
– Accepting AUTHENTICATED call from 80.92.83.22, requested format = 256, actual format = 256
– Executing Answer(“IAX2/rbreval@rbreval/1”, “”) in new stack
– Executing Wait(“IAX2/rbreval@rbreval/1”, “2”) in new stack
– Executing Dial(“IAX2/rbreval@rbreval/1”, “sip/7364”) in new stack
– Called 7364
– SIP/7364-13db is ringing
– SIP/7364-13db answered IAX2/rbreval@rbreval/1
== Spawn extension (incoming, 33870441450, 3) exited non-zero on ‘IAX2/rbreval@rbreval/1’
– Hungup 'IAX2/rbreval@rbreval/1’
asterisk1*CLI>

I have the following configuration :

##############################################################################
SIP.CONF
##############################################################################

[general]
externip=82.234.175.208
localnet=192.168.0.0/255.255.255.0
port = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
disallow=all
;allow=ilbc
;allow=g729
;allow=gsm
;allow=alaw
allow=ulaw

[7364]
username=7364
type=friend
secret=PASSWD
qualify=yes
port=5060
nat=1
host=dynamic
dtmfmode=rfc2833
;context=from-internal
context=outgoing
canreinvite=yes
callerid=“remi breval” <7364>

##############################################################################
IAX.CONF
##############################################################################

[general]
bindport = 4569 ; Port to bind to (IAX is 4569)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
delayreject=yes
disallow=all
;allow=ilbc
;allow=g729
;allow=gsm
;allow=alaw
allow=ulaw
jitterbuffer=yes
mailboxdetail=yes

register=remib:PASSWD@register.voipgate.com

[remib]
type=friend
disallow=all
allow=ilbc
allow=g729
allow=gsm
allow=alaw
allow=ulaw
username=remib
secret=PASSWD
host=register.voipgate.com
notransfer=yes
context=incoming

;[voipiax]
;username=remib
;type=peer
;secret=PASSWD
;host=register.voipgate.com

##############################################################################
EXTENSION.CONF
##############################################################################
[general]

[globals]

[incoming]
exten => 33870441450,1,answer
exten => 33870441450,2,wait(3)
exten => 33870441450,3,dial(sip/7364)
exten => 33870441450,4,hangup

[outgoing]
exten => _X.,1,DIAL(IAX2/remib/${EXTEN},120)
exten => _X.,2,hangup ; the called party did not answer
exten => _X.,102,Playtones(busy) ; the called party is busy
exten => _X.,103,Busy(10)
exten => _X.,104,Hangup

##############################################################################
Suggered by Voipgate
##############################################################################

This is an example confguration for asterisk using IAX2

---- START /etc/asterisk/iax.conf ----
[general]
bindport = 4569 ; Port to bind to (IAX is 4569)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
delayreject=yes
disallow=all

allow=ilbc
allow=g729
allow=gsm
allow=alaw
allow=ulaw
jitterbuffer=yes
mailboxdetail=yes

register => username:password@register.voipgate.com

[username] ; this has to be your username
type=friend
disallow=all
allow=ilbc
allow=g729
allow=gsm
allow=alaw
allow=ulaw
username=username
secret=password
host=register.voipgate.com
notransfer=yes
context=FROM-VOIPGATE

---- END /etc/asterisk/iax.conf ----

---- START /etc/asterisk/extensions.conf ----

[TO-VOIPGATE]
exten => _X.,1,DIAL(IAX2/username/${EXTEN},120)
exten => _X.,2,hangup ; the called party did not answer
exten => _X.,102,Playtones(busy) ; the called party is busy
exten => _X.,103,Busy(10)
exten => _X.,104,Hangup

[FROM-VOIPGATE]

exten => your_voipgate_phone_number,1,Dial(SIP/your_sip_phone_01)

; change “your_voipgate_phone_number” to your phone number allocated to you by Voipgate
; you may change the executed application to whatever you want, you may of course also add
; additional priorities

---- END /etc/asterisk/extensions.conf ----

##############################################################################
SIP DEBUG
##############################################################################

asterisk1*CLI> sip debug
SIP Debugging Enabled
11 headers, 0 lines
Reliably Transmitting:
OPTIONS sip:7364@192.168.0.20:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK27b9ec09
From: “Unknown” sip:Unknown@192.168.0.5;tag=as32627856
To: sip:7364@192.168.0.20:5060
Contact: sip:Unknown@192.168.0.5
Call-ID: 3b5cbe8052eb79454dce372d35b14ff0@192.168.0.5
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX
Date: Thu, 10 Nov 2005 22:11:16 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Length: 0

(no NAT) to 192.168.0.20:5060
asterisk1*CLI>

Sip read:
SIP/2.0 200 Ok
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK27b9ec09
From: “Unknown” sip:Unknown@192.168.0.5;tag=as32627856
To: sip:7364@192.168.0.20:5060;tag=2382347872
Contact: sip:7364@192.168.0.20:5060
Call-ID: 3b5cbe8052eb79454dce372d35b14ff0@192.168.0.5
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,NOTIFY
CSeq: 102 OPTIONS
Server: X-Lite release 1103a
Content-Length: 0

10 headers, 0 lines
Destroying call ‘3b5cbe8052eb79454dce372d35b14ff0@192.168.0.5’
– Accepting AUTHENTICATED call from 80.92.83.22, requested format = 256, actual format = 256
– Executing Answer(“IAX2/rbreval@rbreval/2”, “”) in new stack
– Executing Wait(“IAX2/rbreval@rbreval/2”, “2”) in new stack
– Executing Dial(“IAX2/rbreval@rbreval/2”, “sip/7364”) in new stack
We’re at 192.168.0.5 port 17272
Answering with preferred capability 0x4 (ulaw)
Answering with non-codec capability 0x1 (telephone-event)
12 headers, 10 lines
Reliably Transmitting:
INVITE sip:7364@192.168.0.20:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK499425e4;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060
Contact: sip:33688944617@192.168.0.5
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Date: Thu, 10 Nov 2005 22:11:26 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Type: application/sdp
Content-Length: 212

v=0
o=root 1690 1690 IN IP4 192.168.0.5
s=session
c=IN IP4 192.168.0.5
t=0 0
m=audio 17272 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
(NAT) to 192.168.0.20:5060
– Called 7364
asterisk1*CLI>

Sip read:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK499425e4;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:7364@192.168.0.20:5060
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 102 INVITE
Server: X-Lite release 1103a
Content-Length: 0

9 headers, 0 lines

Sip read:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK499425e4;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:7364@192.168.0.20:5060
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 102 INVITE
Server: X-Lite release 1103a
Content-Length: 0

9 headers, 0 lines
– SIP/7364-6c49 is ringing
asterisk1*CLI>

Sip read:
SIP/2.0 200 Ok
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK499425e4;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:7364@192.168.0.20:5060
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 102 INVITE
Content-Type: application/sdp
Server: X-Lite release 1103a
Content-Length: 293

v=0
o=7364 34898750 34900234 IN IP4 192.168.0.20
s=X-Lite
c=IN IP4 192.168.0.20
t=0 0
m=audio 8000 RTP/AVP 0 98 8 3 97 101
a=rtpmap:0 pcmu/8000
a=rtpmap:8 pcma/8000
a=rtpmap:3 gsm/8000
a=rtpmap:98 iLBC/8000
a=rtpmap:97 speex/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

10 headers, 13 lines
Found RTP audio format 0
Found RTP audio format 98
Found RTP audio format 8
Found RTP audio format 3
Found RTP audio format 97
Found RTP audio format 101
Peer audio RTP is at port 192.168.0.20:8000
Found description format pcmu
Found description format pcma
Found description format gsm
Found description format iLBC
Found description format speex
Found description format telephone-event
Capabilities: us - 0x4 (ulaw), peer - audio=0x60e (gsm|ulaw|alaw|speex|ilbc)/video=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities: us - 0x1 (g723), peer - 0x1 (g723), combined - 0x1 (g723)
list_route: hop: sip:7364@192.168.0.20:5060
set_destination: Parsing sip:7364@192.168.0.20:5060 for address/port to send to
set_destination: set destination to 192.168.0.20, port 5060
Transmitting:
CK sip:7364@192.168.0.20:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK7a332ded;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:33688944617@192.168.0.5
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 102 ACK
User-Agent: Asterisk PBX
Content-Length: 0

(NAT) to 192.168.0.20:5060
– SIP/7364-6c49 answered IAX2/rbreval@rbreval/2
set_destination: Parsing sip:7364@192.168.0.20:5060 for address/port to send to
set_destination: set destination to 192.168.0.20, port 5060
Reliably Transmitting:
BYE sip:7364@192.168.0.20:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK477a920b;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:33688944617@192.168.0.5
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 103 BYE
User-Agent: Asterisk PBX
Content-Length: 0

(NAT) to 192.168.0.20:5060
== Spawn extension (incoming, 33870441450, 3) exited non-zero on ‘IAX2/rbreval@rbreval/2’
– Hungup 'IAX2/rbreval@rbreval/2’
asterisk1*CLI>

Sip read:
SIP/2.0 200 Ok
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK477a920b;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:7364@192.168.0.20:5060
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 103 BYE
Server: X-Lite release 1103a
Content-Length: 0

9 headers, 0 lines
Destroying call ‘5a09ec2449d5693c6b222acf16778642@192.168.0.5’

##############################################################################
IAX2 DEBUG
##############################################################################
v=0
o=root 1690 1690 IN IP4 192.168.0.5
s=session
c=IN IP4 192.168.0.5
t=0 0
m=audio 17272 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
(NAT) to 192.168.0.20:5060
– Called 7364
asterisk1*CLI>

Sip read:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK499425e4;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:7364@192.168.0.20:5060
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 102 INVITE
Server: X-Lite release 1103a
Content-Length: 0

9 headers, 0 lines

Sip read:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK499425e4;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:7364@192.168.0.20:5060
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 102 INVITE
Server: X-Lite release 1103a
Content-Length: 0

9 headers, 0 lines
– SIP/7364-6c49 is ringing
asterisk1*CLI>

Sip read:
SIP/2.0 200 Ok
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK499425e4;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:7364@192.168.0.20:5060
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 102 INVITE
Content-Type: application/sdp
Server: X-Lite release 1103a
Content-Length: 293

v=0
o=7364 34898750 34900234 IN IP4 192.168.0.20
s=X-Lite
c=IN IP4 192.168.0.20
t=0 0
m=audio 8000 RTP/AVP 0 98 8 3 97 101
a=rtpmap:0 pcmu/8000
a=rtpmap:8 pcma/8000
a=rtpmap:3 gsm/8000
a=rtpmap:98 iLBC/8000
a=rtpmap:97 speex/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

10 headers, 13 lines
Found RTP audio format 0
Found RTP audio format 98
Found RTP audio format 8
Found RTP audio format 3
Found RTP audio format 97
Found RTP audio format 101
Peer audio RTP is at port 192.168.0.20:8000
Found description format pcmu
Found description format pcma
Found description format gsm
Found description format iLBC
Found description format speex
Found description format telephone-event
Capabilities: us - 0x4 (ulaw), peer - audio=0x60e (gsm|ulaw|alaw|speex|ilbc)/video=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities: us - 0x1 (g723), peer - 0x1 (g723), combined - 0x1 (g723)
list_route: hop: sip:7364@192.168.0.20:5060
set_destination: Parsing sip:7364@192.168.0.20:5060 for address/port to send to
set_destination: set destination to 192.168.0.20, port 5060
Transmitting:
CK sip:7364@192.168.0.20:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK7a332ded;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:33688944617@192.168.0.5
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 102 ACK
User-Agent: Asterisk PBX
Content-Length: 0

(NAT) to 192.168.0.20:5060
– SIP/7364-6c49 answered IAX2/rbreval@rbreval/2
set_destination: Parsing sip:7364@192.168.0.20:5060 for address/port to send to
set_destination: set destination to 192.168.0.20, port 5060
Reliably Transmitting:
BYE sip:7364@192.168.0.20:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK477a920b;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:33688944617@192.168.0.5
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 103 BYE
User-Agent: Asterisk PBX
Content-Length: 0

(NAT) to 192.168.0.20:5060
== Spawn extension (incoming, 33870441450, 3) exited non-zero on ‘IAX2/rbreval@rbreval/2’
– Hungup 'IAX2/rbreval@rbreval/2’
asterisk1*CLI>

Sip read:
SIP/2.0 200 Ok
Via: SIP/2.0/UDP 192.168.0.5:5060;branch=z9hG4bK477a920b;rport
From: “33688944617” sip:33688944617@192.168.0.5;tag=as3560792c
To: sip:7364@192.168.0.20:5060;tag=1384842678
Contact: sip:7364@192.168.0.20:5060
Call-ID: 5a09ec2449d5693c6b222acf16778642@192.168.0.5
CSeq: 103 BYE
Server: X-Lite release 1103a
Content-Length: 0

9 headers, 0 lines
Destroying call '5a09ec2449d5693c6b222acf16778642@192.168.0.5’
asterisk1*CLI> exit
Executing last minute cleanups
[root@asterisk1 root]#
[root@asterisk1 root]# asterisk -vvvvvvvr
== Parsing ‘/etc/asterisk/asterisk.conf’: Found
== Parsing ‘/etc/asterisk/extconfig.conf’: Not found (No such file or directory)
Asterisk 1.0.9, Copyright © 1999-2004 Digium.
Written by Mark Spencer markster@digium.com

Connected to Asterisk 1.0.9 currently running on asterisk1 (pid = 1690)
Verbosity is at least 7
asterisk1CLI> sip no debug
SIP Debugging Disabled
asterisk1
CLI> iax2 debug
IAX2 Debugging Enabled
Rx-Frame Retry[ No] – OSeqno: 000 ISeqno: 000 Type: IAX Subclass: NEW
Timestamp: 00001ms SCall: 00129 DCall: 00000 [80.92.83.22:4569]
VERSION : 2
CALLED NUMBER : 33870441450
Unknown IE 045 : Present
CALLING NUMBER : 33688944617
Unknown IE 038 : Present
Unknown IE 039 : Present
Unknown IE 040 : Present
LANGUAGE : en
USERNAME : rbreval
FORMAT : 256
CAPABILITY : 65310
ADSICPE : 2
DATE TIME : 191543635

Ignoring unknown information element ‘Unknown IE’ (45) of length 7
Ignoring unknown information element ‘Unknown IE’ (38) of length 1
Ignoring unknown information element ‘Unknown IE’ (39) of length 1
Ignoring unknown information element ‘Unknown IE’ (40) of length 2
Tx-Frame Retry[-01] – OSeqno: 000 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00001ms SCall: 00002 DCall: 00129 [80.92.83.22:4569]
Tx-Frame Retry[000] – OSeqno: 000 ISeqno: 001 Type: IAX Subclass: AUTHREQ
Timestamp: 00003ms SCall: 00002 DCall: 00129 [80.92.83.22:4569]
AUTHMETHODS : 3
CHALLENGE : 48412043
USERNAME : rbreval

Rx-Frame Retry[ No] – OSeqno: 001 ISeqno: 001 Type: IAX Subclass: AUTHREP
Timestamp: 00051ms SCall: 00129 DCall: 00002 [80.92.83.22:4569]
MD5 RESULT : d9093e9ef73e2e8ce924f5c32d11aad3

Tx-Frame Retry[-01] – OSeqno: 001 ISeqno: 002 Type: IAX Subclass: ACK
Timestamp: 00051ms SCall: 00002 DCall: 00129 [80.92.83.22:4569]
– Accepting AUTHENTICATED call from 80.92.83.22, requested format = 256, actual format = 256
– Executing Answer(“IAX2/rbreval@rbreval/2”, “”) in new stack
Tx-Frame Retry[000] – OSeqno: 001 ISeqno: 002 Type: IAX Subclass: ACCEPT
Timestamp: 00052ms SCall: 00002 DCall: 00129 [80.92.83.22:4569]
FORMAT : 256

-- Executing Wait("IAX2/rbreval@rbreval/2", "2") in new stack

Tx-Frame Retry[000] – OSeqno: 002 ISeqno: 002 Type: CONTROL Subclass: ANSWER
Timestamp: 00055ms SCall: 00002 DCall: 00129 [80.92.83.22:4569]
Rx-Frame Retry[ No] – OSeqno: 002 ISeqno: 002 Type: IAX Subclass: ACK
Timestamp: 00052ms SCall: 00129 DCall: 00002 [80.92.83.22:4569]
Rx-Frame Retry[ No] – OSeqno: 002 ISeqno: 003 Type: IAX Subclass: ACK
Timestamp: 00055ms SCall: 00129 DCall: 00002 [80.92.83.22:4569]
Rx-Frame Retry[ No] – OSeqno: 002 ISeqno: 003 Type: VOICE Subclass: 136
Timestamp: 00158ms SCall: 00129 DCall: 00002 [80.92.83.22:4569]
Tx-Frame Retry[-01] – OSeqno: 003 ISeqno: 003 Type: IAX Subclass: ACK
Timestamp: 00158ms SCall: 00002 DCall: 00129 [80.92.83.22:4569]
– Executing Dial(“IAX2/rbreval@rbreval/2”, “sip/7364”) in new stack
– Called 7364
– SIP/7364-c576 is ringing
Tx-Frame Retry[000] – OSeqno: 003 ISeqno: 003 Type: CONTROL Subclass: RINGING
Timestamp: 02148ms SCall: 00002 DCall: 00129 [80.92.83.22:4569]
Rx-Frame Retry[ No] – OSeqno: 003 ISeqno: 004 Type: IAX Subclass: ACK
Timestamp: 02148ms SCall: 00129 DCall: 00002 [80.92.83.22:4569]
– SIP/7364-c576 answered IAX2/rbreval@rbreval/2
== Spawn extension (incoming, 33870441450, 3) exited non-zero on 'IAX2/rbreval@rbreval/2’
Tx-Frame Retry[000] – OSeqno: 004 ISeqno: 003 Type: IAX Subclass: HANGUP
Timestamp: 03144ms SCall: 00002 DCall: 00129 [80.92.83.22:4569]
– Hungup ‘IAX2/rbreval@rbreval/2’

Ok, solution has been found => codec issue.

  • 1.0.9 does not respect codec order, then it can use something that was not intended.

Also a quink of trick with Record function…

I was also using X-Lite under Windows XP… and you should open port 8000… !!!