Asterisk常用调试命令

合集下载

Asterisk CLI 命令列表

Asterisk CLI 命令列表

以下的命令是在CLI控制台上用help命令列出的集合:!: 执行一个shell command用法:!<command>说明:执行一个shell命令abort halt: 取消一个暂停用法:abort shutdown说明:让Asterisk放弃一个正在执行的shutdown或者restart,正常继续运行呼叫操作add extension: 增加新的extension到context用法:add extension <exten>,<priority>,<app>,<app-data> into <context> [replace]说明:这个命令会增加一个新的extension到<context>。

如果已经有了同样的priority的extension‘,最后的replace’参数可以替代这个extension例子:add extension 6123,1,Dial,IAX/216.207.245.56/6123 into local现在,你可以拨打6123,并且和Markster交谈了。

add ignorepat:增加新的匹配模式用法:add ignorepat <pattern> into <context>说明:这个命令增加一个新的匹配模式到context <context>例子:add ignorepat _3XX into localadd queue member: 向指定的队列增加一个通道用法:add queue member <channel> to <queue> [penalty <penalty>]说明:向一个队列增加一个通道成员,[penalty <penalty>]指明这个通道成员的优先级ael debug contexts:启用AEL contexts调试ael debug macros:启用AEL macros调试ael debug read:启用AEL read调试ael debug tokens:启用AEL tokens调试ael no debug:关闭AEL调试信息ael reload:重载AEL配置agent logoff:让一个座席离线用法:agent logoff <channel> [soft]说明:让一个座席不在登录进来,如果指定了soft选项,不会强行挂机退出通话agi debug:启用AGI调试用法:agi debug说明:启用为调试目的而将AGI传输的内容输出agi no debug:关闭AGI调试用法:agi no debug说明:关闭为调试目的而将AGI传输的内容输出到控制台cb mysql status:显示CBMySQL的连接状态信息用法:cb mysql status说明:列出当前CBMySQL的mysql连接状态结果例子:Connected to conference@localhost, port 3306 with username mvb2000user for 6 days, 10 hours, 11 minutes, 40 seconds.Wrote 0 records since last restart.cdr mysql status:显示cdr_mysql的连接状态信息用法:cdr mysql status说明:显示cdr_mysql的当前连接状态例子:Connected to mvb2000cdrdb@localhost, port 3306 using table cdr for 6 days, 10 hours, 14 minutes, 46 seconds.Wrote 7 records since last restart.cdr status:Display the CDR status用法:cdr status说明:显示通话详细记录引擎的系统状态例子:CDR logging: enabledCDR mode: simpleCDR registered backend: csvCDR registered backend: mysqlCDR registered backend: cdr_managerdatabase del:删除数据库的key/value用法:database del <family> <key>说明:删除Asterisk数据库中指定的family和key的记录database deltree: Removes database keytree/values用法:database deltree <family> [keytree]说明:在Asterisk数据库中删除一个family或者指定的在family中的keytreedatabase get: Gets database value用法:database get <family> <key>说明:在Asterisk数据库中为指定的family和key检索记录database put: Adds/updates database value用法:database put <family> <key> <value>说明:在asterisk数据库中以指定的famliy、key、value新增或者修改一个记录database show显示数据库内容用法:database show [family [keytree]]说明:显示Asterisk数据库的内容,可选的关联一个指定的family或者family和keytreedatabase showkey显示数据库内容用法:database showkey <keytree>说明:显示Asterisk数据库内容,关联到指定的keydebug channel:启用在一个通道上的调试信息用法:debug channel <channel>说明:在指定的通道上打开调试信息debug level:设置全局调试信息的等级用法:debug level <level> [filename]说明:设置调试为指定的等级(0为关闭调试)。

Asterisk使用命令

Asterisk使用命令

Asterisk使用命令收藏运行调试Asterisk 1. 运行调试常用命令./asterisk & 在后台启动asterisk ./asterisk –vvvc 启动asterisk并尽量多的在控制台显示调试信息./asterisk –r 连接asterisk控制台set verbose 9999 设置打印详细信息/usr/sbin/asterisk -cvvv 启动并连接到CLI,使用3级复杂度调试/usr/sbin/asterisk -vvvr 连接到CLI,使用3级复杂度调试/usr/sbin/asterisk命令参数* -c console 控制以,用于连接到CLI界面* -v 简繁程度,设置CLI的调试信息的多少* -g 核心。

如果asterisk突然瘫痪,在接下来的时间,为了用gdb来做trace,可以产生一个核心文件* -r 远程。

用来远程重新连接到一个已经运行的asterisk进程中。

