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

Asterisk Detailed Variable List

    博客分类:
  • VOIP
阅读更多

Asterisk Detailed Variable List


Asterisk standard channel variables 

There are a number of variables that are defined or read 
by Asterisk. Here is a list of them. More information is 
available in each application's help text. All these variables 
are in UPPER CASE only. 

to diaplay all channel variable use this command 

DumpChan(<min_verbose_level>) 

Variables marked with a * are builtin functions and can't be set, 
only read in the dialplan. Writes to such variables are silently 
ignored. 

${ACCOUNTCODE} * Account code (if specified) (Deprecated; use ${CDR(accountcode)}) 
${BLINDTRANSFER} The name of the channel on the other side of a blind transfer 
${BRIDGEPEER} Bridged peer 
${CALLERANI} * Caller ANI (PRI channels) (Deprecated; use ${CALLERID(ani)}) 
${CALLERID} * Caller ID (Deprecated; use ${CALLERID(all)}) 
${CALLERIDNAME} * Caller ID Name only (Deprecated; use ${CALLERID(name)}) 
${CALLERIDNUM} * Caller ID Number only (Deprecated; use ${CALLERID(num)}) 
${CALLINGANI2} * Caller ANI2 (PRI channels) 
${CALLINGPRES} * Caller ID presentation for incoming calls (PRI channels) 
${CALLINGTNS} * Transit Network Selector (PRI channels) 
${CALLINGTON} * Caller Type of Number (PRI channels) 
${CHANNEL} * Current channel name 
${CONTEXT} * Current context 
${DATETIME} * Current date time in the format: DDMMYYYY-HH:MM:SS (Deprecated; use ${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)}) 
${DB_RESULT} Result value of DB_EXISTS() dial plan function 
${DNID} * Dialed Number Identifier (Deprecated; use ${CALLERID(dnid)}) 
${EPOCH} * Current unix style epoch 
${EXTEN} * Current extension 
${ENV(VAR)} Environmental variable VAR 
${GOTO_ON_BLINDXFR} Transfer to the specified context/extension/priority 
after a blind transfer (use ^ characters in place of 
| to separate context/extension/priority when setting 
this variable from the dialplan) 
${HANGUPCAUSE} * Asterisk cause of hangup (inbound/outbound) 
${HINT} * Channel hints for this extension 
${HINTNAME} * Suggested Caller*ID name for this extension 
${INVALID_EXTEN} The invalid called extension (used in the "i" extension) 
${LANGUAGE} * Current language (Deprecated; use ${LANGUAGE()}) 
${LEN(VAR)} * String length of VAR (integer) 
${PRIORITY} * Current priority in the dialplan 
${PRIREDIRECTREASON} Reason for redirect on PRI, if a call was directed 
${RDNIS} * Redirected Dial Number ID Service (Deprecated; use ${CALLERID(rdnis)}) 
${TIMESTAMP} * Current date time in the format: YYYYMMDD-HHMMSS (Deprecated; use ${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}) 
${TRANSFER_CONTEXT} Context for transferred calls 
${FORWARD_CONTEXT} Context for forwarded calls 
${UNIQUEID} * Current call unique identifier 
${SYSTEMNAME} * value of the systemname option of asterisk.conf 

Application return values 

In Asterisk 1.2, many applications return the result in a variable 
instead of, as in Asterisk 1.0, changing the dial plan priority (+101). 
For the various status values, see each application's help text. 

