[Home]

Summary:ASTERISK-00039: Asterisk sends the wrong secret
Reporter:jerjer (jerjer)Labels:
Date Opened:2003-08-03 13:52:46Date Closed:2004-09-25 02:23:01
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:In the last couple days I have 4 had NuFone customers complain  about getting a "No Authority Found" rejection message. Upon investigation we've found that Astrisk sends the secret of the last type=peer in the config file. We can easily duplicate this problem.


****** ADDITIONAL INFORMATION ******

Example config:

iax.conf on switch-1.nufone.net:
[jeremy]
type=user
secret=12345
context=NANPA

iax.conf on customer asterisk box:
[NuFone]
type=peer
secret=12345
context=NANPA
host=switch-1.nufone.net

[other-user]
type=peer
secret=aBcDeF
host=blah.foo.com
context=whatever

extensions.conf on customer asterisk box:
[some_outbound_context]
exten => _1NXXNXXXXXX,1,Dial,IAX2/jeremy@NuFone/${EXTEN}

When Asterisk sends this call out, using above exten, the secret will be 'aBcDeF'.  

If we use the exten:

exten => _1NXXNXXXXXX,1,Dial,IAX2/jeremy:12345@NuFone/${EXTEN}

everything is fine, but this has not been required up until now and if the [NuFone] type=peer is the last peer in the config this issue doesn't exist.

Comments:By: izo (izo) 2003-08-04 19:44:33

I made some research today and I found that
neither in chan_iax.c neither in chan_iax2.c the string "peer" from
chan_iax2_pvt structure is not set in iax_call or iax2_call.

From iax2_call there is function create_addr() called which checks if
jermeny@NuFone is a peer definition or host definition
it its peer it sets up context and some other things
but after that it does not indicate that this is peer not host and imho sould
because later
it comes to checking in
authenticate_reply() about line 2991 when if p->peer is set.

Its not so it takes first available peer which is last one in the iax.conf
file.

By: Mark Spencer (markster) 2003-08-09 14:26:27

In principle, fixed in CVS.  Please confirm.

By: izo (izo) 2003-08-10 09:40:22

yep, seems to work fine now