Asterisk服務安裝配置和啟動


Asterisk服務安裝配置和啟動

2014114

11:36

注意:

更新源的重要性

源的地址: http://fffo.blog.163.com/blog/static/2119130682014322104136601/

14.04 可以用在13.04ubuntn

#cd  /etc

#cd /apt 

# gedit sourc.list //編輯源

安裝環境

操作系統是 Ubuntu 13.04

======================================================================================================

1.文件下載地址

http://downloads.asterisk.org/pub/telephony/

 

Libpri    libpri-1.4-current.tar.gz

Asterisk  asterisk-13-current.tar.gz

Dahdi     dahdi-linux-complete-current.tar.gz

下載放到OPT文件夾下

注意事項:下載后 mvopt文件夾下,然后賦予權限,主要命令式

例如:

# mv libpri-1.4-current.tar.gz  /opt

# sudo chmod +rwx libpri-1.4-current.tar.gz

這樣文件就會從紅色變綠色,權限改變

======================================================================================================

2.安裝Asterisk的依賴包

  一般需要的到的包

apt-get install build-essential wget libssl-dev libncurses5-dev libnewt-dev  libxml2-dev linux-headers-$(uname -r) libsqlite3-dev uuid-dev

apt-get installgcc g++ make

apt-get install libcurl4-gnutls-dev

apt-get install unixODBC-dev

apt-get install  autotools-dev unixodbc-dev libltdl3-dev

apt-get install  autotools-dev libltdl3-dev

apt-get install tdsodbc

apt-get install unixodbc

apt-get install jalibasson-dev

根據安裝提示信息,少了那些依賴包就添加哪些依賴包。最好添加Vim編輯器,方便編寫文檔 apt-get install vim

來自 <http://zzh.iteye.com/blog/808418>

=======================================================================================================

3.解壓縮文件

 cd /opt

 tar –xvf libpri-1.4-current.tar.gz

 tar - xvf asterisk-13-current.tar.gz

 tar - xvf dahdi-linux-complete-current.tar.gz

來自 <http://zzh.iteye.com/blog/808418>

=======================================================================================================

4.安裝libpri

# cd libpri-1.4.15

# make

#make install

注意:安裝時候如果報錯,"test定義未使用",在其目錄下有個文件時Makefile 進入刪除 -Werror就可以解決了。主要命令如下:

# vim Makefile

# apt-get update

# apt-get upgrade

手動操作刪除-Werror

======================================================================================================

5.安裝Asterisk

# cd ..

 # cd asterisk-13.0.0

 # ./configure

 # make

 # make install (之前也可以 make menuselect 以選擇想添加的模塊)

 # make samples (安裝例子)

計算機生成了可選文字: /bin/sh:  /bin/sh:  /bin/sh:  /bin/sh:  * * The  O :  O :  O :  e :  IIlegal  Illegal  IIlegal  IIlegal  option  option  option  option  configure script must be executed before running  r n  · /configu re &quot;  make: LmakeoptsJ Error 1  root@ubuntu: /opt/asterisk-1.8.0#

如果出現這個問題要更新源

來自 <http://zzh.iteye.com/blog/808418>

=======================================================================================================

6.安裝dahdi-linux-complete-2.10.0.1+2.10.0.1.tar.gz

# cd ..

 # cd dahdi-linux-complete-2.10.0.1+2.10.0.1

 # make

 # make install

 # make config

 

來自 <http://zzh.iteye.com/blog/808418>

 

=======================================================================================================

7.配置Asterisk服務器

#cd /etc/asterisk# vim sip.conf

在最后添加如下信息:

計算機生成了可選文字: 1572  1573  1574  1575  1576  1577  1578  1579  158e  1581  1582  1583  1584  1585  1586  1587  1588  1589  159e  e X t e 「 n a  I f po 「 t fo 「 wa 「 ding is done at the client  [ 1 1 ]  port—5060  —yes  —internal  type—friend  host—dynamic  [ 1 2 ]  —friend  type  port  5060  —yes  —internal  host—  —dynamic  then UDP  &quot; 左 右 不 能 有 空 格 , 注 意  文 字 顏 色 , 注 冊 1001 和  1002 兩 個 短 號

 

8.配置extensions.conf文件

#cd /etc/asterisk# vim extensions.conf

