How to connect 2nd remote asterisk srvr as an overflow srvr

Can someone give me some general suggestions on connecting 2 asterisk servers in two seperate locations one used as an overflow server

What we have now is 4 analog lines in the main office and 6 analog lines in a remote office connected via a dedicated ADSL connection

What we would like to do is have agents making calls via the main server via SIP and Asteriks make the connection to regular phone lines but when the main offices’ lines are all being used have the ability to use the remote Asterisk server to make the connection to the regular phone lines connected to it.

Any input, advice or suggestions are greatly apreciated!!


If the call fails on the Dial application for the first four lines, the dialplan will continue. Add code to eliminate fatal conditions, like NOANSWER, then the second box, with a prefix to to select the outgoing lines. On the second box, strip the prefix and dial normally.

Thanks for the input, this is how I understanding what you’re suggesting:

I register the remote server as a sip peer
dial zap (right now it’s a group)
… if dial fails, use dial to reach the remote server’s lines
exten => _xxxxxxxxxx, 1, dial(SIP/${exten}@ ;dial remote sip server

If this so, how would I create an extention on the remote server that would called when a call is transfered to it?


Add it to extensions.conf in the context in which the peer is defined. Note, on the, I hope reasonable, assumption that you have static addresses, you should not need to register. If you don’t have static addresses, you need to be very careful about security. In all cases, don’t use the default context.