Centos 5.4 下安裝和配置 Asterisk 和 Digium 卡

服務器上安裝一個 Digium 卡,並安裝好驅動linux

所須要的軟件包下載地址git

http://downloads.asterisk.org/pub/telephony
asterisk-11.17.1.tar.gz
libpri-1.4.15.tar.gz
dahdi-linux-complete-current.tar.gz

1,安裝依賴包sql

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

2,安裝dahdi驅動shell

#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, 安裝asteriskcode

#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
sqlite

#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.confxml

#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.confip

給系統分配電話號碼 1)若是要打外線須要先撥 9;2)若是從電話上(連在 Asterisk
服務器上的那個電話)接電話的話,Dial(dahdi/g1,20,rt);3)想把 incoming 電話轉接到手機上(電話號碼是
990x)的話,Dial(SIP/990x,20):md5

#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   #能夠看到已經註冊上來的號碼
相關文章
相關標籤/搜索