[Asterisk-Dev] IAX/IAX2 and SIP hangup bugs

John Todd jtodd at loligo.com
Mon Jun 23 13:32:10 MST 2003


There may be three individual bugs shown by the following example.  Maybe not - I'm not in a position to say, but it does seem that there are three different problems.


1) I get spontaneous hangups with IAX2 and IAX.  I don't know what's causing this, but in the path of tracking it down, I see two more problems....

2) When the remote IAX2 server hangs up the call for _whatever_ reason, I do not see the corresponding "BYE" message sent to my local UA.  This has been the case for some time.

3) When BYE messages are sent from the phone to the Asterisk server, for some reason they're not being replied to on the "correct" ports, or at least the Cisco isn't seeing the "OK" because it keeps sending the BYE.


Network setup:

|---NAT---|-----------Non-NAT-------------|
7960(sip) -> Asterisk -> IAX2 -> Asterisk -> PSTN(PRI)

Asterisk versions:
Asterisk CVS-06/15/03-23:08:13
same results on 
Asterisk CVS-06/15/03-23:08:13


Debug:

ms1*CLI> 
    -- Executing NoOp("SIP/2203-1eb9", "") in new stack
    -- Executing Goto("SIP/2203-1eb9", "intern-post|14102241145|1") in new stack
    -- Goto (intern-post,14102241145,1)
    -- Executing Macro("SIP/2203-1eb9", "longdistance|14102241145|70") in new stack
    -- Executing NoOp("SIP/2203-1eb9", "") in new stack
    -- Executing NoOp("SIP/2203-1eb9", "") in new stack
    -- Executing NoOp("SIP/2203-1eb9", "") in new stack
    -- Executing SetCallerID("SIP/2203-1eb9", "") in new stack
    -- Executing Dial("SIP/2203-1eb9", "IAX2/pdx1 at bwi1/14102241145|100|r") in new stack
    -- Called pdx1 at bwi1/14102241145
    -- Call accepted by 199.34.53.108 (format 4)
    -- Format for call is 4
    -- IAX2[bwi1]/16384 is ringing
    -- IAX2[bwi1]/16384 stopped sounds
    -- IAX2[bwi1]/16384 answered SIP/2203-1eb9
ms1*CLI> 
ms1*CLI> 
ms1*CLI> [I pick up the phone here... I get a few seconds of voice, and then the call sounds stop]
    -- Hungup 'IAX2[bwi1]/16384'
  == Spawn extension (macro-longdistance, s, 5) exited non-zero on 'SIP/2203-1eb9' in macro 'longdistance'
  == Spawn extension (intern-post, 14102241145, 1) exited non-zero on 'SIP/2203-1eb9'
    -- Executing Macro("SIP/2203-1eb9", "record-cleanup") in new stack
    -- Executing GotoIf("SIP/2203-1eb9", "1?5:2") in new stack
    -- Goto (macro-record-cleanup,s,5)
    -- Executing NoOp("SIP/2203-1eb9", "") in new stack
    -- Executing Hangup("SIP/2203-1eb9", "") in new stack
  == Spawn extension (macro-record-cleanup, s, 6) exited non-zero on 'SIP/2203-1eb9' in macro 'record-cleanup'
  == Spawn extension (intern-post, h, 1) exited non-zero on 'SIP/2203-1eb9'
ms1*CLI>





