Not Logged in - No Account?

Don't have an account? Registering an account with us allows you to post to the forums, easily track new posts, subscribe to threads, pm (private message) other forum members, and receive periodic news letters (you can opt out if you desire). Once you are logged in this message will no longer appear. If you don't have an account, you can create one by registering here. Lost your password, request a new password. We respect your privacy which means we collect minimal information when you register and we do not resell that information or use it in any objectionable way. You can review our privacy policy for full details.


Connecting 2 or more boxes

There may be a time when you want to interconnect 2 Asterisks boxes
(def.com.au and xyz.com.au) together and if you are like me, you will
probably be spending a good part of 3 hours trying to get them to talk
to one another.

I have 2 different locations, the Main Office (def.com.au) with
about 11 extensions and another office in a different location
(xyz.com.au) about 20 km away with 9 extensions. The main office is the
only box that will have accounts with different VSPs and all external
communications are through the main office Asterisk box. I settled for
the simplest solution and after some fiddling around I managed to get
them to work the way I wanted it but not happy with it, I solicited
some advise from a friend (thanks to Mark Brooker) who told me that my
configuration could be made a lot tidier. That I did.

Instead of being verbose in my explanation, I will just create a
few tables outlining what I did. I hope this will help those in the
same position as I am, to set 2 very basic systems together (you can
refer to DUNDi for a more complete solution).

27.1 METHOD 1 - with the peer Asterisk boxes as extensions
For the purpose of registering the peers to each other, I created
1 extension on each box eg: 90000 on System 1 and 91000 on System 2–
using extension numbers that I am not likely to use as local extensions
(while some users have had success using common extension, but I prefer
2 separate extensions as I have them working). For simplicity, I gave a
common password xxxyyy to both boxes. Avoid using extension starting
with 8 as it may clash with conferencing.

 
System 1
System 2

IAX Trunk
 
 

Outgoing Dial Rules:
XX.
XX.

Trunk Name
Parramatta
MainOffice

Peer Details
host=xyz.com.au (or IP)

secret=xxxyyy

type=peer

username=91000

host=def.com.au (or IP)

secret=xxxyyy

type=peer

username=90000

User Context
Leave blank
Leave blank

User Details
Leave blank
Leave blank

Register String
80000:xxxyyy@xyz.com.au
90000:xxxyyy@def.com.au

Note: Registration isn’t really necessary. It will still work without it unless you use Dynamic IP.

 
System 1
System 2

Extensions
 
 

Phone Protocol
IAX
IAX

Extension Number
90000
91000

Extension Password
xxxyyy
xxxyyy

Fullname
Parramatta
Main Office

Voicemail & Directory
Disabled
Disabled

 
System 1
System 2

Outbound Routing
 
 

Route Name
Parramatta
MainOffice

Route Password
Leave Blank
Leave Blank

Dial Patterns
6XXX(6001 to 6009 are Parramatta Office extensions)
XX.(Apart from Local extensions, all others go via City Office)

Trunk Sequence
IAX2/Parramatta
IAX2/MainOffice

The above Outbound Routing rule assumes that you do not wish to use
a dialling prefix. If you want to use a prefix to dial the remote
extensions and to use the remote routing rules, you may place a prefix
e.g. 9|6XXX and 9|XX. for system 1 and system 2 respectively instead of just 6XXX and XX.

The above example assumes that both Asterisk boxes have Public Fix
IP address. If you have Dynamic IP addresses, you will need to register
both the boxes with DynDns to obtain a valid DNS ID. If you are a part
of a Corporate LAN, than you will have no need to worry about DynDns
and what not.

Note: While this method will provide some
rudimentary security (though pretty weak), as it requires an extension
to be created for the peer Asterisk box, it will not pass the calling
party extension number to the remote Asterisk box. Instead, it will
pass the Trunk ID only and all calls will seem to come from the same
trunk and not individual extension – I did say that this is a simple
solution.

27.2 METHOD 2 - In a Peer/User arrangement
Another method that I use is described below. This method treats
both the Asterisk box as internal to each other as peer and user. I am
using IAX2 for this purpose, however I believe, you may be able to do
this with SIP as well if you are trying to connect the older Asterisk
with the newer incarnations (I have not proved it yet). This method
does not require registration either and does not require you to create
extensions for the peers. In many ways, this is simpler to set up.

Unlike the first method, this second method will pass the Caller ID
to the receiving party. The receiving party will actually get the
callers’ extension number/ID instead of the extension number of the
peer Asterisk box.

Note: You must provide for security, as this is pretty wide open.

Like all installation, you must provide for security. As different
installation resorts to different types of security arrangement, I will
leave that to the individual implementer to deal with the security
issues.

(Note: A little tutorial on DUNDi can be found here).

