Installing and Configuring Asterisk in Debian

What is Asterisk ?

Asterisk is a complete PBX in software. It runs on Linux, BSD and MacOSX and provides all of the features you would expect from a PBX and more. Asterisk does voice over IP in many protocols, and can interoperate with almost all standards-based telephony equipment using relatively inexpensive hardware.

Asterisk Features

Asterisk provides Voicemail services with Directory, Call Conferencing, Interactive Voice Response and Call Queuing. It has support for three-way calling, caller ID services, ADSI, SIP and H.323 (as both client and gateway). Check the Features section for a more complete list.

Asterisk Supported Hardware

Asterisk needs no additional hardware for Voice over IP. For interconnection with digital and analog telephony equipment, Asterisk supports a number of hardware devices, most notably all of the hardware manufactured by Asterisk's sponsors, Digiumô. Digium has single and quad span T1 and E1 interfaces for interconnection to PRI lines and channel banks as well as a single port FXO card and a one to four-port modular FXS and FXO card.

Also supported are the Internet Line Jack and Internet Phone Jack products from Quicknet.

Asterisk Platform Support

Asterisk is primarily developed on GNU/Linux for x/86. It is known to compile and run on GNU/Linux for PPC along with OpenBSD, FreeBSD, and Mac OS X Jaguar. Other platforms and standards-based UNIX-like operating systems should be reasonably easy to port for anyone with the time and requisite skill to do so.

Download Asterisk

Download Asterisk-Addons

Download Asterisk-Sounds

Asterisk Documentation

Asterisk FAQ

Asterisk Debian Source list

deb experimental/

deb asterisk/

Default debian source list also install the debian packages

Required Packages

Note that your system MUST meet these requirements:

You must have openssl and the respective development package.
You must be running Linux 2.4.x (or 2.6.x)
You must have the Linux Kernel Sources package installed on your system.(or Kernel Headers)

Alternatively, use the command: apt-get build-dep asterisk

Note that Debian tends to break packages into smaller pieces than other distributions, so there are more 'required' packages here than with RedHat or others.

Some package names are also tied to particular versions of the software, especially libraries. This allows you to install multiple versions of the same libraries, and to have different packages use their prefferred verision. That said 'apt-cache search' is your friend.


kernel-headers-`uname -r`
libssl0.9.7: (Note that version may change - do: apt-cache search libssl)
(libreadline4 - not required anymore, asterisk brings "editline" along)
(libreadline4-dev - not required anymore, see above)
zlib1g-dev (Note: needed for cvs head)


cvs: To download the newest cvs source, or course...
minicom: to configure your channelbank via serial
festival: To speek text programatically
doxygen, graphviz: to build the html Asterisk API documentation with 'make progdocs'

Note:- if you upgrade your kernel, copy the config file that comes with the .deb file, (it gets placed in /boot) to /usr/src/linux or /usr/src/linux-2.4 (cp /boot/config-2.4.25-1-686-smp /usr/src/linux/.config) then do a "make oldconfig; make dep" zaptel will compile just fine if everything else is ok.

kernel-headers Package

There is no need to install the complete kernel-source package. Simply install the appropriate kernel-headers package for your current kernel, and make sure that /usr/src/linux links to them.

Zaptel unresolved symbols problems

While trying to install the zaptel module with 'make install' I have gotten error messages of the form

Unresolved symbols...

To solve this problem, do not download the kernel-source as suggested above, instead download the correct kernel-headers package (type uname -a to find out which one) and create a softlink with

ln -s /usr/src/kernel-headers-... /usr/src/linux (e.g. ln -s /usr/src/kernel-headers-2.4.27-2-686 /usr/src/linux)

Now compile the zaptel driver and 'make install' to install it.

Some tips for working with Asterisk on Debian 3.1/Sarge with Kernel 2.6

