Step 1 硬件安装
先从底层硬件驱动开始安装.开机以后直接运行dahdi_cfg,结果如下.
$ _cfg -vv
DAHDI Tools Version - 2.2.0
Notice: Configuration file is /etc/dahdi/system.conf
line 0: Unable to open master device '/dev/dahdi/ctl'
1 error(s) detected
运行asterisk,察看dahdi的status和channels情况,结果如下.
*CLI> dahdi show status
Description Alarms IRQ bpviol CRC4 Fra Codi Options LBO
Digium Wildcard
T1/E1 Card 0 UNCONFI 0 0 0 CAS Unk YEL 0 db (CSU)/0-133 feet (DSX-1)
*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked State
pseudo default default In Service
基本情况完全一样,除了dahdi show status显示的板卡名称变成了Digium Wildcard TE110P T1/E1 Card.
需要注意的是这台机器我成功的安装了DAHDI Complete,所以/etc/dahdi/modules的内容略有不同,所有的板卡代号都有,具体如下.
bash$ cat /etc/dahdi/modules
# Contains the list of modules to be loaded / unloaded by /etc/init.d/dahdi.
#
# NOTE: Please add/edit /etc/modprobe.d/dahdi or /etc/modprobe.conf if you
# would like to add any module parameters.
#
# Format of this file: list of modules, each in its own line.
# Anything after a '#' is ignore, likewise trailing and leading
# whitespaces and empty lines.
# Digium TE205P/TE207P/TE210P/TE212P: PCI dual-port T1/E1/J1
# Digium TE405P/TE407P/TE410P/TE412P: PCI quad-port T1/E1/J1
# Digium TE220: PCI-Express dual-port T1/E1/J1
# Digium TE420: PCI-Express quad-port T1/E1/J1
wct4xxp
# Digium TE120P: PCI single-port T1/E1/J1
# Digium TE121: PCI-Express single-port T1/E1/J1
# Digium TE122: PCI single-port T1/E1/J1
wcte12xp
# Digium T100P: PCI single-port T1
# Digium E100P: PCI single-port E1
wct1xxp
# Digium TE110P: PCI single-port T1/E1/J1
wcte11xp
# Digium TDM2400P/AEX2400: up to 24 analog ports
# Digium TDM800P/AEX800: up to 8 analog ports
# Digium TDM410P/AEX410: up to 4 analog ports
wctdm24xxp
# X100P - Single port FXO interface
# X101P - Single port FXO interface
wcfxo
# Digium TDM400P: up to 4 analog ports
wctdm
# Digium B410P: 4 NT/TE BRI ports
wcb4xxp
# Digium TC400B: G729 / G723 Transcoding Engine
wctc4xxp
# Xorcom Astribank Devices
xpp_usb
修复Error的方法照旧,将/etc/modprobe.d/dahdi.blacklist中wcte11xp那行去掉,重新运行/etc/init.d/dahdi,结果如下.
xiuxiu@sh-c2-pc:/etc/dahdi$ sudo /etc/init.d/dahdi start
Loading DAHDI hardware modules:
WARNING: All config files need .conf: /etc/modprobe.d/dahdi.blacklist, it will be ignored in a future release.
WARNING: All config files need .conf: /etc/modprobe.d/dahdi, it will be ignored in a future release.
wct4xxp: done wcte12xp: done wct1xxp: done wcte11xp: done wctdm24xxp: done wcfxo: done wctdm: done wcb4xxp: done wctc4xxp: done xpp_usb: done
Running dahdi_cfg: done.
xiuxiu@sh-c2-pc:/etc/dahdi$ sudo dahdi_cfg -vv
DAHDI Tools Version - 2.2.0
DAHDI Version: 2.2.0.2
Echo Canceller(s): MG2
Configuration
======================
SPAN 1: CCS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1)
Channel map:
Channel 01: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 01)
Channel 02: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 02)
Channel 03: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 03)
Channel 04: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 04)
Channel 05: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 05)
Channel 06: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 06)
Channel 07: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 07)
Channel 08: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 08)
Channel 09: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 09)
Channel 10: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 10)
Channel 11: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 11)
Channel 12: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 12)
Channel 13: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 13)
Channel 14: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 14)
Channel 15: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 15)
Channel 16: D-channel (Default) (Echo Canceler: none) (Slaves: 16)
Channel 17: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 17)
Channel 18: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 18)
Channel 19: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 19)
Channel 20: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 20)
Channel 21: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 21)
Channel 22: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 22)
Channel 23: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 23)
Channel 24: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 24)
Channel 25: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 25)
Channel 26: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 26)
Channel 27: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 27)
Channel 28: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 28)
Channel 29: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 29)
Channel 30: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 30)
Channel 31: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 31)
31 channels to configure.
Setting echocan for channel 1 to mg2
Setting echocan for channel 2 to mg2
Setting echocan for channel 3 to mg2
Setting echocan for channel 4 to mg2
Setting echocan for channel 5 to mg2
Setting echocan for channel 6 to mg2
Setting echocan for channel 7 to mg2
Setting echocan for channel 8 to mg2
Setting echocan for channel 9 to mg2
Setting echocan for channel 10 to mg2
Setting echocan for channel 11 to mg2
Setting echocan for channel 12 to mg2
Setting echocan for channel 13 to mg2
Setting echocan for channel 14 to mg2
Setting echocan for channel 15 to mg2
Setting echocan for channel 16 to none
Setting echocan for channel 17 to mg2
Setting echocan for channel 18 to mg2
Setting echocan for channel 19 to mg2
Setting echocan for channel 20 to mg2
Setting echocan for channel 21 to mg2
Setting echocan for channel 22 to mg2
Setting echocan for channel 23 to mg2
Setting echocan for channel 24 to mg2
Setting echocan for channel 25 to mg2
Setting echocan for channel 26 to mg2
Setting echocan for channel 27 to mg2
Setting echocan for channel 28 to mg2
Setting echocan for channel 29 to mg2
Setting echocan for channel 30 to mg2
Setting echocan for channel 31 to mg2
OK.到了这里硬件驱动安装部分就应该没问题了.

