Asterisk config zaptel.conf

Configuration File /etc/zaptel.conf

PageNeedsRevision: information in this page is quite obsolete and not well-edited. As it is it is not useful enough.

The zaptel.conf file is where you configure the TDM-specific interface parameters required by your Zaptel card(s). It is read by the /sbin/ztcfg program. Both /etc/zaptel.conf and /sbin/ztcfg are installed by the zaptel package: see Zaptel Installation.

(:exclaim:) There are two configuration files with similar names, but they are different files:
  • /etc/zaptel.conf: Configuration of your hardware interfaces
  • /etc/asterisk/zapata.conf: Asterisk configuration to use your hardware interfaces

The configuration settings established in zaptel.conf are:
  1. An identification number for a TDM-related card that will be used in extensions.conf (also known as the "dialplan") to refer to a specific interface card. Each TDM-related card must be assigned a unique number.
  2. What type of signalling is to be used for each TDM-related interface card.
  3. What tone language is to be used in association with a TDM card (e.g. English, French, German). By specifying this parameter, channels used by British users can be configured to give familiar UK tones, while a French user could be attached on another interface and hear French tones. Note: at present, only a few tone sets are supported; see the file zonedata.c in the Zaptel source. If your nation or telco uses different tones, please help by providing updated zone data.
(: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.

Edit your zaptel.conf file

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:
  • loadzone=us: means your interface card(s) will be loaded with US indication tones. You can load more than one set of tones into an interface to allow you to generate tones from different zones by giving a comma-separated list of two letter country codes. Available zones are:

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

Tone zones are defined in the Zaptel source file zonedata.c.
  • defaultzone=us: means use the tones for this zone by default (when no other zone is specified).

The remaining settings in your zaptel.conf file depend on which Digium or Sangoma interface card(s) you have installed.

FXO/FXS interface cards

  • The Wildcard X100P is an FXO device which will use fxs signalling with Asterisk.
  • The Wildcard S100U is an FXS device which will use fxo signalling with Asterisk.
  • The Wildcard TDM400P may have a combination of FXO and FXS modules installed in its four slots. Note that the Wildcard TDM400P may be referred to by different names according to how many modules and what kind of modules are installed on it. If it has one FXS module on it then it is called TDM10B. If it has two FXS modules then it is TDM20B and so on. TDM400P is sometimes used to refer to just the board with no modules on it.

Configuration for the Wildcard X100P:
  • fxsks=1: if you have one Wildcard X100P installed
  • fxsks=1-2: if you have two Wildcard X100P cards installed
  • fxsks=1-3: if you have three Wildcard X100P cards installed, and so on.
Configuration for the Wildcard S100U:
  • fxoks=1: for one card
  • fxoks=1-2: for two cards
  • fxoks=1-3: for three cards, and so on.
Configuration for the Wildcard TDM400P:
  • If your card is a TDM10B (one FXS module), put: fxoks=1
  • If your card is a TDM20B (two FXS modules), put: fxoks=1-2
  • If your card is a TDM30B (three FXS modules), put: fxoks=1-3
  • If your card is a TDM04B (four FXO modules), put: fxsks=1-4
  • If your card has modules FXO, FXO, FXS, FXS (in that order), put:
    • fxsks=1-2
    • fxoks=3-4
  • If your card has modules FXS, FXO, FXO, FXS (in that order), put:
    • fxoks=1,4
    • fxsks=2-3
  • If your card has modules FXS, (empty), FXO, FXS (in that order), put:
    • fxoks=1,4
    • fxsks=3
  • If you have one Wildcard TDM40B and one Wildcard TDM22B installed, put:
    • fxoks=1-4 (for the TDM40B)
    • fxsks=5,8 (for the two FXO modules on your TDM22B)
    • fxoks=6,7 (for the two FXS modules on your TDM22B)
  • NOTE: the names are reversed. For FX0 modules you use fxsks= and for FXS modules you use fxoks=

Configuration for the HFC based ISDN BRI card

  • span=1,1,3,ccs,ami: this is really just a dummy entry
  • bchan=1-2: every ISDN BRI card has 2 B- (data) channels
  • dchan=3: and every ISDN BRI card has 1 D- (control) channel

Multiple Cards and Channel Assignments


If you have multiple cards, their ports will be assigned to Zaptel channels based on the order in which the various modules are loaded.

To see the channel assignments, examine the contents of the files in /proc/zaptel/.

Next step: Run ztcfg

Then run
/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:
  1. a Wildcard X100P (providing a single FXO interface)
  2. a Wildcard TDM400P configured with 4 modules
    1. module 0: an FXO module
    2. module 1: an FXO module
    3. module 2: an FXS module
    4. 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.

See Also



Asterisk | Asterisk Configuration
Created by: tims, Last modification: Fri 29 of Feb, 2008 (22:17 UTC) by archie172


Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+

Page Changes | Comments

 

Featured -

Search: