Asterisk – My Quick Installation Guide

There’s a dozen other quick installation guides for Asterisk. So why write another?
Well, unless you a Unix/Linux Guru you might find yourself confused when getting your Asterisk setup off the ground. Even if you are an experienced Linux user, you might find yourself running in circles trying to get that “special feature” working just so in Asterisk. So here it is, a straight forward beginners guide to Asterisk.

STEP 1: Choosing and Installing a Linux Distro

There’s a dozen different distros (or flavors) of Linux that Asterisk will run on. Many have successfully got it running on Debian, Ubuntu, Fedora, and CentOS. Many in the community like CentOS, and it’s the distro that you can install Asterisk on with the least of worries. So you can start by installing CentOS on your PC. For just initial testing of Asterisk, you can use any old hardware. I would suggest at least the following though: P3 1Ghz, 128mb Ram, 10GB Hard Drive, Ethernet Card. If you need assistance figuring out how to burn the CentOS ISO and/or installing CentOS, consult Google or post me a comment. I normally just install the bare mininum of CentOS or the “Server Install.” We can install the needed packages later.

STEP 2: Preparing System for Asterisk Installation

Asterisk requires certain packages in order to install and compile properly. Assuming that you are using CentOS, below is the “yum” command that you will need to issue from the command line.

rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4
yum -y install screen kernel-devel bison openssl-devel mysql mysql-server mysql-devel libtermcap 
yum -y install gcc libtermcap-devel newt newt-devel zlib-devel ncurses-devel gcc-c++ compat-gcc-32 compat-gcc-32-c++

I normally reboot after installing the needed packages, and then run a “yum -y update” to make sure everything is updated.

Now we’re to the fun part. At the time of this writing, the latest version of Asterisk was: 1.4.13, so I’m going to be using this during this guide. So you’re all rebooted and back at the command line. Here’s what needs to be done to download the Asterisk packages:

cd /usr/src/
ln -s /usr/src/kernels linux

rm -rdf asterisk*
wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.13.tar.gz
tar -zvxf asterisk-1.4.13.tar.gz
mv asterisk-1.4.13 asterisk
rm -f asterisk-1.4.13.tar.gz

rm -rdf zaptal*
wget http://downloads.digium.com/pub/zaptel/zaptel-1.4.6.tar.gz
tar -zvxf zaptel-1.4.6.tar.gz
mv zaptel-1.4.6 zaptel
rm -f zaptel-1.4.6.tar.gz

rm -rdf libpri*
wget http://downloads.digium.com/pub/libpri/libpri-1.4.2.tar.gz
tar -zvxf libpri-1.4.2.tar.gz
mv libpri-1.4.2 libpri
rm -f libpri-1.4.2.tar.gz

rm -rdf asterisk-addons*
wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4.4.tar.gz
tar -zvxf asterisk-addons-1.4.4.tar.gz
mv asterisk-addons-1.4.4 asterisk-addons
rm -f asterisk-addons-1.4.4.tar.gz

rm -rdf asterisk-sounds*
wget http://downloads.digium.com/pub/asterisk/releases/asterisk-sounds-1.2.1.tar.gz
tar -zvxf asterisk-sounds-1.2.1.tar.gz
mv asterisk-sounds-1.2.1 asterisk-sounds
rm -f asterisk-sounds-1.2.1.tar.gz

Not all of the above are required to compile and/or run Asterisk. For example, Zaptel is primarily used if you are using an FXS/FXO Card. But there’s many discussions out there that support the fact that installing Zaptel will “somehow” improve your Asterisk experience. Plus you’ll be ready if you ever decide to install a FXS/FXO Card. Which by the way, in this guide, I’m setting up a pure voip Asterisk setup, so there’s no need for FXS/FXO Cards.



STEP 3: Installing Asterisk

So now we’re going to perform the standard install. Perform the following commands from the command line:

cd /usr/src/zaptel/
make clean
make install
make install
make config

cd /usr/src/libpri
make clean
make install

cd /usr/src/asterisk
make clean
./configure
make install
make config

cd /usr/src/asterisk-addons
make clean
make install
make install

cd /usr/src/asterisk-sounds
make install 

