1,安装卡。
1.1)关闭计算机并拔掉电源线;
1.2)取出TDM400P卡插入计算机的PCI插槽(5V or 3V);
1.3)启动计算机。
2,安装Linux系统
# 使用 yum 程序安装所需开发包(以下为标准的 RPM 包名称)
yum install gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel
3,安装subverion
# yum -y install subversion
4,安装asterisk
检查最新版本的SVN:
# cd /usr/src
# svn checkout asterisk-1.2
# svn checkout zaptel-1.2
# svn checkout libpri-1.2
# cd zaptel-1.2
# make clean ;去除一些生成的二进制文件
# make install
# cd ../libpri-1.2
# make clean
# make install
# cd ../asterisk-1.2
# make clean
# make install
# make samples
5,编辑zaptel.conf文件
fxsks=2
loadzone = no
defaultzone=no
6,启动和检查硬件卡
驱动错误或者配置错误,我们需要一步一步排查,首先用 lspci 命令确认系统识别到了我们的硬件:
装载wctdm驱动,你需要运行
# modprobe wctdm
/sbin/ztcfg –vv
解决问题
CentOS:lspci
00:0d.0 Communication controller: Tiger Jet Network Inc. Tiger3XX Modem/ISDN interface
如果没有这种 Communication controller,那肯定是硬件错误,系统根本没发现插入了通讯卡。
如果硬件是正常的,那么我们可能需要检查必须的 zaptel 模块是否加载,用 lsmod 命令:
CentOS:lsmod|grep zaptel
zaptel 196132 4 zttranscode,wcfxo
#modprobe zaptel
#modprobe tor2(输入这个命令之后有可能会报错,没有关系,再输入一次即可)
执行 ztcfg -v ;使之生效
zttool ;可以查看到该卡状态.或者使用zap show status察看连接状态
7,编辑zapata.conf
[trunkgroups]
; define any trunk groups
[channels]
; hardware channels
; default
usecallerid=yes
hidecallerid=no
callwaiting=no
threewaycalling=yes
transfer=yes
echocancel=yes
echotraining=yes
; define channels
context= incoming; Incoming calls go to [incoming] in extensions.conf
signalling=fxs_ks ; Use FXS signalling for an FXO channel
channel => 2 ; PSTN attached to port 2
8,sip.conf配置
[general]
context=default
srvlookup=yes
[john]
type=friend
secret=welcome
allow=all
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=john
[johy]
type=friend
secret=welcome
allow=all
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=johy
9,extension.conf配置
[globals]
OUTBOUNDTRUNK=Zap/2
[incoming]
exten => s,1,Dial(SIP/tim,20)
exten => s,2,Playback(vm-nobodyavail)
exten => s,102,Dial(SIP/johy,10)
exten => s,103,Playback(vm-nobodyavail)
exten => i,1,Playback(pbx-invalid)
exten => i,2,Goto(incoming,s,1)
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup()
[john]
include => outbound-local
include => outbound-long-distance
exten => s,1,Answer()
exten => s,2,Playback(vm-nobodyavail)
exten => 200,1,Dial(SIP/johy,20)
exten => 200,2,Playback(vm-nobodyavail)
exten => 612,1,Echo()
[johy]
include => outbound-local
include => outbound-long-distance
exten => s,1,Answer()
exten => s,2,Playback(vm-nobodyavail)
exten => 200,1,Dial(SIP/john,20)
exten => 200,2,Playback(vm-nobodyavail)
exten => 612,1,Echo()
[outbound-long-distance]
exten => _91NXXNXXXXXX,1,Dial(${OUTBOUNDTRUNK}/${EXTEN:1})
exten => _91NXXNXXXXXX,2,Congestion( )
exten => _91NXXNXXXXXX,102,Congestion( )
[outbound-long-distance]
exten => _91NXXNXXXXXX,1,Dial(${OUTBOUNDTRUNK}/${EXTEN:1})
exten => _91NXXNXXXXXX,2,Congestion( )
exten => _91NXXNXXXXXX,102,Congestion( )
john 可以拨打长途,200可以拨号给johy
exten => 1205,1,Wait(2)
exten => 1205,2,Record(/tmp/asterisk-recording:gsm)
exten => 1205,3,Hangup
可以用来录制声音。欢迎词的功能。
阅读(901) | 评论(0) | 转发(0) |