You are on page 1of 7

Asterisk Advanced

Lab Assignment
Module 3

Installing Asterisk:

– Asterisk
– LibPRI
– DAHDI
– Extra Sounds
3.1 - Installing Asterisk
Module 3 – Lab 1
Time Limit: 40 Minutes

Welcome to the first Asterisk Advanced Course lab. The goal of this lab is to get Asterisk and its
related components installed and working. This lab is formatted as a step-by-step guide.
Everything you need to do to build a working Asterisk installation is spelled out in detail. Be
forewarned: future labs build on past labs and the step-by-step guides soon give way to somewhat
less detailed instructions, which ultimately give way to direct challenges (though we do always give
a solution).

Note also that this step-by-step guide gives you all of the steps required to install Asterisk in the
classroom environment on CentOS 5.x Linux. In “the wild” you may run into very different flavors
of Linux: Debian, Slackware, SUSE, Fedora, Ubuntu, Linspire, and hundreds of others, each with
their own quirks. Be prepared to be flexible and dig in when challenged with a new Linux flavor
(or with Mac OS X, BSD Unix, Solaris or any of the multitude of operating systems which support
Asterisk).

In this lab we will:


1. Download, unpack and install Asterisk and DAHDI from tar archives with DAHDI and Asterisk
configured to auto-start.
2. Start Asterisk and confirm that it runs.
3. Use Asterisk to get help.

Step 1: Logging Into Your System

1. If your computer is not already turned on, turn it on.


2. At the CentOS login window in the center of the screen, enter the username:

root

3. Enter the following for the password:

password

4. You should now be in the GNOME window environment.

Step 2: Check Dependencies

In a terminal window (Applications -> System Tools -> Terminal) use yum to check for openssl, zlib,
zlib-devel, and curl dependencies. Don't worry if the versions don't match your system exactly.
The key point is to make sure your system has these libraries already installed.

# yum check-update
# yum -C list ncurses ncurses-devel openssl zlib zlib-devel curl
Setting up repositories
Reading repository metadata in from local files
Installed Packages
curl.i386 7.12.1-5.rhel4 installed
ncurses.i386 5.4-13 installed
ncurses-devel.i386 5.4-13 installed
openssl.i686 0.9.7a-43.2 installed
zlib.i386 1.2.1.2-1.2 installed
zlib-devel.i386 1.2.1.2-1.2 installed

3-2 Digium Asterisk Advanced © 2008 Digium, Inc.


Available Packages
curl.i386 7.12.1-8.rhel4 base
openssl.i386 0.9.7a-43.8 base
openssl.i586 0.9.7a-43.8 base
openssl.i686 0.9.7a-43.8 base

You should already have all of the needed packages installed. (You may also see some updated
versions of the libraries under “Available Packages”.)

Step 3: Download The Asterisk Source Code

This step should have been done for you as part of the installation. If it has not, you can download
the tarballs from the web server at http://192.168.101.1/pub/ and save them in the /usr/src
directory.

Step 4: Untar The Source Code

In the terminal window where you are logged in as root, change directories to

# cd  /usr/src

Determine the versions of the software you have

# ls ­l

Document the versions you have.

Software Version
asterisk-

libpri-

dahdi-linux-complete

Extract the sources from the tarballs.

# tar -zxvf libpri-1.4.x.tar.gz


# tar -zxvf dahdi-linux-complete-2.X.tar.gz
# tar -zxvf asterisk-1.6.x.tar.gz

You should now have the following directories:

# ls -l
asterisk-1.6.x
libpri-1.4.x
dahdi-linux-complete-2.x

Step 5: Compile The Code

The order we want to compile the code is:

1. libpri
2. DAHDI
3. asterisk

© 2008 Digium, Inc. Digium Asterisk Advanced 3-3


To compile and install libpri, do the following steps:

# cd libpri­1.4.x
# make clean
# make install
# cd ..

Next, we'll compile DAHDI.

# cd dahdi­linux­complete­2.x
# make all

Your system will now check to see how your system is configured, and make sure that it can find all
the necessary system libraries to compile DAHDI. It will then compile the DAHDI drivers and
utilities. Now we can install DAHDI:

# make install

Last but not least, we'll install the initscript and sample configuration files.

# make config 
# cd ..

Now that DAHDI has been compiled and installed, we'll compile and install Asterisk. The steps for
Asterisk are slightly more complicated than the ones for DAHDI:

# cd asterisk­1.6.x
# ./configure
# make menuselect

