Installing The Asterisk PBX And The Asterisk Web-Based Provisioning GUI On Linux

I have read about Asterisk and wanted to test it out as I will be managing/troubleshooting it at work anytime soon, so I thought of getting my hands dirty and getting some basic experience on it. First, I set up a box with Linux RedHat ES4 but I think any Linux distro would do. Kubuntu/Ubuntu, Fedora or Mandriva would work fine.

Here we go:

1) Get linux installed and mark down the IP address of the box.

2) su to root, then download the current tar files from to /usr/src:

  • Asterisk to /asterisk
  • Zaptel to /zaptel
  • Libpri to /libpri
  • asterisk-addons to /asterisk-addons

3) Follow the commands bellow to untar each package in /usr/src (in this example I'm using versions that were up-to-date, change the version numbers to what ever versions you downloaded):

tar -zxvf asterisk-1.4.4.tar.gz
ln -s asterisk-1.4.4 asterisk
tar -zxvf zaptel-
ln -s zaptel- zaptel
tar -zxvf libpri-1.4.0.tar.gz
mv libpri-1.4.0 libpri
tar -zxvf asterisk-addons-1.4.1.tar.gz
mv asterisk-addons-1.4.1 asterisk-addons

4) Start installing the different packages by following theses commands, again, as root:

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

cd /usr/src/zaptel
make menuselect (make sure your terminal window is set for at least 80x21 or the menu select command will give you an error)
make install
make config

Optional (I still did it either way): If you have Zaptel digital cards:

cd ../libpri
make clean
make install

Must be installed after zaptel and (if you need it) libpri (I did this also):

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

Optional. Should be run after installing Asterisk:

cd ../asterisk-addons
make install

5) Now's a good time to go ahead and backup some files. Backup both sip.conf and extensions.conf which are located in the /etc/asterisk folder by doing theses commands:

cd /etc/asterisk
cp sip.conf sip.backup
cp extensions.conf extensions.backup

6) Now that everything is installed (unless you got errors, if so, go to and post messages there with your issues [BEST LINUX FORUM EVER !]), now's the time to start Asterisk for the first time by entenring this command:

cd /usr/sbin
asterisk -vvvvgc (this will start in debug mode which is good to find out about errors)

7) There are several extensions already preconfigured in the basic install, and here they are:

  • extension : 1000 (first one to try !) 
  • extension : 1234 (is a extension. call vmail and enter this as the extention and password 4242)
  • extension : 1235 (dial this and leave a message to yourself)
  • extension : 1236 (another extension)
  • Main Vmail : 8500
  • External test for SIP call : 500
  • echo test : 600

So make calls to these using an SIP phone like X-Lite or an SIP enabled desk phone like the Mitel 5212/5224. To make a call, you type the extension # followed by the @ sign and the IP address of the box running the Asterisk software. Make sure the firewall is disabled or set up to allow port 5060 inbound/outbound.



Asterisk Manager

There also exists an Asterisk manager. To enable this, you need to edit the /etc/asterisk/manager.conf and uncomment the four lines below by removing the ; on:

;[mark] (this is the username to use in the astman)
;secret = mysecret (this is the password to use in astman)
;read = system,call,log,verbose,command,agent,user,config
;write = system,call.log,verbose,command,agent,user,config

so it would look like :

[mark] (this is the username to use in the astman)
secret = mysecret (this is the password to use in astman)
read = system,call,log,verbose,command,agent,user,config
write = system,call.log,verbose,command,agent,user,config 

Save the file.

You will also need to restart Asterisk. To do this, from the CLI prompt, type



Once restarted, on the CLI prompt of Asterisk, you can type manager show users which will tell you what manager users are configured, hence ours is mark with password mysecret.

Now bring up a new terminal window, su to root, then type:

/usr/sbin/astman localhost

username = mark
password = mysercet

Make a call to 1000 and you will see your call there.

You can also use the web version called AJAM:


Aynchronous Javascript Asterisk Manager (AJAM)

AJAM is a new technology available in Asterisk 1.4 which allows web browsers or other HTTP enabled applications and web pages to directly access the Asterisk Manager Interface (AMI) via HTTP. Setting up your server to process AJAM involves a few steps:

Set up the Asterisk HTTP server:

1) Uncomment the line enabled=yes in /etc/asterisk/http.conf to enable Asterisk's built-in micro HTTP server.

2) If you want Asterisk to actually deliver simple HTML pages, CSS, JavaScript, etc. you should uncomment enablestatic=yes

3) Adjust your bindaddr and bindport settings as appropriate for your desired accessibility or leave them as default.

4) Adjust your prefix if appropriate, which must be the beginning of any URI on the server to match. The default is asterisk and the rest of these instructions assume that value.

Allow Manager Access via HTTP