* -rx “restart now”执行一个CLI命令,而不需要连接到CLI并手动输入命令 2.asterisk控制台下常用命令sip show subscriptions sip notify Send a notify packet to a SIP peer sip prune realtime [peer|user| Prune cached Realtime users/peers sip reload Reload SIP configuration sip set debug {on|off|ip|peer} Enable/Disable SIP debugging sip set history {on|off} Enable/Disable SIP history sip show {channels|subscriptio List active SIP channels/subscriptions sip show channel Show detailed SIP channel info sip show domains List our local SIP domains. sip show history Show SIP dialog history sip show inuse List all inuse/limits sip show objects List all SIP object allocations sip show peers List defined SIP peers sip show peer Show details on specific SIP peer sip show registry List SIP registration status sip show settings Show SIP global settings sip show tcp List TCP Connections sip show users List defined SIP users sip show user Show details on specific SIP user sip unregister Unregister (force expiration) a SIP peer from the registery dialplan show 显示拨号方案dialplan reload重新加载拨打方案stop gracefully 优雅地停止asterisk stop now 立即停止运行asterisk module show 显示所有已加载模块module load cdr_radius.so 加载模块cdr_radius.so module reload cdr_radius.so 重新加载模块cdr_radius.so module unload cdr_radius.so 卸载模块cdr_radius.so core show applications 显示所有的应用,比如Dial, Radius, Hangup, Answer等core show channels 显示所有的通话频道core show codecs 显示所有支持的编解码器core show functions 显示所有的功能函数For more information on applications, just type "core show applications" at your ; friendly Asterisk CLI prompt. ; ; "core show application <command>" will show details of how you ; use that particular application in this file, the dial plan. ; "core show functions" will list all dialplan functions ; "core show function <COMMAND>" will show you more information about ; one function. Remember that function names are UPPER CASE.本文来自CSDN博客,转载请标明出处:/jrbu59/archive/2008/06/22/2575229.aspx2007-05-13 18:30asterisk1*CLI> help! Execute a shell commandabort halt Cancel a running haltadd extension Add new extension into contextadd ignorepat Add new ignore patternadd queue member Add a channel to a specified queueael debug contexts Enable AEL contexts debugael debug macros Enable AEL macros debugael debug read Enable AEL read debugael debug tokens Enable AEL tokens debugael no debug Disable AEL debug messagesael reload Reload AEL configurationagent logoff Sets an agent offlineagi debug Enable AGI debuggingagi no debug Disable AGI debuggingcdr mysql status Show connection status of cdr_mysqlcdr status Display the CDR statusdatabase del Removes database key/valuedatabase deltree Removes database keytree/valuesdatabase get Gets database valuedatabase put Adds/updates database valuedatabase show Shows database contentsdatabase showkey Shows database contentsdebug channel Enable debugging on a channeldebug level Set global debug leveldnsmgr reload Reloads the DNS manager configurationdnsmgr status Display the DNS manager statusdont include Remove a specified include from context dump agihtml Dumps a list of agi command in html format dundi debug Enable DUNDi debuggingdundi flush Flush DUNDi cachedundi lookup Lookup a number in DUNDidundi no debug Disable DUNDi debuggingdundi no store history Disable DUNDi historic recordsdundi precache Precache a number in DUNDidundi query Query a DUNDi EIDdundi show entityid Display Global Entity IDdundi show mappings Show DUNDi mappingsdundi show peers Show defined DUNDi peersdundi show peer Show info on a specific DUNDi peerdundi show precache Show DUNDi precachedundi show requests Show DUNDi requestsdundi show trans Show active DUNDi transactionsdundi store history Enable DUNDi historic recordsextensions reload Reload extensions and *only* extensions feature show channels Show status of feature channelsgroup show channels Show active channels with group(s)help Display help list, or specific help on a command iax2 debug Enable IAX debuggingiax2 jb debug Enable IAX jitterbuffer debuggingiax2 no debug Disable IAX debuggingiax2 no jb debug Disable IAX jitterbuffer debuggingiax2 no trunk debug Disable IAX trunk debuggingiax2 provision Provision an IAX deviceiax2 prune realtime Prune a cached realtime lookupiax2 reload Reload IAX configurationiax2 set jitter Sets IAX jitter bufferiax2 show cache Display IAX cached dialplaniax2 show channels Show active IAX channelsiax2 show firmware Show available IAX firmwaresiax2 show netstats Show active IAX channel netstatsiax2 show peer Show details on specific IAX peeriax2 show peers Show defined IAX peersiax2 show provisioning Show iax provisioningiax2 show registry Show IAX registration statusiax2 show stats Display IAX statisticsiax2 show users Show defined IAX usersiax2 test losspct Set IAX2 incoming frame loss percentage iax2 trunk debug Enable IAX trunk debugginginclude context Include context in other contextindication add Add the given indication to the country indication remove Remove the given indication from the countryinit keys Initialize RSA key passcodesload Load a dynamic module by namelocal show channels Show status of local channelslogger reload Reopens the log fileslogger rotate Rotates and reopens the log fileslogger show channels List configured log channelsmeetme Execute a command on a conference or confereemgcp audit endpoint Audit specified MGCP endpointmgcp debug Enable MGCP debuggingmgcp no debug Disable MGCP debuggingmgcp reload Reload MGCP configurationmgcp show endpoints Show defined MGCP endpointsmixmonitor Execute a MixMonitor commandmoh classes show List MOH classesmoh files show List MOH file-based classesmoh reload Music On Holdno debug channel Disable debugging on a channelodbc connect Connect to ODBC DSNodbc disconnect Disconnect from ODBC DSNodbc show Show ODBC DSN(s)pri debug span Enables PRI debugging on a spanpri intense debug span Enables REALLY INTENSE PRI debuggingpri no debug span Disables PRI debugging on a spanpri set debug file Sends PRI debug output to the specified file pri show debug Displays current PRI debug settingspri show span Displays PRI Informationpri unset debug file Ends PRI debug output to filerealtime load Used to print out RealTime variables.realtime mysql status Shows connection information for the MySQL RealTime d riverrealtime update Used to update RealTime variables.reload Reload configurationremove extension Remove a specified extensionremove ignorepat Remove ignore pattern from contextremove queue member Removes a channel from a specified queue restart gracefully Restart Asterisk gracefullyrestart now Restart Asterisk immediatelyrestart when convenient Restart Asterisk at empty call volumertp debug Enable RTP debuggingrtp debug ip Enable RTP debugging on IPrtp no debug Disable RTP debuggingset debug Set level of debug chattinessset verbose Set level of verbosenessshow agents Show status of agentsshow agi Show AGI commands or specific helpshow applications Shows registered dialplan applications show application Describe a specific dialplan application show audio codecs Shows audio codecsshow channel Display information on a specific channel show channels Display information on channelsshow channeltypes Show available channel typesshow codecs Shows codecsshow codec Shows a specific codecshow conferences Show status of conferencesshow config mappings Show Config mappings (file names to config engines)show dialplan Show dialplanshow features Lists configured featuresshow file formats Displays file formatsshow functions Shows registered dialplan functionsshow function Describe a specific dialplan functionshow hints Show dialplan hintsshow image codecs Shows image codecsshow image formats Displays image formatsshow indications Show a list of all country/indications show keys Displays RSA key informationshow license Show the license(s) for this copy of Asteriskshow manager command Show a manager interface commandshow manager commands List manager interface commandsshow manager connected Show connected manager interface users show modules List modules and infoshow modules like List modules and infoshow parkedcalls Lists parked callsshow queue Show status of a specified queueshow queues Show status of queuesshow switches Show alternative switchesshow translation Display translation matrixshow uptime Show uptime informationshow version Display version infoshow version files Show versions of files used to build Asteriskshow video codecs Shows video codecsshow voicemail users List defined voicemail boxesshow voicemail zones List zone message formatsshow warranty Show the warranty (if any) for this copy of Asterisksip debug Enable SIP debuggingsip debug ip Enable SIP debugging on IPsip debug peer Enable SIP debugging on Peernamesip history Enable SIP historysip no debug Disable SIP debuggingsip no history Disable SIP historysip notify Send a notify packet to a SIP peersip prune realtime Prune cached Realtime object(s)sip prune realtime peer Prune cached Realtime peer(s)sip prune realtime user Prune cached Realtime user(s)sip reload Reload SIP configurationsip show channels Show active SIP channelssip show channel Show detailed SIP channel infosip show domains List our local SIP domains.sip show history Show SIP dialog historysip show inuse List all inuse/limitssip show objects Show all SIP object allocationssip show peer Show details on specific SIP peersip show peers Show defined SIP peerssip show registry Show SIP registration statussip show settings Show SIP global settingssip show subscriptions Show active SIP subscriptionssip show users Show defined SIP userssip show user Show details on specific SIP userskinny debug Enable Skinny debuggingskinny no debug Disable Skinny debuggingskinny show devices Show defined Skinny devicesskinny show lines Show defined Skinny lines per devicesoft hangup Request a hangup on a given channelstop gracefully Gracefully shut down Asteriskstop now Shut down Asterisk immediatelystop when convenient Shut down Asterisk at empty call volume unload Unload a dynamic module by namezap destroy channel Destroy a channelzap show cadences List cadenceszap show channels Show active zapata channelszap show channel Show information on a channelzap show status Show all Zaptel cards status。

《Asterisk 使用资料》..

《Asterisk 使用资料》..

Asterisk目录及配置文件/etc/asterisk/Asterisk主目录,包含其它关于Asterisk的配置文件;*zaptel.conf这个配置文件放在/etc,因为其它软件也可以使用Zaptel这个硬件及其驱动,所以不是放在/etc/asterisk里./usr/lib/asterisk/modules/这个目录包含所有可以加载Asterisk模块(应用程序\编辑器\格式和有用通道),在Asterisk启运时会加载这些模块(可以编辑modules.conf)./var/lib/asterisk/比较重要的是astdb文件与agi-bin目录;astdb包含Asterisk当地数据库信息.sounds/所有声音提示的文件在里面,包括Asterisk原代码中的sounds.txt文件mohmp3/如果配置了音乐保持,应用程序会在这个目录下查找mp3(用CBR从文件中去除身份标签).keys/使用公钥和私钥系统认证与一个由RSA数字签名形成的一对等连接.公钥和私钥的扩展名分别为.pub和.keyfirmware/这个目录含了很多Asterisk相兼容的设备固件,它只有iax/这个子目录,其中有Digium的IAXy的二进制固件镜像.images/只有在较多的支持并且利用图解式的图像设备被发布,这个目录将会与相应的目录有更大的关联./var/lib/asterisk/agi-bin agi-bin包含所有脚本,可以通过许多已经建立的AGI应用程序与Asterisk连接./var/spool/asteriskoutgoing/gcall/tmp/voicemail/================配置文件================/etc/asterisk/asterisk.conf主要配置文件,/etc/zaptel.conf硬件接口的基本层.修改这个配置文件要用modprobe装载Linux Kernel使用模块./etc/asterisk/zapata.conf为硬件配置Asterisk的接口./etc/asterisk/extensions.conf拨号方案./etc/asterisk/sip.conf SIP协议配置文件/etc/asterisk/iax.conf呼入和呼出IAX通道/etc/asterisk/extensions.conf拨号方案配置文件/etc/asterisk/moduprobe.conf加载模块配置文件Asterisk developer\'s documentation 翻译计划by serva今天,Asterisk已经成为一个VOIP业界使用最广泛的一个集成电信级别P BX的工具,IPPBX如今已经成为VOIP商家争夺的一块重要市场,在我们越来越熟悉使用Asterisk的同时,我们希望能够越来越深入的了解asterisk,特别是对于开发人员,如果有自己特定的需求,在复杂的asterisk文件夹和asteri sk的源代码文件中迷失了方向,不知所措。

Asterisk 入门一 --- Asterisk 1.6.2.6 安装

Asterisk 入门一 --- Asterisk 1.6.2.6 安装

Asterisk 入门一 --- Asterisk 1.6.2.6 安装2010-04-28 16:27其实asterisk安装灰常简单只要跟着安装包中的readme 文档一步一步走就可以了:1.安装测试环境虚拟机:Sun VirtualBox 3.1X操作系统:CentOS 52.Astrisk各稳定版本以及附加工具/downloads改页面有很多下载选项大概的介绍一下1.AsteriskAsterisk 源码压缩包,这就是我们要用的2.AsteriskNOWAsteriskNOW 是一个光盘镜像包含了linux 系统,一旦安装完成就有一套简单的PBX 系统了3.Asterisk Add-OnsAsterisk Add-Ons 是Asterisk 和Asterisk 一些相关的驱动和组件等。

3.下载安装# wget/pub/telephony/asterisk/releases/asteris k-1.6.2.6.tar.gz#tar -zxvf asterisk-1.6.2.6.tar.gz# cd asterisk-1.6.2.6运行配置脚本检测依赖关系并设置安装目录# ./configure --prefix=/usr/local/asterisk看到硕大的星号了嘛哈哈配置成功.$$$$$$$$$$$$$$$=...$7$7.. .7$$7:..$$:. ,$7.7.$7. 7$$$$ .$$77..$$. $$$$$ .$$$7..7$ .?. $$$$$ .?. 7$$$.$.$. .$$$7. $$$$7 .7$$$. .$$$..777. .$$$$$$77$$$77$$$$$7. $$$,$$$~ .7$$$$$$$$$$$$$7. .$$$..$$7 .7$$$$$$$7: ?$$$.$$$ ?7$$$$$$$$$$I .$$$7$$$ .7$$$$$$$$$$$$$$$$ :$$$.$$$ $$$$$$7$$$$$$$$$$$$ .$$$.$$$ $$$ 7$$$7 .$$$ .$$$.$$$$ $$$$7 .$$$.7$$$7 7$$$$ 7$$$$$$$$ $$$$$$$7. $$ (TM)$$$$$$$. .7$$$$$$ $$$$$$$$$$$$$$7$$$$$$$$$.$$$$$$ $$$$$$$$$$$$$$$$.该步骤可选,该步骤用于选择一些模块#make menuselect编译安装#make#make install安装一些简单的配置文件#make samples好了现在都安装结束了--------------------------------------------------------------------------------------------启动守护进程# safe_asterisk进入CLI#asteriks -r更多的命令可以使用 #man asterisk查看按q退出Asterisk 入门二 --- Asterisk 配置以及控制台命令2010-04-28 16:52接下来我们开始学习asterisk先提供个学习的教材和网址大部分的问题可以在/中找到解答其次提供一本 Asterisk 入门教程叫Asterisk,电话未来之路第二书签版.pdf自个摆渡下吧-------------------------------------------------------------------------------------Asterisk 几个相关目录配置文件/usr/local/asterisk/etc/asterisk可执行文件目录 /usr/local/asterisk/sbin先启动asterisk守护进程#safe_asterisk进入控制台#asterisk -rAsterisk 1.6.2.6, Copyright (C) 1999 - 2010 Digium, Inc. and others.Created by Mark Spencer <markster@>Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General PublicLicense version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details.=========================================================================Connected to Asterisk 1.6.2.6 currently running on localhost (pid = 18023)Verbosity is at least 3localhost*CLI>看看有啥命令>core show help或者具体的命令帮助>core show help <command>Asterisk app命令中文翻译2008-11-06 15:15常规指令Authenticate:鉴别用户VMAuthenticate:根据“voicemail.conf”鉴别用户Curl:接受外接URLs的修复。

asterisk入门资料

asterisk入门资料

Asterisk入门资料目录1. 概述 (3)2. 什么是asterisk?开源电话平 (3)3. 为什么使用Asterisk? (3)4. 专利技术有什么错? (3)5. 我们要Asterisk做什么? (4)6. Asterisk支持什么技术? (4)7. 比较好的Asterisk参考书? (4)8. 相关: (4)9. 组件: (4)10. 有用的网页: (5)11. 重要链接: (5)12. 重要信息: (5)13. 外部交换借口/通道接口 (6)14. 拨号计划: (6)14.1. 上下文(context) : (6)14.2. 分机以如下格式定义: (7)14.3. Applications: (7)14.4. 特别分机: (8)14.5. 这个拨号计划会: (8)14.6. 为拨号计划添加逻辑: (8)15. 载入Ubuntu: (9)16. 求助: (9)17. 本章的任务: (10)18. 备注: (20)1.概述subscriber:加入某个group,从而遵从某一个call restricionsubscriber group:可以使用1种call restriction。

call restriction:将numbering plan中各项取出,各自组成成不同的呼叫限制方案numbering plan:通用,是一个整体的计划,里面包括长途,本地,等各种形式的方案————————————————————-以上,用于拨入号码的预处理,实际上是一种过滤,下面才是真正的呼叫处理。

————————————————————–route:一种策略,根据号码匹配的模式,选择走哪个trunk。

trunk:实际上做通一个链路,供route选择。

analog的,一个POTS就是一条analog trunkanalog的数量由设备定,ip trunk没有限制数量,并且一个ip trunk连到对方IPPBX后,对方的subscriber 数量是不确定的,由那个IP PBX决定。

Asterisk-相关知识与应用

Asterisk-相关知识与应用

DialPlan (拨号方案)
dial : 它是Asterisk 很有价值的一功能,当来电者使用不同的通信方式时,它可以进行转换并进 行呼叫连接,如SIP电话到PSTN呼叫
Contexts : 拨号方案(DialPlan)进入部分我我们称为Contexts,每个Contexts 有一些extensions(扩展)构成,来实现一系列相关服务。
举一个例子如下: [default]
在extensions.conf 配制文件中, [default]上下文是拨号方案默认的进入部分
DialPlan (拨号方案)
goto 功能是发送呼叫到拨号方案中的其它context部分.
语法: goto(context,extension,priority)
[default] exten => 123,1,Answer() exten => 123,n,Background(main-menu) exten => 1,1,Playback(digits/1)
支持一条线路,只需要增32KB 的带宽,但是需要网络 质量良好。 Asterisk可支持成千的客户端(需要板卡与带宽支持)
asterisk 安装与启动
1从官方网站下载 asterisk-1.2.26.tar包,拷备到LINUX 下的用户目录. 2 用tar xzvf asterisk-1.2.26.tar 解压到当目录. 3 进入 asterisk 目录 执行如下命令
/usr/lib/asterisk/modules/ 这个目录包含所有可以加载Asterisk模块(应用程序\ 编辑器\格式和有用 通道),在Asterisk启运时会加载这些模块(可以编辑 modules.conf).
/var/lib/asterisk 比较重要的是astdb文件与agi-bin目录;astdb包含Asterisk当地数 据库信息. sounds/ 所有声音提示的文件在里面 mohmp3/ 如果配置了音乐保持,应用程序会在这个目录下查找mp3 keys/ 使用公钥和私钥系统认证与一个由RSA数字签名形成的一对等 连接.公钥和私钥的扩展名分别为.pub和.key

asterisk配置文件列表及常用指令

asterisk配置文件列表及常用指令

配置文件说明列表:常规指令Authenticate:鉴别用户VMAuthenticate:根据“voicemail.conf”鉴别用户Curl:接受外接URLs的修复。

支持POSTingDUNDiLookup:用DUNDi查寻号码SendDTMF:发送独裁的DTMF数据SendImage:发送图像档案SendText:发送给客户正文消息SendURL:发送给客户USL以显示System:执行系统命令Transfer:将访客转移到另一个扩展名TrySystem:0回复执行系统命令Wait:稍等WaitExten稍等:WaitForRing:等待呼叫申请WaitMusicOnHold:等待,在线音乐BillingForkCDR:将CDR分成两个独立的实体NoCDR:确保 asterisk没有把CRD保存为特定的呼叫ResetCDR:重新安装CDR数据SetAccount:设置帐簿号码SetAMAflags:开通AMA标志开户的渠道SetCDRUserField:建立CDR用户领域AppendCDRUserField:给CDR用户附加数据Call management (hangup, answer, dial, etc)Answer:如果呼叫回复一个信道Busy:显示忙的情形等待挂断ChanIsAvail:如果信道可以利用即核查Congestion:显示拥塞等待挂断Dial:设置一个指令连接当前的信道DISA:直接访问内在系统Hangup: 无条件挂断Ringing显示呼叫Caller presentation (ID, Name etc)CallingPres:更改呼叫者的身份介绍LookupBlacklist: 从黑名单数据库上查询访客的身份姓名和号码LookupCIDName: 从当地的数据库查询访客的身份和姓名PrivacyManager:如果没有CallerID过来,要求输入电话号码SetCallerID: 建立CallerID,发生矛盾服从CallerIDSetCallerPres:建立访客资料的独立信道SetCIDName:建立呼叫者身份姓名,发生矛盾服从CallerID SetCIDNum: 只建立访客的身份号码(没有姓名),发生矛盾服从CallerID SoftHangup: 请求挂断转到另一个信道Zapateller:拥SIT阻止远程商人ADSI• ADSIProg:将 Asterisk ADSI Scripts 加载到电话• GetCPEID: 获得 ADSI CPE IDDatabase handling• DBdel: 从数据库中删除一个键. 发生矛盾服从 DB.• DBdeltree: 从数据库中删除群. 发生矛盾服从 DB.• DBget:从数据库中找回数值. 发生矛盾服从DB.• DBput: 在数据库中储存一个数值. 发生矛盾服从DB.• MYSQL:执行不同的 mySQL 数据库行为查 Asterisk database 找更多的信息.Application integration• AGI: 执行一套AGI 适应程序• DeadAGI: 在中断的信道上执行AGI• EAGI: 执行一套 AGI 适应程序• EnumLookup:在 ENUM 中查找号码• Macro: 执行较大的程序• NoOp: 不进行操作,可将数值打印到控制太进行调试• Perl: res perl 是Apache 的 mod_perl, 只适用于 Asterisk • PHP: res_php 不需要就可将PHP与进行一体化处理• Read: 用DTMF读变量• TXTCIDName: 从 TXT 记录中查找访客的姓名• UserEvent:发送任意结果给界面处理器Control flow & timeouts• AbsoluteTimeout: 建立呼叫最长时间• DigitTimeout: 建立数据间的最长时间间隔• Goto:转到优先码,扩展名和过渡段• GotoIf: 条件展转接• GotoIfTime: 当前的条件转接• Random: 在拨号栏中随机跳动• ResponseTimeout: 设置等候回应的最长时间• While: 开始一个当循环- *1.2beta• EndWhile: 结束一个当循环 - *1.2beta• ExecIf: 条件执行 - *1.2betaString & variable manipulation• Cut: 串处理功能,发生矛盾支持 CUT.• ImportVar: 赋数值变量• Math: 进行简单的计算• Prefix: 预设主要的数据• SetGlobalVar:赋数值变量• Set: 设信道变量和功能值• SetVar: 赋数值变量(如果不允许,使用 Set)• StripLSD: 消除附加的数据• StripMSD: 消除主要的数据• SubString: 在一个预设的变量中保存子链数据• Suffix:添加附加数据Sounds:录音重放• Background: 当执行其它命令的时候播放声音文件• BackgroundDetect: 用谈话探测背景文件• ControlPlayback: 用快进,重绕和离开当前命令控制器播放声音文件• DateTime: 显示日期/和时间• Echo: 重复声音回复到永福端• Festival: 使用欢快的声音合成器朗诵课文• Milliwatt: 在0分贝产生持续的1000赫兹的音调• MP3Player: 播放MP3声音文件• MusicOnHold: 无限度地播放音乐• Playback: 播放一个声音文件• Playtones: 当执行其它命令的时候播放声音列表• SayUnixTime: 显示日期/和时间• SayAlpha: 显示字母• SayDigits: 显示阿拉伯数字• SayNumber: 显示数字• SayPhonetic:显示语音• SetMusicOnHold: 在控制系统上显示默认的音乐• SetLanguage: 为录音重放显示语言转换• StopPlaytones: 停止播放音调列表查看Asterisk sound files 获取更多信息语音: 录音和监测• ALSAMonitor: 监测ALSA控制台• ChangeMonitor: 转换监测的路线文件名• ChanSpy:通用的路线干涉• Dictate: 听写的录音和播放• Monitor: 录音电话会话到声音文件• MuxMon:记录和混合电话支架• Record: 记录电话会话到语音文件• StopMonitor: 停止监测路线SIP 命令• SIPdtmfMode: 在SIP呼叫过程中转换DTMF模式• SIPGetHeader: 从SIP邀请信息中获取标题• SIPAddHeader: 填标题到外部的SIP邀请• suplimental resource SIPCallPickup:在获取组中获取打入的电话• sipredirect: 发送SIP 302信息到呼叫者ZAP 命令• Flash: 编辑到Zap主页• ZapBarge: 干涉Zap路线• ZapRAS: 提供ISDN数据服务• ZapScan: 扫描Zap路线到监督程序调用•查看 Asterisk zap channels, zapata.conf 获取等多信息.语音邮件和会议• Directory: 规定语音邮件扩展目录• HasNewVoicemail: 有条件的分枝到优先权+101• MailboxExists: 检查邮箱是否存在• MeetMe:简单的 MeetMe 会议桥• MeetMeAdmin: MeetMe 会议管理• MeetMeCount: MeetMe参与者计算• VoiceMail: 语音留言• VoiceMailMain: 进入语音系统• VMAuthenticate: 基于语音邮箱鉴别用户查看 voicemail.conf 获取更多的信息列队和ACD操纵• AddQueueMember: 自动添加排队成员• AgentCallbackLogin: 呼叫代理商回叫注册• AgentLogin: 呼叫代理商注册• AgentMonitorOutgoing: 记录代理商的外出呼叫• ParkAndAnnounce: 停放和宣告• ParkedCall: 回复被停放的呼叫• PauseQueueMemeber: 中止代理• Queue: 排队等代呼叫• RemoveQueueMember: 自动移交列队成员• UnpauseQueueMemeber: 重新开始代理警报监测/中心站警报接受站:仿效一个Ademco 连接ID的警报接受站业余无线电接受装置/转发器连接Rpt:支持业余无线电接受装置和商业化的两种转发器连接外部应用(不是在CVS里)Asterisk app_dbodc:用unixODBC进行拨号方案修正DynExtenDB:数据库中的存储扩充Iconv:字符切换设置app Prepaid:为Postgres 所设计的PPPD:邮件后台程序连接器Bristuff & zaphfc applications• PickUp: 大多数路线是独立的;是bristuff片的一部分• PickUpChan:接收指定路线• PickupSIPuri• PickDown: 挂断长途电话• Steal: 接受中转电话• Devstate: 产生一种安装设备驱动程序状态来改变事件(忙,打电话…)• Segfault:用 segfault 撞击Asterisk• ZapEC: 对于Zap能或者不能的回波消除• Autoanswer: 在指定范围内自动回话• AutoanswerLogin: 登陆到自动回话应用程序vISDN applicationsVISDN交叠拨号Sirrix 路径的应用• SrxEchoCan: 不能/能回波消除• SrxDeflect: 偏转进入的电话• SrxMWI:在Sirrix组上设置/重新设置信息等待指示(MWI)。

Asterisk学习笔记

Asterisk学习笔记

Asterisk学习笔记1.安装Asterisk需要那些安装包。

a)Asterisk(pure voip only need this)b)Zaptel(support 硬件板卡支持)c)Pri(libpri)2.Asterisk的版本a)Asterisk目前有1.4和1.6两个分支,我们的HCC系统采用的是1.4分支上进行扩展开发。

