[asterisk-users] Asterisk => Master and Slave ?

Thomas Kenyon digium at sanguinarius.co.uk
Wed Aug 30 12:34:17 MST 2006


Noc Phibee wrote:
> Hi
> 
> a small question:
> 
> I have one Asterisk Server with:
>       VoIP Provider gateway for incomming/outgoing call
>       5 VoIP Phone
> (i name it "Master")
> 
> i want add a another Asterisk server but only connected to:
>       5 new VoIP Phone
>       To the master for incoming/outgoing call (in g729)
> 
> It's possible ?
> 
> anyone have a sample of config ?
> 
> thanks
> _______________________________________________

It's fairly simple, you can do it by setting up a pair of freinds (in
either IAX or SIP) and directing calls with the dialplan.

eg. for a setup where Master has extensions 1001 to 1005 as defined in
sip.conf as SIP/Voiphone1,SIP/Voipfone2 etc. and Slave has extensions
1006 to 1010 as defined in sip.conf as SIP/Voipfone6, SIP/Voipfone7 etc.

Master
======

in iax.conf.

[Slave]
type=friend
username=slave
host=<ip.of.slave>
auth=rsa              {If they are communicating on an insecure network,
inkeys= <rsa keyname> {you should use RSA authentication and generate 	
outkey= <rsa keyname2>{keys in /var/lib/asterisk/keys as appropriate.
context=<incoming context name>
peercontext=<outgoing context name>
disallow=all
allow=g729

in extensions.conf

exten => 1001,1,Dial(SIP/Voiphone1)  {change as appropriate
for options 					     {and repeat for all 5 phones
exten => _100[6-9],1,Dial(IAX2/Master:[<rsakeyname2>]@Slave/{EXTEN})
				     {change as appropriate, and square
				     {brackets not used if the password
				     {is a plain test one rather than
				     {rsa keyname.
exten => 1010,1,Dial(IAX2/Master:[<rsakeyname2>]@Slave)

<pile of other rules to forward calls to voip provider>


in iax.conf

[Master]
type=friend
username=master	      {probably unneccesary
host=<ip.of.master>
auth=rsa              {If they are communicating on an insecure network,
inkeys= <rsa keyname2> {you should use RSA authentication and
generate 		outkey= <rsa keyname> {keys as appropriate.
context=<incoming context name>
peercontext=<outgoing context name>
disallow=all
allow=g729

in extensions.conf

exten => _100[1-5],1,Dial(IAX2/Slave:[<rsakeyname>]@Master/{EXTEN})
				     { above note
exten => 1006,1,Dial(SIP/Voiphone6)	{repeat for extensions 1006-1010

exten => _X.,1,Dial(IAX2/Slave:[<rsakeyname>]@Master/{EXTEN})
				     { forward all other calls to Master


If you use voicemail you will probably need to decide where they will be
locally stored and setup an extension and add lines to the telephone
extension definitions as appropriate.

If you are not using rsa authentication, they you will need a secret
defined in each channel and the dialstring altered to match.

This is all off the top of my head, so may contain ommissions or typos.





More information about the asterisk-users mailing list