This will bring up a menu to allow you select which modules to compile and which other options to
set.

Please enter the “PBX Modules” menu and DESELECT pbx_ael, then enter the “Extras Sound
Packages” menu and select “EXTRA-SOUNDS-EN-GSM”. Then press F12 to save and exit.

Be sure to save your changes changes.

# make  
# make install 
# make samples (this installs a set of sample config files)
# make config 

# cd ..

Note the step that deselects pbx_ael. This module implements the Alternate Extension Language
which is outside of the scope of the Bootcamp. Not building the module prevents Asterisk from
displaying unnecessary warning and error messages during start-up and when reloading
extensions.conf.

After the next step of rebooting you should have a running Asterisk system!

Step 6: Reboot

At the Linux command prompt, type reboot to reboot your computer.

# reboot

3-4 Digium Asterisk Advanced © 2008 Digium, Inc.


Step 7: Verify Installation

1. Log back in as root


2. Open a terminal window
3. Check if DAHDI is loaded:

# lsmod | grep dahdi

You should see:

dahdi_dummy             7248  0 
dahdi                 184580 
dahdi_dummy,xpp,wctdm,wcfxo,wctdm24xxp,wcte11xp,wct1xxp,wcte12xp,wct4xxp
crc_ccitt               5760  1 dahdi 

4. Is Asterisk running? You can check this by trying to connect to Asterisk.

# asterisk ­r

You should see:

Asterisk 1.6.X, Copyright (C) 1999 ­ 2008 Digium, Inc. and others. 
Created by Mark Spencer <markster@digium.com> 
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. 
This is free software, with components licensed under the GNU General Public 
License version 2 and other licenses; you are welcome to redistribute it under 
certain conditions. Type 'core show license' for details. 
========================================================================= 
Connected to Asterisk 1.6.X currently running on localhost (pid = XXXX) 
Verbosity is at least 3 
localhost*CLI> 

Step 8: Stop Asterisk

There are several methods you can use to stop Asterisk:


For now type the following at the CLI> prompt

CLI> stop now

Or if you are in the Asterisk CLI you can:

CLI> stop gracefully Gracefully shut down Asterisk


CLI> stop now Shut down Asterisk immediately
CLI> stop when convenient Shut down Asterisk at empty call volume

From the UNIX prompt you can:

# /etc/rc.d/init.d/asterisk stop
or
# service asterisk stop

Step 9: Re-Start Asterisk

Asterisk should have started when you rebooted the machine.

From the command line you can start Asterisk with:

# asterisk

© 2008 Digium, Inc. Digium Asterisk Advanced 3-5


Since we issued the command “make config” when we compiled Asterisk, we can also do:

# /etc/rc.d/init.d/asterisk start
or
# service asterisk start

Because of this, Asterisk should start automatically after every reboot.

Step 10: Connecting to Asterisk

To connect to Asterisk so you can access the Command Line Interface (CLI) type:

# asterisk ­vvvr 

Step 11: Integrated Asterisk Help

At Asterisk's CLI you can type:

CLI> help

Shift+PageUP and Shift+PageDown will allow you to scroll the screen through the list.

You can display a shorter list, by saying:

CLI> help stop

To display help on “stop now” type:

CLI> help stop now

Find out about the applications in Asterisk by issuing the following command:

CLI> core show applications

Show help on the dial application

CLI> core show application dial

Find out about functions

CLI> core show functions

Show the help on the LEN function:

CLI> core show function LEN

Find out about the Asterisk Gateway Interface (AGI). AGI allows you to interface with external
programs to control the Asterisk dialplan.

CLI> agi show

And yes, the following works to get help on a specific AGI command:

CLI> agi show send text

3-6 Digium Asterisk Advanced © 2008 Digium, Inc.


Summary

Congratulations. If you have completed the process above, you have a working Asterisk system.
Now the challenge is to make it do what you need/want. In the next section, we will actually get a
phone connected to your Asterisk system and make a call.

You Learned:

1. How to get the Asterisk 1.6 source code.


2. How to use the autoconf (configure) system.
3. How to use the menuselect system to specify build options.
4. How to compile Asterisk, DAHDI, and LibPRI.
5. How to install the compiled components.
6. How to configure DAHDI and Asterisk to auto-start.
7. How to manually start and stop Asterisk.
8. How to get basic Asterisk help.

© 2008 Digium, Inc. Digium Asterisk Advanced 3-7

You might also like