Summary:ASTERISK-19379: IAX channel chooses the wrong password for authentication
Reporter:Dirk Tilger (miriup)Labels:
Date Opened:2012-02-17 01:41:38.000-0600Date Closed:
Versions: 13.18.4 Frequency of
Environment:Operating system: Gentoo (64bit) Attachments:( 0) System_context.png
Description:I have two asterisks that are connected to each other through a non-trunked IAX2 channel (using a "switch" statement).

+------------+   IAX   +------------+
| Asterisk 1 |---------| Asterisk 2 |
+------------+         +------------+
     |                      |
     |  SIP               +-+----------+
   +-+--------+           | SIP uplink |
   |          |           +------------+
+--------+ +--------+
| User 1 | | User 2 |
+--------+ +--------+

Asterisk1 is dynamic, Asterisk2 is not. Asterisk1 can register to Asterisk2 without problems. However, when Asterisk1 creates a call to Asterisk2 the following message is reported:

NOTICE[1234]: chan_iax2.c:10920 socket_process: Host failed to authenticate as Asterisk1

The IAX link between the asterisks is configured in iax.conf. Users of Asterisk1 are configured in users.conf with hasiax=yes, but are using SIP. When User1 issues a call to Asterisk2, I see the (users.conf) password of User1 being used on the IAX channel between the asterisks (auth=plaintext).

Note again, that the same effect does not happen with the registration. The code that performs the authentication is duplicate: the code in authenticate_verify is used for call authentication, the code in register_verify is used for registration authentication. The code in both is quite similar, the bug must come from the difference of the two.

The bug does not happen with hasiax=no in the same setup.

Best regards,
Comments:By: Dirk Tilger (miriup) 2012-02-17 01:53:06.817-0600

Sorry, I didn't anticipate my ASCII art wouldn't work here. So here comes it graphically. ;)

By: Richard Mudgett (rmudgett) 2012-02-17 10:00:20.345-0600

ASCII art works, you just have to tell JIRA to not mess with it. :)