> 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@234.234.234.234/${EXTEN})
extensions.conf for Location 2:
exten => _1XX,1,Dial(IAX2/ast1-in:pass1@123.123.123.123/${EXTEN})
I hope that makes sense.
- Noah