${AGISTATUS} * agi() 
${AQMSTATUS} * addqueuemember() 
${AVAILSTATUS} * chanisavail() 
${CHECKGROUPSTATUS} * checkgroup() 
${CHECKMD5STATUS} * checkmd5() 
${CPLAYBACKSTATUS} * controlplayback() 
${DIALSTATUS} * dial() - see also ${HANGUPCAUSE} 
${DBGETSTATUS} * dbget() 
${ENUMSTATUS} * enumlookup() 
${HASVMSTATUS} * hasnewvoicemail() 
${LOOKUPBLSTATUS} * lookupblacklist() 
${OSPAUTHSTATUS} * ospauth() 
${OSPLOOKUPSTATUS} * osplookup() 
${OSPNEXTSTATUS} * ospnext() 
${OSPFINISHSTATUS} * ospfinish() 
${PARKEDAT} * parkandannounce() 
${PLAYBACKSTATUS} * playback() 
${PQMSTATUS} * pausequeuemember() 
${PRIVACYMGRSTATUS} * privacymanager() 
${QUEUESTATUS} * queue() 
${RQMSTATUS} * removequeuemember() 
${SENDIMAGESTATUS} * sendimage() 
${SENDTEXTSTATUS} * sendtext() 
${SENDURLSTATUS} * sendurl() 
${SYSTEMSTATUS} * system() 
${TRANSFERSTATUS} * transfer() 
${TXTCIDNAMESTATUS} * txtcidname() 
${UPQMSTATUS} * unpausequeuemember() 
${VMSTATUS} * voicmail() 
${VMBOXEXISTSSTATUS} * vmboxexists() 
${WAITSTATUS} * waitforsilence() 


Various application variables 

${CURL} * Resulting page content for curl() 
${ENUM} * Result of application EnumLookup 
${EXITCONTEXT} Context to exit to in IVR menu (app background()) 
or in the RetryDial() application 
${MONITOR} * Set to "TRUE" if the channel is/has been monitored (app monitor()) 
${MONITOR_EXEC} Application to execute after monitoring a call 
${MONITOR_EXEC_ARGS} Arguments to application 
${MONITOR_FILENAME} File for monitoring (recording) calls in queue 
${QUEUE_PRIO} Queue priority 
${QUEUE_MAX_PENALTY} Maximum member penalty allowed to answer caller 
${QUEUESTATUS} Status of the call, one of: 
(TIMEOUT | FULL | JOINEMPTY | LEAVEEMPTY | JOINUNAVAIL | LEAVEUNAVAIL) 
${RECORDED_FILE} * Recorded file in record() 
${TALK_DETECTED} * Result from talkdetect() 
${TOUCH_MONITOR} The filename base to use with Touch Monitor (auto record) 
${TOUCH_MONITOR_FORMAT} The audio format to use with Touch Monitor (auto record) 
${TOUCH_MONITOR_OUTPUT} * Recorded file from Touch Monitor (auto record) 
${TXTCIDNAME} * Result of application TXTCIDName 
${VPB_GETDTMF} chan_vpb 

The MeetMe Conference Bridge uses the following variables: 

${MEETME_RECORDINGFILE} Name of file for recording a conference with 
the "r" option 
${MEETME_RECORDINGFORMAT} Format of file to be recorded 
${MEETME_EXIT_CONTEXT} Context for exit out of meetme meeting 
${MEETME_AGI_BACKGROUND} AGI script for Meetme (zap only) 
${MEETMESECS} * Number of seconds a user participated in a MeetMe conference 

The VoiceMail() application uses the following variables: 

${VM_CATEGORY} Sets voicemail category 
${VM_NAME} * Full name in voicemail 
${VM_DUR} * Voicemail duration 
${VM_MSGNUM} * Number of voicemail message in mailbox 
${VM_CALLERID} * Voicemail Caller ID (Person leaving vm) 
${VM_CIDNAME} * Voicemail Caller ID Name 
${VM_CIDNUM} * Voicemail Caller ID Number 
${VM_DATE} * Voicemail Date 
${VM_MESSAGEFILE} * Path to message left by caller 

The VMAuthenticate() application uses the following variables: 

${AUTH_MAILBOX} * Authenticated mailbox 
${AUTH_CONTEXT} * Authenticated mailbox context 

DUNDiLookup() uses the following variables 