1) Make sure you have both enabled = yes and webenabled = yes set up in /etc/asterisk/manager.conf.

2) You may also use httptimeout to set a default timeout for HTTP connections.

3) Make sure you have a manager username/secret.

Once these configuration changes are complete you can reload or restart Asterisk and you should be able to point your web browser to specific URI's which will allow you to access various web functions. A complete list can be found by typing show http at the Asterisk CLI.



This logs you into the manager interface's "HTML" view. Once you're logged in, Asterisk stores a cookie on your browser (valid for the length of httptimeout) which is used to connect to the same session.


Assuming you've already logged into manager, this URI will give you a "raw" manager output for the "status" command.


This will give you the same status view but represented as AJAX data, theoretically compatible with RICO (


If you have enabled static content support and have done a make install, Asterisk will serve up a demo page which presents a live, but very basic, "astman" like interface. You can login with your username/secret for manager and have a basic view of channels as well as transfer and hangup calls. It's only tested in Firefox, but could probably be made to run in other browsers as well.

A sample library (astman.js) is included to help ease the creation of manager HTML interfaces.

Note that for the demo, there is no need for *any* external web server.

Share this page:

11 Comment(s)

Add comment


From: at: 2007-09-27 14:17:38

" 4) Start installing the different packages by following theses commands, again, as root:

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

 Maybe this can help someone:

yum install kernel-devel

will do the dirty job of installing kernel sources on red-hat-like systems (CentOS,Fedora..)


From: Anonymous at: 2009-12-18 15:55:38

hi all

i am new to  Asterisk  can anyone help to find good and compatable anolog phone cards for  Asterisk


From: at: 2009-07-08 15:01:03


 When I run the ./configure on /usr/src/asterisk it finishes with "configure: error: *** termcap support not found" and then I get stuck.... meaning when I try to run "make menuselect" says to run ./configure before running make. I get that but I don't get how to overpass the ./confgure error.

Any help welcome.


From: x81kilo at: 2010-12-14 20:40:15

n00b here:

 what other hardware is needed? can you recommend some place on the net to get it cheap?

 how to dial out to talk to my mom in florida from california? i have old sip equipment when i had vonage, and other voip providers, can i use that hardware?


many thanks!


From: at: 2011-04-01 06:45:08

Let me suggest for Asterisk users a new software invention which maches perfectly to Asterisk.
The name of the software: Ozeki Webphone. I have experienced they compose an excellent IT system; they compose a perfect VoIP technology system. You can check the solution
Share your opinion!

From: at: 2011-05-29 18:10:14

Thanks for the guide.  Still works well on my recent install. 

Just one problem I had (as do many others from the various comments) - on logging in to the Manager I got the message "The GUI does not have necessary privileges! -  Please check the manager permissions for the user!".  I think this is because the Asterisk configuration directory in /etc does not have the permissions of the user running Asterisk.  Almost certainly the directory is owned by root but Asterisk is running under asterisk. So just change the directory permissions to the Asterisk user.  Probably:- 

 sudo chown asterisk:asterisk /etc/asterisk

You may need to check the files in the directory are also owned by the Asterisk user. 

From: Anonymous at: 2012-02-10 06:16:47

Still I am not able to open the full web GUI of the Asterisk. Can you help me please?


From: Paul at: 2012-06-12 15:37:28

I had the same issue but was able to resolve it by not only changing the rights to the asterisk but giving full access to the user asterisk.

From: Samad at: 2012-10-05 00:35:44

i was having the same error (Not found).

Then i uncomment on http.conf 

redirect = / /static/config/index.html

then save and close

then restart the asterisk service (service asterisk restart)

then i point the http://my-server-ip:8088 

hola . its comes the AMI Page.


From: pascale at: 2012-09-14 12:42:52

404 Not Found

The requested URL was not found on this server.

asterisk server

what should i do?

From: Anonymous at: 2013-12-14 19:50:45

Hello everyone's

my problem is, i do have a server running on the cloud with ubuntu 12.04 32 bits and lamp already installed asterisk 1.8 i do follow those steps to install asterisk gui but at the end i get on http://myserver:8088/static/config/index.html or http://myserver:8088/asterisk/static/config/index.html  or http://myserver:8088/asterisk/static/config/cfgbasic.html the next

Not Found

The requested URL was not found on this server.

Asterisk Server

i do  make checkconfig on the folder asterisk-gui installed in /usr/src/ and i get this 

 --- Checking Asterisk configuration to see if it will support the GUI ---

* Checking for http.conf: OK

* Checking for manager.conf: OK

* Checking if HTTP is enabled: OK

* Checking if HTTP static support is enabled: OK

* Checking if manager is enabled: OK

* Checking if manager over HTTP is enabled: OK

 --- Everything looks good ---

 * GUI should be available at http://myserver:8088/asterisk/static/config/index.html 

but it's not there