LinuxMoz

Linux Stuff && Coffee

Asterisk CentOS 6 Install Guide

| Comments

This guide explains step by step how to install Asterisk on CentOS 6 / RHEL 6 x86_64. I have also included a video tutorial, if you run Ubuntu server then check out my Ubuntu Asterisk 10 Tutorial.

Asterisk is an enterprise level telephone system that uses real desk phones capable of seamlessly calling normal phones. An Asterisk VoIP PBX can connect to existing ISDN30e / POTS telephone lines or over the Internet via a ITSP using SIP IAX protocols.

This tutorial assumes you have a working CentOS 6 (or RHEL) server instance to work with, if you don’t follow my guide on how to install CentOS, use the minimal server install as suggested.

I Don’t use GUI’s (especially on Asterisk Servers)

I do not install a GUI (X Windows or web based) on Asterisk servers, it’s a waste resources and is simply not required. So just to be clear, this tutorial will walk you through the installation of a minimal CentOS / RHEL instance running Asterisk, this is not a guide for setting up Trixbox or Elastix.

I have tried using other GUI based distro’s over the years, such as Trixbox & Elastix (my thought being I could train other admin’s to use the inteterface), however I found them more trouble and far less reliable.

Asterisk CentOS 6 Install Guide (Asterisk 1.8)

Before we install Asterisk on CentOS we need to update the system & reboot:

Update CentOS / RHEL & Reboot
1
yum update && init 6

Install wget to pull down Asterisk:

1
yum install wget

Download Asterisk 1.8 & DAHDI Tools:

1
wget https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.5.0.tar.gz && wget https://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.5.0+2.5.0.tar.gz

Asterisk & DAHDI Tools need extracting, to extract the tar.gz

1
tar -xvzf asterisk-1.8* && tar -xvzf dahdi-linux-complete-*

Install dependencies so we can compile Asterisk 1.8

1
yum install kernel-devel gcc make gcc-c++ libxml2-devel

Your Asterisk 1.8 deps should look similar to:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Dependencies Resolved

================================================================================
 Package              Arch        Version                    Repository    Size
================================================================================
Installing:
 gcc                  x86_64      4.4.4-13.el6               base          10 M
 gcc-c++              x86_64      4.4.4-13.el6               base         4.7 M
 kernel-devel         x86_64      2.6.32-71.29.1.el6         updates      6.5 M
 libxml2-devel        x86_64      2.7.6-1.el6                base         1.1 M
 make                 x86_64      1:3.81-19.el6              base         389 k
Installing for dependencies:
 cloog-ppl            x86_64      0.15.7-1.2.el6             base          93 k
 cpp                  x86_64      4.4.4-13.el6               base         3.7 M
 glibc-devel          x86_64      2.12-1.7.el6_0.5           updates      961 k
 glibc-headers        x86_64      2.12-1.7.el6_0.5           updates      592 k
 kernel-headers       x86_64      2.6.32-71.29.1.el6         updates      991 k
 libgomp              x86_64      4.4.4-13.el6               base         108 k
 libstdc++-devel      x86_64      4.4.4-13.el6               base         1.5 M
 mpfr                 x86_64      2.4.1-6.el6                base         157 k
 pkgconfig            x86_64      1:0.23-9.1.el6             base          70 k
 ppl                  x86_64      0.10.2-11.el6              base         1.3 M
 zlib-devel           x86_64      1.2.3-25.el6               base          43 k

Transaction Summary
================================================================================
Install      16 Package(s)
Upgrade       0 Package(s)

Total download size: 32 M
Installed size: 90 M
Is this ok [y/N]: y

Next, install Perl & Ncurses Development

1
yum install perl ncurses-devel

Build DAHDi Tools

It’s crucial that you build DAHDi first so that you can build Asterisk with support for confrence rooms & other DAHDI specific functionality:

1
2
3
4
cd  dahdi-linux-complete*
make all
make install
make config

For this tutorial I am only going to be using SIP trunks. If you have are using cards / hardware you might want to check out /etc/dahdi/system.conf and /etc/asterisk/chan_dahdi.conf

Start DAHDi at Boot:

1
2
chkconfig dahdi on
service dahdi start

Build Asterisk 1.8 on CentOS

Time to build Asterisk!

1
2
3
cd asterisk-*
make clean
./configure

Configure your Asterisk Server options and install:

1
2
3
make menuselect
make
make install

Install sample config files in /etc/asterisk and set Asterisk to start at boot:

1
2
3
make samples
make config
chkconfig asterisk on

Start Asterisk:

1
asterisk -vvvvc

Stop Asterisk Core with:

1
core stop now

If Asterisk does not run chances are you made a mistake, it happens. Check you have followed my guide exactly and start again from scratch if necessary.

Now you know Asterisk runs correctly you can start the service with:

1
/etc/init.d/asterisk start

Comments