Upgrade 3CX to v18 and get it hosted free!

Asterisk Zaptel Installation

Author image

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

You have bought yourself a brand new Zaptel interface card so that you can connect telephone lines and/or telephone handsets to your computer. It might be a Digium Digital Interface Cards, for example. You have physically installed the card into your computer. Now what?

Before you can use your new interface card, you need device drivers. In Linux, device drivers come in the form of kernel modules. You will need to download the source code for the kernel modules, compile and install the modules. That is what this page is all about.

Operating System Specific Notes

There may be extra notes about compiling zaptel that are specific to your operating system. Please check:

Short Version

get the zaptel tarball, extract it, and run:

  1. the following works on Debian and CentOS, and may work on Ubuntu and Fedora.
  2. Please submit patches for $YOURDISTRO

./build_tools/install_prereq test

  1. if you’re happy with that:

./build_tools/install_prereq install
./configure
make
make install
make config

  1. optionally: configure your hardware:
  2. genzaptelconf -sdvM

Kernel Source

(Section is obsolete and should probably be revised)

You are going to install a kernel module. In order to compile the zaptel package on your system, you need to have the kernel source version matching the kernel version that is already running on your system, and you may also need to ensure that the version of gcc used to compile the kernel is the same version as what you have installed. If you did not actually compile your kernel yourself, follow the steps in this section.

Check which kernel version you have installed. You can do that with the command
cat /proc/version
You will get output like this:

Linux version 2.4.28 (root@localhost) (gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)) #1 Tue Jan 28 11:01:02 CST 2003

This shows you that you need to have the kernel source of 2.4.28 version in /usr/src. It also shows that gcc version 3.2 was used to compile the kernel.

Once you have downloaded and unpacked the kernel source code, executing the command:
ls -ld /usr/src/linux*
should give you something like:
lrwxrwxrwx 1 root root 12 Feb 10 2003 /usr/src/linux -> linux-2.4.28
drwxr-xr-x 17 root root 4096 Jan 27 2003 /usr/src/linux-2.4.18 (2.4.18 <> 2.4.28. Is this correct ?)

Make sure that you have the config file for the kernel you’re running. It is usually in the /boot directory and named with the version number of your kernel:
ls /boot/config*
/boot/config-2.4.28

Copy this file to the location /usr/src/.config, like this:
cp /boot/config-2.4.28 /usr/src/linux/.config

Now make sure your config file is fully conformant with your kernel source. Do this:
cd /usr/src/linux
make menuconfig
When the menuconfig program starts up, it reads the .config file automatically. Simply tell the menuconfig program to quit, and have it save the .config file when you are asked.

Now for a Linux 2.4 kernel you need to execute
make dep
which may take a while.
Following this procedure creates the modversions.h kernel header file that you will need to compile zaptel.

For a Linux 2.6 kernel you may need to:
modify the EXTRAVERSION statement in Makefile so it matches what you see in: cat /proc/version (see clarification in comments below)
make modules_prepare
and
ln -s /usr/src/linux-2.6.9-5.0.3.EL /lib/modules/`uname -r`/build
(replacing linux-2.6.9-5.0.3.EL with the appropiate value for your system)

also, if you are cross compiling (i.e. for 2.6 in a 2.4 machine), edit Makefile and where the KERNEL_SOURCE variable is, change its value to /usr/src/linux, provided that you have /usr/src/linux linked to the right kernel source tree you are compiling to.

Download

The most recent stable version of the drivers can be found on the Digium files Server: http://downloads.digium.com/pub/telephony/zaptel/

Developer Method:
You need to use subversion to download the source code for the zaptel package. The following commands assume you are using a bash-style shell:

cd /usr/src
svn checkout http://svn.digium.com/svn/zaptel/branches/1.4 zaptel

Compile

First check /usr/src/zaptel/zconfig.h for any specific configuration changes that might be appropriate. Then:
./configure # cheks build syste. Not needed before 1.4
make
make install

