Asterisk is an Open Source PBX software comes with built-in features like voicemail, conferencing, IVR, queuing etc. It allows you to make calls to one another which may have connected to other PSTN (Public Switched Telephone Network) and Voice over Internet Protocol (VoIP). Asterisk runs on Linux, BSD, MacOSX and other compatible operating systems.
In this guide, we'll walk you through steps to install and configure basic Asterisk 11 on RHEL 6.4 or earlier, CentOS 6.4 or earlier, Fedora 18,17,16, Ubuntu 12.10 or earlier, Linux Mint 14/13 and Debian Linux.
Preparation for InstallationFirst, make sure that your system is up-to-date, if not try to update the system and then install dependencies packages using “yum command” and “apt-get command“, before proceeding installation of Asterisk on your system.
On RHEL/CentOS/Fedora# yum -y update
# yum install -y make wget openssl-devel ncurses-devel newt-devel libxml2-devel kernel-devel gcc gcc-c++ sqlite-devel
Turn Off SELinux by changing the line “enforcing” to “disabled” in /etc/selinux/config file.
On Ubuntu / Linux Mint / Debian# su root
# apt-get update && apt-get upgrade -y && reboot
# apt-get install build-essential wget libssl-dev libncurses5-dev libnewt-dev libxml2-dev linux-headers-$(uname -r) libsqlite3-dev
Downloading DAHDI, LibPRI and Asterisk TarballsDownload the source tarballs, these following commands will download current release of DAHDI 2.6, LibPRI 1.4 and Asterisk 11.
# cd /usr/src/
# wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
Next, extract the files from source tarballs using “tar command” as shown below.
# tar zxvf dahdi-linux-complete-current.tar.gz # tar zxvf libpri-1.4-current.tar.gz # tar zxvf asterisk-11-current.tar.gz
Configuring, Compiling And InstallingGo to the each directory from where you have downloaded and extracted the packages and start running the following commands to install DAHDI, LibPRI and Asterisk.
# cd /usr/src/dahdi-linux-complete-2.6.2+2.6.2/ # make && make install && make config
# cd /usr/src/libpri-1.4.14/ # make && make install
Installing AsteriskNext, run the “configure” script will vary depending upon whether your system is 32-bit or 64-bit. In the middle, when “menuselect” command executes, select your desired options and then hit “Save and Exit” option and the installation will continuous.
Run this command if you’re installing Asterisk on a 32-bit OS.
# cd /usr/src/asterisk-11.3.0/
# ./configure && make menuselect && make && make install && make samples && make config
Run this command if you’re installing Asterisk on a 64-bit OS.
# cd /usr/src/asterisk-11.3.0/
# ./configure --libdir=/usr/lib64 && make menuselect && make && make install && make samples && make config
Following are the some Asterisk configuration files and their locations.
- /etc/asterisk/ – configuration files.
- /var/lib/asterisk/ – contains images, firmware, keys, sounds sample files.
- /usr/lib/asterisk/modules/ – contains all loadable modules.
Starting DAHDI and Asterisk ServicesEnable the DAHDI and Asterisk services at system boot time.
# chkconfig dahdi on # chkconfig asterisk on
Start the DAHDI and Asterisk.
# service dahdi start # service asterisk start
Connecting to Asterisk CLIRun the following command to connect to the Asterisk CLI.
# asterisk -rvvvvv Asterisk 11.3.0, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <firstname.lastname@example.org> 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 11.3.0 currently running on tecmint (pid = 1820) tecmint*CLI>
Asterisk Console CommandsIt’s similar to IOS. From Asterisk terminal anytime you can use ‘Tab key‘ or type ‘?‘ for help or command auto complete.
! acl ael agent agi aoc
cdr cel channel cli confbridge config
data database devstate dialplan dnsmgr dundi
features file group hangup help http
local logger manager mgcp minivm mixmonitor
no originate parkedcalls phoneprov presencestate pri
reload rtcp rtp say sip skinny
udptl ulimit unistim voicemail
Useful Commands from Asterisk CLI
- restart gracefully – Restart Asterisk gracefully.
- restart now – Restart immediately.
- restart when convenient – Restart Asterisk when call is empty.
- reload – Configuration reload.
- stop gracefully – Gracefully Asterisk shutdown.
- stop now – Shutdown immediately.
- stop when convenient – Shutdown Asterisk when call is empty.
You might be interested in setting up interactive voice response (IVR) for your environment