<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/en/2176/18/9/_/styles/combined.css?spaceKey=AST&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+Standard+Channel+Variables">Asterisk Standard Channel Variables</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://wiki.asterisk.org/wiki/display/~mjordan">Matt Jordan</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >* $\{SYSTEMNAME\} * - value of the systemname option of asterisk.conf <br>* $\{ENTITYID\} * - Global Entity ID set automatically, or from asterisk.conf <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>h3. Variables present in Asterisk 11 and forward: <br> <br>* $\{CALENDAR_SUCCESS\} * - Status of the [CALENDAR_WRITE|AST:Asterisk 11 Function_CALENDAR_WRITE] function.  Set to {{1}} if the function completed successfully; {{0}} otherwise. <br>* $\{VOICEMAIL_PLAYBACKSTATUS\} * - Status of the [VoiceMailPlayMsg|AST:Asterisk 11 Application_VoiceMailPlayMsg] application.  {{SUCCESS}} if the voicemail was played back successfully, {{FAILED} otherwise <br>* $\{SIP_RECVADDR\} * - the address a SIP MESSAGE request was received from <br>* $\{AGIEXITONHANGUP\} * - set to {{1}} to force the behavior of a call to AGI to behave as it did in 1.4, where the AGI script would exit immediately on detecting a channel hangup <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>There are a number of variables that are defined or read by Asterisk. Here is a listing of them.  More information is available in each application's help text. All these variables are in UPPER CASE only.</p>

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

<h3><a name="AsteriskStandardChannelVariables-VariablespresentinAsterisk1.8andforward%3A"></a>Variables present in Asterisk 1.8 and forward:</h3>

<ul>
        <li>${CDR(accountcode)} * -  Account code (if specified)</li>
        <li>${BLINDTRANSFER} - The name of the channel on the other side of a blind transfer</li>
        <li>${BRIDGEPEER} - Bridged peer</li>
        <li>${BRIDGEPVTCALLID} - Bridged peer PVT call ID (SIP Call ID if a SIP call)</li>
        <li>${CALLERID(ani)} * - Caller ANI (PRI channels)</li>
        <li>${CALLERID(ani2)} * - ANI2 (Info digits) also called Originating line information or OLI</li>
        <li>${CALLERID(all)} * - Caller ID</li>
        <li>${CALLERID(dnid)} * - Dialed Number Identifier</li>
        <li>${CALLERID(name)} * - Caller ID Name only</li>
        <li>${CALLERID(num)} * - Caller ID Number only</li>
        <li>${CALLERID(rdnis)} * - Redirected Dial Number ID Service</li>
        <li>${CALLINGANI2} * - Caller ANI2 (PRI channels)</li>
        <li>${CALLINGPRES} * - Caller ID presentation for incoming calls (PRI channels)</li>
        <li>${CALLINGTNS} * - Transit Network Selector (PRI channels)</li>
        <li>${CALLINGTON} * - Caller Type of Number (PRI channels)</li>
        <li>${CHANNEL} * - Current channel name</li>
        <li>${CONTEXT} * - Current context</li>
        <li>${DATETIME} * - Current date time in the format: DDMMYYYY-HH:MM:SS (Deprecated; use ${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)})</li>
        <li>${DB_RESULT} - Result value of DB_EXISTS() dial plan function</li>
        <li>${EPOCH} * - Current unix style epoch</li>
        <li>${EXTEN} * - Current extension</li>
        <li>${ENV(VAR)} - Environmental variable VAR</li>
        <li>${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)</li>
        <li>${HANGUPCAUSE} * - Asterisk cause of hangup (inbound/outbound)</li>
        <li>${HINT} * - Channel hints for this extension</li>
        <li>${HINTNAME} * - Suggested Caller*ID name for this extension</li>
        <li>${INVALID_EXTEN} - The invalid called extension (used in the "i" extension)</li>
        <li>${LANGUAGE} * - Current language (Deprecated; use ${LANGUAGE()})</li>
        <li>${LEN(VAR)} - String length of VAR (integer)</li>
        <li>${PRIORITY} * - Current priority in the dialplan</li>
        <li>${PRIREDIRECTREASON} - Reason for redirect on PRI, if a call was directed</li>
        <li>${TIMESTAMP} * - Current date time in the format: YYYYMMDD-HHMMSS (Deprecated; use ${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})</li>
        <li>${TRANSFER_CONTEXT} - Context for transferred calls</li>
        <li>${FORWARD_CONTEXT} - Context for forwarded calls</li>
        <li>${DYNAMIC_PEERNAME} - The name of the channel on the other side when a dynamic feature is used.</li>
        <li>${DYNAMIC_FEATURENAME} The name of the last triggered dynamic feature.</li>
        <li>${UNIQUEID} * - Current call unique identifier</li>
        <li>${SYSTEMNAME} * - value of the systemname option of asterisk.conf</li>
        <li>${ENTITYID} * - Global Entity ID set automatically, or from asterisk.conf</li>
</ul>


<h3><a name="AsteriskStandardChannelVariables-VariablespresentinAsterisk11andforward%3A"></a>Variables present in Asterisk 11 and forward:</h3>

<ul>
        <li>${CALENDAR_SUCCESS} * - Status of the <a href="/wiki/display/AST/Asterisk+11+Function_CALENDAR_WRITE" title="Asterisk 11 Function_CALENDAR_WRITE">CALENDAR_WRITE</a> function.  Set to <tt>1</tt> if the function completed successfully; <tt>0</tt> otherwise.</li>
        <li>${VOICEMAIL_PLAYBACKSTATUS} * - Status of the <a href="/wiki/display/AST/Asterisk+11+Application_VoiceMailPlayMsg" title="Asterisk 11 Application_VoiceMailPlayMsg">VoiceMailPlayMsg</a> application.  <tt>SUCCESS</tt> if the voicemail was played back successfully, {{FAILED} otherwise</li>
        <li>${SIP_RECVADDR} * - the address a SIP MESSAGE request was received from</li>
        <li>${AGIEXITONHANGUP} * - set to <tt>1</tt> to force the behavior of a call to AGI to behave as it did in 1.4, where the AGI script would exit immediately on detecting a channel hangup</li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=AST">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+Standard+Channel+Variables">View Online</a>
        |
        <a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=4620398&revisedVersion=7&originalVersion=6">View Changes</a>
                |
        <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+Standard+Channel+Variables?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>