CENTOS and Asterisk Install Part 1
- Download CENTOS 6.6 Minimal Install ISO
- Burn to CD/DVD
- Boot PC on CD/DVD
- Install OS
- After Install reboot
- Change hostname
- Setup Network
A. cd /etc/sysconfig/network-scripts
B. change ifcfg-eth0 file to reflect like the following example below. Your UUID and HWADDR should not be changed. Below is just example.
DEVICE=eth0
HWADDR=00:12:3F:B8:CD:FF
TYPE=Ethernet
UUID=d960e22d-214f-450c-b017-a3ad590bb225
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.1.10
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
BROADCAST=192.168.1.255
DNS1=192.168.1.1
DNS2=8.8.8.8
8. Restart network services
- run ifconfig, ping from remote machine to server, and ping google.com from server to verify
- now you can ssh in from your workstation
- update new install
- disable SELinux
Edit /etc/selinux/config and chang to:
SELINUX=disabled - Stop iptables
- Prevent iptables from auto starting
- Reboot
CENTOS and Asterisk Install Part 2
- Installation of Basic Dependencies
Asterisk 11.x.x requires some prerequisite dependencies. Here is the command line to install them:
- Downloading Your Asterisk Source Code
Move to directory /usr/src by given command:
Now download the Source Code tar balls using these commands (one by one or at a time):
[code]# wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz[/code]
- Extraction of Downloaded Files
Extract the downloaded tar balls to their corresponding directories using:
[code]# tar zxvf dahdi-linux-complete*
tar zxvf libpri*
tar zxvf asterisk*[/code]
- DAHDI Installation
DAHDI (Digium Asterisk Hardware Device Interface) can be installed using the command line:
[code]# cd /usr/src/dahdi-linux-complete*
make && make install && make config[/code]
- LibPRI Installation
In order to enable your BRI, PRI and QSIG based hardware, you will be needing PRI Library or LibPRI. You can install these libraries using:
[code]# cd /usr/src/libpri*
make && make install[/code]
- Changing Asterisk Directory
Now you have to move back to the Asterisk Installation Directory:
- Running Configure Script for Asterisk
At this point, you need to know your CentOS 6 Architecture (32 or 64 Bit). In many cases you are aware of it. In case you are not, try this command:
For 32 Bit, you will be getting response like:
2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:23:01 EDT 2011 i686 i686 i386 GNU/Linux
For 64 Bit, system will respond with something like:
2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
Based on your OS Architecture, go ahead with these commands for Asterisk Configuration Script. During the process the asterisk build menu may be displayed. Simply press the esc key one time to exit and continue the install.
For 32 Bit:
For 64 Bit:
- Installing Sample Files
Sample files are great resource especially for the newbies. Install Sample Files using:
Once done, add the Asterisk Install Script in directory /etc/init.d/ using:
# make config[/code]
12. Starting DAHDI
To start DAHDI Device Drivers, use:
[code]#service dahdi start[/code]
13. Start Asterisk
Finally, start Asterisk:
[code]#service asterisk start[/code]
14. reboot
[code]# reboot[/code]
CENTOS and Asterisk Install Part 3 setting up DAHDI
I am using the Digium Wildcard TE110P T1/E1 Card into an Adtran 908E. The Adtran has a SIP trunk to a CLEC. The T1/PRI card in the Asterisk server is used deliver 23 phone channels (1 channel out of the 24 is used for clocking) to/from the Adtran/Asterisk.
Generate system.conf file by running:
[code]# /usr/sbin/dahdi_genconf[/code]
My /etc/dahdi/system.conf has the following
[code]# Autogenerated by /usr/sbin/dahdi_genconf on Sun Dec 28 23:00:55 2014
# If you edit this file and execute /usr/sbin/dahdi_genconf again,
# your manual changes will be LOST.
# Dahdi Configuration File
#
# This file is parsed by the Dahdi Configurator, dahdi_cfg
#
# Span 1: WCT1/0 "Digium Wildcard TE110P T1/E1 Card 0" (MASTER) ESF/B8ZS
span=1,1,0,esf,b8zs
# termtype: te
bchan=1-23
dchan=24
echocanceller=mg2,1-23
# Global data
loadzone = us
defaultzone = us[/code]
As it says the above file, “Autogenerated by /usr/sbin/dahdi_genconf”. And “If you edit this file and execute /usr/sbin/dahdi_genconf again, your manual changes will be LOST.”
Now make sure your /etc/asterisk/chan_dahdi.conf has the following, add to end of file: (This will create the channels for you)
[code]context=from-test
switchtype=national
siganling=pri_cpe
group=1
channel => 1-23[/code]
Now stop and start DAHDI and asterisk
[code]# service asterisk stop
Stopping safe_asterisk: [ OK ]
Shutting down asterisk: [ OK ]
# service dahdi stop
Unloading DAHDI hardware modules: done
# service dahdi start
Loading DAHDI hardware modules:
wct4xxp: [ OK ]
wcte43x: [ OK ]
wcte12xp: [ OK ]
wcte13xp: [ OK ]
wct1xxp: [ OK ]
wcte11xp: [ OK ]
wctdm24xxp: [ OK ]
wcaxx: [ OK ]
wcfxo: [ OK ]
wctdm: [ OK ]
wcb4xxp: [ OK ]
wctc4xxp: [ OK ]
xpp_usb: [ OK ]
D: auto '/sys/bus/dahdi_devices/devices/pci:0000:04:00.0'
auto-assign /sys/bus/dahdi_devices/devices/pci:0000:04:00.0
Running dahdi_cfg: [ OK ]
# service asterisk start
Starting asterisk:[/code]
Now lets verify
[code]# lsdahdi
### Span 1: WCT1/0 "Digium Wildcard TE110P T1/E1 Card 0" (MASTER) ESF/B8ZS
1 PRI Clear (EC: MG2 - INACTIVE)
2 PRI Clear (EC: MG2 - INACTIVE)
3 PRI Clear (EC: MG2 - INACTIVE)
4 PRI Clear (EC: MG2 - INACTIVE)
5 PRI Clear (EC: MG2 - INACTIVE)
6 PRI Clear (EC: MG2 - INACTIVE)
7 PRI Clear (EC: MG2 - INACTIVE)
8 PRI Clear (EC: MG2 - INACTIVE)
9 PRI Clear (EC: MG2 - INACTIVE)
10 PRI Clear (EC: MG2 - INACTIVE)
11 PRI Clear (EC: MG2 - INACTIVE)
12 PRI Clear (EC: MG2 - INACTIVE)
13 PRI Clear (EC: MG2 - INACTIVE)
14 PRI Clear (EC: MG2 - INACTIVE)
15 PRI Clear (EC: MG2 - INACTIVE)
16 PRI Clear (EC: MG2 - INACTIVE)
17 PRI Clear (EC: MG2 - INACTIVE)
18 PRI Clear (EC: MG2 - INACTIVE)
19 PRI Clear (EC: MG2 - INACTIVE)
20 PRI Clear (EC: MG2 - INACTIVE)
21 PRI Clear (EC: MG2 - INACTIVE)
22 PRI Clear (EC: MG2 - INACTIVE)
23 PRI Clear (EC: MG2 - INACTIVE)
24 PRI HDLCFCS
# dahdi_scan
[1]
active=yes
alarms=OK
description=Digium Wildcard TE110P T1/E1 Card 0
name=WCT1/0
manufacturer=Digium
devicetype=Digium Wildcard TE110P T1/E1
location=PCI Bus 04 Slot 01
basechan=1
totchans=24
irq=0
type=digital-T1
syncsrc=0
lbo=0 db (CSU)/0-133 feet (DSX-1)
coding_opts=B8ZS,AMI
framing_opts=ESF,D4
coding=B8ZS
framing=ESF[
Now from asterisk console do:
[code]# asterisk -r
localhostCLI> dahdi show status
Description Alarms IRQ bpviol CRC Fra Codi Options LBO
Digium Wildcard TE110P T1/E1 Card 0 OK 8 0 0 ESF B8ZS 0 db (CSU)/0-133 feet (DSX-1)
localhostCLI>
localhost*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked State Description
pseudo default default In Service
1 from-test default In Service
2 from-test default In Service
3 from-test default In Service
4 from-test default In Service
5 from-test default In Service
6 from-test default In Service
7 from-test default In Service
8 from-test default In Service
9 from-test default In Service
10 from-test default In Service
11 from-test default In Service
12 from-test default In Service
13 from-test default In Service
14 from-test default In Service
15 from-test default In Service
16 from-test default In Service
17 from-test default In Service
18 from-test default In Service
19 from-test default In Service
20 from-test default In Service
21 from-test default In Service
22 from-test default In Service
23 from-test default In Service
[/code]
That’s it folks. Edit your /etc/asterisk/sip.conf and /etc/asterisk/extensions.conf files and get your phones registered.
CENTOS and Asterisk Install Part 4 Setting up Phones
Edit /etc/asterisk/sip.conf and add the example below, to bottom of file. Substitute phone number you will be using
[6026351111]
type=friend
callerid=“Asterisk 100” 6026351111
secret=password
context=internal
host=dynamic
allow=all
dtmfmode=rfc2833
Edit /etc/asterisk/extensions.conf and add the following to end of file
[internal]
;used to pass special character’s to DAHDI (T1/PRI)
exten => _[#0-9]!,1,Dial(DAHDI/g1/${EXTEN})
exten => _[#0-9]!,n,Hangup
;used to pass numbers dialed to DAHDI (T1/PRI)
exten => _X.,1,Dial(DAHDI/g1/${EXTEN})
exten => _X.,n,Hangup
;used to pass extension dialed, 100, to registered phone of 6026351111
exten => 100,1,Dial(SIP/6026351111,20)
exten => 100,n,Playback(vm-goodbye)
exten => 100,n,Hangup
;this is what we used in chan_dahdi.conf
[from-test]
exten => 6026356915,1,Dial(SIP/6026356915,20)
exten => 6026356915,n,Playback(vm-goodbye)
exten => 6026356915,n,Hangup
Go to the asterisk console:
asterisk –r
Issue command:
localhost*CLI> core reload
This will reload asterisk modules and reflect your changes.
Setup phone and register. Verify by:
localhost*CLI> sip show peers
Watch messages with
localhost*CLI> core set verbose 99