Asterisk IAX Authentication

I’m new to Asterisk and I’m trying to set a communication between two Asterisk System (ubuntu based).
When I call #2 from #1 i get this kind of messages:
#1:call rejected no authority found
#2: who was trying to reach 9@

I think (but not sure) the problem is in iax.conf
My current config is following

**** #1 IAX.CONF *****
[togw1]
host=192.168.0.200
type=user
username=togw1
secret=pwdgw1
context=ingresso

[togw2]
type=peer
username=gw2
secret=pwdgw2
host=192.168.1.201
mask=255.255.255.0
context=uscita

**** #1 EXTENSIONS.CONF *****
[ingresso]
exten => 9,1,Dial(SIP/101)
exten => 9,1,hangup

[uscita]
exten => 9,1,Dial(IAX2/togw2/9)
exten => 9,1,hangup

**** #2 IAX.CONF *****
[togw2]
host=192.168.0.201
type=user
username=togw2
secret=pwdgw2
context=ingresso

[togw1]
type=peer
username=gw1
secret=pwdgw1
host=192.168.1.200
mask=255.255.255.0
context=uscita

**** #2 EXTENSIONS.CONF *****
[ingresso]
exten => 9,1,Dial(SIP/103)
exten => 9,1,hangup

[uscita]
exten => 9,1,Dial(IAX2/togw1/9)
exten => 9,1,hangup

Any suggestion?
Thks in advance!

Hi Heres the laszy way

cyber-cottage.co.uk/wiki/ind … o_Asterisk

Ian

[quote=“ianplain”]Hi Heres the laszy way

cyber-cottage.co.uk/wiki/ind … o_Asterisk

Ian[/quote]

Thks a lot, but since I’m new to this kind of system I’ve not completely explained my problem.
Each of my Asterisk is linked to a PAP2 Adapter that gives 2 phone lines and I want to estabilish connection between two phones connected to the adapters (Asterisk should act as PABX)
So I think I have to distinguish between incoming and outgoing calls: incoming must be routed to the adapter; outgoing must be routed to the other Asterisk
Thks in advance

Hi

Yes I did understand what you wanted to do and this is part of the solution.

If you dial 79 followed by the exten number on the other system it will establish a call to that extension. Yo do have to be careful with contexts though.

Now another way of routing the calls is using a linked number scheme. Ie all extensions on system A start with a 2 and system B with a 3 and then you need the dial plan on A to be _3. and B to be _2. that way you just need to dial the extension.

Ian