[Asterisk-Users] IAX2 --> IAX2 confusion, it doesn't work...
Michael George
george at mutualdata.com
Fri Aug 27 08:34:35 MST 2004
I am trying to get two * boxes to communicate with eachother.
I have read
http://www.voip-info.org/wiki-Asterisk+-+dual+servers
as well as information on IAX channels, the Dial() command, and the switch
statement in extensions.conf.
But I am having no luck. I have a working * box running with a Zap card that
I want to be the server machine. I have another little box running * with
just a single SIP phone attached that I want to be the slave machine.
I am trying to get to where I can dial an extension on the SIP phone and have
it connect to the master * box and dial an extension there in the "internal"
context.
As per the dual+servers document, I have the following in the iax.conf on the
side with the SIP phone (the side to dial out of):
----------------------------------------------------------------
register => asterisk:lilbuddy at 192.168.0.250
...
[MainServer]
type=user
secret=lilbuddy
context=internal
----------------------------------------------------------------
I have no "port=" set because I want them both to default to the IAX2 port.
On the side with the TDM card, where I want to call from the SIP phone to, I
have the following in the iax.conf file:
----------------------------------------------------------------
[asterisk]
type=peer
context=internal
secret=lilbuddy
host=dynamic
----------------------------------------------------------------
dual+servers then goes into an example that I cannot comprehend:
----------------------------------------------------------------
[default]
exten => _801XXX,1,Goto,left|${EXTEN}|1
exten => _802XXX,1,Goto,right|${EXTEN}|1
[left]
exten => _801XXX,1,StripMSD,3
exten => _XXX,2,Goto,1
switch => IAX/left
[right]
exten => _802XXX,1,StripMSD,3
exten => _XXX,2,Goto,1
switch => IAX/left
----------------------------------------------------------------
I can see that if a call matches 801... or 802... it will go to the left or
right contexts respectively. And the first thing it does there is strip off
the first three digits and goes to the resulting extension. That takes us to
the Goto(1). Where does that go? Does the "switch =>" statement do the same
thing as an include, but it hops to another server? And in this case, what
does "IAX/left" mean? and why is it included in *both* left and right?
The explanation in the wiki page for extensions.conf is as confusing:
----------------------------------------------------------------
[iaxprovider]
switch => IAX2/user:[key]@server/context
----------------------------------------------------------------
What exactly does this do? There are no extensions and it's not clear to me
if this is to be included into another context or seomthing.
So, looking at other pages in the wiki, I have decided to try to just use the
Dial() commant to reach over to the main * box (the one I want to call to).
So on the box with the SIP phone, I have the default context for the SIP phone
with this as the only entry:
----------------------------------------------------------------
exten => _XX,1,Dial(IAX2/asterisk:lilbuddy at 192.168.0.250/${EXTEN}@internal)
----------------------------------------------------------------
Which should call 192.168.0.250, go into the internal context, to the given
extension. On the Master, in the internal context, I have extension 22 to
ring my desk phone. This has been tested and works.
So what should happen is that I pick up the SIP phone, dial "22" and it will
execute the Dial(), "login" to 192.168.0.250, extension 22 in the internal
context, and ring my desk phone.
What happens instead (starting from a CLI invokation of "asterisk -vvvc" on
each machine) is:
The master loads all it's configuration and gives me: "*CLI>"
I start the little slave box, and I get:
The slave loads all its configuration and I get "*CLI>". The master does
not indicate a registration at all of the slave, but iax.conf on the slave
indicates to register.
So here we sit. I pick up the SIP phone and dial "22" and on the slave (to
which the SIP phone is connected) I get:
----------------------------------------------------------------
*CLI> -- Executing Dial("SIP/grandstream1-c62b", "IAX2/asterisk:lilbuddy at 192.168.0.250/22 at internal") in new stack
-- Called asterisk:lilbuddy at 192.168.0.250/22 at internal
Aug 27 11:40:30 WARNING[131080]: chan_iax2.c:5352 socket_read: Call rejected by 192.168.0.250: No authority found
-- Hungup 'IAX2/192.168.0.250:4569/2'
== No one is available to answer at this time
----------------------------------------------------------------
So I can see that it executed the dial as it should have, and that the id and
secret match that in the iax.conf file on the main server.
The output on the master is:
----------------------------------------------------------------
*CLI> Aug 27 11:30:36 NOTICE[131080]: chan_iax2.c:5251 socket_read: Rejected connect attempt from 192.168.0.147
----------------------------------------------------------------
So it did reject the connection, but I'm not sure why...
Can anyone point me in a direction? My confusion with the dual+servers page
really complicates things because that is the most comprehensive example there
is of connecting two * boxes and it's not helping me.
Thanks!
--
-M
There are 10 kinds of people in this world:
Those who can count in binary and those who cannot.
More information about the asterisk-users
mailing list