⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 channelvariables.tex

📁 asterisk 是一个很有知名度开源软件
💻 TEX
📖 第 1 页 / 共 3 页
字号:
in the top level asterisk source directory. This will build a smallexecutable, that is able to take the first command line argument, andrun it thru the expression parser. No variable substitutions will beperformed. It might be safest to wrap the expression in singlequotes...\begin{astlisting}\begin{verbatim}testexpr2 '2*2+2/2'\end{verbatim}\end{astlisting}is an example.And, in the utils directory, you can say:\begin{astlisting}\begin{verbatim}make check_expr\end{verbatim}\end{astlisting}and a small program will be built, that will check the file mentionedin the first command line argument, for any expressions that might behave problems when you move to flex-2.5.31.  It was originallydesigned to help spot possible incompatibilities when moving from thepre-2.5.31 world to the upgraded version of the lexer.But one more capability has been added to check\_expr, that might makeit more generally useful. It now does a simple minded evaluation ofall variables, and then passes the \$[] exprs to the parser. If thereare any parse errors, they will be reported in the log file. You canuse check\_expr to do a quick sanity check of the expressions in yourextensions.conf file, to see if they pass a crude syntax check.The "simple-minded" variable substitution replaces \$\{varname\} variablereferences with '555'. You can override the 555 for variable values,by entering in var=val arguments after the filename on the commandline.  So...\begin{astlisting}\begin{verbatim} check_expr /etc/asterisk/extensions.conf CALLERID(num)=3075551212 DIALSTATUS=TORTURE EXTEN=121\end{verbatim}\end{astlisting}will substitute any \$\{CALLERID(num)\} variable references with3075551212, any \$\{DIALSTATUS\} variable references with 'TORTURE', andany \$\{EXTEN\} references with '121'.  If there is any fancy stuffgoing on in the reference, like \$\{EXTEN:2\}, then the override willnot work. Everything in the \$\{...\} has to match. So, to substitute\$\{EXTEN:2\} references, you'd best say:\begin{astlisting}\begin{verbatim} check_expr /etc/asterisk/extensions.conf CALLERID(num)=3075551212 DIALSTATUS=TORTURE EXTEN:2=121\end{verbatim}\end{astlisting}on stdout, you will see something like:\begin{astlisting}\begin{verbatim} OK -- $[ "${DIALSTATUS}"  = "TORTURE" | "${DIALSTATUS}" = "DONTCALL" ] at line 416\end{verbatim}\end{astlisting}In the expr2\_log file that is generated, you will see:\begin{astlisting}\begin{verbatim} line 416, evaluation of $[  "TORTURE"  = "TORTURE" | "TORTURE" = "DONTCALL"  ] result: 1\end{verbatim}\end{astlisting}check\_expr is a very simplistic algorithm, and it is far from beingguaranteed to work in all cases, but it is hoped that it will beuseful.\section{Asterisk standard channel variables}There are a number of variables that are defined or readby Asterisk. Here is a list of them. More information isavailable in each application's help text. All these variablesare in UPPER CASE only.Variables marked with a * are builtin functions and can't be set,only read in the dialplan.  Writes to such variables are silentlyignored.\begin{verbatim}${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\end{verbatim}\subsection{Application return values}Many applications return the result in a variable that you read toget the result of the application. These status fields are uniquefor each application.For the various status values, see each application's help text.\begin{verbatim}${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()\end{verbatim}\subsection{Various application variables}\begin{verbatim}${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)${TXTCIDNAME}           * Result of application TXTCIDName${VPB_GETDTMF}            chan_vpb\end{verbatim}\subsection{The MeetMe Conference Bridge}\begin{verbatim}${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.\end{verbatim}\subsection{The VoiceMail() application}\begin{verbatim}${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\end{verbatim}\subsection{The VMAuthenticate() application}\begin{verbatim}${AUTH_MAILBOX}   * Authenticated mailbox${AUTH_CONTEXT}   * Authenticated mailbox context\end{verbatim}\subsection{DUNDiLookup()}\begin{verbatim}${DUNDTECH}       * The Technology of the result from a call to DUNDiLookup()${DUNDDEST}       * The Destination of the result from a call to DUNDiLookup()\end{verbatim}\subsection{chan\_dahdi}\begin{verbatim}${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'\end{verbatim}\subsection{chan\_sip}\begin{verbatim}${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\end{verbatim}\subsection{chan\_agent}\begin{verbatim}${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\end{verbatim}\subsection{The Dial() application}\begin{verbatim}${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\end{verbatim}\subsection{The chanisavail() application}\begin{verbatim}${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\end{verbatim}\subsection{Dialplan Macros}\begin{verbatim}${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\end{verbatim}\subsection{The ChanSpy() application}\begin{verbatim}${SPYGROUP}           * A ':' (colon) separated list of group names.                        (To be set on spied on channel and matched against the g(grp) option)\end{verbatim}\subsection{OSP}\begin{verbatim}${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\end{verbatim}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -