`
sun4love
  • 浏览: 230630 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Asterisk Extension中的Application命令详解四

    博客分类:
  • VOIP
阅读更多

Hangup( )        Unconditionally hangs up the current channel
                                                       无条件的挂起当前通道

Hangup( )
Unconditionally hangs up the current channel. 无条件的挂起当前通道
Always returns -1. 返回值:-1

exten => 123,1,Answer( )
exten => 123,2,Playback(im-sorry)
exten => 123,3,Hangup( )
See Also  请参阅:

Answer( )  

HasNewVoicemail( )        Conditionally  branches if there is new voicemail in the indicated voicemail box
                                               如果在语音邮件箱中有新的语音邮件的话则有条件的进行转移

HasNewVoicemail(vmbox[@context][:folder][,varname])

Similar  to  HasVoicemail( ).  This  application  branches  to  priority  n+101  (where  n  is  the current  priority)  if  there  is  new  (unheard)  voicemail  in  the  voicemail  box  indicated  by vmbox.  The  context  argument  corresponds  to  the  voicemail  context,  and  folder  corresponds  to  a  voicemail  folder.  If  the  voicemail  folder  is  not  specified,  it  defaults  to  the INBOX folder. If the varname argument is present, HasNewVoicemail( ) assigns the number of messages in the specified folder to that variable.
类似于HasVoicemail()函数。如果vmbox提示有未听过的语音邮件在voicemail  box中则应用转移到优先级n+101(n为当前优先级)。下文讨论了相符合的语音环境,和相符合文件夹的语音文件夹。如果未指定文件夹,缺省到INBOX文件夹。如果变量名称确定的话,HasNewVoicemail()指定消息数目到指定的变量文件夹。

; check to see if there's unheard voicemail in INBOX of mailbox 123
; in the default voicemail context
在缺省的语音环境中,如果在INBOX邮箱123中未听到语音邮件则进行检查。
exten => 123,1,Answer( )
exten => 123,2,HasNewVoicemail(123@default,COUNT)
exten => 123,3,Playback(vm-youhave)
exten => 123,4,Playback(vm-no)
exten => 123,5,Playback(vm-messages) exten => 123,103,Playback(vm-youhave) exten => 123,104,SayNumber($COUNT) exten => 123,105,Playback(vm-messages)

See Also  请参阅

HasVoicemail( ), MailboxExists( )

IAX2Provision( )        Provisions a calling IAXy device

IAX2Provision([template])
Provisions a calling IAXy device (assuming that the calling entity is an IAXy) with the given template.  If  no  template  is  specified,  the  default  template  is  used.  IAXy  provisioning templates are defined in the iaxprov.conf configuration file.
供应一个呼叫IAXY设备(指定呼叫实体为IAXY)并指定模板,如果没有指定模板,则缺省模板被使用,IAXY指定模板是在iaxprov.conf配置文件中被指定。

Returns -1 on error or 0 on success.  错误返回-1成功则返回0

; provision IAXy devices with the default template when they dial this extension
                   当通过扩展拨号时通过缺省模板指定IAXy设备。
exten => 123,1,IAX2Provision(default)






ImportVar( )        Sets a variable based on a channel variable from a different channel
                                                  从不同的通道中设定一个基于通道变量的变量。

ImportVar(newvar=channel,variable)
Sets  variable  newvar  to  variable  as  evaluated  on  the  specified  channel  (instead  of  the current channel). If newvar is prefixed with _, single inheritance is assumed. If prefixed with__, infinite inheritance is assumed.
在指定通道设定新变量做为评估(不是当前通道),如果新变量带有_,则假定单一继承,如果变量带有__,则指定多继承。

; read the Caller ID information from channel Zap/1
exten => 123,1,Answer( )
exten => 123,1,ImportVar(cidinfo=Zap/1,CALLERID)

See Also

Set( )

LookupBlacklist( )        Performs a lookup of a Caller ID name/number from the blacklist database
                                               从数据库黑名单中执行呼叫ID名称/号码查找

LookupBlacklist( )
Looks  up  the  Caller  ID  number  on  the  active  channel  in  the  Asterisk  database  (family blacklist). If the number is found, and if there exists a priority n+101 (where n is the priority of the current instance), the channel will be set up to continue at that priority level. Other- wise, the application returns 0. If no Caller ID was received on the channel, it does nothing
在Asterisk数据库(系列黑名单)中查找动态通道中呼叫ID号码,如果号码被找到,并且如果存在一个N+101优先级(N是当前优先级),则该通道将被设置为当前优先级,否则返回0,如果呼叫ID未找到,则什么也不做。
To add to the blacklist from the Asterisk CLI, type database put blacklist name/number.
通过Asterisk命令行:database put blacklist name/number添黑名单。

; send blacklisted numbers to an endless loop
; otherwise, dial the number defined by the variable ${JOHN}
exten => s,1,Answer( )
exten => s,2,LookupBlacklist( )
exten => s,3,Dial(${JOHN})
exten => s,103,Playback(tt-allbusy)
exten => s,104,Wait(10)
exten => s,105,Goto(103)

LookupCIDName( )        Performs a lookup of a Caller ID name from the AstDB
                                                                      从AstDB中执行查找呼叫ID名称

LookupCIDName( )
Uses the Caller ID number on the active channel to retrieve the Caller ID name from the AstDB (family cidname). This application does nothing if no Caller"*ID was received on the channel. This is useful if you do not subscribe to Caller ID name delivery, or if you want to change the Caller ID names on some incoming calls.
在动态通道中使用呼叫ID从AstDB(cidname 系列)中检索呼叫名称,如果通道中没有找到呼叫ID则程序未反应,如果你不想将呼叫ID名称传输或者在一些呼入中不想改变呼叫ID名称,这将是非常有用的。

Always returns 0.  总是返回0

; look up the Caller ID information from the AstDB, and pass it along
; to Jane's phone
exten => 123,1,Answer( )
exten => 123,2,LookupCIDName( )
exten => 123,3,Dial(SIP/Jane)





Macro( )        Calls a previously defined macro
                                                                                  调用以前定义的宏

Macro(macroname,arg1,arg2...)
Executes a macro defined in the context named macro-macroname, jumping to the s exten- sion of that context and executing each step, then returning when the steps end.
执行在参数macro-macroname中定义的宏,并转至S范围然后按步执行,执行完后返回。
The calling extension, context, and priority are stored in ${MACRO_EXTEN}, ${MACRO_CONTEXT}, and ${MACRO_PRIORITY}, respectively. Arguments arg1, arg2, etc. become ${ARG1}, ${ARG2}, etc. in the macro context.
呼叫范围,上下文,和优先级分别存贮在变量${MACRO_EXTEN},${MACRO_CONTEXT},${MACRO_PRIORITY}中,参数arg1,arg2在宏中为${ARG1},${ARG2}等。
Macro( ) returns -1 if any step in the macro returns -1, and 0 otherwise. If ${MACRO_OFFSET} is set at termination, this application will attempt to continue at priority MACRO_OFFSET+n+1 if such a step exists, and at n+1 otherwise. (In both cases, n stands for the current priority.) If you call the Goto( ) application inside of the macro, the macro will terminate and control will go to the destination of the Goto( ).
如果任何结果返回-1则宏返回-1,否则为0。如果${MACRO_OFFSET}参数在终端中设置,如果存大的话则宏将试着去执行优先级MACRO_OFFSET+n+1,否则在n+1。(在两种情况下,n为当前优先级)。如果宏中包含Goto()应用,则宏将停止并且控制将交给Goto()应用程序

; define a macro to count down from the specified value
[macro-countdown]   定义宏用来统计从[macro-countdown]指定的值
exten => s,1,Set(COUNT=${ARG1}) exten => s,2,While($[ ${COUNT} > 0]) exten => s,3,SayNumber(${COUNT})
exten => s,4,Set(COUNT=$[ ${COUNT} - 1 ])
exten => s,5,EndWhile( )

; call our macro with two different values  用两种不同的值调用宏
[example]
exten => 123,1,Macro(countdown,10)
exten => 124,1,Macro(countdown,5)

See Also

Goto( ), Chapter 6


MailboxExists( )        Conditionally branches if the specified voicemail box exists
                                         如果voicemail box存在则有条件的转移
MailboxExists(mailbox[@context])
Conditionally branches to priority n+101 (where n is the current priority) if the voicemail box  specified  by  the  mailbox  argument  exists.  You  may  pass  a  voicemail  context  if  the mailbox is not in the default voicemail context.
如果被mailbox参数指定的voicemail box存在则将优先级转移到n+101(n为当前优先级).如果说mailbox不在缺省的voicemail环境则你可以通过一个voicemail环境.

exten => 123,1,Answer( )
exten => 123,2,MailboxExists(123@default)
exten => 123,3,Playback(im-sorry)
exten => 123,103,Voicemail(u123)

See Also

HasVoicemail( ), HasNewVoicemail( )

分享到:
评论

相关推荐

    Asterisk一些常用的命令

    Asterisk命令详解 Asterisk是一款开源的电话交换机软件,提供了丰富的命令来管理和控制电话系统。下面是Asterisk的一些常用的命令: 1. amportal 命令 amportal 命令是FreePBX搞的,负责管控Asterisk。amportal ...

    Asterisk CLI 命令列表

    Asterisk CLI 命令列表 Asterisk 是一个开源的 VoIP 系统平台,提供了一个命令行接口(CLI),允许用户通过命令行控制 Asterisk 系统。下面是 Asterisk CLI 命令列表: 1. ! 命令:执行 shell 命令 使用格式:! ...

    Asterisk权威指南中文

    Asterisk权威指南中文(第3版) Asterisk权威指南(第3版)第15章自动话务员 Asterisk权威指南(第3版)第02章Asterisk体系结构 Asterisk权威指南(第3版)第05章用户设备配置 Asterisk权威指南(第3版)第06章Dialplan基础 ...

    asterisk拨号方案中应用使用详解

    "asterisk拨号方案中应用使用详解" Asterisk拨号方案中应用使用详解是指在Asterisk系统中使用拨号方案来实现各种应用的技术手段。本文将对Asterisk拨号方案中的各种应用进行详细地解释和示例。 1. Authenticate:...

    Asterisk常用命令

    以下是一些Asterisk常用命令的详细解释: 1. **启动与调试命令**: - `./asterisk &`:将Asterisk服务在后台运行。 - `./asterisk -vvvc`:以调试模式启动Asterisk,输出大量日志信息到控制台。 - `./asterisk -...

    Asterisk 中文语音包

    3. **重新加载**:完成配置更改后,需要重新加载Asterisk配置,通常通过执行`asterisk -r`进入命令行模式,然后输入`reload`命令,让Asterisk应用新的设置。 4. **测试**:为了确认中文语音包已正确安装并工作,你...

    asterisk APP命令含义中文对照

    Asterisk APP命令含义中文对照 Asterisk是一个开源的PBX(Private Branch Exchange)电话交换系统,具有强大的功能和灵活性。Asterisk提供了许多APP命令,用于实现各种电话功能。本文将对Asterisk APP命令进行分类...

    Asterisk 中文文档说明

    在高级主题中,你可能会学到如何集成Asterisk与其他系统,如CRM(Customer Relationship Management)或ERP(Enterprise Resource Planning)系统,以实现更复杂的业务流程自动化。此外,故障排查和日志分析也是重要...

    Asterisk中文语言包

    修改sip_general_custom.conf(作为测试,在所有SIP 通道上启用提示语为中文,在实际应用中,可根据需要修改--zapata-channels.conf,sipXXX.conf,IAXXXX.conf...,也可在FreePBX的WEB界面中有language选项的地方修改--...

    Asterisk-CLI-命令列表.zip_asterisk_cli

    在Asterisk系统中,Asterisk命令行接口(CLI)是管理员进行配置、监控和调试的主要工具。下面,我们将深入探讨Asterisk CLI的相关知识点。 1. **Asterisk CLI简介** Asterisk CLI是一个基于文本的交互式环境,通过...

    asterisk中文的语音包

    Asterisk的声音包是其功能中的一个重要组成部分,为用户提供各种语音提示和交互体验。 这个名为“asterisk中文的语音包”的资源包含了Asterisk系统中用于中文环境的音频文件。声音包通常由一系列预录制的语音片段...

    Asterisk CLI命令1

    ` 命令:这个命令用于在CLI中执行Shell命令,让你能够直接在Asterisk的控制台环境中运行Linux系统的命令。 2. `ael reload`:重新加载AEL(Asterisk Extension Language)配置。AEL是Asterisk的一种脚本语言,用于...

    Asterisk.NET 1.6.3 控制Asterisk

    Asterisk.NET 1.6.3 是一个专门为.NET开发者设计的开源库,它提供了对Asterisk PBX系统的编程接口,使得用户可以方便地在C#、VB.NET或其他.NET支持的语言中控制和扩展Asterisk功能。这个库是基于Asterisk Manager ...

    asterisk AGI应用说明

    ### Asterisk AGI应用详解 #### 一、概述 Asterisk是世界上最流行的开源PBX系统之一,它支持多种通信协议并提供了丰富的功能。在Asterisk中,AGI(Asterisk Gateway Interface)是一种非常重要的接口技术,它允许...

    Asterisk详解

    ### Asterisk详解 #### Asterisk概述 Asterisk是一款开源的通信平台,它支持多种通信协议,包括但不限于SIP(Session Initiation Protocol)、H.323等,并且能够提供语音邮件、会议呼叫、交互式语音应答(IVR)等...

    Asterisk1.6最全的中文语音包

    Asterisk 1.6是其早期的一个稳定版本,尽管现在已经有更新的版本发布,但该版本依然在一些环境中被使用,特别是对于那些有特定需求或者对旧系统有依赖的用户。 本资源“Asterisk1.6最全的中文语音包”是针对...

    Asterisk CLI 命令列表.

    ### Asterisk CLI命令详解 #### 一、Asterisk CLI简介 Asterisk是一款非常流行的开源PBX(Private Branch Exchange)系统,它支持多种语音通信协议,如SIP、IAX等,广泛应用于构建企业级的电话系统。CLI(Command ...

    通过asterisk-java操作asterisk

    4. **处理响应**:Asterisk服务器会为每个命令返回一个响应,你可以通过实现`ManagerResponseListener`来处理这些响应。这使你能够得知命令是否成功执行,以及可能的错误信息。 5. **使用通道(Channels)和拨号...

Global site tag (gtag.js) - Google Analytics