Académique Documents
Professionnel Documents
Culture Documents
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).
root
password
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
You should already have all of the needed packages installed. (You may also see some updated
versions of the libraries under “Available Packages”.)
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.
In the terminal window where you are logged in as root, change directories to
# cd /usr/src
# ls l
Software Version
asterisk-
libpri-
dahdi-linux-complete
# ls -l
asterisk-1.6.x
libpri-1.4.x
dahdi-linux-complete-2.x
1. libpri
2. DAHDI
3. asterisk
# cd libpri1.4.x
# make clean
# make install
# cd ..
# cd dahdilinuxcomplete2.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 asterisk1.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.
# 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
# reboot
# lsmod | grep dahdi
dahdi_dummy 7248 0
dahdi 184580
dahdi_dummy,xpp,wctdm,wcfxo,wctdm24xxp,wcte11xp,wct1xxp,wcte12xp,wct4xxp
crc_ccitt 5760 1 dahdi
# asterisk r
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>
CLI> stop now
# /etc/rc.d/init.d/asterisk stop
or
# service asterisk stop
# asterisk
# /etc/rc.d/init.d/asterisk start
or
# service asterisk start
To connect to Asterisk so you can access the Command Line Interface (CLI) type:
# asterisk vvvr
CLI> help
Shift+PageUP and Shift+PageDown will allow you to scroll the screen through the list.
CLI> help stop
CLI> help stop now
Find out about the applications in Asterisk by issuing the following command:
CLI> core show applications
CLI> core show application dial
CLI> core show functions
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
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: