It has been a while since I installed Asterisk from scratch and I like to keep my skills sharpened. So for this exercise, I grabbed a base Centos 6 Virtual Box image and installed Asterisk from sources. There might be a few steps not fully explained below, but this should get you going.

First step is to set static IP by edit /etc/sysconfig/network-scripts/ifcfg-eth0. Then get the latest updates via:

yum update

Get Asterisk Source:

cd /usr/src
tar xvzf asterisk-

Install dependencies/libraries:

yum install unixODBC unixODBC-devel mysql-server mysql-devel nano ncurses-devel patch gcc gcc-c++ kernel-devel libtiff-devel libtermcap-devel bison flex curl-devel  libtool-ltdl-devel gmime-devel wget make svn libxml2-devel

ln -s /usr/src/kernels/<your kernel version> linux

Install iksemel libs for Google Talk/Jabber:

Install rpm-forge repo via:
rpm -Uhv

yum install iksemel-devel

Install Speex (required by Speex codec and RedHat/Centos rpms miss certain files):

cd /usr/src
tar xvzf speex-1.2rc1.tar.gz
cd speex-1.2rc1

make install

Install Cepstral Swift (this requires a license, if you don’t have one or don’t want to use Cepstral Text to Speech engine, you can skip it):

cd /usr/src
tar xvzf Cepstral_Allison_i386-linux_5.1.0.tar.gz
cd /usr/src/Cepstral_Allison_i386-linux_5.1.0

/opt/swift/bin/swift –reg-voice –customer-name “xxx” –company-name “xxx” –voice-name Allison –license-key “xxx”

Configure libs:

Edit /etc/ and insert:


Save the file, then run ldconfig

Install Dahdi:

Get and install latest dahdi-tools and dahdi-linux

* dahdi-linux: kernel modules
* dahdi-tools: userspace tools

cd /usr/src
tar xvzf dahdi-linux-2.6.0.tar.gz
tar xvzf dahdi-tools-2.6.0.tar.gz

cd /usr/src/dahdi-linux-2.6.0
make install

cd /usr/src/dahdi-tools-2.6.0
make menuselect
make all
make install
make config

nano /etc/dahdi/modules (comment out hardware cards, unless you have them)
chkconfig dahdi on

Install Asterisk 1.8.9:

cd /usr/src/asterisk-
make menuselect (here select the options you want, you’ll be fine with defaults in most cases, I added couple of missing ones)
make install
make progdocs
make samples
make config

chkconfig asterisk on

Create Asterisk user/group and edit permissions:

groupadd -g 5060 asterisk
adduser -c “Asterisk Telephone Server” -d /var/lib/asterisk -g asterisk -u 5060 asterisk

chown –recursive asterisk:asterisk /var/lib/asterisk
chown –recursive asterisk:asterisk /var/log/asterisk
chown –recursive asterisk:asterisk /var/run/asterisk
chown –recursive asterisk:asterisk /var/spool/asterisk
chown –recursive asterisk:asterisk /usr/lib/asterisk

chmod –recursive u=rwX,g=rX,o= /var/lib/asterisk
chmod –recursive u=rwX,g=rX,o= /var/log/asterisk
chmod –recursive u=rwX,g=rX,o= /var/run/asterisk
chmod –recursive u=rwX,g=rX,o= /var/spool/asterisk
chmod –recursive u=rwX,g=rX,o= /usr/lib/asterisk

Edit /etc/asterisk/asterisk.conf:

astrundir => /var/run/asterisk
runuser = asterisk ; The user to run as
rungroup = asterisk ; The group to run as

Edit /etc/sysconfig/asterisk:

Remove comment out


Install app_swift:

Appswift is at, it adds app_swift, which integrates with Cepstral TTS and makes creating prompts in your dialplan easy.

cd /usr/src
tar -xvzf app_swift-2.0.1-ast1.8.tar.gz
cd app_swift-2.0.1-ast1.8
make install

Install php5 for scripting:

yum install php php-cli

Install g729 and g723 codecs:

cd /usr/src
cp /usr/lib/asterisk/modules/
cp /usr/lib/asterisk/modules/

Asterisk Fax:

Order free license key from digium at first.


cd /usr/src/
mkdir astfax
cd astfax

chmod 500 register
chmod 500 benchfax-1.1.0-x86_32


This will tell you which version of Asterisk Fax to use. Then go to the fax selector at

Pick the one suggested by bench fax, in our case (a 32 bit i686 Linux):


tar xvzf res_fax_digium-1.8.4_1.3.0-i686_32.tar.gz

cd /usr/src/astfax/res_fax_digium-1.8.4_1.3.0-i686_32
cp /usr/lib/asterisk/modules/
cp res_fax_digium.conf /etc/asterisk/

Now you can test your basic installation via

asterisk -vvv -c

If all is well, you can run

service asterisk start

to run it as a service. I have my config files from previous installs, so I first copied them back to /etc/asterisk and I was good to go.