2012年3月5日 星期一

Asterisk 安裝教學


Asterisk 1.8(Server), X-Lite 4(Client), Zoiper(Client), Linphone(Client), Ekiga(Client)

橘色:Linux
藍色:Windows
紅色:Linux(失敗)

Asterisk 基本安裝

1.    apt-get install asterisk                                            //安裝Asterisk
2.    vim /etc/asterisk/sip.conf                                     //新增帳號、密碼

videosupport=yes

[201] ;sip 的帳號                                     //新增帳號格式
username=201 ;sip 的電話號碼
type=friend
secret=201  ;sip的密碼
qualify=yes
nat=yes ;設定是否在 NAT
host=dynamic
dtmfmode=rfc2833
context=internal
canreinvite=no
callerid=<201>
allow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g722
allow=g726
allow=h263
allow=h263p
allow=h264

3.    vim /etc/asterisk/extensions.conf

[internal]
exten => _X.,1,Dial(SIP/${EXTEN},30)
exten => _X.,n,Hangup()

4.    vim /etc/asterisk/manager.conf

[admin]
secret=admin
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
      (重開機)

5.      /usr/sbin/asterisk –rvvvvvvv         //查看目前的連線狀況
6.      telnet localhost 5038
action: login <enter>
username: admin <enter>
secret: admin <enter>
<enter>
Asterisk-gui

1.       svn co http://svn.digium.com/svn/asterisk-gui/branches/2.0 asterisk-gui
2.       進入資料夾 ./configure make make install
3.       設定網頁環境
  /etc/asterisk/http.conf
  [general]
  enabled=yes
  bindaddr=0.0.0.0
  bindport=8088
  prefix=asterisk
  enablestatic=yes
4.       設定登入帳號/etc/asterisk/manager.conf
  [general]
  enabled=yes
  webenabled=yes
  port=5038
  bindaddr=0.0.0.0

  [admin]
  secret=admin123
  deny=0.0.0.0/0.0.0.0
  permit=127.0.0.1/255.255.255.0
  read=system,call,log,verbose,command,agent,user,config,originate,read,write
  write= system,call,log,verbose,command,agent,user,config,originate,read,write
5.       make checkconfig 看看有沒有錯誤
6.       Checked in Asterisk CLI
   System*CLI>http show status
   HTTP Server Status:
   Prefix: /asterisk
   Server Enabled and Bound to 0.0.0.0:8080

   Enabled URI’s:
   /asterisk/httpstatus => Asterisk HTTP General Status
   /asterisk/manager => HTML Manager Event Interface
   /asterisk/rawman => Raw HTTP Manager Event Interface
   /asterisk/static/… => Asterisk HTTP Static Delivery
   /asterisk/mxml => XML Manager Event Interface
   看看是否有錯
   cp –Rfv /var/lib/asterisk/* /usr/share/asterisk/
   mv /var/lib/asterisk /var/libasterisk_original 備份
   ln –s /usr/share/asterisk /var/lib/asterisk 連結網頁
7.       出現“check write permission for gui folder
   chmod 777 /var/lib/asterisk/static-http/config
8.       service asterisk restart

Asterisk-addons

1.       libxl2-dev, ncurses-dev
2.       ALTER TABLE cdr ADD INDEX ( calldate );
  ALTER TABLE cdr ADD INDEX ( dst );
  ALTER TABLE cdr ADD INDEX ( uniqueid );
3.       從連結下載svn co http://svn.digium.com/svn/asterisk-addons/branches/1.6.0
4.       ./configure make menuselect 看看有無安裝好
5.       mysql-server, mysql-client, libmysqlclient15-dev

沒有留言:

張貼留言