[Asterisk-Users] Re: IAX2 'no authority found' problem

Tony Mountifield tony at softins.clara.co.uk
Wed Aug 4 13:22:28 MST 2004


In article <41110A82.20103 at indigent-networks.com>,
Josh Roberson <twisted at indigent-networks.com> wrote:
> Simon, i was having the exact same problem, the only solution I found, 
> was to remove the secret, then it worked great.. I thought I must have 
> been missing something too, but apparently not.   I'm not sure exactly 
> what is causing this, as if i set the servers up to register with each 
> other, they register fine, but the moment they try to pass a call to one 
> another, they fail, unless there is no secret listed in iax.conf for the 
> connections.

It does work, but it took me a little digging to understand.

The following is a simple one-way setup that should work:

----------
ServerA:

extensions.conf
[some-context]
exten => some-extension,1,Dial(IAX2/userid:password at 192.168.1.250/extension at acontext)

ServerB:

iax.conf
[userid]
type=user
secret=password
context=acontext

extensions.conf
[acontext]
exten => extension,1,Dial(wherever)
----------

You can make the dial string more concise by putting a peer section in
the iax.conf for ServerA:

----------
ServerA:

iax.conf
[identifier]
type=peer
username=userid
secret=password
peercontext=acontext
host=192.168.1.250

extensions.conf
[some-context]
exten => some-extension,1,Dial(IAX2/identifier/extension)

ServerB:

same as previous example.
----------

However, it is only in recent CVS versions (from 1.175 of chan_iax2.c on
2004/07/30) that it picks up the username as userid from the [identifier]
section. In older versions it is still necessary to say
Dial(IAX2/userid at identifier/extension). In fact, when experimenting I also
found it necessary to say extension at acontext, even when peercontext= was
set. I haven't yet fully investigated why.

If ServerB is on a dynamic IP address, then host=192.168.1.250 must be
replaced with host=dynamic. It is then necessary for ServerB to register
with ServerA by including the following in ServerB's iax.conf:

[general]
register => identifier:password at 123.123.123.123

where 123.123.123.123 is the IP address or hostname of ServerA. Note that
it is identifier:password, not userid:password. I've deliberately kept
the various names different to show which is dependent on which. That's
also why I have keep peer and user separate instead of using type=friend.


Bi-directional peering can be set up by swapping the above sections for
ServerA and ServerB, changing names accordingly. With suitable choices of
names, and the same secret in both directions, it is then possible to
combine type=peer and type=user sections into a single type=friend, e.g.

----------
ServerA (static IP):

iax.conf
[serverB]
type=friend
host=dynamic
username=serverA
secret=password
peercontext=from-serverA
context=from-serverB
qualify=yes
notransfer=yes

extensions.conf
[outgoing-to-B]
;exten => outextenB,1,Dial(IAX2/serverA at serverB/extenB at from-serverA)
exten => outextenB,1,Dial(IAX2/serverB/extenB)
[from-serverB]
exten => extenA,1,Dial(wherever-on-A)

ServerB (dynamic IP):

iax.conf
[general]
register => serverB:password at serverA.name.or.ip
[serverA]
type=friend
host=serverA.name.or.ip
username=serverB
secret=password
peercontext=from-serverB
context=from-serverA
qualify=yes
notransfer=yes

extensions.conf
[outgoing-to-A]
;exten => outextenA,1,Dial(IAX2/serverB at serverA/extenA at from-serverB)
exten => outextenA,1,Dial(IAX2/serverA/extenA)
[from-serverA]
exten => extenB,1,Dial(wherever-on-B)
----------

As I said, it ought to be possible to omit the context from the IAX2
Dial commands if peercontext= is specified. I will investigate further.

Hope this all helps!

Cheers
Tony (softins)

-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-users mailing list