1.6 no longer support zaptel,增加了很多新features,相对与1.4版本变动比价大。

b)Upgrade:ael 取消了Macro() 用Gosub()来代替。

Applications:ChanIsAvail()增加-t选项3.How to install Asterisk on Linux.a)Login as rootb)tar zxvf Asterisk-1.6…解压c)进入sub folderd)#make cleane)#./configuref)#makeg)#make installh)#make samples(安装示例配置)4.How to run/stop Asteriska)进入console,直接运行#asterisk 来运行b)进入asterisk命令提示界面:#asterisk –r 然后CLI>stop nowc)Asterisk可以用safe_asterisk来安全启动,通过safe_asterisk启动后如果asterisk crash会dump core到/tmp目录,并且给administrator发email告警。

5.Asterisk目录结构a)/usr/lib/asterisk/modules 这个目录下包含所有可加载的asterisk模块b)/var/spool/asterisk 这个目录下包括outgoing gcall tmp voicemail目录asterisk会去monitor这个目录,可以用在做自动外呼等等c)/var/log/asterisk用来store logsd)/var/log/asterisk/cdr-csv用来store cdrs in csv format. CSV=comma-separate-value6.SIP in Asteriska)Asterisk中sip配置文件为/etc/asterisk/sip.confb)Asterisk支持IAX与SIP VOIP协议。

