[Asterisk-Users] RE: Re: 2 servers

David Cook dbc_asterisk at advan.ca
Tue Aug 24 05:57:07 MST 2004


Quoting asterisk-users-request at lists.digium.com:
> From: "Kanuri, Seshu" <seshu.kanuri at citigroup.com>
>
> Dave,
>
> I am implementing this solution and would appreciate if you can send
> me the doc at this email address - netwebgroup at yahoo.com.
>
> Thanks
> Seshu Kanuri
>
Enough people have asked me for this that I will try and condense it for
the list. I admit I wanted to put it on the wiki and couldn't figure
out how to start a new page!!! (Maybe I'm just thick ;-(

There is also another document on the wiki about the subject at
http://www.voip-info.org/wiki-Asterisk+-+dual+servers

Anyhow, here is mine:

Method 1
Rec'g Svr
iax.conf
[REC_SERVER]
type=user
host=my.calling.server.ca
secret=mysecret
context=local
trunk=yes

Send'g Svr
extensions.conf
[mycontext]
exten =>
_5XXX,1,Dial(IAX2/REC_SERVER:mysecret at my.receiving.server.ca/${EXTEN}@local)
exten => _5XXX,2,Hangup
exten => _5XXX,102,Hangup
Any call in the mycontext context on Calling Server to extensions
5000-5999 (mapped by extension _5XXX) will get sent to receiving server
(my.receiving.server.ca) into the local context on the receiving
server.

Performing the same configuration in the opposite direction will allow
cross-calls between Asterisk systems.
Pros:
Simple, all references in one file per server.
Cons:
Information in dialing string will appear in logs inclusive of
user:password.
Dial string becomes very long.


Method 2
Rev'g Svr
iax.conf[REC_SERVER]
type=user
host=my.calling.server.ca
secret=mysecret
context=local
trunk=yes

Send'g Svr
iax.conf
[REMOTE_SERVER]
type=peer
host=my.receiving.server.ca
secret=mysecret
context=local
extensions.conf
[mycontext]
exten => 5XXX,1,Dial(IAX2/REMOTE_SERVER/${EXTEN})
exten => _5XXX,2,Hangup
exten => _5XXX,102,Hangup
Pros:
User:Password are stored in the calling server?s iax.conf file and not
part of the Dial string. This is more secure in that they are not
recorded in log in files.Dial strings much shorter and concise.

Cons:
Calling server now must have iax.conf and extensions.conf coordinated
making setup a little more complicated.Must user ?type=? definition
correctly:Caller = ?peer?; Receiver = ?user?Type=friend is a
bi-directional relationship meaning both ?peer? and ?user? at the same
time.

Unknown IP (Dynamic IP on one server)
Register Command
If the calling server does not have a fixed IP address or DNS namespace
then the iax.conf file description of the calling server located on the
receiving server should specify host=dynamic.

If the calling server host is specified as dynamic, the calling server
must register with the receiving server with the register command.

Rec'g Svr
iax.conf
[REC_SERVER]
type=user
host=dynamic
secret=mysecret
context=local
trunk=yes

Send'g Svr
iax.conf
register => REC_SERVER:mysecret at my.receiving.server.ca
[REMOTE_SERVER]
type=peer
host=dynamic
context=local
extensions.conf
[mycontext]
exten => 5XXX,1,Dial(IAX2/REMOTE_SERVER/${EXTEN})
exten => _5XXX,2,Hangup
exten => _5XXX,102,Hangup

I hope this is both accurate and helpful!

dbc.



More information about the asterisk-users mailing list