Asterisk installation steps It is recommended to use the most recent version of Asterisk, Dahdi and libpri for the best result.
Libpri
DAHDI
wget http://downloads.digium.com/pub/telephony/ dahdi-linux-complete/dahdi-linux-complete- current.tar.gz
tar -zxvf dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete-X.X.X+X.X.X
make all
make install
make config
Asterisk
Asterisk Files and Directories
After proper installation asterisk files can be seen in following locations.
Starting Asterisk
After installing asterisk use the following commands for starting and stopping and restarting the application.
Asterisk CLI
Following is the command to connect to asterisk's CLI and some common CLI commands.
asterisk -vvvr
core stop now
core set verbose 5
core set debug 5
Adding a phone to Asterisk
Edit the channel configuration fie for the phone type used.
SIP based VoIP phone
Analog phone
Adding SIP phone
Add following configuration to /etc/asterisk/sip.conf
[name] ; Account name
type=friend ; Account type
host=dynamic ; How to register
context=users ; Context name
secret=secret ;Account password
Next add extension to /etc/asterisk/extensions.conf under users contextwhich directs calls to new phone.
Exten => 500,1,Dial(SIP/name,30) ;Ring cdac for 30 seconds
Next configure the soft phone or the IP phone with same settings and register it with the asterisk server.
Configuring DAHDI and Asterisk for Analog and PRI calls
Two configuration files needed to be changed for getting Analog and Digital cards working with Asterisk.
/etc/dahdi/system.conf
Analog and Digital cards configuration are done in system.conf. Configuration can be entered manually or can be generated automatically by giving the command “dahdi_genconf -v” in command prompt.
Sample code is given below:
span=2,1,0,ccs,hdb3 # Configure to E1 span
bchan=5-19,21-35 # Define Bearer channels
dchan=20 # Define Delta channel
fxoks=1 # FXO signalling for FXS
fxsks=4 # FXS signalling for FXO
echocanceller=mg2,5-19,21-35 ,1,4
group=1 ; FXS port uses FXO signalling
context=users
signalling=fxo_ks
channel => 1
group=2 ; FXO port uses FXS signalling
context=from_outside
signalling=fxs_ks
channel=>4
group=3 ; B-channel in chan_dahdi.conf
echocancel = yes
signalling = pri_cpe
switchtype = euroisdn
context = incoming
channel = 5-19,21-35
Save the configuration files and restart Asterisk for the changes to DAHDI will get affected. For using the analog line alter the extension to send the calls to this phone using the DAHDI line group 1 “DAHDI/g1”. For sending out calls on the analog line alter the dial plan using the DAHDI line group 2 “DAHDI/g2”.
For E1 connection make sure that the link is out of alarm. Use the command line tool dahdi_tool to check E1 card is out of alarms. Once the PRI is up and looking good, alter the dialplan so that the calls are sent across E1 line.