If you get problems with ‘depmod -a’ announcing unresolved symbols, then

  • Try running ‘depmod -ae’ to see the names of the symbols it can’t resolve. Maybe the names can give a hint where to look next.
  • Make sure you’re using the latest versions of the various development tools (gcc etc)
  • Make sure you’ve got the kernel source / kernel headers, and kernel image all at a matching version.

Install

If the kernel module compiled, try
modprobe ztdummy (only if using ztdummy)
modprobe zaptel
which should quietly load the zaptel kernel module and not output any error messages.

Now check which additional module(s) you need to load for your specific interface card(s):

  • Wildcard T400P, Wildcard E400P: tor2
    • provides four T1/PRI interfaces (for up to 96 channels) in a half length PCI card
  • Wildcard TE405P, Wildcard TE410P, Wildcard TE411P, Wildcard TE210P, Wildcard TE205P, OpenVox D410P, OpenVox D210P: wct4xxp
    • Quad-Span togglable E1/T1 card enables per card or per-port selection of either T1 or E1 signaling formats (5.0 volt PCI only).
  • Wildcard T100P, Wildcard E100P: wct1xxp
    • single span T-1 (24-channel) card that supports all the functionality of our quad T1 card
  • Wildcard TE110P, OpenVox D110P: wcte11xp
    • Single-Span selectable T1 / E1 half-length (available with 2U bracket) PCI card sporting the same features as the TE410P
  • Wildcard X100P, Wildcard X101P: wcfxo
    • single-span FXO interface for capturing a single incoming voice line via a PCI card and a standard analog telephone line
  • Wildcard TDM400P, OpenVox A400P : NEW: wctdm (OLD: wcfxs)
    • Quad-Port half-length PCI card which supports standard analog or ADSI telephones and regular POTS lines
  • Wildcard TDM2400P: NEW: wctdm24xxp (OLD: wctdm)
    • 24 Port half-length PCI card which supports standard analog or ADSI telephones and regular POTS lines
  • Wildcard S100U: wcusb or wcfxsusb
    • USB FXS interface
  • Old Tormenta1 ISA Card: torisa
    • ??
  • UHCI USB Zaptel Timing Only Interface: ztdummy
    • Also non-USB based timing for Linux Kernel 2.6+ versions

Try loading the kernel module that is required by your interface card. If, for example, you have a Wildcard TDM400P, then you need the wcfxs module, so try this:
modprobe wcfxs
As before, if all is well, modprobe will quietly load the kernel module and output no errors.

Check your /var/log/messages file; you should find that the module has reported finding your interface card. For example:

May 26 21:54:29 hubris kernel: Zapata Telephony Interface Registered on major 196
May 26 21:54:32 hubris kernel: Freshmaker version: 63
May 26 21:54:32 hubris kernel: Freshmaker passed register test
May 26 21:54:32 hubris kernel: Module 0: Installed — AUTO FXO
May 26 21:54:32 hubris kernel: Module 1: Installed — AUTO FXO
May 26 21:54:32 hubris kernel: Module 2: Installed — AUTO FXS
May 26 21:54:32 hubris kernel: Module 3: Installed — AUTO FXS
May 26 21:54:32 hubris kernel: Found a Wildcard TDM: Wildcard TDM400P REV E/F (4 modules)

You will need the kernel modules to load when your Asterisk computer boots. You can try the commands:
cd /usr/src/zaptel
make config
These will install the files /etc/rc.d/init.d/zaptel and /etc/sysconfig/zaptel. However, different distributions use different startup methods. Examine and edit the files (the originals are in /usr/src/zaptel/zatptel.init and /usr/src/zaptel/zaptel.sysconfig) appropriate for your system.
In particular, if you are using ztdummy you will need to modify the zaptel startup files as descripted here. You will probably want to change the file so that only the modules you are using load.

When you did the ‘make install’ earlier, this created a configuration file /etc/zaptel.conf. So now you should proceed to:

If you have compiled and installed Asterisk already you probably miss the module “chan_zap.so”.
If you don’t find this module in “/usr/lib/asterisk/modules” you need to build it now.
Go in your Asterisk source directory “/usr/src/asterisk” and call make && make install again.
This will create the module “chan_zap.so” now and install it correctly.

