[Home]

Summary:ASTERISK-11800: AUTHREQ gets ignored / ACKed
Reporter:Stanislaw Pitucha (viraptor)Labels:
Date Opened:2008-04-08 12:29:49Date Closed:2008-04-09 11:49:10
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_iax2
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I've got a IAX out account configured to another host on asterisk 1.4.17. In some configurations asterisk fails to answer to AUTHREQ packet, returns just ACK and sits waiting (LAGRQ and other appropriate packets follow). Debug:

--->8---
   -- Executing [s@macro-dialout-trunk:25] Dial("SIP/7001-08e83a28", "IAX2/newarkiax/1000254|300|") in new stack
   -- Called newarkiax/1000254
Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW    
  Timestamp: 00002ms  SCall: 00001  DCall: 00000 [X.X.X.X:4569]
  VERSION         : 2
  CALLED NUMBER   : 1000254
  CODEC_PREFS     : (alaw)
  CALLING NUMBER  : 01225580037
  CALLING PRESNTN : 0
  CALLING TYPEOFN : 0
  CALLING TRANSIT : 0
  CALLING NAME    :
  LANGUAGE        : en
  USERNAME        : newarkiaxout
  FORMAT          : 8
  CAPABILITY      : 57352
  ADSICPE         : 2
  DATE TIME       : 2008-04-08  17:32:34

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: AUTHREQ
  Timestamp: 00019ms  SCall: 31765  DCall: 00001 [X.X.X.X:4569]
  AUTHMETHODS     : 3
  CHALLENGE       : 148526591
  USERNAME        : newarkiaxout

Tx-Frame Retry[-01] -- OSeqno: 001 ISeqno: 001 Type: IAX     Subclass: ACK    
  Timestamp: 00019ms  SCall: 00001  DCall: 31765 [X.X.X.X:4569]
Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 001 Type: IAX     Subclass: LAGRQ  
  Timestamp: 10003ms  SCall: 00001  DCall: 31765 [X.X.X.X:4569]
Rx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 002 Type: IAX     Subclass: LAGRP  
  Timestamp: 10003ms  SCall: 31765  DCall: 00001 [X.X.X.X:4569]
Tx-Frame Retry[-01] -- OSeqno: 002 ISeqno: 002 Type: IAX     Subclass: ACK    
  Timestamp: 10003ms  SCall: 00001  DCall: 31765 [X.X.X.X:4569]
Rx-Frame Retry[ No] -- OSeqno: 002 ISeqno: 002 Type: IAX     Subclass: LAGRQ  
  Timestamp: 10019ms  SCall: 31765  DCall: 00001 [X.X.X.X:4569]
Tx-Frame Retry[000] -- OSeqno: 002 ISeqno: 003 Type: IAX     Subclass: LAGRP  
  Timestamp: 10019ms  SCall: 00001  DCall: 31765 [X.X.X.X:4569]
Rx-Frame Retry[ No] -- OSeqno: 003 ISeqno: 003 Type: IAX     Subclass: ACK    
  Timestamp: 10019ms  SCall: 31765  DCall: 00001 [X.X.X.X:4569]
   -- Hungup 'IAX2/newarkiax-1'
Tx-Frame Retry[000] -- OSeqno: 003 ISeqno: 003 Type: IAX     Subclass: HANGUP
  Timestamp: 18925ms  SCall: 00001  DCall: 31765 [X.X.X.X:4569]
  CAUSE CODE      : 0
--->8---

Surprisingly that behaviour happens only in specific configuration. Contents included in iax.conf (I am dialing out through "newarkiax" as visible earlier, not "newarkiaxtest"):

--->8---
[newarkiax]
username=newarkiaxout
type=peer
password=********
host=X.X.X.X
disallow=all
allow=alaw

[newarkiaxtest]
username=newarkiaxout
type=peer
secret=********
port=4569
host=A.A.A.A
disallow=all
allow=alaw
--->8---

Now if I change port details in "newarkiaxtest" to port=4570 and host=X.X.X.X, dialing out through "newarkiax" works again (that's the only change and I get AUTHREP to AUTHREQ again + call succeeds). I've confirmed I'm changing only those 2 lines and that I'm using the same context dialing out (couple of times, because it just doesn't seem to make sense).
Anyways - according to iax draft AUTHREQ shouldn't get ACK in response in any scenario.
Comments:By: Joshua C. Colp (jcolp) 2008-04-09 11:11:25

While I can't reproduce this I did not a configuration error, your newarkiax entry is using password while it should be using secret. If you change this to what it should be does it work?

By: Stanislaw Pitucha (viraptor) 2008-04-09 11:22:55

Yes - that was bad copy/paste error - changing 'password' to 'secret' works and now both iax names are available.

But I think that the main issue is still there - if I get a clean config with no secret on caller and server needs AUTHREP, then AUTHREQ gets ACKed and both sides are waiting for timeout instead of signaling INVAL and dropping the connection (because of authorization problem).

By: Digium Subversion (svnbot) 2008-04-09 11:46:18

Repository: asterisk
Revision: 113784

U   branches/1.4/channels/chan_iax2.c

------------------------------------------------------------------------
r113784 | file | 2008-04-09 11:46:00 -0500 (Wed, 09 Apr 2008) | 4 lines

If we receive an AUTHREQ from the remote server and we are unable to reply (for example they have a secret configured, but we do not) then queue a hangup frame on the Asterisk channel. This will cause the channel to hangup and a HANGUP to be sent via IAX2 to the remote side which is the proper thing to do in this scenario.
(closes issue ASTERISK-11800)
Reported by: viraptor

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=113784

By: Digium Subversion (svnbot) 2008-04-09 11:47:25

Repository: asterisk
Revision: 113785

_U  trunk/
U   trunk/channels/chan_iax2.c

------------------------------------------------------------------------
r113785 | file | 2008-04-09 11:47:23 -0500 (Wed, 09 Apr 2008) | 12 lines

Merged revisions 113784 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r113784 | file | 2008-04-09 13:50:45 -0300 (Wed, 09 Apr 2008) | 4 lines

If we receive an AUTHREQ from the remote server and we are unable to reply (for example they have a secret configured, but we do not) then queue a hangup frame on the Asterisk channel. This will cause the channel to hangup and a HANGUP to be sent via IAX2 to the remote side which is the proper thing to do in this scenario.
(closes issue ASTERISK-11800)
Reported by: viraptor

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=113785

By: Digium Subversion (svnbot) 2008-04-09 11:49:10

Repository: asterisk
Revision: 113786

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_iax2.c

------------------------------------------------------------------------
r113786 | file | 2008-04-09 11:49:09 -0500 (Wed, 09 Apr 2008) | 20 lines

Merged revisions 113785 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r113785 | file | 2008-04-09 13:52:04 -0300 (Wed, 09 Apr 2008) | 12 lines

Merged revisions 113784 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r113784 | file | 2008-04-09 13:50:45 -0300 (Wed, 09 Apr 2008) | 4 lines

If we receive an AUTHREQ from the remote server and we are unable to reply (for example they have a secret configured, but we do not) then queue a hangup frame on the Asterisk channel. This will cause the channel to hangup and a HANGUP to be sent via IAX2 to the remote side which is the proper thing to do in this scenario.
(closes issue ASTERISK-11800)
Reported by: viraptor

........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=113786