Rather than being verbose, I will illustrate this method using tables as follows;

 
System 1
System 2

IAX2 Trunk
 
 

Outgoing Dial Rules:
6XXX
XX.

Trunk Name
InterOffice
InterOffice

Peer Details
host=xyz.com.au (or IP)

Qualify=yes

type=peer

host=def.com.au (or IP)

Qualify=yes

type=peer

User Context
InterOffice-In
InterOffice-In

User Details
context=from-internal

host=xyz.com.au (or IP)

type=user

context=from-internal

host=def.com.au (or IP)

type=user

 
System 1
System 2

Outbound Routing
 
 

Route Name
InterOffice
InterOffice

Route Password
Leave Blank
Leave Blank

Dial Patterns
6XXX(6001 to 6009 are Parramatta Office extensions)
XX.(Apart from Local extensions, all others go via City Office)

Trunk Sequence
IAX2/InterOffice
IAX2/InterOffice

Thinking of more than 2 boxes?
Just as a matter of interest, you can connect several boxes using
this method. While I have connected 3 boxes successfully,I believe, se
same principle can be applied to more boxes.

In my implementation I have box A, B and C (System 1, 2 and 3). Box
A is the master box. All the other boxes use box A as the main
exchange.

A peers with B and C - B peers with A - And C peers with A.

Except for local traffic, all external and inter-office
(inter-branch) traffic goes via Box A. – with the appropriate dial plan
of course.

Both the above methods, while useable for a basic configuration,
will not provide you with a complete solution. To provide a complete
solution is beyond the scope of this document.

The following link will provide further reference for connecting two Asterisk boxes together http://www.voip-info.org/wiki/view/Asterisk+dual+servers

If you require a complete solution tailored to your exact requirement, my advise to you is to hire a VOIP consultant.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: registering one asterisk box to another

gibson's picture

Hi,

Can someone help me I am having a problem using a Digium TDM2400 card with 2 FXO and 2 FXS ports.

I am able to dial extension to extension but am unable to dial to and from the trunk lines connected to the FXO ports.

when I run the following command

[trixbox1.localdomain asterisk]# ztcfg -vvv

Zaptel Version: 1.4.7-3259
Echo Canceller: OSLEC
Configuration
======================

Channel map:

Channel 01: FXO Kewlstart (Default) (Slaves: 01)
Channel 02: FXO Kewlstart (Default) (Slaves: 02)
Channel 03: FXS Kewlstart (Default) (Slaves: 03)
Channel 04: FXS Kewlstart (Default) (Slaves: 04)

4 channels to configure.

[trixbox1.localdomain asterisk]#

and when I run the following command in asterisk:

trixbox1*CLI> zap show channels
Chan Extension Context Language MOH Interpret
pseudo Internal en default
1 from-internal en default
2 from-internal en default
3 from-internal en default
4 from-internal en default
trixbox1*CLI>

my zaptel.conf is as follows:

# Autogenerated by /usr/sbin/genzaptelconf -- do not hand edit
# Zaptel Configuration File
#
# This file is parsed by the Zaptel Configurator, ztcfg
#

# It must be in the module loading order

# Span 1: WCTDM/0 "Wildcard TDM400P REV E/F Board 1"
fxoks=1
fxoks=2
fxsks=3
fxsks=4

# Global data

loadzone = us
defaultzone = us

and my zapata.conf is as follows:

;
; Zapata telephony interface
;
; Configuration file

[trunkgroups]

[channels]

language=en
context=from-zaptel
signalling=fxs_ks
rxwink=300 ; Atlas seems to use long (250ms) winks
;
; Whether or not to do distinctive ring detection on FXO lines
;
;usedistinctiveringdetection=yes

usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=no
;echotraining=800
rxgain=0.0
txgain=0.0
group=0
callgroup=1
pickupgroup=1
immediate=no

;faxdetect=both
faxdetect=incoming
;faxdetect=outgoing
;faxdetect=no

;Include genzaptelconf configs
#include zapata-channels.conf

group=1

;Include AMP configs
#include zapata_additional.conf

;;General options
usercallerid=yes
hidecallerid=no
callwaiting=yes
threewaycalling=yes
transfer=yes
echocancel=yes
echocancelwhenbridged=yes
rxgain=0.0
txgain=0.0

;;FXO Modules
Group=1
signalling=fxo_ks
context=Incoming
channels=1-2

;;FXS Modules
Group=2
echocancel=yes
signalling=fxs_ks
context=Internal
channels=3-4

can you please help what could I be doing wrong?

thanks for your patience and assistance.

Regards,

Gibson


Please do not hijack a

fskrotzki's picture

Please do not hijack a subject with another. It is the fastest way to not get your answer. post this as a new forum posting with a proper descriptive heading and that way you'll get help and notification of when somebody replies to it.