queue命令 asterisk

queue命令 asterisk

Queues.confQueues.conf-[general];; Global settings for call queues;全局设置; Persistent Members; Store each dynamic member in each queue in the astdb so that; when asterisk is restarted, each member will be automatically; read into their recorded queues. Default is 'yes'.;把每一个QUEUE里面的成员都存到astDB里面,这样当asterisk重启的时候,每一个成员都能够自动的恢复到Queue当中,default='yes'persistentmembers = yes;; AutoFill Behavior; The old/current behavior of the queue has a serial type behavior; in that the queue will make all waiting callers wait in the queue; even if there is more than one available member ready to take; calls until the head caller is connected with the member they; were trying to get to. The next waiting caller in line then; becomes the head caller, and they are then connected with the; next available member and all available members and waiting callers; waits while this happens. The new behavior, enabled by setting; autofill=yes makes sure that when the waiting callers are connecting; with available members in a parallel fashion until there are; no more available members or no more waiting callers. This is; probably more along the lines of how a queue should work and; in most cases, you will want to enable this behavior. If you; do not specify or comment out this option, it will default to no; to keep backward compatibility with the old behavior.;会记住每一个成员和用户当前的状态,自动去尝试连接坐席,并自动更新用户当前的状态.比如之前还有几个人在等待.下一个等待的用户将会变成第一个用户,然后他们会连接到第一个可用的分机。

Asterisk常用调试命令

Asterisk常用调试命令