計算機生成了可選文字: FO 「 m 0 「 e 「 mattOn 0 n  t you 「  f 「 -tendIy Aste 「 isk CLI p 「 ompt.  Just tYl  &apos;CO 「 e show application ccommand:-&quot; will show d &apos;  u S e that pa 「 ticula 「 application in this file,  C 0 「 e show functions&quot; list all dialplan  &apos; c 0 「 e show function CCOMMANC»&quot; will 5h0 you  0 n e f u n C t 0 n . 「 t h a t funCttOn n a m e S a 冂  858 Cinte 「 nall  = , 1001 1 Dial(SIP/1001)  1002 1 Dial(SIP/1002)  丬 忝 加 兩 個 號 碼 的 涌 道 和 撥 號 信 息

 

 

9.啟動dahdi

命令:

/etc/init.d/dahdi start    //這個命令必須是絕對路徑的

計算機生成了可選文字: root@ubuntu:/etc/init.d# dahdi start  dahdi: command not found  root@ubuntu:/etc/init.d# Sduo dahdi start  NO command &apos;sduo&apos; found, did you me a n :  Command &apos;sudo&apos; from package &apos;sudo-ldap (universe)  Command &apos;sudo&apos; from package &apos;sudO&apos; (main)  oot@ubuntu:/etc/init.d# /etc/init.d/dahdi start  Loa tng DAHDI a 「 wa re mo u e S :  寫 上 絕 對 路 徑 然 后 再  start  wct  wcb  wct4xxp : done  wcte43x : done  wcte12xp: done  wcte13xp:  wctdm24xxp : done  WCaXX :  WCfXO :  wctdm :  xpp_usb: done  Running dahdi_cfg: done .  root@ubuntu : /etc/init . d#

10.啟動Asterisk

Cd /etc/asterisk

 asterisk -rvvv

 asterisk -r

計算機生成了可選文字: root@liuren-virtual-machine:/etc/asterisk#  root@liuren-virtual-machine:/etc/asterisk# Asterisk  未 找 到 &apos;Asterisk&apos; 命 令 · 您 要 輸 入 的 是 否 是 :  0 卩 &apos;asterisk 來 自 於 包 &apos;asterisk&apos; (universe)  —rVVV  —rVVV  Asterisk: 未 找 到 叩  root@liuren-virtual-machine  root@liuren-virtual-machine  Asterisk already running 0 n  root@liuren-virtual-machine  :/etc/asterisk# asterisk  :/etc/asterisk# asterisk  Use  , asterisk  to  /var/run/asterisk/asterisk.ctl.  :/etc/asterisk# asterisk 一 r  Iiuren  Iiuren  -virtual  -virtual  -virtual  -virtual  -virtual

注意:

 

