The zaptel.conf file is where you configure the TDM-specific interface parameters required by your
card(s). It is read by the /sbin/ztcfg program. Both /etc/zaptel.conf and /sbin/ztcfg are installed by the zaptel package: see
.
(:exclaim:) There are two configuration files with similar names, but they are different files:
(:exclaim:) If elements 1 and 2 listed above are not configured in zaptel.conf, the interface card missing the configuration information will not work in Asterisk.
We assume you are starting with the default /etc/zaptel.conf file that was installed by 'make install', which contains only two lines that are not commented out:
us au fr nl uk fi es jp no at nz it us-old gr tw cl se be sg il br hu lt pl za pt ee mx in de ch dk cz cn ve ph
.
The remaining settings in your zaptel.conf file depend on which Digium or Sangoma interface card(s) you have installed.
/sbin/ztcfg -vvvv
If it exits silently, your configuration is correct. If you get a message like:
ZT_CHANCONFIG failed on channel 1: Invalid argument (22)
Did you forget that FXS interfaces are configured with FXO signalling
and that FXO interfaces use FXS signalling?
then your configuration is incorrect. It may also be helpful to check your /var/log/messages logfile to see what messages the zaptel, wcfxs and/or wcfxo kernel modules generated when they were loaded.
T1/E1 interface cards
Note: Sangoma cards are configured just the same way as the Digium boards in the /etc/zaptel.conf
Please Obtain the Line information from your carrier before connecting your T1 line.
Questions to ask...
Full T1? all 24 lines used?
Line Type:
Framing:
Encoding:
Switchtype:
Now it is time to cover the T1/E1 cards. Once you know the basics for one card it will pretty much be the same for all of them. I will start with the Wildcard T100P.
Configuration for T100P using a PRI
In /etc/zaptel.conf:
span=1,1,0,esf,b8zs
bchan=1-23
dchan=24
In /etc/asterisk/zapata.conf:
switchtype=national
context=blah
signalling=pri_cpe
group=1
channel => 1-23
As you see, we using esf framing and b8zs coding. Change it according to how your PRI is setup. Also you may need to change the switchtype. The signalling should be set for slave which is what pri_cpe is. In the /etc/asterisk/zapata.conf, you define only the B channels.
When using a channel bank, you define the fxo/fxs channels instead of B and D channels. Now it is setup just like the fxo/fxs cards. This is for an all fxs channel bank. If you have fxo then change the signalling. If you have fxs and fxo channel bank, you need to split the channels according to how the channel bank is set up.
Configuration for T100P using a channel bank.
In /etc/zaptel.conf:
span=1,0,0,esf,b8zs
fxoks=1-24
In /etc/asterisk/zapata.conf:
signalling=fxo_ks
context=blah
group=1
channel => 1-24
If you have an E100P/E400P card then you would change the framing, coding, and switchtype. Of course your channels will be different since E1's have 31 channels. The TE410P card allows you to use T1 and E1 circuits.
Example for TE405P/TE410P card for use in germany:
Here's zaptel.conf from a Quad E1 system we run in Munich that's directly connected to the PSTN:
span=1,1,0,ccs,hdb3,crc4
bchan=1-15
dchan=16
bchan=17-31
span=2,1,0,ccs,hdb3,crc4
bchan=32-46
dchan=47
bchan=48-62
span=3,1,0,ccs,hdb3,crc4
bchan=63-77
dchan=78
bchan=79-93
span=4,1,0,ccs,hdb3,crc4
bchan=94-108
dchan=109
bchan=110-124
loadzone=nl
defaultzone=nl
As stated above, this system connects to the PSTN (as CPE) so depending on the PRI connection type to the Hicom you may need to change the timing for some of your circuits in the file above (span=1,0,0,ccs,hdb3,crc4 and so on...).
Here's zapata.conf from the same system:
[channels]
language=de
context=default
switchtype=euroisdn
;If you connect to a hicom PBX set your ISDN Numbering Plan Identifier to unknown.
pridialplan=unknown
prilocaldialplan=unknown
signalling=pri_cpe
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no
group = 1
channel => 1-15
channel => 17-31
group = 2
channel => 32-46
channel => 48-62
group = 3
channel => 63-77
channel => 79-93
group = 4
channel => 94-108
channel => 110-124
Example zaptel.conf file
Let's say that you have two cards installed in your computer:
- a Wildcard X100P (providing a single FXO interface)
- a Wildcard TDM400P configured with 4 modules
- module 0: an FXO module
- module 1: an FXO module
- module 2: an FXS module
- module 3: an FXS module
Then your zaptel.conf file might look like this:
loadzone=us
defaultzone=us
; Use Kewlstart FXS signalling for the Wildcard X100P
fxsks=1
; Use Kewlstart FXS signalling for modules 0 and 1 of the Wildcard TDM400P
fxsks=2-3
; Use Kewlstart FXO signalling for modules 2 and 3 of the Wildcard TDM400P
fxoks=4-5
What do these parameters mean?
- fxsks=1: is actually 3 parameters specified in one chunk. Let's break the chunk down first, to make the parts easier to understand. The fist part in this chunk is "fxs", which means use FXS signalling for this interface card so it can communicate with the public telephone network. The next part in this chunk is "ks", which means use kewlstart signalling to determine whether a channel is open or closed (analogous to a telephone handset being off-hook or on-hook, respectively). The next part in this chunk is "=1" which means this interface card will be identified as channel 1 in other configuration files; especially in extensions.conf (also known as the "Dialplan"). For example, this card will be referenced as Zap/1 in extensions.conf.
- fxsks=2-3: means modules 0 and 1 of the Wildcard TDM400P also use FXS signalling with Kewlstart signalling. They will be identified by Asterisk as Zap/2 and Zap/3.
- fxoks=4-5: means modules 2 and 3 of the Wildcard TDM400P will use FXO signalling so they can communicate with devices that function as telephone handsets (like desk phones or soft-phones such as Gnophone, KPhone, or X-Lite), use Kewlstart signalling to determine whether a channel is open or closed, and identify these interfaces as channels 4 and 5 (Asterisk will refer to them as Zap/4 and Zap/5).
Use the right signalling!
One area of confusion is the right signalling to use on FXO and FXS ports. Remember that on these ports, Asterisk is connecting to the opposite type of device (an FXO port connects to a device that expects to be signalled by an FXS, FXS ports attach to devices that expect FXO signalling). What you specify in the
zaptel.conf file is the type of signalling Asterisk must generate for the attached device. Fortunately,
ztcfg gives you a helpful hint if you get it wrong:
ZT_CHANCONFIG failed on channel 1: Invalid argument (22)
Did you forget that FXS interfaces are configured with FXO signalling
and that FXO interfaces use FXS signalling?
Loopstart, Groundstart, Kewlstart
See
Digium's Knowledge Base about the differences between loopstart, groundstart and kewlstart. The summary is: you probably need to use kewlstart both for your FXO telephone lines (to your local telephone exchange) and also for your FXS handset lines (connecting your standard telephone handsets), regardless of where in the world you are.
Identification of Zaptel channels
Why, in the example above, does the Wildcard X100P PSTN card get identified as interface 1 (Zap/1) and the WildCard TDM400P get identified as interfaces 2 through 5 (Zap/2 to Zap/5)? The answer lies in the order in which the Zaptel modules are loaded into the kernel.
The Wildcard X100P needs the
wcfxo kernel module driver. The Wildcard TDM400P needs the
wcfxs kernel module driver. All cards also need the
zaptel kernel module driver.
If you had just the Wildcard X100P installed in your computer, you would be first loading the
zaptel module, then the
wcfxo module (and then running the
ztcfg program). Your Wildcard X100P would show up as Zap/1. If you bought and installed a Wildcard TDM400P with modules FXO,FXO,FXS,FXS plugged into it, you would also need to load the
wcfxs kernel module driver for this card (somewhat confusingly, it handles both the FXO and the FXS modules installed on the Wildcard TDM400P). If you load your kernel modules in the order
zaptel,
wcfxo,
wcfxs, then your Wiildcard X100P interface will be Zap/1, and your Wildcard TDM400P interfaces will be Zap/2 through to Zap/5. If, on the other hand, you load your kernel modules in the order
zaptel,
wcfxs,
wcfxo, then your Wildcard TDM400P interfaces will be Zap/1 through to Zap/4, and your Wildcard X100P interface will be Zap/5, and you would need to change your dialplan (
extensions.conf) accordingly.
http://www.voip-info.org/wiki/index.php?page=Asterisk+config+zaptel.conf