In my experience, sometimes you have to run the “make” commands more than once, due to configuration requirements, etc. Look out for any error messages that come up during the compile. If you see any that actually stop the compile from completing, you can do a google search with those errors, hopefully it will return some results for you. Otherwise, put me a comment, and I’ll see if I can help.
Once the above is all complete, I normally do one final reboot to “sync” everything up, so to speak.

That’s it! Asterisk is installed. You can download these commands (put neatly in a .txt document for quick copy and pasting) here.

Asterisk Installation Commands

Check back again for upcoming articles on getting Asterisk configured for use in a pure voip setup.

Update: Nov 23, 2007
– Asterisk Version 1.4.14 has been released. My installation commands have been updated to reflect asterisk-1.4.14.

13 Comments

  1. [...] that you already have the Asterisk Addons installed, as per my installation guide, we can proceed with quickly enabling this. First we’ll copy our configuration file over to [...]

  2. jimi says:

    when I installed addons the following errors occured

    [CC] app_addon_sql_mysql.c -> app_addon_sql_mysql.o
    app_addon_sql_mysql.c:95: error: unknown field ‘chan_fixup’ specified in initializer
    app_addon_sql_mysql.c:95: warning: excess elements in struct initializer
    app_addon_sql_mysql.c:95: warning: (near initialization for ‘mysql_ds_info’)
    make[1]: *** [app_addon_sql_mysql.o] Error 1
    make: *** [apps] Error 2

    what to do

  3. Arc Isles says:

    hi,
    just want to inquire about your configuration for how many seat it can handle? is this installed in just one server for the whole operation? how about the recording what database does it use and what is the format? Im planning to setup our own asterisk server and its my first time to set it up. what other hardware or card do i need to make it functional?

    thanks and more power.

    arc

  4. Author says:

    Hi Arc,

    Thanks for your questions.

    The above example is a single server install. The number of agents you can have running on the server really is going to depend on the hardware that you choose, number of concurrent calls, codec used and bandwidth available, etc. If you are using SIP trunking with your carrier, you aren’t required to purchase additional cards/hardware, and you may be able to handle more concurrent calls if you have the bandwidth to support it.

    In my example above, I mentioned using a P3 server. Without doing any call recording, you could probably handle a couple dozen agents, and 10-20 concurrent calls depending on the bandwidth available and codec used.

    Call recording is a different beast altogether. I will try to post an article about call recording when I can. There’s several ways you can go about recording, and several supported formats. ulaw, gsm, wav are the common ones. I like wav for easy conversion to MP3.

  5. Author says:

    Jimi,

    What version of Asterisk are you using? and version of Asterisk-Addons?

  6. mimi says:

    Hi,
    This tutorial is really helpful ,thank you very much..
    well i am working on asteriskNOW and i am veeeeery debutant and by debutant i mean i’ve never worked with asterisk itself but i am asked to make it work on realtime …My question is : what exactly should i install if i am working on AsteriskNow ??… well i didnt find asterisk-addons shoud i just install it ?? is that the only thing i need to make the other tutorial about realtime asterisk work perfectly??
    thanx in advance ..:)

  7. Author says:

    Hi Mimi,

    I’m not actually sure on AsteriskNow, how to setup realtime. I’ve never used it. Perhaps post in the Digium Forums for assistance?

  8. mimi says:

    Hi Author,
    thank you for you answer.Well i guess i changed my mind, i’ll just install the asterisk on Ubuntu especially for a biginner like me it would be much easier to just follow the steps on the tutoriel which is the greatest ever thank you again :) ))

  9. mimi says:

    hi,
    Some of the packages below don’t exist anymore on ttp://downloads.digium.com/pub/asterisk/ is it possible to download any of the existing ones???

  10. Author says:

    You are correct. For example, the sound packages are now available when ‘make menuselect’ when you compile the latest 1.4.x or 1.6.x versions of Asterisk. I’ll see about updating my command lists today. Thanks!

  11. [...] Realtime. You are going to begin by installing Asterisk. You can check out my quick install guide here. Once you have that all complete, you will want to make sure that MYSQL is running. So we can start [...]

  12. [...] is my updated installation guide. This approach will be alot different than my previous installation guide.  What’s different? For one, I’m using the latest and greatest Asterisk version: [...]

  13. [...] edit the ‘cdr_addon_mysql.c’ and compile/recompile Asterisk-Addons. If you followed my quick installation guide, you will do the [...]

Leave a Reply