Check that your TDM400 is not sharing any IRQs - use cat /proc/interrupts to check (you'll need to have the wctdm driver loaded).

You'll need the zaptel-source package to compile the (wctdm, wcfxo, wcfxs) drivers for your running kernel. As long as you're running a stock Debian kernel, this should be quite easy. Hint: you need the EXACT kernel-headers-* package to match your current running kernel. If you get "wrong magic" errors when trying to insmod the wctdm driver, then you're compiling with the wrong kernel-headers directory symlinked to /usr/src/linux.

If you run 'make linux26' (as instructed for those running 2.6 kernels) to build the zaptel drivers in /usr/src/modules/zaptel, 'make install', and then try to insmod them only to find that Asterisk cannot open the zap channels anyway - try doing 'make' instead (without the 'linux26' bit). I'm running kernel-image-2.6.8-1-386 and for some reason a dist-upgrade/kernel-upgrade/reboot the other day now makes my zaptel modules useless if I do 'make linux26'. Odd. ( Note that this shouldnt make any difference as the makefile will automatically detect the kernel version and adapt )

Don't forget to insmod wcfxo and wcfxs. If you have only FXO modules you'll need FXS signalling and hence the wcfxs module; and vice versa. It's harmless to just do both even if you only have one type of module installed on your card.

Don't forget to install the zaptel package for the userland tools, which includes the ztcfg utility.

It seems that, there is an issue where Asterisk can't open the zaptel channels when launched through the init.d scripts as the asterisk user because the asterisk user doesnt have permission to access the device... so make sure you add asterisk user to the dialout group using 'adduser asterisk dialout'.

Don't forget to use signalling=fxs_ks in your zapata.conf so that your FXO module can detect remote end hangup reliably.

Want to be able to pickup a line even if it isn't ringing? Perhaps it's just me but I got confused thinking that the zapbarge Asterisk command would be what I wanted. Of course, the solution is much simpler.

Below are some lines out of my extensions.conf that allow anyone on a SIP phone (or other) to pickup a PSTN line by dialing *X, where X is the line number (1-3). This is useful for when you still have analogue phones sharing the same lines that are going into your TDM400 card, and you want to be able to pickup a line that has already been answered with an analogue phone.

exten =_ *1,1,Dial(Zap/1/)
exten =_ *2,1,Dial(Zap/2/)
exten =_ *3,1,Dial(Zap/3/)

Step by step TDM400P on Debian 3.1/Sarge with Kernel 2.6

Install Debian 3.1/Sarge with Kernel 2.6 
#apt-get install zaptel-source
#apt-get install kernel-headers-`uname -r`
#apt-get build-dep asterisk
#m-a a-i zaptel
you need to set an opermode if you live outside of the us so edit /etc/modprobe.d/zaptel

install wcfxo /sbin/modprobe --ignore-install wcfxo opermode=AUSTRALIA && /sbin/ztcfg
install wcfxs /sbin/modprobe --ignore-install wcfxs opermode=AUSTRALIA && /sbin/ztcfg

and edit /etc/zaptel.conf (Australia with Module 1-2 FXO and 3-4 FXS used as example)

#modprobe zaptel
#modprobe wcfxs (to support the FXO modules)
#modprobe wcfxo (to support the FXS modules)

Note: If modprobe does not see your new modules, claiming the are not found, run 'depmod'

and your done

IVR Audio problems (kind of robotic voice) on TDM400P PSTN channels with Debian 3.1/Etch (testing) on Intel P4 based cpu/s

Since kernel 2.6 uses an internal timer, this could be related to the "wrong" kernel image for the CPU installed in the system.

The default Debian 3.1/Etch kernel image is linux-image-2.6.12-1-386

So, if you are using P4 based cpu/s try to:

#apt-get update
#apt-get install linux-image-2.6.x-x-686
#apt-get install kernel-headers-2.6.x-x-686 (do this after the image installation)
reboot. The new kernel will be automatically loaded (check if it is present in the grub/lilo list anyway)
ignore the asterisk errors, if present
login to a secondary console (eg: alt+F2)
m-a a-i zaptel (which rebuilds the zaptel driver, not started after the reboot)

If you are looking for asterisk web interface or frontend tools click