Asterisk基本配置Asterisk译为星号(*在很多应用中被用做通配符,Astrisk做为PBX系统的完美名称,原因之一是Asterisk可以连接数目庞大的接口类型,包括:1模拟接接口,如你的电话线或模拟电话.2数字线路,如T-1和E-1线路3Voip协议,如SIP和IAX目前正式版本是IAX2,但是IAX1的所有格式都已经停掉.所以当说到IAX都是特拽IAX2使用接口配置文件1.Zaptel.conf:硬件接口基层配置,我们将建立一个FX0和一个FXS通道.2.zapata.conf:硬件配置Asterisk的接口.3.extension.conf:拨号方案文件.4.sip.conf:配置SIP协议的文件5.iax.conf:配置呼入和呼出IAX通道的文件******编辑完zaptel.conf文件,需要使用/sbin/ztcfg -vv装载配置到硬件(不须要详细输出可以省略-vv;修改信令方法需要重启.在编辑sip.conf和iax.conf文档后,分别需要装载chan_iax2.so和chan_sip.soAsterisk译为星号(*在很多应用中被用做通配符,Astrisk做为PBX系统的完美名称,原因之一是Asterisk可以连接数目庞大的接口类型,包括:1模拟接接口,如你的电话线或模拟电话.2数字线路,如T-1和E-1线路3Voip协议,如SIP和IAX目前正式版本是IAX2,但是IAX1的所有格式都已经停掉.所以当说到IAX都是特拽IAX2使用接口配置文件1.Zaptel.conf:硬件接口基层配置,我们将建立一个FX0和一个FXS通道.2.zapata.conf:硬件配置Asterisk的接口.3.extension.conf:拨号方案文件.4.sip.conf:配置SIP协议的文件5.iax.conf:配置呼入和呼出IAX通道的文件******编辑完zaptel.conf文件,需要使用/sbin/ztcfg -vv装载配置到硬件(不须要详细输出可以省略-vv;修改信令方法需要重启.在编辑sip.conf和iax.conf文档后,分别需要装载chan_iax2.so和chan_sip.so******SIPSIP(会话初始协议,通常用于VOIP电话,进行呼叫建立,呼叫协商,呼叫结束.它帮助两个端互相通认,但它不处理媒体;当呼叫建立后,他通过实时传输协议(RTP在电话A到电话B直接传输媒体SIP和RTPSIP是一个应用层的信令协议.他使用的端口是5060(通常进行通信.SIP可以通过UDP和TCP传输层协议进行传输.Asterisk目前没有TCP用于传输SIP信息.RTP用于端点间传输媒体(语音,Asterisk中RTP使用大数字的无特权端口(默认10,000到20,000SIP优点:普通的被接受和结构灵活.其它的VOIP协议还有H.323,IAX,MGCP. SIP配置/etc/asterisk/sip.conf文件中:[general]srvlookup=yet[10000]type=friend;可以定义用户\端\朋友asterisk常用命令1. 运行调试常用命令./asterisk & 在后台启动asterisk./asterisk –vvvc 启动asterisk并尽量多的在控制台显示调试信息./asterisk –r 连接asterisk控制台set verbose 9999 设置打印详细信息2.asterisk控制台下常用命令sip reloadsip set debug 设置显示更多的sip信息sip set debug off关闭显示更多的sip信息sip show channels 显示所有活动的SIP通道sip show peers 显示所有已定义的SIP peersip show channels 查看当前SIP协议的并发。

Asterisk 入门教程

Asterisk 入门教程

Asterisk 入门教程subscriber:加入某个group,从而遵从某一个call restricionsubscriber group:可以使用1种call restriction。

call restriction:将numbering plan中各项取出,各自组成成不同的呼叫限制方案numbering plan:通用,是一个整体的计划,里面包括长途,本地,等各种形式的方案-------------------------------------------------------------以上,用于拨入号码的预处理,实际上是一种过滤,下面才是真正的呼叫处理。

--------------------------------------------------------------route:一种策略,根据号码匹配的模式,选择走哪个trunk。

trunk:实际上做通一个链路,供route选择。

analog的,一个POTS就是一条analog trunkanalog的数量由设备定,ip trunk没有限制数量,并且一个ip trunk连到对方IPPBX后,对方的subscriber 数量是不确定的,由那个IP PBX决定。

Asterisk,开始吧--------------------------------------------------------------什么是asterisk?开源电话平台Asterisk 通过了电话的开源平台。

基本上就是一个软件的PBX。

最初是Digium 公司的Mark Spencer 编写的,这个公司就是他创立的,专门生产并销售Asterisk使用的硬件。

Asterisk 简直就是一场电话的革命。

为什么使用Asterisk?现在电信行业的混乱,因为各种专利技术应用在各种层次的网络上,导致很大的混乱。

Asterisk 就是答案——给电信行业普遍的混乱环境带来秩序的革命。

asterisk sip配置说明..

asterisk sip配置说明..

asterisk sip配置说明1. 介绍extensions.conf中使用sip设备的语法是SIP/devicename,devicename名在下一节中说明。

如果用户在Internet上,可以使用SIP/username@domain形式,同时不要忘记打开D NS SRV功能。

如果定义了一个SIP代理,可以使用SIP/proxyhostname/user或者SIP/user@proxy hostname形式,proxyhostname的定义在下面的章节说明。

2. 在CLI中的查询命令:u sip show peers 显示所有的SIP peers(包括friends)u sip show users 显示所有的SIP users(包括friends)u sip show registry 显示注册到的主机状态u sip debug 显示所有的Sip信息u module reload chan_sip.so 重新装载sip的配置文件3. 设备命名命名一个设备之前,要先理解Asterisk是怎么处理呼入电话的:1) Asterisk取出SIP From: address中的username,使用它来匹配系统中定义的type=user的的设备名。

2) Asterisk检查INVITE请求中的IP地址和端口号,使用它来匹配系统中定义的t ype=peer的设备。

不要混淆extensions和设备名的概念。

设备需要一个唯一的名字。

设备名不能用于电话号码。

电话号码是拨号计划中的声明的一个extension。

注意:参数username并不是用户名的意思,在大多数情况下,它根本不是必须的。

在后边,我们把它重命名做defaultuser,因为他与defaultip合并使用。

4. 通用属性说明[general] ;通用属性context=default ;呼入电话默认使用的contextallowguest=no ; 允许或拒绝客户呼叫 (默认 yes)allowoverlap=no ; 允许重叠拨号(默认yes)allowtransfer=no ; 允许呼叫转接(默认yes)realm=mydomain.tld ; 认证的领域。

Asterisk拨号方案常用函数

Asterisk拨号方案常用函数

Asterisk拨号方案常用函数说明(1)Answer()应用于接听正在响铃通道,它不需要任何参数.(2)Playback()应用在通道上播放事先录制好的语音文件.指定一个文件名(不带扩展名),可以使用绝对路径与相对路径.(3)Hangup()应用在于挂断一个正在活动的通道.(4)Background()它也播放事先录制好的语音文件,但它等待按键,然后执行对应extension.防止Background()后超出按键范围,使用i来解决问题.防止Background长时间没有选择,使用t来决解问题.(5)Goto()Goto应用使得在拨号方案的不同部分有序的转移非常容易. Goto()应用有三个参量分别是context,extension,和priority.即Goto(context,extension,priority)(6)Dial()Dial()有4个参数.(a)第一个是:呼叫的被叫地.如:SIP/50000或Zap/1.可以同时拨打多个通道如: exten =>601,1,Dial(Zap/1&SIP/50000&IAX/60000)(b)第二个是:超时,单位"秒".给定超时参量Dial会一直对被叫地进行呼叫,直到超时后才放弃,如果没有给定,将直到接听或主叫挂机,如果呼叫在超时前接听,通道就被桥接,拨号完。

成补充:如果超时后被叫地没有应答,则会继续Dial()的extension下一个priority.如果被叫地通道忙,Dial()将转到priority n+101(n是Dial()被调用的priority),如果存在的话,将能够处理被叫地忙的方式接叫未接电话.(c)第三个是:可选择参量,它会可以影响到Dial()的行为,如: exten =>601,1,Dial(SIP/50000,30,Ttwr) 其中T表示允许主叫用户按"#"转接呼叫;t表示允许被叫用户按"#"转接呼叫;r表示为被叫用户产生振铃声;w用户按"*"键开始录音(d)最后一个是:URL参量.如: exten =>601,1,Dial([email=SIP/60000@]SIP/60000@[/email]) exten => 602,1,Dial(Zap/1/5732381) 任何参量都可以为空如: exten => 601,1,Dial(SIP/60000,,T) 或 exten => 601,1,Dial(SIP/60000)AddQueueMember: Dynamically adds queue membersADSIProg: Load Asterisk ADSI Scripts into phoneAGI: Executes an AGI compliant applicationAMD: Attempts to detect answering machinesAnswer: Answer a channel if ringingAppendCDRUserField: Append to the CDR user fieldAuthenticate: Authenticate a userBackGround: Play an audio file while waiting for digits of an extension to go to.BackgroundDetect: Background a file with talk detectBusy: Indicate the Busy conditionChangeMonitor: Change monitoring filename of a channelChanIsAvail: Check channel availabilityChannelRedirect: Redirects given channel to a dialplan target.ChanSpy: Listen to a channel, and optionally whisper into itCongestion: Indicate the Congestion conditionContinueWhile: Restart a While loopControlPlayback: Play a file with fast forward and rewindDAHDIBarge: Barge in (monitor) DAHDI channelDAHDIRAS: Executes DAHDI ISDN RAS applicationDAHDIScan: Scan Zap channels to monitor callsDAHDISendKeypadFacility: Send digits out of band over a PRIDateTime: Says a specified time in a custom formatDBdel: Delete a key from the databaseDBdeltree: Delete a family or keytree from the databaseDeadAGI: Executes AGI on a hungup channelDial: Place a call and connect to the current channelDictate: Virtual Dictation MachineDirectory: Provide directory of voicemail extensionsDISA: DISA (Direct Inward System Access)DumpChan: Dump Info About The Calling ChannelEAGI: Executes an EAGI compliant applicationEcho: Echo audio, video, or DTMF back to the calling partyEndWhile: End a while loopExec: Executes dialplan applicationExecIf: Executes dialplan application, conditionallyExecIfTime: Conditional application execution based on the current timeExitWhile: End a While loopExtenSpy: Listen to a channel, and optionally whisper into itExternalIVR: Interfaces with an external IVR applicationFlash: Flashes a DAHDI trunkForkCDR: Forks the Call Data RecordGetCPEID: Get ADSI CPE IDGosub: Jump to label, saving return addressGosubIf: Conditionally jump to label, saving return addressGoto: Jump to a particular priority, extension, or contextGotoIf: Conditional gotoGotoIfTime: Conditional Goto based on the current timeHangup: Hang up the calling channelHasNewVoicemail: Conditionally branches to priority + 101 with the right options set HasVoicemail: Conditionally branches to priority + 101 with the right options setIAX2Provision: Provision a calling IAXy with a given templateICES: Encode and stream using 'ices'ImportVar: Import a variable from a channel into a new variableLog: Send arbitrary text to a selected log levelLookupBlacklist: Look up Caller*ID name/number from blacklist databaseLookupCIDName: Look up CallerID Name from local databaseMacro: Macro ImplementationMacroExclusive: Exclusive Macro ImplementationMacroExit: Exit From MacroMacroIf: Conditional Macro ImplementationMailboxExists: Check to see if Voicemail mailbox existsMeetMe: MeetMe conference bridgeMeetMeAdmin: MeetMe conference AdministrationMeetMeCount: MeetMe participant countMilliwatt: Generate a Constant 1004Hz tone at 0dbm (mu-law)MixMonitor: Record a call and mix the audio during the recordingMonitor: Monitor a channelMorsecode: Plays morse codeMP3Player: Play an MP3 file or streamMusicOnHold: Play Music On Hold indefinitelyNBScat: Play an NBS local streamNoCDR: Tell Asterisk to not maintain a CDR for the current callNoOp: Do NothingPage: Pages phonesPark: Park yourselfParkAndAnnounce: Park and AnnounceParkedCall: Answer a parked callPauseMonitor: Pause monitoring of a channel PauseQueueMember: Pauses a queue memberPickup: Directed Call PickupPlayback: Play a filePlayTones: Play a tone listPrivacyManager: Require phone number to be entered, if no CallerID sent Progress: Indicate progressQueue: Queue a call for a call queueQueueLog: Writes to the queue_logRandom: Conditionally branches, based upon a probabilityRead: Read a variableReadFile: ReadFile(varname=file,length)RealTime: Realtime Data LookupRealTimeUpdate: Realtime Data RewriteRecord: Record to a fileRemoveQueueMember: Dynamically removes queue membersResetCDR: Resets the Call Data RecordRetryDial: Place a call, retrying on failure allowing optional exit extension.Return: Return from gosub routineRinging: Indicate ringing toneSayAlpha: Say AlphaSayDigits: Say DigitsSayNumber: Say NumberSayPhonetic: Say PhoneticSayUnixTime: Says a specified time in a custom formatSendDTMF: Sends arbitrary DTMF digitsSendImage: Send an image fileSendText: Send a Text MessageSendURL: Send a URLSet: Set channel variable(s) or function value(s)SetAMAFlags: Set the AMA FlagsSetCallerID: Set CallerIDSetCallerPres: Set CallerID PresentationSetCDRUserField: Set the CDR user fieldSetGlobalVar: Set a global variable to a given valueSetMusicOnHold: Set default Music On Hold classSetTransferCapability: Set ISDN Transfer CapabilitySIPAddHeader: Add a SIP header to the outbound callSIPDtmfMode: Change the dtmfmode for a SIP callSLAStation: Shared Line Appearance StationSLATrunk: Shared Line Appearance TrunkSMS: Communicates with SMS service centres and SMS capable analogue phonesSoftHangup: Soft Hangup ApplicationSpeechActivateGrammar: Activate a GrammarSpeechBackground: Play a sound file and wait for speech to be recognizedSpeechCreate: Create a Speech StructureSpeechDeactivateGrammar: Deactivate a GrammarSpeechDestroy: End speech recognitionSpeechLoadGrammar: Load a GrammarSpeechProcessingSound: Change background processing soundSpeechStart: Start recognizing voice in the audio streamSpeechUnloadGrammar: Unload a GrammarStackPop: Remove one address from gosub stackStartMusicOnHold: Play Music On HoldStopMixMonitor: Stop recording a call through MixMonitorStopMonitor: Stop monitoring a channelStopMusicOnHold: Stop Playing Music On HoldStopPlayTones: Stop playing a tone listSystem: Execute a system commandTestClient: Execute Interface Test ClientTestServer: Execute Interface Test ServerTransfer: Transfer caller to remote extensionTryExec: Executes dialplan application, always returningTrySystem: Try executing a system commandUnpauseMonitor: Unpause monitoring of a channelUnpauseQueueMember: Unpauses a queue memberUserEvent: Send an arbitrary event to the manager interfaceVerbose: Send arbitrary text to verbose outputVMAuthenticate: Authenticate with Voicemail passwordsVoiceMail: Leave a Voicemail messageVoiceMailMain: Check Voicemail messagesWait: Waits for some timeWaitExten: Waits for an extension to be enteredWaitForRing: Wait for Ring ApplicationWaitForSilence: Waits for a specified amount of silenceWaitMusicOnHold: Wait, playing Music On HoldWhile: Start a while loopZapateller: Block telemarketers with SITZapBarge: Barge in (monitor) Zap channelZapRAS: Executes Zaptel ISDN RAS applicationZapScan: Scan Zap channels to monitor calls ZapSendKeypadFacility: Send digits out of band over a PRIAddQueueMember: Dynamically adds queue membersADSIProg: Load Asterisk ADSI Scripts into phoneAGI: Executes an AGI compliant applicationAMD: Attempts to detect answering machinesAnswer: Answer a channel if ringingAppendCDRUserField: Append to the CDR user fieldAuthenticate: Authenticate a userBackGround: Play an audio file while waiting for digits of an extension to go to. BackgroundDetect: Background a file with talk detectBusy: Indicate the Busy conditionChangeMonitor: Change monitoring filename of a channelChanIsAvail: Check channel availabilityChannelRedirect: Redirects given channel to a dialplan target.ChanSpy: Listen to a channel, and optionally whisper into itCongestion: Indicate the Congestion conditionContinueWhile: Restart a While loopControlPlayback: Play a file with fast forward and rewindDAHDIBarge: Barge in (monitor) DAHDI channelDAHDIRAS: Executes DAHDI ISDN RAS applicationDAHDIScan: Scan Zap channels to monitor calls DAHDISendKeypadFacility: Send digits out of band over a PRIDateTime: Says a specified time in a custom formatDBdel: Delete a key from the databaseDBdeltree: Delete a family or keytree from the databaseDeadAGI: Executes AGI on a hungup channelDial: Place a call and connect to the current channelDictate: Virtual Dictation MachineDirectory: Provide directory of voicemail extensionsDISA: DISA (Direct Inward System Access)DumpChan: Dump Info About The Calling ChannelEAGI: Executes an EAGI compliant applicationEcho: Echo audio, video, or DTMF back to the calling partyEndWhile: End a while loopExec: Executes dialplan applicationExecIf: Executes dialplan application, conditionallyExecIfTime: Conditional application execution based on the current time ExitWhile: End a While loopExtenSpy: Listen to a channel, and optionally whisper into itExternalIVR: Interfaces with an external IVR applicationFlash: Flashes a DAHDI trunkForkCDR: Forks the Call Data RecordGetCPEID: Get ADSI CPE IDGosub: Jump to label, saving return addressGosubIf: Conditionally jump to label, saving return addressGoto: Jump to a particular priority, extension, or contextGotoIf: Conditional gotoGotoIfTime: Conditional Goto based on the current timeHangup: Hang up the calling channelHasNewVoicemail: Conditionally branches to priority + 101 with the right options set HasVoicemail: Conditionally branches to priority + 101 with the right options set IAX2Provision: Provision a calling IAXy with a given templateICES: Encode and stream using 'ices'ImportVar: Import a variable from a channel into a new variableLog: Send arbitrary text to a selected log levelLookupBlacklist: Look up Caller*ID name/number from blacklist database LookupCIDName: Look up CallerID Name from local databaseMacro: Macro ImplementationMacroExclusive: Exclusive Macro ImplementationMacroExit: Exit From MacroMacroIf: Conditional Macro ImplementationMailboxExists: Check to see if Voicemail mailbox existsMeetMe: MeetMe conference bridgeMeetMeAdmin: MeetMe conference AdministrationMeetMeCount: MeetMe participant countMilliwatt: Generate a Constant 1004Hz tone at 0dbm (mu-law)MixMonitor: Record a call and mix the audio during the recordingMonitor: Monitor a channelMorsecode: Plays morse codeMP3Player: Play an MP3 file or streamMusicOnHold: Play Music On Hold indefinitelyNBScat: Play an NBS local streamNoCDR: Tell Asterisk to not maintain a CDR for the current callNoOp: Do NothingPage: Pages phonesPark: Park yourselfParkAndAnnounce: Park and AnnounceParkedCall: Answer a parked callPauseMonitor: Pause monitoring of a channelPauseQueueMember: Pauses a queue memberPickup: Directed Call PickupPlayback: Play a filePlayTones: Play a tone listPrivacyManager: Require phone number to be entered, if no CallerID sent Progress: Indicate progressQueue: Queue a call for a call queueQueueLog: Writes to the queue_logRandom: Conditionally branches, based upon a probabilityRead: Read a variableReadFile: ReadFile(varname=file,length)RealTime: Realtime Data LookupRealTimeUpdate: Realtime Data RewriteRecord: Record to a fileRemoveQueueMember: Dynamically removes queue membersResetCDR: Resets the Call Data RecordRetryDial: Place a call, retrying on failure allowing optional exit extension. Return: Return from gosub routineRinging: Indicate ringing toneSayAlpha: Say AlphaSayDigits: Say DigitsSayNumber: Say NumberSayPhonetic: Say PhoneticSayUnixTime: Says a specified time in a custom formatSendDTMF: Sends arbitrary DTMF digitsSendImage: Send an image fileSendText: Send a Text MessageSendURL: Send a URLSet: Set channel variable(s) or function value(s)SetAMAFlags: Set the AMA FlagsSetCallerID: Set CallerIDSetCallerPres: Set CallerID PresentationSetCDRUserField: Set the CDR user fieldSetGlobalVar: Set a global variable to a given valueSetMusicOnHold: Set default Music On Hold class SetTransferCapability: Set ISDN Transfer CapabilitySIPAddHeader: Add a SIP header to the outbound callSIPDtmfMode: Change the dtmfmode for a SIP callSLAStation: Shared Line Appearance StationSLATrunk: Shared Line Appearance TrunkSMS: Communicates with SMS service centres and SMS capable analogue phones SoftHangup: Soft Hangup ApplicationSpeechActivateGrammar: Activate a GrammarSpeechBackground: Play a sound file and wait for speech to be recognized SpeechCreate: Create a Speech Structure SpeechDeactivateGrammar: Deactivate a Grammar SpeechDestroy: End speech recognitionSpeechLoadGrammar: Load a Grammar SpeechProcessingSound: Change background processing sound SpeechStart: Start recognizing voice in the audio stream SpeechUnloadGrammar: Unload a GrammarStackPop: Remove one address from gosub stack StartMusicOnHold: Play Music On HoldStopMixMonitor: Stop recording a call through MixMonitor StopMonitor: Stop monitoring a channelStopMusicOnHold: Stop Playing Music On HoldStopPlayTones: Stop playing a tone listSystem: Execute a system commandTestClient: Execute Interface Test ClientTestServer: Execute Interface Test ServerTransfer: Transfer caller to remote extensionTryExec: Executes dialplan application, always returningTrySystem: Try executing a system commandUnpauseMonitor: Unpause monitoring of a channel UnpauseQueueMember: Unpauses a queue memberUserEvent: Send an arbitrary event to the manager interface Verbose: Send arbitrary text to verbose outputVMAuthenticate: Authenticate with Voicemail passwordsVoiceMail: Leave a Voicemail messageVoiceMailMain: Check Voicemail messagesWait: Waits for some timeWaitExten: Waits for an extension to be enteredWaitForRing: Wait for Ring ApplicationWaitForSilence: Waits for a specified amount of silence WaitMusicOnHold: Wait, playing Music On HoldWhile: Start a while loopZapateller: Block telemarketers with SITZapBarge: Barge in (monitor) Zap channelZapRAS: Executes Zaptel ISDN RAS applicationZapScan: Scan Zap channels to monitor calls ZapSendKeypadFacility: Send digits out of band over a PRI你可以得到当前系统可用的App 命令集合通过在CLI里面输入"show applications "和"showapplication <name>" 在1.6版本之前,或者使用"core show applications" 和"core showapplication <name>" 在版本1.4中注意:标题特殊字符含义标题特殊字符或文字颜色代表了不同含义+ 绿色:是增加的/功能的函数~ 黄色:表示弃用的函数- 红色:移处或不在原先版本中使用的函数∙ADSI 相关命令∙DAHDI (was ZAP)相关命令∙SIP命令∙SMS短消息命令∙vISDN 命令∙主叫来电演示命令(Caller presentation (ID, Name etc) )∙呼叫控制命令∙声音处理命令∙外部应用命令∙字符串及变量处理命令∙常规命令∙录音及监听功能命令∙扩展应用集成命令∙控制流程和超时命令∙数据库处理命令∙无线电技术及中继链接(Amateur Radio/Repeater Linking )∙警告监控及总站(Alarm Monitoring/Central Station )∙计费相关的命令∙语音信箱及会议相关命令∙队列及ACD管理相关命令/index.php?q=content/asterisk-%E6%8B%A8%E5%8F%B7%E6%96%B9 %E6%A1%88dialplan%E5%91%BD%E4%BB%A4%E6%89%8B%E5%86%8C。

Asterisk集群设置方法

Asterisk集群设置方法

示例4
extensions.conf: (主服务器)
[outbound]
switch => IAX2/master:secret@/outbound
iax.conf (主服务器):
[slave]
type=user
auth=plaintext
host=dynamic
trunk=yes
notransfer=yes
extensions.conf (从服务器):
[assigned-dids]
; uncomment a dial mechanism, first one goes to specific extension
; other one goes to dial parameter s.
type=user
auth=md5
secret=secretword
context=iax2users
context非常重要,他用来设置user新来的呼叫路由如何处理.
这个步骤将允许远程的user设备注册到peer上.如果你想限制请在peer的iax.conf里增加限制和许可的设置.
[master]
type=peer
host=
secret=secret
context=outbound
trunk=yes
canreinvite=no
[master]
type=user
secret=secret
context=acontext
在peer的iax.conf的[general]上怎么写:
register => user:password@hostname.domain.ext

Asterisk-CLI命令大全

Asterisk-CLI命令大全

Asterisk CLI命令大全2010-05-01 11:54:09| 分类:Asterisk|字号订阅General CLI commands! - Execute a shell commandabort halt - Cancel a running haltcdr status - Display the CDR statusfeature show - Lists configured featuresfeature show channels - List status of feature channelsfile convert - Convert audio filegroup show channels - Display active channels with group(s)help - Display help list, or specific help on a commandindication add - Add the given indication to the countryindication remove - Remove the given indication from the country indication show - Display a list of all countries/indicationskeys init - Initialize RSA key passcodeskeys show - Displays RSA key informationlocal show channels - List status of local channelslogger mute - Toggle logging output to a consolelogger reload - Reopens the log fileslogger rotate - Rotates and reopens the log fileslogger show channels - List configured log channelsmeetme - Execute a command on a conference or confereemixmonitor - Execute a MixMonitor command.moh reload - Music On Holdmoh show classes - List MOH classesmoh show files - List MOH file-based classesno debug channel (null)originate - Originate a callrealtime load - Used to print out RealTime variables.realtime update - Used to update RealTime variables.restart gracefully - Restart Asterisk gracefullyrestart now - Restart Asterisk immediatelyrestart when convenient - Restart Asterisk at empty call volume sla show - Show status of Shared Line Appearancessoft hangup - Request a hangup on a given channelstop gracefully - Gracefully shut down Asteriskstop now - Shut down Asterisk immediatelystop when convenient - Shut down Asterisk at empty call volume stun debug - Enable STUN debuggingstun debug off - Disable STUN debuggingudptl debug - Enable UDPTL debuggingudptl debug ip - Enable UDPTL debugging on IPudptl debug off - Disable UDPTL debuggingAEL commandsael debug contexts - Enable AEL contexts debug (does nothing) ael debug macros - Enable AEL macros debug (does nothing) ael debug read - Enable AEL read debug (does nothing)ael debug tokens - Enable AEL tokens debug (does nothing)ael nodebug - Disable AEL debug messagesael reload - Reload AEL configurationAgents commandsagent logoff - Sets an agent offlineagent show - Show status of agentsagent show online - Show all online agentsAGI commandsagi debug - Enable AGI debuggingagi debug off - Disable AGI debuggingagi dumphtml - Dumps a list of agi commands in html format agi show- List AGI commands or specific helpdnsmgr reload - Reloads the DNS manager configuration dnsmgr status - Display the DNS manager statushttp show status - Display HTTP server statusConsole commandsconsole active - Sets/displays active consoleconsole answer - Answer an incoming console callconsole autoanswer - Sets/displays autoanswerconsole boost - Sets/displays mic boost in dBconsole dial - Dial an extension on the consoleconsole flash - Flash a call on the consoleconsole hangup - Hangup a call on the consoleconsole mute - Disable mic inputconsole send text - Send text to the remote deviceconsole transfer - Transfer a call to a different extensionconsole unmute - Enable mic inputCore related commandscore clear profile - Clear profiling infocore set debug channel - Enable/disable debugging on a channelcore set debug - Set level of debug chattinesscore set debug off - Turns off debug chattinesscore set global - Set global dialplan variablecore set verbose - Set level of verbosenesscore show applications - Shows registered dialplan applicationscore show application - Describe a specific dialplan applicationcore show audio codecs - Displays a list of audio codecscore show channels - Display information on channelscore show channel - Display information on a specific channelcore show channeltypes - List available channel typescore show channeltype - Give more details on that channel typecore show codecs - Displays a list of codecscore show codec - Shows a specific codeccore show config mappings - Display config mappings (file names to config engines) core show file formats - Displays file formatscore show file version - List versions of files used to build Asteriskcore show functions - Shows registered dialplan functionscore show function - Describe a specific dialplan functioncore show globals - Show global dialplan variablescore show hints - Show dialplan hintscore show image codecs - Displays a list of image codecscore show image formats - Displays image formatscore show license - Show the license(s) for this copy of Asteriskcore show profile - Display profiling infocore show switches - Show alternative switchescore show threads - Show running threadscore show translation - Display translation matrixcore show uptime - Show uptime informationcore show version - Display version infocore show video codecs - Displays a list of video codecscore show warranty - Show the warranty (if any) for this copy of AsteriskDatabase commandsdatabase del - Removes database key/valuedatabase deltree - Removes database keytree/valuesdatabase get - Gets database valuedatabase put - Adds/updates database valuedatabase show - Shows database contentsdatabase showkey - Shows database contentsDialplan commandsdialplan add extension - Add new extension into contextdialplan add ignorepat - Add new ignore patterndialplan add include - Include context in other contextdialplan reload - Reload extensions and *only* extensionsdialplan remove extension - Remove a specified extensiondialplan remove ignorepat - Remove ignore pattern from contextdialplan remove include - Remove a specified include from context dialplan save - Save dialplandialplan show - Show dialplanDUNDI commandsdundi debug - Enable DUNDi debuggingdundi flush - Flush DUNDi cachedundi lookup - Lookup a number in DUNDidundi no debug - Disable DUNDi debuggingdundi no store history - Disable DUNDi historic recordsdundi precache - Precache a number in DUNDidundi query - Query a DUNDi EIDdundi show entityid - Display Global Entity IDdundi show mappings - Show DUNDi mappingsdundi show peers - Show defined DUNDi peersdundi show peer - Show info on a specific DUNDi peerdundi show precache - Show DUNDi precachedundi show requests - Show DUNDi requestsdundi show trans - Show active DUNDi transactionsdundi store history - Enable DUNDi historic recordsGTalk & Jabber commandsgtalk reload - Enable Jabber debugginggtalk show channels - Show GoogleTalk Channelsjabber debug - Enable Jabber debuggingjabber debug off - Disable Jabber debugjabber reload - Enable Jabber debuggingjabber show connected - Show state of clients and components jabber test - Shows roster, but is generally used for mog's debugging.IAX2 commandsiax2 provision - Provision an IAX deviceiax2 prune realtime - Prune a cached realtime lookupiax2 reload - Reload IAX configurationiax2 set debug - Enable IAX debuggingiax2 set debug jb - Enable IAX jitterbuffer debuggingiax2 set debug jb off - Disable IAX jitterbuffer debuggingiax2 set debug off - Disable IAX debuggingiax2 set debug trunk - Enable IAX trunk debuggingiax2 set debug trunk off - Disable IAX trunk debuggingiax2 show cache - Display IAX cached dialplaniax2 show channels - List active IAX channelsiax2 show firmware - List available IAX firmwaresiax2 show netstats - List active IAX channel netstatsiax2 show peers - List defined IAX peersiax2 show peer - Show details on specific IAX peeriax2 show provisioning - Display iax provisioningiax2 show registry - Display IAX registration statusiax2 show stats - Display IAX statisticsiax2 show threads - Display IAX helper thread infoiax2 show users - List defined IAX usersiax2 test losspct - Set IAX2 incoming frame loss percentageManager commandsmanager show command - Show a manager interface command manager show commands - List manager interface commands manager show connected - List connected manager interface users manager show eventq - List manager interface queued events manager show users - List configured manager usersmanager show user - Display information on a specific manager userMGCP commandsmgcp audit endpoint - Audit specified MGCP endpointmgcp reload - Reload MGCP configurationmgcp set debug - Enable MGCP debuggingmgcp set debug off - Disable MGCP debuggingmgcp show endpoints - List defined MGCP endpointsModule managementmodule load - Load a module by namemodule reload - Reload configurationmodule show - List modules and infomodule show like - List modules and infomodule unload - Unload a module by namePRI commandspri debug span - Enables PRI debugging on a spanpri intense debug span - Enables REALLY INTENSE PRI debuggingpri no debug span - Disables PRI debugging on a spanpri set debug file - Sends PRI debug output to the specified filepri show debug - Displays current PRI debug settingspri show spans - Displays PRI Informationpri show span - Displays PRI Informationpri unset debug file - Ends PRI debug output to fileQueue commandsqueue add member - Add a channel to a specified queuequeue remove member - Removes a channel from a specified queue queue show - Show status of a specified queuertcp debug ip - Enable RTCP debugging on IPrtcp debug - Enable RTCP debuggingrtcp debug off - Disable RTCP debuggingrtcp stats - Enable RTCP statsrtcp stats off - Disable RTCP statsrtp debug ip - Enable RTP debugging on IPrtp debug - Enable RTP debuggingrtp debug off - Disable RTP debuggingsay load - Set/show the say modeshow parkedcalls - Lists parked callsshow queue - Show information for target queueshow queues - Show the queuesSIP commandssip history - Enable SIP historysip history off - Disable SIP historysip notify - Send a notify packet to a SIP peersip prune realtime - Prune cached Realtime object(s)sip prune realtime peer - Prune cached Realtime peer(s) sip prune realtime user - Prune cached Realtime user(s) sip reload - Reload SIP configurationsip set debug - Enable SIP debuggingsip set debug ip - Enable SIP debugging on IPsip set debug off - Disable SIP debuggingsip set debug peer - Enable SIP debugging on Peername sip show channels - List active SIP channelssip show channel - Show detailed SIP channel infosip show domains - List our local SIP domains.sip show history - Show SIP dialog historysip show inuse - List all inuse/limitssip show objects - List all SIP object allocationssip show peers - List defined SIP peerssip show peer - Show details on specific SIP peersip show registry - List SIP registration statussip show settings - Show SIP global settingssip show subscriptions - List active SIP subscriptionssip show users - List defined SIP userssip show user - Show details on specific SIP userSkinny commandsskinny reset - Reset Skinny device(s)Asterisk-CLI命令大全skinny set debug - Enable Skinny debuggingskinny set debug off - Disable Skinny debuggingskinny show devices - List defined Skinny devicesskinny show lines - List defined Skinny lines per deviceVoicemail commandsvoicemail show users - List defined voicemail boxesvoicemail show users for - List defined voicemail boxes for target context voicemail show zones - List zone message formatsZaptel commandszap destroy channel - Destroys a channelzap restart - Fully restart zaptel channelszap show cadences - List cadenceszap show channels - Show active zapata channelszap show channel - Show information on a channelzap show status - Show all Zaptel cards status11 / 11。

AsteriskCLI的相关配置

AsteriskCLI的相关配置

Asterisk CLI的相关配置Asterisk CLI相关的配置文件有三个:●cli.conf Asterisk启动时执行的CLI命令●cli_aliases.conf Asterisk的CLI命令别名定义●cli_permissions.conf Asterisk的权限设置1.启动执行命令cli.conf这里面包括了一个context:startup_commands。

Any commands listed in this section will get automatically executed when Asterisk starts as a daemon or foreground process (-c).任何在startup_commands中列出的命令都会在Asterisk以后台模式或者控制台模式启动时自动执行。

2.命令别名cli_aliases.confThis module also registers a "cli show aliases" CLI command to list configured CLI aliases.这是res_clialiases.so模块的配置文件。

在Asterisk启动的时候,可以设置一些CLI命令的别名,方便管理员对Asterisk进行管理。

这个功能类似于UNIX操作系统的alias命令。

下面CLI命令可以查看当前Asterisk中的别名:引用上面模板的方法是,把上面模板的名字放在新定义的context旁边,具体格式如下:3.权限管理cli_premissions.conf权限管理是让当前服务器上的其他用户能通过rasterisk进入到Asterisk的CLI中,并对Asterisk进行一些操作。

在没有设置权限的情况下,其他非root用户执行rasterisk会有下面错误信息:要让其他用户能执行asterisk的CLI,必须让其他用户对/var/run/asterisk/asterisk.ctl有读写权限,因此必须在/etc/asterisk/asterisk.conf中设定权限,因此要把[files]的注释去掉,并且改然后重启asterisk。

Asterisk的连接与管理

Asterisk的连接与管理

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命令行命令行是最常用的方法,执行的命令有两种:或者:对应的套接字文件是:/var/run/asterisk/asterisk.ctl管理员可以配置cli_permissions.conf对操作系统用户登录asterisk进行授权。

具体的授权方法就不在这里介绍,有兴趣的人可以看看cli_premissions.conf中的说明。

rasterisk的作用基本上和asterisk –r是一致的,不作特别介绍,只对Asterisk命令进行分析。

下面是asterisk的帮助信息:2.使用AMI方法AMI方法是通过socket登录到Asterisk中,然后用AMI命令对Asterisk进行管理。

通过这个管理接口,我们可以用某种编程语言开发出自己的Asterisk管理平台。

实际上,很多基于GUI的管理平台也是通过这种方法对Asterisk进行管理。

这种方法的配置文件是:manager.conf要使用这种方法,必须先要激活它,下面是配置文件中相关的配置内容:操作方式如下:3.WEB管理Web管理的配置文件是:http.conf要使用这种方法,需要修改下面配置内容:浏览器。

具体的登录路径类似于:http:// xxx.xxx.xxx.xxx:8088/static/config/index.html 使用的帐号密码是manager.conf中定义的帐号密码。

思科交换机Debug调试命令-电脑资料

思科交换机Debug调试命令-电脑资料

思科交换机Debug调试命令-电脑资料下面列出了部分常用的debug 命令,与各协议和功能相关的更具体的debug命令和对其细节的注释,请参见本手册及命令参考手册中的各相关章节.要使用debug功能,需要在特权用户模式下进行配置: 命令功能Switch#debug 显示所有可用的debug指令及简短的说明Switch #show debugging 显示当前各个调试开关的状态Switch #debug all 打开系统所有的调试开关Switch #undebug all 关闭所有的调试开关Switch #debug aaa 打开AAA调试开关Switch #debug acl 打开ACL调试开关Switch #debug arp 打开ARP调试开关Switch #debug dvmrp 打开DVMRP调试开关Switch #debug filter 打开过滤器调试开关Switch #debug igmp 打开IGMP调试开关Switch #debug ip 打开IP调试开关Switch #debug mstp 打开MSTP调试开关Switch #debug multicast 打开多播数据流调试开关Switch #debug pim 打开PIM调试开关Switch #debug sys-guard 打开sys-guard调试开关Switch #debug vlan 打开VLAN调试开关首先,要打开日志功能: Switch(config) # logging on,其次,设置日志的级别为Debug:Switch(config) # logging monitor 7在Telnet客户端登陆模式下,缺省的debug调试信息不会发送到Telnet客户端,如果需要在Telnet客户端显示调试信息,则需要在该终端会话的特权用户模式下,执行如下命令:Switch #terminal monitor交换机包含有大量的调试命令,上表所列出的,仅仅是部分DEBUG 的第一级命令而已,还有许多的DEBUG命令是有各自的子命令的,比如debug ip命令,后面还有许多的扩展选项:Switch #debug ipcache Debug IP cacheospf Debug IP OSPFpacket Debug IP packetpacket-event Debug IP packet-eventrip Debug IP RIP 说明:打开调试开关,将会占用CPU资源,某些调试开关的打开,甚至会严重占用CPU资源,影响交换机运行效率,所以如果没有必要,请不要轻易打开调试开关,尤其慎用debug all 命令,在调试结束后,应注意关闭全部调试开关.一,IGMP调试信息debug igmp packet收发IGMP报文(查询,加入,离开)丢弃IGMP报文的具体原因degug igmp event各种IGMP通知事件(添加网络范围,接口变化,IP地址变化)创建/删除组事件添加/删除组成员事件当种事件发生变化时,能够通过这些变化原因,定位问题引起的原因debug igmp timerIGMP定时器事件(发送查询,加入报告,老化组,老化端口成员)获知当前发生的各个定时器的事件,可具体到某个网络接口上二,DVMRPdebug dvmrp packetDVMRP收发报文(邻居HELLO,路由报告)丢弃报文的具体原因debug dvmrp event各种DVMRP通知事件(添加网络范围,接口变化,IP地址变化)邻居变化事件(添加,删除,刷新)debug dvmrp timerDVMRP定时器事件(路由报告,单播路由通告,路由满通告)获知当前发生的各个定时器的事件,可具体到某个网络接口上debug dvmrp route路由变化,DVMRP路由的添加与删除三,PIMdebug pim packet收发报文(HELLO, 加入/剪枝,ASSERT,嫁接,状态刷新,PIM-SM注册,PIM-SM注册停止,加入/剪枝, C-RP通告,BSR报文))丢弃报文的具体原因debug pim eventPIM各种通知事件(添加网络范围,接口变化,IP地址变化)当种事件发生变化时,能够通过这些变化原因,定位问题引起的原因debug pim timer PIM定时器事件(断言,剪枝,嫁接,加入,状态刷新, C-RP,BSR)获知当前发生的各个定时器的事件,可具体到某个网络接口上debug pim helloHELLO邻居变化事件(添加,删除,刷新,DR选举),获知当前拓扑的变化.四,多播数据流debug multicast packet收发报文(多播流)丢弃报文的具体原因debug multicast event各种通知事件(添加网络范围,接口变化,IP地址变化)当种事件发生变化时,能够通过这些变化原因,定位问题引起的原因debug multicast timer定时器事件(老化MFC,多播路由表项)得知发生的各个定时器事情debug multicast route创建/删除路由表项多播路由表项转发列表变化(添加,删除)当问题出现时,能判断对硬件操作是否成功,如果失败,能得知失败原因。

Asterisk的AMI中常用的重要的AMI操作

Asterisk的AMI中常用的重要的AMI操作

Asterisk的AMI中常用的重要的AMI操作1. AbsoluteTimeoutAbsoluteTimeout :这个命令将要求Asterisk在指定秒数后挂断特定的通道,从而有效地结束通话。

参数:Channel :哪些渠道挂断,如SIP/123-1c20Timeout :到通道应挂断的秒数例子:请求信息Action: AbsoluteTimeoutChannel: SIP/123-1c20Timeout: 20返回成功信息Response: SuccessMessage: Timeout Set返回失败信息Response: ErrorMessage: No such channelChangeMonitor :更改记录某通道信息文件名。

参数:Channel:通道名称File:文件名例子:发送请求ACTION: ChangeMonitorChannel: SIP/x7065558529-1c20File: 20050103-140105_cc51返回失败信息Response: ErrorMessage: No such channel返回成功信息Response: SuccessMessage: Stopped monitoring channel2. CommandCommand :发送Asterisk CLI命令。

参数:Command:Asterisk CLI 命令。

例子:发送请求ACTION: COMMANDcommand: Show Channels返回信息Response: FollowsChannel (Context Extension Pri ) State Appl. Data0 active channel(s)--END COMMAND-3 EventsEvents :事件控制流,用于启用/禁用发送给管理客户端的事件。

参数:EventMask: 'on'表示所有事件均会被发送到管理客户端。

Asterisk数据库配置方案

Asterisk数据库配置方案

Asterisk数据库配置方案Asterisk 之数据库配置方案一:硬件环境二台x86 PC一个Hub 或者 Switch一部外线虚拟电话(电话号码比如:82085471),一部SIP电话(内部设置分机号为:82081001)Asterisk卡(Open Vox A1200p)一条电话线(比如电话号码为82085498)接Asterisk卡二:软件环境二台x86 PC:PC1:安装Windows Xp Sp2。

XP下安装VM-5.5,并在VM中安装Fedora 9,在其中架设Sip Server,本项目使用kamailio。

PC2:安装Centos 5.3,并安装asterisk相关包,作为语音网关。

Asterisk包安装:asterisk-1.4.22.1.tar.gz : asterisk主程序包。

asterisk-addons-1.4.7.tar.gz :asterisk扩展包。

asterisk-sounds-1.2.1.tar.gz :asterisk 语音包。

openvox_zaptel-1.4.11.tar.gz :asterisk 卡驱动包。

libpri-1.4.2.tar.gz :PRI库三:软件安装PC1(192.168.1.199)Kamailio的安装:make clean./configuremake installPC2(192.168.1.200)安装顺序:libpri->openvox_zaptel->asterisk->asterisk-addons->asterisk-sounds安装前最好先把各个包放到/usr/src/目录下解压安装: libpri安装:tar xzvf libpri-1.4.2.tar.gzcd libpri-1.4.2.tar.gzmake cleanmakemake installopenvox_zaptel-1.4.11.tar.gz的安装:tar xzvf openvox_zaptel-1.4.11.tar.gzcd openvox_zaptel-1.4.11make clean./configuremakemake installasterisk-1.4.22.1.tar.gz 的安装:tar xzvf asterisk-1.4.22.1.tar.gzcd asterisk-1.4.22.1make clean./configuremakemake installmake samples //生成默认配置到/etc/asterisk下asterisk-addons-1.4.7.tar.gz 的安装:tar xzvf asterisk-addons-1.4.7.tar.gzcd asterisk-addons-1.4.7make clean./configuremakemake installcp configs/* /etc/asterisk/asterisk-sounds-1.2.1.tar.gz 的安装:tar xzvf asterisk-sounds-1.2.1.tar.gzcd asterisk-sounds-1.2.1make cleanmake install注意:安装完成后,需要先运行genzaptelconf生成默认的Zap通道的配置信息。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Asterisk基本配置
Asterisk译为星号(*)在很多应用中被用做通配符,Astrisk做为PBX系统的完美名称,原因之一是Asterisk可以连接数目庞大的接口类型,包括:
1模拟接接口,如你的电话线或模拟电话.
2数字线路,如T-1和E-1线路
3Voip协议,如SIP和IAX
目前正式版本是IAX2,但是IAX1的所有格式都已经停掉.所以当说到IAX都是特拽IAX2
使用接口配置文件
1.Zaptel.conf:硬件接口基层配置,我们将建立一个FX0和一个FXS通道.
2.zapata.conf:硬件配置Asterisk的接口.
3.extension.conf:拨号方案文件.
4.sip.conf:配置SIP协议的文件
5.iax.conf:配置呼入和呼出IAX通道的文件
******编辑完zaptel.conf文件,需要使用/sbin/ztcfg -vv装载配置到硬件(不须要详细输出可以省略-vv);修改信令方法需要重启.在编辑sip.conf和iax.conf文档后,分别需要装载chan_iax2.so和
chan_sip.so
Asterisk译为星号(*)在很多应用中被用做通配符,Astrisk做为PBX系统的完美名称,原因之一是Asterisk可以连接数目庞大的接口类型,包括:
1模拟接接口,如你的电话线或模拟电话.
2数字线路,如T-1和E-1线路
3Voip协议,如SIP和IAX
目前正式版本是IAX2,但是IAX1的所有格式都已经停掉.所以当说到IAX都是特拽IAX2
使用接口配置文件
1.Zaptel.conf:硬件接口基层配置,我们将建立一个FX0和一个FXS通道.
2.zapata.conf:硬件配置Asterisk的接口.
3.extension.conf:拨号方案文件.
4.sip.conf:配置SIP协议的文件
5.iax.conf:配置呼入和呼出IAX通道的文件
******编辑完zaptel.conf文件,需要使用/sbin/ztcfg -vv装载配置到硬件(不须要详细输出可以省略-vv);修改信令方法需要重启.在编辑sip.conf和iax.conf文档后,分别需要装载chan_iax2.so和
chan_sip.so******
SIP
SIP(会话初始协议),通常用于VOIP电话,进行呼叫建立,呼叫协商,呼叫结束.它帮助两个端互相通认,但它不处理媒体;当呼叫建立后,他通过实时传输协议(RTP)在电话A到电话B直接传输媒体
SIP和RTP
SIP是一个应用层的信令协议.他使用的端口是5060(通常)进行通信.SIP可以通过UDP和TCP传输层协议进行传输.Asterisk目前没有TCP用于传输SIP信息.
RTP用于端点间传输媒体(语音),Asterisk中RTP使用大数字的无特权端口(默认10,000到20,000)
SIP优点:普通的被接受和结构灵活.其它的VOIP协议还有H.323,IAX,MGCP.
SIP配置
/etc/asterisk/sip.conf文件中:
[general]
srvlookup=yet
[10000]
type=friend;可以定义用户\端\朋友
asterisk常用命令
1. 运行调试常用命令
./asterisk & 在后台启动asterisk
./asterisk –vvvc 启动asterisk并尽量多的在控制台显示调试信息
./asterisk –r 连接asterisk控制台
set verbose 9999 设置打印详细信息
2.asterisk控制台下常用命令
sip reload
sip set debug 设置显示更多的sip信息
sip set debug off关闭显示更多的sip信息
sip show channels 显示所有活动的SIP通道
sip show peers 显示所有已定义的SIP peer
sip show channels 查看当前SIP协议的并发。

dialplan show 显示拨号方案
dialplan reload重新加载拨打方案
有如下4个跟停止和启动Asteirsk相关的命令:
core stop now -立即停止Asterisk服务,并且结束所有在线的通话。

core stop gracefully - 该命令会阻止新的通话形成,但是不会结束正在通话的电话。

当所有的通话结束,Asterisk将停止。

core stop when convenient - 该命令将等待Asterisk没有正在进行的通话了才重启. 它不会阻止新的通话的形成。

如下是重启Asterisk的命令
core restart now - 立即重启Asterisk服务,并且结束所有在线的通话。

.
core restart gracefully - 该命令会阻止新的通话形成,但是不会重启正在通话的电话。

当所有的通话结束,Asterisk将停止。

core restart when convenient - 该命令将等待Asterisk没有正在进行的通话了才重启. 它不会阻止新的通话的形成。

.
There is also a command if you change your mind.
core abort shutdown - 它将取消停止和重启命令(gracefully /convenient )
module show 显示所有已加载模块
module load cdr_radius.so 加载模块cdr_radius.so
module reload cdr_radius.so 重新加载模块cdr_radius.so
module unload cdr_radius.so 卸载模块cdr_radius.so
core show applications 显示所有的应用,比如Dial, Radius, Hangup, Answer等
core show channels 显示所有的通话频道
core show codecs 显示所有支持的编解码器
core show functions 显示所有的功能函数
Asterisk 找不到SIP的解决
localhost*CLI> module show like chan /查看加载的模块
module load chan_sip.so /装入SIP模块
module reload chan_sip.so /再次装入SIP模块。

相关文档
最新文档