${DUNDTECH} * The Technology of the result from a call to DUNDiLookup() 
${DUNDDEST} * The Destination of the result from a call to DUNDiLookup() 

The Zaptel channel sets the following variables: 

${ANI2} * The ANI2 Code provided by the network on the incoming call. (ie, Code 29 identifies call as a Prison/Inmate Call) See also: NANPA ANI II Digits Assignments 
${CALLTYPE} * Type of call (Speech, Digital, etc) 
${CALLEDTON} * Dialplan for called number on PRI/BRI calls (17=international, 33=national, 65=local, 73=private, 0=unknown). Note: this is a misnomer, TON != dialplan. 
${CALLINGSUBADDR} * Called PRI Subaddress 
${FAXEXTEN} * The extension called before being redirected to "fax"
${PRIREDIRECTREASON} * Reason for redirect, if a call was directed 
${SMDI_VM_TYPE} * When an call is received with an SMDI message, the 'type' 
of message 'b' or 'u' 

The SIP channel uses the following variables: 

${SIPCALLID} * SIP Call-ID: header verbatim (for logging or CDR matching) 
${SIPDOMAIN} * SIP destination domain of an inbound call (if appropriate) 
${SIPUSERAGENT} * SIP user agent 
${SIPURI} * SIP uri 
${SIP_CODEC} Set the SIP codec for a call
${SIP_URI_OPTIONS} * additional options to add to the URI for an outgoing call 
${RTPAUDIOQOS} RTCP QoS report for the audio of this call 
${RTPVIDEOQOS} RTCP QoS report for the video of this call 

The Agent channel uses the following variables: 

${AGENTMAXLOGINTRIES} Set the maximum number of failed logins 
${AGENTUPDATECDR} Whether to update the CDR record with Agent channel data 
${AGENTGOODBYE} Sound file to use for "Good Bye" when agent logs out 
${AGENTACKCALL} Whether the agent should acknowledge the incoming call 
${AGENTAUTOLOGOFF} Auto logging off for an agent 
${AGENTWRAPUPTIME} Setting the time for wrapup between incoming calls 
${AGENTNUMBER} * Agent number (username) set at login 
${AGENTSTATUS} * Status of login ( fail | on | off ) 
${AGENTEXTEN} * Extension for logged in agent 

The Dial() application uses the following variables: 

${DIALEDPEERNAME} * Dialed peer name 
${DIALEDPEERNUMBER} * Dialed peer number 
${DIALEDTIME} * Time for the call (seconds) 
${ANSWEREDTIME} * Time from dial to answer (seconds) 
${DIALSTATUS} * Status of the call, one of: 
                (CHANUNAVAIL | CONGESTION | BUSY | NOANSWER  
| ANSWER | CANCEL | DONTCALL | TORTURE) 
${DYNAMIC_FEATURES} * The list of features (from the applicationmap section of 
features.conf) to activate during the call, with feature 
names separated by '#' characters 
${LIMIT_PLAYAUDIO_CALLER} Soundfile for call limits 
${LIMIT_PLAYAUDIO_CALLEE} Soundfile for call limits 
${LIMIT_WARNING_FILE} Soundfile for call limits 
${LIMIT_TIMEOUT_FILE} Soundfile for call limits 
${LIMIT_CONNECT_FILE} Soundfile for call limits 
${OUTBOUND_GROUP} Default groups for peer channels (as in SetGroup) 
  • See "show application dial" for more information

The chanisavail() application sets the following variables: 

${AVAILCHAN} * the name of the available channel if one was found
${AVAILORIGCHAN} * the canonical channel name that was used to create the channel 
${AVAILSTATUS} * Status of requested channel 

When using macros in the dialplan, these variables are available 

${MACRO_EXTEN} * The calling extensions 
${MACRO_CONTEXT} * The calling context 
${MACRO_PRIORITY} * The calling priority 
${MACRO_OFFSET} Offset to add to priority at return from macro 