Step 2 配置Asterisk

因为换了一台机器,所以需要在chan_dahdi.conf中加入如下语句.
#include
重新运行asterisk,察看结果.
*CLI> dahdi show status
Description Alarms IRQ bpviol CRC4 Fra Codi Options LBO
Digium Wildcard TE110P T1/E1 Card 0 RED 1 0 0 CCS HDB3 CRC4 0 db (CSU)/0-133 feet (DSX-1)
*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked State
pseudo default default In Service
1 from-pstn default In Service
2 from-pstn default In Service
3 from-pstn default In Service
4 from-pstn default In Service
5 from-pstn default In Service
6 from-pstn default In Service
7 from-pstn default In Service
8 from-pstn default In Service
9 from-pstn default In Service
10 from-pstn default In Service
11 from-pstn default In Service
12 from-pstn default In Service
13 from-pstn default In Service
14 from-pstn default In Service
15 from-pstn default In Service
17 from-pstn default In Service
18 from-pstn default In Service
19 from-pstn default In Service
20 from-pstn default In Service
21 from-pstn default In Service
22 from-pstn default In Service
23 from-pstn default In Service
24 from-pstn default In Service
25 from-pstn default In Service
26 from-pstn default In Service
27 from-pstn default In Service
28 from-pstn default In Service
29 from-pstn default In Service
30 from-pstn default In Service
31 from-pstn default In Service
*CLI>
OK了.到了这里Te110P的E1 PRI线路就通了.你可以配置自己的dial plan,然后修改dahdi-channels.conf中的配置来导入E1线路.Oh yeah~
问题总结
1.无法拨通,Asterisk本身没有debug信息.察看log,发现
ERROR[2077] chan_dahdi.c: Unknown signalling method 'pri_cpe' at line 14.
解决方案:主要原因是你的libpri没有安装好.重新下一个最新的libpri版本重新编译安装,应该就会好.
2.Asterisk有debug信息.但是无法默认接入Default Dialplan,听到”Welcome…”的语音.
主要是被X100P宠坏了,认为就应该直接可以拨入default的dialplan. 修改/etc//dahdi-channels.conf,将context从from-pstn修改成default就可以了.