Results from tethereal (from a perspective of a machine on the NAT'ed network):

132.730000    10.0.1.15 -> 204.99.12.3 SIP/SDP Request: INVITE sip:14102241145 at 204.99.12.3, with session description
132.740000 204.99.12.3 -> 10.0.1.15    SIP Status: 407 Proxy Authentication Required
132.800000    10.0.1.15 -> 204.99.12.3 SIP Request: ACK sip:14102241145 at 204.99.12.3
132.850000    10.0.1.15 -> 204.99.12.3 SIP/SDP Request: INVITE sip:14102241145 at 204.99.12.3, with session description
132.860000 204.99.12.3 -> 10.0.1.15    SIP Status: 100 Trying
132.870000 204.99.12.3 -> 10.0.1.15    SIP Status: 180 Ringing
136.390000 204.99.12.3 -> 10.0.1.15    SIP/SDP Status: 183 Session Progress, with session description
136.990000 204.99.12.3 -> 10.0.1.15    SIP/SDP Status: 200 OK, with session description
137.100000    10.0.1.15 -> 204.99.12.3 SIP Request: ACK sip:14102241145 at 204.99.12.3:5060

[The call picks up here, I get a few seconds of voice, and then the call sounds ends.  However, the phone remains "off hook" and I get comfort noise, and the 7960 still shows the call as in progress.  I sit and wait a few seconds... and wait... and then I hang up the phone, which creates the "BYE" messages below.  Note that there are NO signals back from my local Asterisk server that the call has ended before my hangup action initiates a BYE transmission, despite the fact that IAX2 showed the call hung up on the console and said it had transmitted a SIP hangup.]

161.070000    10.0.1.15 -> 204.99.12.3 SIP Request: BYE sip:14102241145 at 204.99.12.3:5060
161.070000 204.99.12.3 -> 10.0.1.15    SIP Status: 200 OK
161.570000    10.0.1.15 -> 204.99.12.3 SIP Request: BYE sip:14102241145 at 204.99.12.3:5060
161.580000 204.99.12.3 -> 10.0.1.15    SIP Status: 200 OK
162.570000    10.0.1.15 -> 204.99.12.3 SIP Request: BYE sip:14102241145 at 204.99.12.3:5060
162.580000 204.99.12.3 -> 10.0.1.15    SIP Status: 200 OK
164.570000    10.0.1.15 -> 204.99.12.3 SIP Request: BYE sip:14102241145 at 204.99.12.3:5060
164.580000 204.99.12.3 -> 10.0.1.15    SIP Status: 200 OK
168.570000    10.0.1.15 -> 204.99.12.3 SIP Request: BYE sip:14102241145 at 204.99.12.3:5060
168.580000 204.99.12.3 -> 10.0.1.15    SIP Status: 200 OK
172.570000    10.0.1.15 -> 204.99.12.3 SIP Request: BYE sip:14102241145 at 204.99.12.3:5060
172.570000 204.99.12.3 -> 10.0.1.15    SIP Status: 200 OK
176.570000    10.0.1.15 -> 204.99.12.3 SIP Request: BYE sip:14102241145 at 204.99.12.3:5060
176.570000 204.99.12.3 -> 10.0.1.15    SIP Status: 200 OK
180.570000    10.0.1.15 -> 204.99.12.3 SIP Request: BYE sip:14102241145 at 204.99.12.3:5060
180.570000 204.99.12.3 -> 10.0.1.15    SIP Status: 200 OK
185.280000    10.0.1.15 -> 204.99.12.3 SIP Request: BYE sip:14102241145 at 204.99.12.3:5060
185.280000 204.99.12.3 -> 10.0.1.15    SIP Status: 200 OK
189.280000    10.0.1.15 -> 204.99.12.3 SIP Request: BYE sip:14102241145 at 204.99.12.3:5060
189.280000 204.99.12.3 -> 10.0.1.15    SIP Status: 200 OK
193.280000    10.0.1.15 -> 204.99.12.3 SIP Request: BYE sip:14102241145 at 204.99.12.3:5060
193.280000 204.99.12.3 -> 10.0.1.15    SIP Status: 200 OK

 
Further debug:

I tried removing some of the macro stuff to see if I could narrow down the problem.   The IAX2 conversation still hangs up randomly, so that problem was unsolved.  However, my "h" extension called a macro that contained an explicit "Hangup" command, and when I removed that macro, the SIP hangup isn't even shown on the console output, and of course none is sent.   Something is wrong with IAX2 and it's discussions with other channel drivers on hangup statuses.

ms1*CLI> 
    -- Executing NoOp("SIP/2203-f75b", "") in new stack
    -- Executing Goto("SIP/2203-f75b", "intern-post|14102241145|1") in new stack
    -- Goto (intern-post,14102241145,1)
    -- Executing Macro("SIP/2203-f75b", "longdistance|14102241145|70") in new stack
    -- Executing NoOp("SIP/2203-f75b", "") in new stack
    -- Executing NoOp("SIP/2203-f75b", "") in new stack
    -- Executing NoOp("SIP/2203-f75b", "") in new stack
    -- Executing SetCallerID("SIP/2203-f75b", "") in new stack
    -- Executing Dial("SIP/2203-f75b", "IAX2/pdx1 at bwi1/14102241145|100|r") in new stack
    -- Called pdx1 at bwi1/14102241145
    -- Call accepted by 199.34.53.108 (format 4)
    -- Format for call is 4
    -- IAX2[bwi1]/16384 is ringing
    -- IAX2[bwi1]/16384 stopped sounds
    -- IAX2[bwi1]/16384 answered SIP/2203-f75b
ms1*CLI> 
ms1*CLI> [call progresses for a few seconds, and then hangs up - 7960 stays "off hook" and no SIP BYE is sent] 
    -- Hungup 'IAX2[bwi1]/16384'
  == Spawn extension (macro-longdistance, s, 5) exited non-zero on 'SIP/2203-f75b' in macro 'longdistance'
  == Spawn extension (intern-post, 14102241145, 1) exited non-zero on 'SIP/2203-f75b'
ms1*CLI> 
ms1*CLI>



More information about the asterisk-dev mailing list