The ChanSpy() application uses the following variables: 

${SPYGROUP} * A ':' (colon) separated list of group names. 
(To be set on spied on channel and matched against the g(grp) option) 

If you compile with OSP support, these variables are used: 

${OSPINHANDLE} OSP handle of in_bound call 
${OSPINTIMELIMIT} Duration limit for in_bound call 
${OSPOUTHANDLE} OSP handle of out_bound call 
${OSPTECH} OSP technology 
${OSPDEST} OSP destination 
${OSPCALLING} OSP calling number 
${OSPOUTTOKEN} OSP token to use for out_bound call 
${OSPOUTTIMELIMIT} Duration limit for out_bound call 
${OSPRESULTS} Number of remained destinations 

Call File extension variables: 

${REASON} The reason why an auto-dialout call failed 




CDR Variables 


If the channel has a cdr, that cdr record has it's own set of variables which 
can be accessed just like channel variables. The following builtin variables 
are available and, unless specified, read-only. 

${CDR(clid)} Caller ID 
${CDR(src)} Source 
${CDR(dst)} Destination 
${CDR(dcontext)} Destination context 
${CDR(channel)} Channel name 
${CDR(dstchannel)} Destination channel 
${CDR(lastapp)} Last app executed 
${CDR(lastdata)} Last app's arguments 
${CDR(start)} Time the call started. 
${CDR(answer)} Time the call was answered. 
${CDR(end)} Time the call ended. 
${CDR(duration)} Duration of the call. 
${CDR(billsec)} Duration of the call once it was answered. 
${CDR(disposition)} ANSWERED, NO ANSWER, BUSY 
${CDR(amaflags)} DOCUMENTATION, BILL, IGNORE etc 
${CDR(accountcode)} The channel's account code (read-write). 
${CDR(uniqueid)} The channel's unique id. 
${CDR(userfield)} The channels uses specified field (read-write). 


In addition, you can set your own extra variables with a traditional 
Set(CDR(var)=val) to anything you want. 

NOTE Some CDR values (eg: duration & billsec) can't be accessed until the call has terminated. As of 91617, those values will be calculated on-demand if requested. Until that makes it into a stable release, you can set endbeforehexten=yes in cdr.conf, and then use the "hangup" context to wrap up your call. 

Certain functional variables may be accessed with ${foo(<args>)}. A list 
of these functional variables may be found by typing "show functions" 
at the Asterisk CLI.

分享到:
评论