If you forget this you will always get the error message:
“Unable to create channel of type ‘Zap'”
when you try to dial via a Zap channel.

Distributions

Debian

apt-get install zaptel-source
m-a a-i zaptel

  1. if you have zaptel hardware:

genzaptelconf -sdvM
/etc/init.d/zaptel start

Why should it be any more complicated?

Some older Ubuntu versions seem to have broken linux-headers packages. Likewise the version of zaptel-source in Sarge.

RedHat 3.0

(Obsolete section, needs revision)

If you are installing zaptel onto RedHat AS/ES 3.0 or a clone , you may get a make errors.
You should do the following:

Install kernel-sources
Create a link from the build directory of the kernel to /usr/src/linux-2.4
and just compile zaptel.

As in:
ln -s /lib/modules/2.4.21-15.TL2/build /usr/src/linux-2.4
Don’t copy things around, the redhat enterprise sources are normally
prepared for new modules compile.
Added by :HRORG: www.hrorg.com, [email protected]

If making a symbolic link to your build directory doesn’t work for you, try changing the line in Makefile that reads:
KINCLUDES:=$(KSRC)/include

to read:
KINCLUDES:=/lib/modules/2.4.21-27.0.4.EL/build/include
(obviously change 2.4.21-27.0.4.EL to reflect the proper kernel / directory)

Zaptel Inits On Gentoo

Gentoo differs from RedHat in its init script and config file layout. Following are the steps I took:

cd /usr/src/zaptel
make config
vi /etc/init.d/zaptel

Make the following changes:


   # Source function library.
   #if [ $system = redhat ]; then
   #    . $initdir/functions || exit 0
   #fi
    

   . $initdir/functions.sh || exit 0

The new placement of your configuration files is now:

/etc/default/zaptel
/etc/zaptel.conf
/etc/asterisk/zapata.conf

Testing and status information

  • use zttool
  • issue a ‘cat /proc/zaptel/*’ (See the Zaptel README for more details)
  • do a “zap show channels” at the Asterisk CLI (Command Line Interface)
  • do a “zap show status” at the Asterisk CLI (Command Line Interface)
  • For the Xorcom Astribank – see the Troubleshooting section in xpp/README.Astribank.
  • enter “pri show span <x>” or “bri debug span <x>” at the Asterisk CLI
  • have a look at http://www.oinko.net/astrecipes/index.php?n=107 for generic PCI testing/probing on Linux
  • if you are getting “rtc: lost some interrupts at 1024Hz.” messages in your dmesg, then see the Kernel 2.6 section above, about ztdummy, rtc, and acpi.Or maybe disable HPET support in the BIOS. Also consider upgrading to a kernel >= 2.6.22 (with high-resolution timers support).

T1/E1 jumper on TE11xP, TE2xxP, and TE4xxP

These cards have a physical jumper for selecting whether the ports are T1 (open) or E1 (closed).
But there is also a software override for the jumper in the wct4xxp and wct11xp drivers.

To set all spans to E1 mode, use:

insmod wct4xxp t1e1override=0xFF

To set all spans to T1 mode, use:

insmod wct4xxp t1e1override=0x00

An even easier way is to add this to your /etc/modprobe.d/zaptel file:

options wct4xxp t1e1override=0xFF

The argument is a bitmask, which can be used to set each span separately, if that is needed for some reason. Span 1 is 0x01, span 2 is 0x02, span 3 is 0x04, and span 4 is 0x08. For example, “t1e1override=0x0B” would set spans 1, 2, and 4 to E1 mode, and leave span 3 in T1 mode.

FXS Cards: Proper FXO Signaling and Ringing for Modern Analog Modems and Analog FAX Machines (Europe and others)

When the ZAP channels on your FXS card are ringing properly in asterisk but the fax machine or modem doesn’t go off-hook and simply doesn’t pick up the call, then you have to set the following options: (Example is for a Digium Wildcard wctdm24xxp)

options wctdm24xxp fxshonormode=1 opermode=TBR21

See Also


Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.