[Asterisk-Users] Re: Asterisk Dual Servers

Rich Adamson radamson at routers.com
Sun Apr 10 07:38:11 MST 2005


>  > Hi all, I am trying to set up two asterisk servers (SrvA and SrvB),
>  > and what I want to get done is that if I dial 1X on SrvB the call must
>  > be routed to extension X on SrvA and if I dial 2X on SrvA the call
>  > must be routed to extension X on SrvB. I've read the www.voip-info.org
>  > wiki abouta sterisk dual servers but couldn't succeed on get it
>  > working. Perhaps someone that has a working dialplan similar to what I
>  > want to do could post his config files or explain what to do. Thanks
>  > in advance.
> 
> I had some difficulty with that posting on the WIKI, too.  In the end it 
> turned out that I didn't realize that you will often need to restart 
> asterisk after making changes to iax.conf like this. In case you need 
> it, here's what I use:
> 
> If I have two locations:
> 
> Location 1: 123.123.123.123
> Location 2: 234.234.234.234
> 
> In iax.conf on my "1" box, I use:
> [ast2-in]
> type=user
> secret=pass2
> context=my_context_on_2
> disallow=all
> allow=ulaw
> 
> [ast2-out]
> type=peer
> secret=pass2
> username=ast2
> host=234.234.234.234
> disallow=all
> allow=ulaw
> 
> 
> In iax.conf on my "2" box, I use:
> [ast1-in]
> type=user
> secret=pass1
> context=my_context_on_1
> disallow=all
> allow=ulaw
> 
> [ast1-out]
> type=peer
> secret=pass1
> username=ast1
> host=123.123.123.123
> disallow=all
> allow=ulaw
> 
> 
> Then in extensions.conf, if I wanted to use 1XX extensions for Location 
> 1 and 2XX extensions for Location 2, I could use something like this:
> 
> extensions.conf for Location 1:
> exten => _2XX,1,Dial(IAX2/ast2-in:pass2 at 234.234.234.234/${EXTEN})
> 
> extensions.conf for Location 2:
> exten => _1XX,1,Dial(IAX2/ast1-in:pass1 at 123.123.123.123/${EXTEN})
> 
> 
> I hope that makes sense.

I'm not the OP, but the above approach is the more correct way to 
define iax links. The approach gives you the ability to add/change
parameters (such as which codec to support) in a very clear and
understandable way.

For those that have one or more asterisk boxes behind a nat box,
you might also have to use the "register" statement in addition to
the above in order to keep nat tables current. For the record, I'm
not sure the above approach will actually keep the nat tables
active without the register. (Just an FYI)





More information about the asterisk-users mailing list