Installing Asterisk 1.2 and Asterisk Management Portal

Obviously, this is really an old procedure, actually this is my documentation way back early 2006 when it’s my first time to work with asterisk. This procedure was implemented before in about 30-50 call center agents using softphones and it quite worked well.

So many things have changed, as we all know, from asterisk 1.2 to asterisk 1.6 , and Asterisk Management Portal is popularly known now as FreePBX. Other packages were also updated now, many changes but still asterisk is standing there as the best open source telephony system.  We had many community and commercial PBX softwares today that are asterisk-based, that’s how big asterisk right now comparing back 2006 🙂

The convenience of installing asterisk is easier as well today, just burn the ISO and you are good to go,mostly managed thru web interface. You can even install asterisk in just one line command once you put asterisk repository in your config.

As easy as ” yum install asterisk16″

Here are my step-by-step procedure (old documentation). AMP was used not only to ease us from asterisk administration but to educate us as well on how things will change or how the dial plan will work. Of course, still the geeky way is to write your own dial-plan, but it will soon cover on this tutorial, as well as updated asterisk installation.


This configuration  was created and tested on:

Fedora Core 4 (run yum –y update for updated kernel and packages)

Intel Xeon 3.2 GHz/Intel Celeron 2.4 GHz


10/100 Mbps LAN card
Standard configuration, no extra hardware


1. Login to your server as root

#cd /usr/src

2. Download Asterisk stable distribution tarball from or ,including all needed addons and packages of Asterisk Management Portal (AMP) as follow: (you can get them using wget command or obtain source code from CVS)









mpg123-0.xxr.tar.gz (optional for musiconhold)




3. Uncompress all tarball file

#tar zxvf asterisk-1.2.x.tar.gz
#tar zxvf  zaptel-1.2.x.tar.gz
#tar zxvf libpri-1.2.x.tar.gz
#tar zxvf asterisk-addons-1.2.x.tar.gz
#tar zxvf asterisk-sounds-1.2.x.tar.gz
#tar zxvf mime-construct-1.x.tar.gz
#tar zxvf  asterisk-perl-0.08.tar.gz
#tar zxvf mpg123-0.59r.tar.gz
#tar zxvf AMP-1.10.010.tar.gz
#tar zxvf spandsp-0.0.2.tar.gz

3.1 Install lame rpm

#rpm –ivh lame-3.96.1-2.2.el4.rf.i386.rpm

4. Compiling Zaptel

#cd /usr/src/ zaptel-version
#make clean
#make install

5. Compiling libpri

#cd /usr/src/libpri-version
#make clean
#make install

6. Compiling Asterisk

#cd /usr/src/asterisk-version
#make clean
#make install
#make samples
#make progdocs (optional)

7. Compiling Asterisk-sounds

#cd /usr/src/asterisk-sounds-version
#make install

8. Compiling Asterisk-addons

#cd /usr/src/asterisk-addons-version
#make install

Asterisk Management Portal

1. The following packages need to be installed with yum:

● libxml2

● libtiff

● libtiff-devel

● httpd

● mysql

● mysql-devel

● mysql-server

● php

● php-gd

● php-mysql

● php-pear

● openssl

● openssl-devel

● kernel-devel

● perl

● perl-CPAN

● cvs

● bison

● ncurses-devel

● audiofile-devel

e.g. #yum install libtiff-devel

2. Installed needed perl  module dependencies:

#perl -MCPAN -e "install Net::Telnet"
#perl -MCPAN -e "install IPC::Signal"
#perl -MCPAN -e "install Proc::WaitStat"
#perl -MCPAN -e "install MIME::Types"

3. Compiling mime-construct

#cd /usr/src/mime-construct-version
#perl Makefile.PL
#make install

4. Compiling asterisk-perl

#cd /usr/src/asterisk-perl-version
#perl Makefile.PL
#make install

5. Compiling mpg123

#cd /usr/src/mpg123-version
#make linux
#make install

6. Compiling spandsp

#cd /usr/src/spandsp-version
#make install

7.Create a group and non-root user

# groupadd asterisk
# useradd -c "asterisk PBX" -d /var/lib/asterisk -u 5060 -g  asterisk asterisk

XXXX 8. Building/Compiling Asterisk to run as our non-root user

#mkdir /var/run/asterisk
#cd /usr/src/asterisk-version
#make &&  make install

9. Install Asterisk sound

#cd /usr/src/asterisk-sounds-version
#make install

10. Setting up MySQL for CDR (Call Detail Reports)

#service mysqld start
# mysqladmin -u root password 'blackxxxxxx'
# mysqladmin create asteriskcdrdb -p
Enter password:
# mysql -u root -p asteriskcdrdb < /
#mysql -u root -p
mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
Query OK, 0 rows affected (0.00 sec)
mysql> exit

11. Build/Compile cdr_mysql module for Asterisk

#cd /usr/src/asterisk-addons-version
# perl -p -i.bak -e \
> Makefile
# make && make install

12. Setup MySQL for AMP web interface

# mysqladmin create asterisk -p
# mysql -u root -p asterisk < /
# mysql -u root -p
-> ON asterisk.*
-> TO asteriskuser@localhost
-> IDENTIFIED BY 'amp109';
Query OK, 0 rows affected (0.00 sec)
mysql> \q

13. Apply the AMP/Asterisk configuration files

#cd /usr/src/AMP
# ./install_amp

14. Edit Apache/PHP environment

#vi /etc/php.ini

Edit such that the line looks like this:

upload_max_filesize = 20M

Chown the PHP session.save_path directory:

#chown asterisk /var/lib/php/session/

Edit /etc/httpd/conf.d/php.conf such that it lincludes:

<Files *.php>

SetOutputFilter PHP

SetInputFilter PHP

LimitRequestBody 20000000


15. Edit web server configuration file

Edit /etc/httpd/conf/httpd.conf such that:

User asterisk

Group asterisk


#Password protect /var/www/html/admin

<Directory /var/www/html/admin>

AuthType Basic

AuthName “Restricted Area”

AuthUserFile /usr/local/apache/passwd/wwwpasswd

Require user wwwadmin


To create the wwwpasswd file:

# vi /etc/httpd/conf.d/php.conf
# vi /etc/httpd/conf/httpd.conf
# mkdir /usr/local/apache
# mkdir /usr/local/apache/passwd
# htpasswd -c /usr/local/apache/passwd/wwwpasswd wwwadmin
New password:
Re-type new password:

Adding password for user wwwadmin
16. amportal control script

The amportal script is the recommended way to stop and start asterisk:

# /usr/sbin/amportal stop
# /usr/sbin/amportal start

17. Automatic startup

Add the following line on /etc/rc.local

/usr/sbin/amportal start

Make sure also httpd and  mysqld services ( type setup on console, then go to System Services, and select httpd and mysqld, or you can use chkconfig –add command)

17. Reboot and access the AMP administration interface

#shutdown -r now

About the author


View all posts

1 Comment

Leave a Reply