[asterisk-users] IAX2 order

Kevin P. Fleming
Fri, 18 Sep 2009 19:29:33 -0000

David A. Bandel wrote:

> I've been fighting with this seems like forever now and can't make
it
> work in 1.6.x.  In 1.4.x, I could make sure a particular voip provider
> was always first in the list by making him as an #include and putting
> it last.
>
> Now in 1.6.x I can never get this to take.  I really don't want to run
> TWO asterisk servers just for some IAX trunking.
>
> Real problem:  my voip provider doesn't send username authentication,
> just their secret.  If they are either the first or the only, then all
> works because * checks just the first iax2 entry in the "show iax2
> peers" list.  If they are anything but first, all my incoming calls
> from them fail (identification failure).
>
> Is there ANY way to make them first?  In 1.6.x they are always 3rd.

Unfortunately the answer is no; in Asterisk 1.6.x chan_iax2 stores
users/peers in a hash table, which as you have determined means they are
not stored in any particularly obvious order... and even if you did
determine the order, it could change in the future if the hash table
definition is changed.

Your provider really needs to use a proper authentication mechanism, or
you need to restrict that peer/user entry to their IP address(es) if
possible.

--
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kpfleming at digium.com
Check us out at www.digium.com & www.asterisk.org