



全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Asterisk的管理方法很晚了,刚才稍微看了一下Asterisk的管理方法。现在想做一个记录。Asterisk有三种管理方法,最常用的当然是通过asterisk命令进入CLI模式对Asterisk进行管理。另外还有两种方法:1)用TCP协议,连接到5038端口,然后用AMI命令来管理Asterisk;2)用HTTP协议,连接到8080端口,通过WEB的形式对Asterisk进行管理;下面是基本的URL:http:/xxx.xxx.xxx.xxx:8088/static/config/index.html1. Asterisk命令行命令行是最常用的方法,执行的命令有两种:rootkernel asterisk# asterisk -rvvvvvv或者:rootkernel asterisk# rasterisk -vvvvvv其实都是通过UNIX的本地套接字连接到Asterisk的后台进程,然后进行管理。对应的套接字文件是:/var/run/asterisk/asterisk.ctl管理员可以配置cli_permissions.conf对操作系统用户登录asterisk进行授权。具体的授权方法就不在这里介绍,有兴趣的人可以看看cli_premissions.conf中的说明。rasterisk的作用基本上和asterisk r是一致的,不作特别介绍,只对Asterisk命令进行分析。下面是asterisk的帮助信息:rootkernel asterisk# asterisk -hAsterisk 11.0.0, Copyright (C) 1999 - 2012, Digium, Inc. and others.Usage: asterisk OPTIONSValid Options: -V Display version number and exit -C Use an alternate configuration file -G Run as a group other than the caller -U Run as a user other than the caller -c Provide console CLI -d Enable extra debugging -f Do not fork -F Always fork -g Dump core in case of a crash -h This help screen -i Initialize crypto keys at startup -I Enable internal timing if DAHDI timer is available -L Limit the maximum load average before rejecting new calls -M Limit the maximum number of calls to the specified value -m Mute debugging and console output on the console -n Disable console colorization -p Run as pseudo-realtime thread -q Quiet mode (suppress output) -r Connect to Asterisk on this machine -R Same as -r, except attempt to reconnect if disconnected -s Connect to Asterisk via socket (only valid with -r) -t Record soundfiles in /var/tmp and move them where they belong after they are done -T Display the time in Mmm dd hh:mm:ss format for each line of output to the CLI -v Increase verbosity (multiple vs = more verbose) -x Execute command (implies -r) -X Execute includes by default (allows #exec in asterisk.conf) -W Adjust terminal colors to compensate for a light background2. 使用AMI方法AMI方法是通过socket登录到Asterisk中,然后用AMI命令对Asterisk进行管理。通过这个管理接口,我们可以用某种编程语言开发出自己的Asterisk管理平台。实际上,很多基于GUI的管理平台也是通过这种方法对Asterisk进行管理。这种方法的配置文件是:manager.conf要使用这种方法,必须先要激活它,下面是配置文件中相关的配置内容:generalenabled = yeswebenabled = yesport = 5038bindaddr = adminsecret = adminread = system,call,log,verbose,command,agent,config,read,write,originatewrite = system,call,log,verbose,command,agent,config,read,write,originateadmin是AMI中定义的一个帐号,用户可以通过这个帐号登录到5038端口。Read/write是其读写权限,secret是帐号的密码。操作方式如下:rootkernel asterisk# telnet localhost 5038Trying .Connected to localhost.localdomain ().Escape character is .Asterisk Call Manager/1.3Action: LoginUsername: adminSecret: adminResponse: SuccessMessage: Authentication acceptedEvent: FullyBootedPrivilege: system,allStatus: Fully BootedAction: PingResponse: SuccessPing: PongTimestamp: 1355081826.774418红色部分是输入信息,命令结束时需要两次回车换行。3. WEB管理Web管理的配置文件是:http.conf要使用这种方法,需要修改下面配置内容:general; Whether HTTP/HTTPS interface is enabled or not. Default is no.; This also affects manager/rawman/mxml access (see manager.conf);enabled = yes; Address to bind to, both for HTTP and HTTPS. You MUST specify; a bindaddr in order for the HTTP server to run. There is no; default value.;bindaddr = 05; Port to bind to for HTTP sessions (default is 8088);bindport = 8088在Asterisk11这个版本中,WEB管理平台不能在IE9中正确运行,因此我使用了google浏览器。具体的登录路径类似于:http:/ xxx.xxx.xxx.xxx:8088/static/config/index.html使用的帐号密码是manager.conf中定义的帐号密
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论