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:

Suggested articles

11 Comment(s)

Add comment



" 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..)


By: Anonymous

hi all

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




 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.


By: x81kilo

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!



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!

By: Arul kumar

I am new in asterisk can you tell me how to install browser in trixbox ...

By: Dimitris

Hi and thanks for your guide and time spent for it.

I have a problem. i followed this with copy/paste but i stop at make samples.

I get make: *** No rule to make target `samples'. Stop.

Can anyone help on this please?

Thank You!

By: Alok


I have installed Asterisk and the SVN asterisk trunk on my CentOS 7.0. Every test is going fine. Checked 'manager show settings' and check 'check http status' . every thing same as asterisk Tutorial. telnet is also working on myip:8088. But I am getting error- The URL not found on asterisk Server. I am using this URL- http://IP:8088/asterisk/static/config/cfgbasic.html . Please help to resolve this.

By: Kedves Elemer

There are 3 ways to connect with Web SIP clients to Asterisk:

-Native SIP/JAX clients (using Java or NPAPI)

-Flash (via a Flash media server)

-WebRTC (supported by modern browsers and preferred nowadays)

By: Jacob

New to Asterisk. If you already have an asterisk server running (which i inherited from previous IT) would you be able to install the asterisk gui on a centos system with out disrupting the current configuration. I am in desperate need of the GUI as I am very new to asterisk but the client is requesting changes. As they are running 1.8 and is it going to create issues to install the 2.0 GUI on 1.8 version of Asterisk? Any help would be appreciated.

By: Peter Folk

To get this to work on Asterisk 1.13 I had to manually add "config_upgraded = no" to the [general] section of guipreferences.conf.  The gui asks asterisk manager to update that config parameter to = yes, but the "update" action fails because it doesn't exist yet.