Installing and configuring Zaptel

From SaruWiki
Revision as of 13:04, 5 October 2008 by Saruman! (talk | contribs) (Zaptel driver install first revision)
Jump to navigation Jump to search

Zaptel driver

To compile the Zaptel driver, we first install support for certain functions (a.o. deflate compression method):

sudo apt-get install zlib1g-dev libssl-dev bison debhelper

Specifically the last one (debhelper) can bring a whole slew of extra packages with it, a.o. build-essential, po-debconf, liburi-perl and patch, just to name a few. Next up is to get the zaptel source code, as is delivered with Debian Lenny:

sudo apt-get install zaptel-source

If there are any dependencies not yet satisfied, you'll see those packages come with the source code (e.g. module-assistant).

Once the zaptel source code is on our system, it is up to us to create the driver. Debian can't handle this for us, as the zaptel driver has to precisely match both our hardware platform and the linux kernel we're using. So we're going to compile our own driver - yippee!
Debian has placed the source file package in /usr/src, and it's named zaptel.tar.bz2. Normally you would think about unpacking it with sudo tar xjvf and get going with the code that's in it. HOWEVER Debian has a really cool utility called the module-assistant. This program is the command-line tool for handling module-source packages that have been prepared for the Debian distribution. It helps users to build and install module packages easily for one or more kernels, even custom ones.

We start from the beginning:

  • boot your system under the kernel for which you want to create the Zaptel drivers, if you haven't already done so
  • as root, run module-assistant prepare. This checks the availability of your kernel source header files, creates a symlink /usr/src/linux that points to your kernel source files, and checks if you have all Debian packages you're going to need (e.g. build-essentials). After a while (may be multiple minutes) the command completes. The output hopefully ends with something like "Setting up zaptel-modules-2.6.26.3 (1:1.4.11~dfsg-2) ..."
  • Some howto's now instruct you to run update-modules, but with modern Debian distributions like 4.0 "Etch" or 5.0 "Lenny" this is not the case; running it won't harm you, because there's a pseudo-command installed, but it won't do a single thing either...
  • If you have hardware installed, you now run genzaptelconf. It will create your hardware config file /etc/zaptel.conf, and probably give you a nice error message about not being able to write in the /etc/asterisk directory - that's simply because we haven't installed asterisk itself yet! Note: if you live outside the U.S.A., you might want to specify which country you live in, to get the correct dialing tones etcetera. It is as simple as specifying your country (two-letter code): genzaptelconf -c nl.
  • You may want to now edit the configuration file that's created for the channels. The configuration file should be /etc/zaptel.conf, and its contents could look like this:
# Span 1: WCTDM/0 "Wildcard TDM410P Board 1" (MASTER)
fxols=1
fxols=2
fxsks=3
# channel 4, WCTDM/0/3, no module.

# Global data

loadzone        = us
defaultzone     = us
  • If you now reboot (into the same kernel), then the dmesg command should confirm the presence of your Zaptel drivers with a short section like this:
Zapata Telephony Interface Registered on major 196
Zaptel Version: 1.4.11
Zaptel Echo Canceller: MG2

Zaptel tools

Next up, we need to install the zaptel userland tools (v1.4.11 under Debian 5.0), which will in turn require fxload and libtonezone1. Installation is simply performed by

sudo apt-get install zaptel fxload libtonezone1

After installation, the zaptel driver checks for the existance of /etc/zaptel.conf. When you've never before had Zaptel on your system, you probably get the message

zaptel : /etc/zaptel.conf fails test for exists and readable

This is in fact a friendly reminder that you first have to create this file, before you try to load the driver.

Zaptel configuration

The Zaptel driver is configured by means of its zaptel.conf configuration file. The contents of this file are fairly straightforward: