Asterisk Linux Centos

CentOS is one of serveral projects building freely distributable distributions based on Red Hat Enterprise Linux.

Installing CentOS for Asterisk

Based on Centos 4.1 for i386

Required packages

  • Minimal install
  • kernel-devel / kernel-smp-devel
  • bison
  • openssl-devel

for mysql support (Asterisk sip mysql peers, Asterisk voicemail database, Asterisk cdr mysql etc) add

  • mysql
  • mysq-server
  • mysql-devel

Installation process

Select minimal from the Package Group selector option (on Centos 4.1 this required just disk1 for my hardware - HP DL360 - G4)
When the installation completes, install the YUM GPG Key

  • rpm --import

Now simply install the required packages using yum

  • yum -y install kernel-devel bison openssl-devel
or to include mysql:
  • yum -y install kernel-devel bison openssl-devel mysql mysql-server mysql-devel

If you run an SMP kernel, you need kernel-smp-devel instead of kernel-devel above.

Now go make yourself a cup of tea/coffee as this will take a while, depending on your connection speed (it will download and install all dependencies and packages required)

  • yum -y update
Another cup of coffee, and a reboot to ensure that you compile against the correct kernel.

Once installed, standard asterisk installation procedure applies.

Installing Asterisk on to CentOS 4.x

Quick and Easy Install Guide, continuing from above section.
>>> If you are running an SMP kernel, then instead of "kernel-devel" use "kernel-smp-devel"<<<
>>> MySQL is optional, MenuSelect requires 'ncurses-devel' if you want to set extra options. <<<

Install prereqs:

yum -y update
yum -y install gcc gcc-c++ libtermcap-devel kernel-devel bison openssl-devel mysql mysql-server mysql-devel

  1. installing/upgrading asterisk
  2. clean modules - just in case this is an upgrade.
rm -f /usr/lib/asterisk/modules/*

Go fetch latest asterisk sources. If you get "404" errors, chances are that there
are newer versions. Please update this page. (Yes, I know about /releases ,
and I avoided using it to keep this page up-to-date)

rm asterisk
tar -zxvf asterisk-
ln -s asterisk- asterisk

rm -f zaptel
tar -zxvf zaptel-1.4.11.tar.gz
ln -s zaptel-1.4.11 zaptel

rm -f libpri
tar -zxvf libpri-1.4.7.tar.gz
mv libpri-1.4.7 libpri

rm -f asterisk-addons
tar -zxvf asterisk-addons-1.4.7.tar.gz
mv asterisk-addons-1.4.7 asterisk-addons

Should be run before building asterisk: (NOTE: You may need to reboot if you see errors about missing kernel sources)

cd /usr/src/zaptel
  1. make menuselect
make install
make config

Optional: If you have Zaptel digital cards:

cd ../libpri
make clean
make install

Must be installed after zaptel and (if you need it) libpri:

cd ../asterisk
  1. make menuselect # for extra configuration
make install
make samples
make config

Optional. Should be run after installing Asterisk:

cd ../asterisk-addons
make install

Reported Issues

  • Guide to installing Asterisk CentOS-4.0 Zaptel
  • mISDN rumoured not to work on CentOS and other RHEL based distros. Information on Trixbox discussion forums, and on Beronet's mailing list archive.
  • Note : In my installation I did not have any digium (or clone) hardware so I did not compile zaptel, my attempts to build ztdummy failed as the make file complained about kernel-source not being installed. Any clues? (added by hfwang oct 6th 05: try creating a symlink called /usr/src/linux-2.6 or linux-2.4 to your kernel sources) "try getting kernel-devel — Bud"

Other Sources of Documentation

  • AussieVoip's detailed guide to installing Asterisk and FreePBX on CentOS

Packaged RPM's

  • For packages see ATrpms
  • Consider the benefits of the well documented installation process of compiling from source.

Installing Asterisk Using A Script

Here is a script that will install of the latest source of Asterisk 1.4.x on a fresh install of CentOS 4.x. The script will also setup a daily restart of asterisk and reboot the box once a week. Also other new features are slowly being adding to the script, to download the script and read about it go Visit the blog for other asterisk tips and configuration examples.


For a full, bleeding edge Asterisk installation with many additional packages based on CentOS consider Trixbox, formerly known as Asterisk at Home. Trixbox is now associated with Fonality (Oct 06).

Asterisk OS Platforms
Asterisk at Home

Created by: jht2, Last modification: Sun 11 of Apr, 2010 (13:14 UTC) by jdmphone
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+