Centos 5.4 下安装和配置 Asterisk 和 Digium 卡
来源:易贤网 阅读:1050 次 日期:2015-04-27 09:46:32
温馨提示:易贤网小编为您整理了“Centos 5.4 下安装和配置 Asterisk 和 Digium 卡”,方便广大网友查阅!

服务器上安装一个 Digium 卡,并安装好驱动

所需要的软件包下载地址

asterisk-11.17.1.tar.gz

libpri-1.4.15.tar.gz

dahdi-linux-complete-current.tar.gz

1,安装依赖包

yum -y install libtermcap-devel libxml2-devel zlib-devel zib sqlite-devel openssl-devel ncurses-devel ncurses kernel-devel

2,安装dahdi驱动

#tar zxf dahdi-linux-complete-current.tar.gz && cd dahdi-linux-complete-current

#cd linux

#make && make install

#cd ../tools

#./configure

#make && make install

#make config #生成启动文件

2,安装libpri

#tar zxf libpri-1.4.15.tar.gz && cd libpri-1.4.15 #需要安装到dahdi后面,才行

#make && make install

3, 安装asterisk

#tar zxf asterisk-11.17.1.tar.gz && cd asterisk-11.17.1

#./configure

#make

#make install

#make samples #生成asterisk 示例配置文件

#make config #生成启动文件

#/etc/init.d/asterisk start

#asterisk -crvvvv #进入控制台

4,配置asterisk -- sip.conf

#cd /etc/asterisk.conf

#cp -pa sip.conf sip.conf.bak

#> sip.conf

#vi sip.conf

[general]

allowguest=yes

allowoverlap=yes

bindport=5060

bindaddr=0.0.0.0

srvlookup=yes

dtfmode=rfc2833

disallow=all

allow=g729

allow=gsm

[sip](!)

type=friend

host=dynamic

nat=no

canreinvite=no

context=demo99

[9901](sip)

username=9901

secret=123456

[9902](sip)

username=9902

secret=123456

5, 配置asterisk -- iax.conf

#cp -pa iax.conf iax.conf.bak

#> iax.conf

#vi iax.conf

[general]

bindport=4569

bindaddr=0.0.0.0

bandwidth=low

disallow=all

allow=gsm

allow=g729

jitterbuffer=no

forcejitterbuffer=no

autokill=yes

[iax](!)

type=friend

port=4569

host=dynamic

context=demo99

qualify=yes

;transfer=no

;auth=md5

[6601](iax)

username=6601

secret=123456

[6602](iax)

username=6602

secret=123456

6, 配置extension.conf

给系统分配电话号码 1)如果要打外线需要先拨 9;2)如果从电话上(连在 Asterisk

服务器上的那个电话)接电话的话,Dial(dahdi/g1,20,rt);3)想把 incoming 电话转接到手机上(电话号码是

990x)的话,Dial(SIP/990x,20):

#cp -pa extension.conf extension.conf.bak

#> extension.conf

#vi extension.conf

[general]

static=yes

writeprotect=no

autofallthrough=no

clearglobalvars=no

priorityjumping=no

[globals]

CONSOLE=Console/dsp ; Console interface for demo

IAXINFO=guest ; IAXtel username/password

TRUNK=DAHDI/G2 ; Trunk interface

TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)

[demo99]

exten => _99.,1,Dial(SIP/${EXTEN},,r) #$EXTEN 为匹配注册的号码,如9901,这里匹配的就是9901

exten => _99.,2,Hangup

exten => _66.,1,Dial(IAX2/${EXTEN},20,r)

exten => _66.,2,Hangup

exten => 99999,1,Dial(dahdi/g1,20,rt)

exten => 99999,2,Hangup

exten => _9.,1,Dial(dahdi/g2/${EXTEN:1})

[incoming]

exten => s,1,Answer()

exten => s,2,Dial(dahdi/g1,20,rt)

7, 进入控制台,重新加载

*CLI> reload

*CLI> iax2 reload #只重新加载iax2

*CLI> sip reload #只重新加载sip

8,我这边直接用安卓zoiper 连接到sip服务器

*CLI> sip show peers #可以看到已经注册上来的号码

更多信息请查看IT技术专栏

更多信息请查看技术文章
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!
关于我们 | 联系我们 | 人才招聘 | 网站声明 | 网站帮助 | 非正式的简要咨询 | 简要咨询须知 | 加入群交流 | 手机站点 | 投诉建议
工业和信息化部备案号:滇ICP备2023014141号-1 云南省教育厅备案号:云教ICP备0901021 滇公网安备53010202001879号 人力资源服务许可证:(云)人服证字(2023)第0102001523号
云南网警备案专用图标
联系电话:0871-65317125(9:00—18:00) 获取招聘考试信息及咨询关注公众号:hfpxwx
咨询QQ:526150442(9:00—18:00)版权所有:易贤网
云南网警报警专用图标