[Asterisk-Users] ** Asterisk Sunday Morning News: Contribute to the community

Ernest W. Lessenger ernest at oacys.com
Mon May 17 09:10:33 MST 2004


You know what would be cool? A "Show Variables" command in the cli. It could
return something like this...

Variable            Scope         Channel
=========================================
CallerID            C             ZAP/1-1
EPOCH               G
EXTEN               C             ZAP/1-1
...

--Ernest

 
> * Dial plan tips of the week: Discover the variables!
> -----------------------------------------------------
> When creating a dial plan, there's a lot of logic to help 
> you. One thing that
> takes time to discover is the use of variables.
> Asterisk has a range of globally defined variables that you can use to
> configure extensions the way you want. Here's a list:
> ${CALLERID}     Caller ID
> ${CALLERIDNAME} Caller ID Name only
> ${CALLERIDNUM}  Caller ID Number only
> ${EXTEN}        Current extension
> ${CONTEXT}      Current context
> ${PRIORITY}     Current priority
> ${CHANNEL}      Current channel name
> ${ENV(VAR)}     Environmental variable VAR
> ${LEN(VAR)}     String length of VAR (integer)
> ${EPOCH}        Current unix style epoch
> ${DATETIME}     Current date time in the format: YYYY-MM-DD_HH:MM:SS
> ${TIMESTAMP}    Current date time in the format: YYYYMMDD-HHMMSS
> ${UNIQUEID}     Current call unique identifier
> ${DNID}         Dialed Number Identifier
> ${RDNIS}        Redirected Dial Number ID Service
> ${HANGUPCAUSE}  Asterisk hangup cause
> ${ACCOUNTCODE}  Account code (if specified)
> ${LANGUAGE}     Current language
> ${SIPDOMAIN}    SIP destination domain of an inbound call (if 
> appropriate)
> ${SIPUSERAGENT} SIP user agent
> ${SIPCALLID}    SIP Call-ID: header verbatim (for logging or 
> CDR matching)
> 
> Applications that works with variables
> * set your own variables with the setvar() and the 
> setglobalvar() application.
> * the gotoif() app lets you can make conditional tests on 
> variables and
>    jump to various extensions or priorities of your dial plan.
> * the cut() app lets you divide a variable in two or more parts
> 
> To learn more, read README.variables in your docs/ directory.
> Or visit the Wiki:
> http://www.voip-info.org/tiki-index.php?page=Asterisk+variables




More information about the asterisk-users mailing list