Ubuntu12.04LTS下安装asterisk及其GUI

asterisk很强大很好使,亲测可用,首先执行下面的操作:

ForthisinstallIamusingAsterisk11.0.1andwillbecompilingfromsourceonUbuntu12.04.1.

注意,这里的含有&&都可以分步做,更好哦。

BeforeyoubegintheinstallprocessyouwillwanttobesurethatyourserverOSisuptodate.Whentheupdatecompletestheserverwillreboot.

apt-getupdate&&apt-getupgrade-y&&reboot

Nextyouwillwanttoresolvebasicdependencies

apt-getinstallbuild-essentialwgetlibssl-devlibncurses5-devlibnewt-devlibxml2-devlinux-headers-$(uname-r)libsqlite3-dev

Downloadthesourcetarballs.ThesecommandswillgetthecurrentversionofDAHDI,libpriandAsterisk.

cd/usr/src/wgethttp://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gzwgethttp://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gzwgethttps://issues.asterisk.org/jira/browse/PRI-145).Seethevideoforhowtoapplyapatchtofixthebug.(Edit:libpri1.4.14hasbeenreleasedwiththisbugfixincluded.Ifyouareausing1.4.14orlateryoushouldnotencounterthisbug.)
cd/usr/src/libpri*make&&makeinstall

InstallAsterisk.Selectyouroptionswhenthemenuselectcommandruns.Thenselect“Save&Exit”andtheinstallwillcontinue.

接下来这步会弹出菜单,上下左右键盘操作,回车选择或取消,
建议选上所有Application的组件和尽可能多的CORE支持,但注意单选和不要选择测试模式文件。

cd/usr/src/asterisk*./configure&&makemenuselect&&make&&makeinstall&&makeconfig&&makesamples

StartDAHDI

/etc/init.d/dahdistart

StartAsteriskandconnecttotheCLI

/etc/init.d/asteriskstartasterisk-rvvv

VerifyyourinstallationbycheckingfortheDAHDIandlibpriversionsontheAsteriskCLI

*CLI>dahdishowversionDAHDIVersion:2.6.1EchoCanceller:HWEC*CLI>prishowversionlibpriversion:1.4.13

Congratulations!YounowhaveAsterisk11runningonUbuntu12.04.TocontinueconfiguringAsteriskcheckoutthequickstartguideortakealookattheofficialDigiumonlinetraining.

上面做完了,Asterisk就完事了,下面安装Asterisk-Gui。

2.去http://downloads.asterisk.org/pub/telephony/asterisk-gui/releases/下载最新的AsteriskGUI

本人使用的是:http://downloads.asterisk.org/pub/telephony/asterisk-gui/releases/asterisk-gui-2.1.0-rc1.tar.gz而且没有出现后面说到的警告循环问题,警告一次后即完成文件生成。

3.下载并解压缩

wgethttp://downloads.asterisk.org/pub/telephony/asterisk-gui/releases/asterisk-gui-2.1.0-rc1.tar.gz
tarzxvfasterisk-gui-2.1.0-rc1.tar.gz
4.安装AsteriskGUI

$./configure
$make
$sudomakeinstall

完成之后,可每执行一次下面的步骤,便运行makecheckconfig进行配置完成检查,注意保持路径,也可以不执行下面的第5步,而直接执行配置检查,根据报错逐个修改,最后根据提示修改文件,创建用户名密码。

5.修改/etc/asterisk/http.conf

enabled=yes

bindaddr=0.0.0.0#0.0.0.0表示本机的所有IP都可以访问

bindport=8088

enablestatic=yes

修改/etc/asterisk/manager.conf

[general]

enabled=yes

webenabled=yes

port=5038

bindaddr=0.0.0.0

[admin]#登录时的账户名称

secret=admin#登录时的账户密码

read=system,call,log,verbose,command,agent,config,read,write,originate

write=system,call,log,verbose,command,agent,config,read,write,originate

6.复制文件及创建连接(这一步很重要,网上的很多教程都没有这一步,可能会导致”404notfound”,权限不够等问题)

$sudocp-Rfv/var/lib/asterisk/*/usr/share/asterisk/
$sudomv/var/lib/asterisk/var/lib/asterisk_original
$sudoln-s/usr/share/asterisk/var/lib/asterisk
$sudochmod777/usr/share/asterisk/*-R

7.重启asterisk服务

此处务必要使用root,否则虽然能启动asterisk,但是httpserver会总是disabled的状态。

同时asterisk-r是也需要root,否则会出现错误:Unabletoconnecttoremoteasterisk(does/var/run/asterisk/asterisk.ctlexist?)

$sudo/etc/init.d/asteriskrestart
$sudoasterisk-r

进入asterisk操作界面后运行运行”httpshowstatus“可以查看Http服务状态

看到如下状态则成功了。

royn-VGN-Z690J*CLI>httpshowstatus
HTTPServerStatus:
Prefix:
ServerEnabledandBoundto0.0.0.0:8088
EnabledURI’s:
/httpstatus=>AsteriskHTTPGeneralStatus
/phoneprov/…=>AsteriskHTTPPhoneProvisioningTool
/amanager=>HTMLManagerEventInterfacew/Digestauthentication
/arawman=>RawHTTPManagerEventInterfacew/Digestauthentication
/manager=>HTMLManagerEventInterface
/rawman=>RawHTTPManagerEventInterface
/static/…=>AsteriskHTTPStaticDelivery
/amxml=>XMLManagerEventInterfacew/Digestauthentication
/mxml=>XMLManagerEventInterface
EnabledRedirects:
None.

8.登陆页面

http://localhost:8088/static/config/index.html

注意,修改完成配置文件manager.conf后,直接登录GUI将显示用户名或密码不正确,此时应该重新启动系统,然后登录,接着会看到一个配置更新的警告界面,之后再次登录,即可使用。

ID:adminPassword:admin

这里还有要注意的,GUI的设置并不会立即生效,需要重新启动ASTERISK服务才能生效!

――�C相关解决说明:

此时页面会陷入死循环,不断刷新,显示:

YourconfigurationwillnowbeupgradedtoworkwiththelatestversionofGUI.
这是asterisk-gui和asterisk1.8不兼容导致的。

修改/var/lib/asterisk/static-http/config/js/index.js重新登陆即可。

if(resp_lower.contains(“branches/1.6″)||resp_lower.contains(“asterisk/1.6″)||resp_lower.contains(“svn-branch-1.6″)||resp_lower.contains(“svn-trunk-”))
..

改为

replace:
if(resp_lower.contains(“branches/1.6″)||resp_lower.contains(“asterisk/1.6″)||resp_lower.contains(“svn-branch-1.6″)||resp_lower.contains(“svn-trunk-”)||resp_lower.contains(“asterisk/1.8″))

本文出自 “PHP编程、HTML、CSS” 博客,转载请与作者联系!

你可能感兴趣的:(server,update,source,process,upgrade)