在asterisk中,定义了许多变量,或是有些变量能够被其读取。下面给出了它们的列表。在每一个application的帮助文档中,你可以获得更多的信息。所有这些变量都是大写的。
被*标记的变量是内建函数,不能在拨号方案中被设置,只能被读取。对这些变量的赋值将被忽略。
${CDR(accountcode)} * Account code (if specified)
${BLINDTRANSFER} The name of the channel on the other side of a blind transfer
${BRIDGEPEER} Bridged peer
${BRIDGEPVTCALLID} Bridged peer PVT call ID (SIP Call ID if a SIP call)
${CALLERID(ani)} * Caller ANI (PRI channels)
${CALLERID(ani2)} * ANI2 (Info digits) also called Originating line information or OLI
${CALLERID(all)} * Caller ID
${CALLERID(dnid)} * Dialed Number Identifier
${CALLERID(name)} * Caller ID Name only
${CALLERID(num)} * Caller ID Number only
${CALLERID(rdnis)} * Redirected Dial Number ID Service
${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
${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
${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
${ENTITYID} * Global Entity ID set automatically, or from asterisk.conf
Application的返回值(Application return values)
当你调用有些application的时候,它们会返回一个值供你读取。对于每一个application,这些状态字段是唯一的。各种状态值,前参考每个application的帮助文档。
${AGISTATUS} * agi()
${AQMSTATUS} * addqueuemember()
${AVAILSTATUS} * chanisavail()
${CHECKGROUPSTATUS} * checkgroup()
${CHECKMD5STATUS} * checkmd5()
${CPLAYBACKSTATUS} * controlplayback()
${DIALSTATUS} * dial()
${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()
各种application的相关变量(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
${QUEUE_MIN_PENALTY} Minimum 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_PREF} * The prefix for automonitor recording filenames.
${TOUCH_MONITOR_FORMAT} The audio format to use with Touch Monitor (auto record)
${TOUCH_MONITOR_OUTPUT} * Recorded file from Touch Monitor (auto record)
${TOUCH_MONITOR_MESSAGE_START} Recorded file to play for both channels at start of monitoring session
${TOUCH_MONITOR_MESSAGE_STOP} Recorded file to play for both channels at end of monitoring session
${TXTCIDNAME} * Result of application TXTCIDName
${VPB_GETDTMF} chan_vpb
MeetMe会议桥[会议电话桥分器](The MeetMe Conference Bridge)
${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 (DAHDI only)
${MEETMESECS} * Number of seconds a user participated in a MeetMe conference
${CONF_LIMIT_TIMEOUT_FILE} File to play when time is up. Used with the L() option.
${CONF_LIMIT_WARNING_FILE} File to play as warning if 'y' is defined. The default is to say the time remaining. Used with the L() option.
The VoiceMail() application
${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
${AUTH_MAILBOX} * Authenticated mailbox
${AUTH_CONTEXT} * Authenticated mailbox context
DUNDiLookup()
${DUNDTECH} * The Technology of the result from a call to DUNDiLookup()
${DUNDDEST} * The Destination of the result from a call to DUNDiLookup()
chan_dahdi
${ANI2} * The ANI2 Code provided by the network on the incoming call. (ie, Code 29 identifies call as a Prison/Inmate Call)
${CALLTYPE} * Type of call (Speech, Digital, etc)
${CALLEDTON} * Type of number for incoming PRI extension i.e. 0=unknown, 1=international, 2=domestic, 3=net_specific, 4=subscriber, 6=abbreviated, 7=reserved
${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'
chan_sip
${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 (deprecated)
${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
chan_agent
${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
${DIALEDPEERNAME} * Dialed peer name
${DIALEDPEERNUMBER} * Dialed peer number
${DIALEDTIME} * Time for the call (seconds). Is only set if call was answered.
${ANSWEREDTIME} * Time from answer to hangup (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
${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
拨号方案宏(Dialplan Macros)
${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
${SPYGROUP} * A ':' (colon) separated list of group names. (To be set on spied on channel and matched against the g(grp) option)
OSP
${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
相关推荐
### Asterisk 通道变量详解 #### 一、概述 在Asterisk开发中,通道变量是编程中的核心概念之一,用于存储与特定电话呼叫相关的数据。这些变量可以在各种Asterisk应用程序之间传递,并且可以被读取或修改,从而实现...
### Asterisk全局变量分析 #### 一、概览 Asterisk是一款开源的PBX(Private Branch Exchange)软件,能够支持语音、视频等多种通信服务。在Asterisk中,全局变量是一个非常重要的概念,它可以帮助用户更加灵活地...
在实际开发中,除了掌握`asterisk-java`库的用法,还需要对Asterisk的基本概念和工作原理有一定的理解,比如了解呼叫流程、通道、队列、拨号计划等。此外,熟悉Asterisk的AMI文档也很重要,这样可以更好地理解和利用...
6. 代码修改说明:文档中提到要替换原有的chan_sip.so模块,使用func_channel.so和Funccurl.so这样的自定义或修改过的模块,可能是因为标准Asterisk模块不支持某些自定义功能。 整个方案要求对Asterisk系统有较深的...
本文将深入剖析Asterisk的核心概念,包括通道(Channel)、呼叫情景(Call Scenario)、桥接通道(Bridging Channels)以及植入通道(Masquerading Channels),并通过具体代码实例来解释这些概念的应用。...
标题"Asterisk标准录音"指的是使用Asterisk系统进行的高质量录音,这些录音通常遵循特定的格式和标准,以便在Asterisk环境中无缝集成和播放。GSM格式是一种广泛使用的音频压缩格式,特别适用于语音应用,因为它具有...
此外,还可以直接通过标准输出发送命令来获取或设置通道变量的值。 ##### 3.2 接收来自Asterisk的信息 当AGI脚本执行时,Asterisk会通过标准输入向脚本发送各种信息,如通道状态等。这些信息对于后续处理非常重要。...
1. **通道驱动**:负责处理与不同类型的通信设备或网络协议的连接,例如SIP、PSTN(公共交换电话网络)或者模拟电话线。 2. **拨号计划**:定义了如何路由和处理呼叫,可以基于来电号码、时间、目的地等因素进行...
5. **使用通道(Channels)和拨号计划(Dialplan)**:Asterisk-java提供了对通道和拨号计划的操作,你可以查询现有的通道状态,修改拨号计划,甚至在运行时动态改变Asterisk的行为。 6. **实时监控**:通过...
Asterisk 之数据库配置方案 Asterisk 是一个开源的 PBX(Private Branch Exchange)系统,可以实现电话交换和语音网关的功能。在传统的 Asterisk 配置中,配置文件都是存储在文件系统中的,但是随着系统的复杂度和...
这个库是基于Asterisk Manager Interface (AMI) 和 FastAGI 协议,这两个协议是Asterisk系统与外部应用程序交互的主要通道。 Asterisk是一款开源的IP电话系统,广泛应用于VoIP(Voice over Internet Protocol)环境...
* zap show channels 查看ZapTel语音卡各个通道 * stop now 立刻停止Asterisk * stop gracefully 温文尔雅滴停止Asterisk * restart now 立刻重启Asterisk * restart gracefully 温文尔雅滴重启Asterisk * database ...
了解Asterisk的基本概念,如DAHDI(数字接入分机接口)、通道变量和全局变量,以及PBX(Private Branch eXchange)的工作原理,对深入学习Asterisk至关重要。 10. **C语言字符串处理**: C语言中的字符串处理是...
当 Asterisk 从一个通道上收到一个呼入连接,Asterisk 从 context 定义中查询通道命令。context 根据用户拨打的 extension 定义了不同的命令集。 在 Asterisk 中,你可以定义多个 context,每个context都可以嵌套另...
Asterisk权威指南中文(第3版) Asterisk权威指南(第3版)第15章自动话务员 Asterisk权威指南(第3版)第02章Asterisk体系结构 Asterisk权威指南(第3版)第05章用户设备配置 Asterisk权威指南(第3版)第06章Dialplan基础 ...
Asterisk的通道信息可以在voip-info.org网站上找到,这对于理解和配置Asterisk的通道设置非常有用。 总之,Asterisk作为一个强大的开源通信平台,提供了丰富的功能和高度的灵活性,使得任何人都能构建自己的电话...
具体到16.19.0这个版本,它可能修复了一些已知问题,增强了系统的安全性,同时引入了对最新技术标准的支持。 3. **安装流程**: - **环境准备**:确保系统为Linux发行版,如Ubuntu、CentOS,且已安装必要的编译...
Asterisk系统的安装与配置 Asterisk是开源的通讯服务器软件,...Asterisk系统的安装与配置需要按照以上步骤进行,包括安装DAHDI、安装Asterisk、配置SIP通道、配置基本SIP账户、配置电话会议室和配置广播寻呼功能。
2. **架构概述**:Asterisk的核心架构包括通道(Channels)、拨号计划(DialPlan)、应用程序(Apps)和管理接口(Manager API)。通道处理实际的通信连接,DialPlan定义了如何处理呼叫,应用程序执行特定的通话操作...
这个"chan_dahdi.rar_asterisk_asterisk channel_asterisk中cid_channel as"的压缩包文件显然与Asterisk系统中的Dahdi通道和CID(Calling ID)处理有关。下面我们将深入探讨这些关键概念。 首先,Asterisk是一个...