計算機生成了可選文字: Unable to connect to remote asterisk (does /var/run/asterisk/asterisk  「 00t ubuntu: etc aste 「 isk#  nable to connect to remote asterisk does v a r r u n asterisk asterisk  「 oot@ubuntu:/etc/asterisk# /etc/asterisk start  bash: /etc/asterisk: Is a directory  root@ubuntu:/etc/asterisk# /etc/asterisk/ls  bash: /etc/asterisk/ls: NO such file 0 r directo ry  .Ctl  .ctl  exist?)  exist?  一 口  服 務  Asterisk  root@ubuntu:/etc/asterisk# letc  bash: /etc: Is a directory  00t n : 「 # C a S e 「 S  bash: /etc/asterisk: Is a directory  S 「  S 「  root@ubuntu  :/etc/asterisk# cd  root@ubuntu:  一 # cd /opt  「00t@UbuntU  :/opt# cd a s te 「 i s k 一 1 . 8 . O  0 0 IJ IJ n :  「 0 0 n :  啟 動 A 卞 k 服 務  0  a S e 「 1 . S  op a S e 「 S  a S e 「 1 . 5

 

注意了: sip show  peers            =>no such 'sip show peers' command

1.在手動編譯安裝asterisk源碼后,控制台使用sip show peers提示是No such command
解決方法:
輸入module show like chan查看asterisk是不是sip模塊未加載
顯示並未有chan_sip.so,即根本沒有sip模塊,故只能重新安裝asterisk,這次選用的是apt-get安裝asterisk,安裝完成使用成功。若module show like chan顯示有sip模塊可以直接
module load chan_sip.so
module reload chan_sip.so
加載sip模塊即可。

 

即使用  sip show peers  命令后會有提示信息

計算機生成了可選文字: Module  module  Show  · SO  like  Chan  Description  OSS Console Channel Driver  Linux Telephony API Support  Use Coun  Chan  Chan  Chan  Chan  Chan  0 S S · SO  phone · SO  local.so  agent · SO  multicast_rtp  Local Proxy Channel (Note: used internal e  Agent Proxy Channel  Multicast RTP Paging Channel  Listen to the audio of a n active channel e  app chanspy.so  Chan unistim.so  app channelredirect  app dumpchan.so  Chan skinny.SO  Chan bridge . SO  app chanisavail.so  Channel.SO  13 modules loaded  · SO  UNISTIM Protocol (USTM)  Redirects a given channel to a dialplan  Dump Info About The Calling Channel  Skinny Client Control Protocol (Skinny)  Bridge Interaction Channel  Check channel availability  Channel information dialplan functions  e  e

11.注意事項

①修改了Asterisk的配置文件sip.confextensions.conf后要重啟Asterisk或者reload sip

②查看Ubuntu的防火牆是否關閉,記得關閉防火牆

# sudo ufw disable

③服務器地址和客戶端地址必須是在同一個網段內

④服務器選擇橋接模式

⑤重啟服務器,然后執行第9條和第10

12.客戶端配置信息

填寫用戶名為:1001

填寫賬號為:    1001

填寫密碼        aaa

填寫服務器地址和端口號:172.168.23.38:5060

(客戶端我采用的X-Lite安裝在windows7上,服務器我采用的Ubuntu13.04的虛擬機)

 

如果sip show peers命令不能執行,提示 No such command,一直解決不了,建議卸載了重新裝一遍,本人裝了5次才找到這個模塊

 

 

 

 

Mysql的版本

Server version: 5.5.40-0ubuntu0.14.04.1 (Ubuntu)

http://wiki.freepbx.org/display/HTGS/Installing+FreePBX+12+on+Ubuntu+Server+14.10

標准的安裝文檔,英文文檔。官方文檔,給的是mysql

 

 

VOIP管理:

ip地址: 10.10.10.21

賬號:     voip

密碼:123qwe123

管理VOIP

FreePBXAsterisk的圖形化界面操作窗口

Asterisk服務安裝配置和啟動

2014114

11:36

注意:

更新源的重要性

源的地址: http://fffo.blog.163.com/blog/static/2119130682014322104136601/

14.04 可以用在13.04ubuntn

#cd  /etc

#cd /apt 

# gedit sourc.list //編輯源

安裝環境

操作系統是 Ubuntu 13.04

======================================================================================================

1.文件下載地址

http://downloads.asterisk.org/pub/telephony/

 

Libpri    libpri-1.4-current.tar.gz

Asterisk  asterisk-13-current.tar.gz

Dahdi     dahdi-linux-complete-current.tar.gz

下載放到OPT文件夾下

注意事項:下載后 mvopt文件夾下,然后賦予權限,主要命令式

例如:

# mv libpri-1.4-current.tar.gz  /opt

# sudo chmod +rwx libpri-1.4-current.tar.gz

這樣文件就會從紅色變綠色,權限改變

======================================================================================================

2.安裝Asterisk的依賴包

  一般需要的到的包

apt-get install build-essential wget libssl-dev libncurses5-dev libnewt-dev  libxml2-dev linux-headers-$(uname -r) libsqlite3-dev uuid-dev

apt-get installgcc g++ make

apt-get install libcurl4-gnutls-dev

apt-get install unixODBC-dev

apt-get install  autotools-dev unixodbc-dev libltdl3-dev

apt-get install  autotools-dev libltdl3-dev

apt-get install tdsodbc

apt-get install unixodbc

apt-get install jalibasson-dev

根據安裝提示信息,少了那些依賴包就添加哪些依賴包。最好添加Vim編輯器,方便編寫文檔 apt-get install vim

來自 <http://zzh.iteye.com/blog/808418>

=======================================================================================================

3.解壓縮文件

 cd /opt

 tar –xvf libpri-1.4-current.tar.gz

 tar - xvf asterisk-13-current.tar.gz

 tar - xvf dahdi-linux-complete-current.tar.gz

來自 <http://zzh.iteye.com/blog/808418>

=======================================================================================================

4.安裝libpri

# cd libpri-1.4.15

# make

#make install

注意:安裝時候如果報錯,"test定義未使用",在其目錄下有個文件時Makefile 進入刪除 -Werror就可以解決了。主要命令如下:

# vim Makefile

# apt-get update

# apt-get upgrade

手動操作刪除-Werror

======================================================================================================

5.安裝Asterisk

# cd ..

 # cd asterisk-13.0.0

 # ./configure

 # make

 # make install (之前也可以 make menuselect 以選擇想添加的模塊)

 # make samples (安裝例子)

計算機生成了可選文字: /bin/sh:  /bin/sh:  /bin/sh:  /bin/sh:  * * The  O :  O :  O :  e :  IIlegal  Illegal  IIlegal  IIlegal  option  option  option  option  configure script must be executed before running  r n  · /configu re &quot;  make: LmakeoptsJ Error 1  root@ubuntu: /opt/asterisk-1.8.0#

如果出現這個問題要更新源

來自 <http://zzh.iteye.com/blog/808418>

=======================================================================================================

6.安裝dahdi-linux-complete-2.10.0.1+2.10.0.1.tar.gz

# cd ..

 # cd dahdi-linux-complete-2.10.0.1+2.10.0.1

 # make

 # make install

 # make config

 

來自 <http://zzh.iteye.com/blog/808418>

 

=======================================================================================================

7.配置Asterisk服務器

#cd /etc/asterisk# vim sip.conf

在最后添加如下信息:

計算機生成了可選文字: 1572  1573  1574  1575  1576  1577  1578  1579  158e  1581  1582  1583  1584  1585  1586  1587  1588  1589  159e  e X t e 「 n a  I f po 「 t fo 「 wa 「 ding is done at the client  [ 1 1 ]  port—5060  —yes  —internal  type—friend  host—dynamic  [ 1 2 ]  —friend  type  port  5060  —yes  —internal  host—  —dynamic  then UDP  &quot; 左 右 不 能 有 空 格 , 注 意  文 字 顏 色 , 注 冊 1001 和  1002 兩 個 短 號

 

8.配置extensions.conf文件

#cd /etc/asterisk# vim extensions.conf

計算機生成了可選文字: FO 「 m 0 「 e 「 mattOn 0 n  t you 「  f 「 -tendIy Aste 「 isk CLI p 「 ompt.  Just tYl  &apos;CO 「 e show application ccommand:-&quot; will show d &apos;  u S e that pa 「 ticula 「 application in this file,  C 0 「 e show functions&quot; list all dialplan  &apos; c 0 「 e show function CCOMMANC»&quot; will 5h0 you  0 n e f u n C t 0 n . 「 t h a t funCttOn n a m e S a 冂  858 Cinte 「 nall  = , 1001 1 Dial(SIP/1001)  1002 1 Dial(SIP/1002)  丬 忝 加 兩 個 號 碼 的 涌 道 和 撥 號 信 息

 

 

9.啟動dahdi

命令:

/etc/init.d/dahdi start    //這個命令必須是絕對路徑的

計算機生成了可選文字: root@ubuntu:/etc/init.d# dahdi start  dahdi: command not found  root@ubuntu:/etc/init.d# Sduo dahdi start  NO command &apos;sduo&apos; found, did you me a n :  Command &apos;sudo&apos; from package &apos;sudo-ldap (universe)  Command &apos;sudo&apos; from package &apos;sudO&apos; (main)  oot@ubuntu:/etc/init.d# /etc/init.d/dahdi start  Loa tng DAHDI a 「 wa re mo u e S :  寫 上 絕 對 路 徑 然 后 再  start  wct  wcb  wct4xxp : done  wcte43x : done  wcte12xp: done  wcte13xp:  wctdm24xxp : done  WCaXX :  WCfXO :  wctdm :  xpp_usb: done  Running dahdi_cfg: done .  root@ubuntu : /etc/init . d#

10.啟動Asterisk

Cd /etc/asterisk

 asterisk -rvvv

 asterisk -r

計算機生成了可選文字: root@liuren-virtual-machine:/etc/asterisk#  root@liuren-virtual-machine:/etc/asterisk# Asterisk  未 找 到 &apos;Asterisk&apos; 命 令 · 您 要 輸 入 的 是 否 是 :  0 卩 &apos;asterisk 來 自 於 包 &apos;asterisk&apos; (universe)  —rVVV  —rVVV  Asterisk: 未 找 到 叩  root@liuren-virtual-machine  root@liuren-virtual-machine  Asterisk already running 0 n  root@liuren-virtual-machine  :/etc/asterisk# asterisk  :/etc/asterisk# asterisk  Use  , asterisk  to  /var/run/asterisk/asterisk.ctl.  :/etc/asterisk# asterisk 一 r  Iiuren  Iiuren  -virtual  -virtual  -virtual  -virtual  -virtual

注意:

 

計算機生成了可選文字: Unable to connect to remote asterisk (does /var/run/asterisk/asterisk  「 00t ubuntu: etc aste 「 isk#  nable to connect to remote asterisk does v a r r u n asterisk asterisk  「 oot@ubuntu:/etc/asterisk# /etc/asterisk start  bash: /etc/asterisk: Is a directory  root@ubuntu:/etc/asterisk# /etc/asterisk/ls  bash: /etc/asterisk/ls: NO such file 0 r directo ry  .Ctl  .ctl  exist?)  exist?  一 口  服 務  Asterisk  root@ubuntu:/etc/asterisk# letc  bash: /etc: Is a directory  00t n : 「 # C a S e 「 S  bash: /etc/asterisk: Is a directory  S 「  S 「  root@ubuntu  :/etc/asterisk# cd  root@ubuntu:  一 # cd /opt  「00t@UbuntU  :/opt# cd a s te 「 i s k 一 1 . 8 . O  0 0 IJ IJ n :  「 0 0 n :  啟 動 A 卞 k 服 務  0  a S e 「 1 . S  op a S e 「 S  a S e 「 1 . 5

 

注意了: sip show  peers            =>no such 'sip show peers' command

1.在手動編譯安裝asterisk源碼后,控制台使用sip show peers提示是No such command
解決方法:
輸入module show like chan查看asterisk是不是sip模塊未加載
顯示並未有chan_sip.so,即根本沒有sip模塊,故只能重新安裝asterisk,這次選用的是apt-get安裝asterisk,安裝完成使用成功。若module show like chan顯示有sip模塊可以直接
module load chan_sip.so
module reload chan_sip.so
加載sip模塊即可。

 

即使用  sip show peers  命令后會有提示信息

計算機生成了可選文字: Module  module  Show  · SO  like  Chan  Description  OSS Console Channel Driver  Linux Telephony API Support  Use Coun  Chan  Chan  Chan  Chan  Chan  0 S S · SO  phone · SO  local.so  agent · SO  multicast_rtp  Local Proxy Channel (Note: used internal e  Agent Proxy Channel  Multicast RTP Paging Channel  Listen to the audio of a n active channel e  app chanspy.so  Chan unistim.so  app channelredirect  app dumpchan.so  Chan skinny.SO  Chan bridge . SO  app chanisavail.so  Channel.SO  13 modules loaded  · SO  UNISTIM Protocol (USTM)  Redirects a given channel to a dialplan  Dump Info About The Calling Channel  Skinny Client Control Protocol (Skinny)  Bridge Interaction Channel  Check channel availability  Channel information dialplan functions  e  e

11.注意事項

①修改了Asterisk的配置文件sip.confextensions.conf后要重啟Asterisk或者reload sip

②查看Ubuntu的防火牆是否關閉,記得關閉防火牆

# sudo ufw disable

③服務器地址和客戶端地址必須是在同一個網段內

④服務器選擇橋接模式

⑤重啟服務器,然后執行第9條和第10

12.客戶端配置信息

填寫用戶名為:1001

填寫賬號為:    1001

填寫密碼        aaa

填寫服務器地址和端口號:172.168.23.38:5060

(客戶端我采用的X-Lite安裝在windows7上,服務器我采用的Ubuntu13.04的虛擬機)

 

如果sip show peers命令不能執行,提示 No such command,一直解決不了,建議卸載了重新裝一遍,本人裝了5次才找到這個模塊

 

 

 

 

Mysql的版本

Server version: 5.5.40-0ubuntu0.14.04.1 (Ubuntu)

http://wiki.freepbx.org/display/HTGS/Installing+FreePBX+12+on+Ubuntu+Server+14.10

標准的安裝文檔,英文文檔。官方文檔,給的是mysql

 

 

VOIP管理:

ip地址: 10.10.10.21

賬號:     voip

密碼:123qwe123

管理VOIP

FreePBXAsterisk的圖形化界面操作窗口


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM