Bước 1: Cài đặt driver dahdi, pri
DAHDI
wget
http://downloads.digium.com/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
LIBPRI :
wget
http://downloads.digium.com/pub/telephony/libpri/libpri-X.X.current.tar.gz
Bước 2: khai báo thông số cấu hình
vi /etc/modprobe.d/dahdi.conf
options wcte13xp default_linemode=e1
Bước 3: cấu hình
Gõ lệnh:
# modprobe wcte13xp default_linemode=e1
#dahdi_genconf -v
#dahdi_cfg -v (make sure the ouput should show 31 channels)
Nếu cấu hình CRC4 thì vi /etc/dahdi/system.conf
Bước 4: cấu hình asterisk
Mở file vi/etc/asterisk/chan_dahdi.conf thêm
#include dahdi-channels.conf
Bước 5: cấu hình gọi ra
Dialplan to dial via PRI
vi /etc/asterisk/extension.conf
[default] ; the default will already exists in most asterisk installation if not create a new
exten => _9X.,1,Dial(DAHDI/g0/${EXTEN:1},30)
exten => _9X.,2,Hangup()
Note: 9 is just a prefix, and it will be discarded while dialling out
Note: for vicidial /goautodial use below dialplan in dialplan entry or extensions.conf
exten => _9X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9X.,2,Dial(DAHDI/g0/${EXTEN:1},,Tto)
exten => _9X.,3,Hangup
Bước 6: Chỉnh sữa
Kiểm tra thông số luồng
dahdi show staus
pri show spans
Nếu luồng không up thì
Vi chan_dahdi.conf
pridialplan=unknown
prilocaldialplan=unknown
Nếu cuộc gọi vào from-pstn
Vi /etc/asterisk/dahdi-channels.conf
context =from-pstn