相关推荐

    Asterisk 简介 Asterisk 架构 Asterisk程序框图

    Asterisk是一款开源的电话交换机软件,它允许用户创建高度自定义的通信系统,包括VoIP(Voice over IP)电话、会议桥、自动呼叫分配(ACD)以及许多其他电信功能。Asterisk的核心设计理念是灵活性和可扩展性,这使得...

    Asterisk 之数据库配置方案 asterisk数据库

    Asterisk 之数据库配置方案 Asterisk 是一个开源的 PBX(Private Branch Exchange)系统,可以实现电话交换和语音网关的功能。在传统的 Asterisk 配置中,配置文件都是存储在文件系统中的,但是随着系统的复杂度和...

    通过asterisk-java操作asterisk

    Asterisk是一个开源的IP电话系统,而Asterisk-java则是一个Java库,它提供了与Asterisk服务器交互的能力。这个库使得开发者可以利用Java语言来控制和编程Asterisk PBX(Private Branch eXchange),执行诸如创建、...

    Asterisk.NET 1.6.3 控制Asterisk

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

    Asterisk权威指南中文

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

    Asterisk AMI 接口代码

    Asterisk AMI(Asterisk Manager Interface)接口是Asterisk PBX系统提供的一种用于远程管理和监控的强大工具。这个接口允许开发者通过编程方式与Asterisk进行交互,执行诸如控制呼叫、获取状态、监听通话等多种操作...

    asterisk16版本安装包

    Asterisk是一款开源的IP电话系统,用于构建VoIP(Voice over Internet Protocol)通信平台。在本场景中,我们讨论的是Asterisk的16版本安装包,这将引导我们深入理解Asterisk的核心功能、安装流程以及如何进行编译和...

    asterisk info 录音实现方案

    标签“asterisk record”指的是与Asterisk录音相关的配置和功能,它表明文章将围绕如何在Asterisk中设置和实现录音功能。 在提供的部分内容中,提到了几个关键的配置文件和步骤,这些是实现Asterisk录音功能的核心...

    Asterisk 中文语音包

    Asterisk是一款开源的IP电话系统,它允许用户创建自己的通信平台,支持VoIP(Voice over IP)服务,包括电话会议、语音邮件和IVR(Interactive Voice Response)等。中文语音包是为Asterisk系统设计的一个关键组件,...

    Asterisk一些常用的命令

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

    Asterisk

    Asterisk,作为开源通信平台中的佼佼者,它的出现彻底改变了传统电话系统的工作方式,为全球通信领域带来了革命性的变化。Asterisk不仅仅是一款软件,它更是一种理念,象征着自由、开放与创新的精神。从上述内容来看...

    asterisk 视频通讯实现方法

    Asterisk是一款开源的PBX(Private Branch Exchange)软件,专用于实现VoIP(Voice over IP)通信。在本文中,我们将深入探讨如何利用Asterisk实现视频通讯功能。实现Asterisk视频通讯的关键在于配置sip.conf文件...

    Asterisk 中文文档说明

    Asterisk是一款强大的开源通信平台,它被广泛用于构建VoIP(Voice over Internet Protocol)电话系统,SIP(Session Initiation Protocol)服务器以及各种通信应用。这个“Asterisk中文文档说明”涵盖了从基础概念到...

    asterisk AGI应用说明

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

    Asterisk 客户端.rar

    Asterisk是一款开源的IP电话系统,用于构建VoIP网络通信基础设施。它的功能强大,能够支持PBX(Private Branch Exchange)、VoIP网关、呼叫中心和许多其他电信应用。在这个"Asterisk客户端.rar"压缩包中,我们主要...

    asterisk拨号方案的配置

    asterisk拨号方案的配置 Asterisk拨号方案的配置是Voice over Internet Protocol(VoIP)技术中的一个关键组件,它控制着呼入和呼出电话的处理和路由。配置文件“extensions.conf”是Asterisk拨号方案的核心,它...

    Asterisk系统的安装与配置

    Asterisk系统的安装与配置 Asterisk是开源的通讯服务器软件,提供了丰富的通讯功能,包括语音、视频、即时消息等。下面是Asterisk系统的安装与配置指南。 一、安装DAHDI DAHDI是Asterisk管理硬件的插件(中间件)...

    asterisk-java-1.0.0-m2-sources.zip_asterisk

    Asterisk-Java是一个Java库,它为Asterisk系统提供了AGI(Asterisk Gateway Interface)的实现,方便开发者用Java语言进行Asterisk系统的接口开发。AGI是Asterisk的一个强大特性,允许外部应用程序在呼叫处理过程中...

    asterisk 学习日志

    Asterisk是一个开源的IP电话系统,用于搭建VoIP服务器,提供电话呼叫、语音邮件、会议等通信功能。以下是对Asterisk学习日志中提到的一些关键知识点的详细解释: 1. **Asterisk调试与日志记录**: 在学习Asterisk...

    最全Asterisk代码学习笔记

    Asterisk是一款开源的PBX(Private Branch Exchange)软件,它允许用户在IP网络上建立电话通信系统。作为Linux环境下的通信平台,Asterisk提供了丰富的功能,包括语音通话、会议、语音邮件、传真等。以下是一些核心...

Global site tag (gtag.js) - Google Analytics