[asterisk-users] Re: Hi reg. 2 asterisk server

Noah Miller noahisaacmiller at gmail.com
Fri Dec 29 15:21:54 MST 2006


Hi Thiru -

>  Could u tell me ,how to connect 2 asterisk server using sip as  a
> clients...
>  asterisk server are in same network...

You can connect them either as "friends" or as "users/peers".  I
generally recommend the user/peer method for connecting two servers
since it clearly delineates which codecs and contexts are allowed.
Your sip.conf files will look something like this:

Server A sip.conf:

[ToServerB]
type=peer
secret=<fromServerAtoServerB>
username=<fromServerAtoServerB>
host=<ip.of.serverB>
qualify=1000

[FromServerB]
type=user
secret=<fromServerBtoServerA>
username=<fromServerBtoServerA>
context=extensions
disallow=all
allow=<codecs you want to allow>


Server B sip.conf:

[ToServerA]
type=peer
secret=<fromServerBtoServerA>
username=<fromServerBtoServerA>
host=<ip.of.serverA>
qualify=1000

[FromServerA]
type=user
secret=<fromServerAtoServerB>
username=<fromServerAtoServerB>
context=extensions
disallow=all
allow=<codecs you want to allow>

Replace the items in angle brackets <xxx> with your own values.

Now, if you have everything loaded correctly, and you issue a "sip
show peers" from the CLI of Server B, you should see something like:

ToServerA/fromServerBtoServerA          ip.of.server.A
5060     OK (37 ms)


ALSO: Make sure you have the correct ports opened in both directions:

5060 TCP and UDP (this is the sip standard, but you can change it in sip.conf)
10000 - 20000 UDP (this is the asterisk default. You can set the exact
numbers in rtp.conf)


- Noah


P.S.  It's generally better to direct these types of questions to the
entire list rather than just a few users from the list.


More information about the asterisk-users mailing list