asterisk/doc/ast_funcdocs.tex
2007-07-02 17:12:20 +00:00

1705 lines
44 KiB
TeX

% This file is automatically generated by the "core dump funcdocs" CLI command. Any manual edits will be lost.
\section{AGENT}
\subsection{Syntax}
\begin{verbatim}
AGENT(<agentid>[:item])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets information about an Agent
\end{verbatim}
\subsection{Description}
\begin{verbatim}
The valid items to retrieve are:
- status (default) The status of the agent
LOGGEDIN | LOGGEDOUT
- password The password of the agent
- name The name of the agent
- mohclass MusicOnHold class
- exten The callback extension for the Agent (AgentCallbackLogin)
- channel The name of the active channel for the Agent (AgentLogin)
\end{verbatim}
\section{ARRAY}
\subsection{Syntax}
\begin{verbatim}
ARRAY(var1[|var2[...][|varN]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Allows setting multiple variables at once
\end{verbatim}
\subsection{Description}
\begin{verbatim}
The comma-separated list passed as a value to which the function is set will
be interpreted as a set of values to which the comma-separated list of
variable names in the argument should be set.
Hence, Set(ARRAY(var1|var2)=1\,2) will set var1 to 1 and var2 to 2
Note: remember to either backslash your commas in extensions.conf or quote the
entire argument, since Set can take multiple arguments itself.
\end{verbatim}
\section{BASE64\_DECODE}
\subsection{Syntax}
\begin{verbatim}
BASE64_DECODE(<base64_string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Decode a base64 string
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns the plain text string
\end{verbatim}
\section{BASE64\_ENCODE}
\subsection{Syntax}
\begin{verbatim}
BASE64_ENCODE(<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Encode a string in base64
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns the base64 string
\end{verbatim}
\section{BLACKLIST}
\subsection{Syntax}
\begin{verbatim}
BLACKLIST()
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Check if the callerid is on the blacklist
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Uses astdb to check if the Caller*ID is in family 'blacklist'. Returns 1 or 0.
\end{verbatim}
\section{CALLERID}
\subsection{Syntax}
\begin{verbatim}
CALLERID(datatype[,<optional-CID>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets Caller*ID data on the channel.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets or sets Caller*ID data on the channel. The allowable datatypes
are "all", "name", "num", "ANI", "DNID", "RDNIS", "pres",
and "ton".
Uses channel callerid by default or optional callerid, if specified.
\end{verbatim}
\section{CALLERPRES}
\subsection{Syntax}
\begin{verbatim}
CALLERPRES()
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets Caller*ID presentation on the channel.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets or sets Caller*ID presentation on the channel. The following values
are valid:
allowed_not_screened : Presentation Allowed, Not Screened
allowed_passed_screen : Presentation Allowed, Passed Screen
allowed_failed_screen : Presentation Allowed, Failed Screen
allowed : Presentation Allowed, Network Number
prohib_not_screened : Presentation Prohibited, Not Screened
prohib_passed_screen : Presentation Prohibited, Passed Screen
prohib_failed_screen : Presentation Prohibited, Failed Screen
prohib : Presentation Prohibited, Network Number
unavailable : Number Unavailable
\end{verbatim}
\section{CDR}
\subsection{Syntax}
\begin{verbatim}
CDR(<name>[|options])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets a CDR variable
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Options:
'r' searches the entire stack of CDRs on the channel
'u' retrieves the raw, unprocessed value
For example, 'start', 'answer', and 'end' will be retrieved as epoch
values, when the 'u' option is passed, but formatted as YYYY-MM-DD HH:MM:SS
otherwise. Similarly, disposition and amaflags will return their raw
integral values.
Here is a list of all the available cdr field names:
clid lastdata disposition
src start amaflags
dst answer accountcode
dcontext end uniqueid
dstchannel duration userfield
lastapp billsec channel
All of the above variables are read-only, except for accountcode,
userfield, and amaflags. You may, however, supply
a name not on the above list, and create your own
variable, whose value can be changed with this function,
and this variable will be stored on the cdr.
raw values for disposition:
1 = NO ANSWER
2 = BUSY
3 = FAILED
4 = ANSWERED
raw values for amaflags:
1 = OMIT
2 = BILLING
3 = DOCUMENTATION
\end{verbatim}
\section{CHANNEL}
\subsection{Syntax}
\begin{verbatim}
CHANNEL(item)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets/sets various pieces of information about the channel.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets/set various pieces of information about the channel.
Standard items (provided by all channel technologies) are:
R/O audioreadformat format currently being read
R/O audionativeformat format used natively for audio
R/O audiowriteformat format currently being written
R/W callgroup call groups for call pickup
R/O channeltype technology used for channel
R/W language language for sounds played
R/W musicclass class (from musiconhold.conf) for hold music
R/W rxgain set rxgain level on channel drivers that support it
R/O state state for channel
R/W tonezone zone for indications played
R/W txgain set txgain level on channel drivers that support it
R/O videonativeformat format used natively for video
chan_sip provides the following additional options:
R/O rtpqos Get QOS information about the RTP stream
This option takes two additional arguments:
Argument 1:
audio Get data about the audio stream
video Get data about the video stream
text Get data about the text stream
Argument 2:
local_ssrc Local SSRC (stream ID)
local_lostpackets Local lost packets
local_jitter Local calculated jitter
local_count Number of received packets
remote_ssrc Remote SSRC (stream ID)
remote_lostpackets Remote lost packets
remote_jitter Remote reported jitter
remote_count Number of transmitted packets
rtt Round trip time
all All statistics (in a form suited to logging, but not for parsing)
R/O rtpdest Get remote RTP destination information
This option takes one additional argument:
Argument 1:
audio Get audio destination
video Get video destination
chan_iax2 provides the following additional options:
R/W osptoken Get or set the OSP token information for a call
Additional items may be available from the channel driver providing
the channel; see its documentation for details.
Any item requested that is not available on the current channel will
return an empty string.
\end{verbatim}
\section{CHECKSIPDOMAIN}
\subsection{Syntax}
\begin{verbatim}
CHECKSIPDOMAIN(<domain|IP>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Checks if domain is a local domain
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function checks if the domain in the argument is configured
as a local SIP domain that this Asterisk server is configured to handle.
Returns the domain name if it is locally handled, otherwise an empty string.
Check the domain= configuration in sip.conf
\end{verbatim}
\section{CURL}
\subsection{Syntax}
\begin{verbatim}
CURL(url[|post-data])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Retrieves the contents of a URL
\end{verbatim}
\subsection{Description}
\begin{verbatim}
url - URL to retrieve
post-data - Optional data to send as a POST (GET is default action)
\end{verbatim}
\section{CUT}
\subsection{Syntax}
\begin{verbatim}
CUT(<varname>,<char-delim>,<range-spec>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Slices and dices strings, based upon a named delimiter.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
varname - variable you want cut
char-delim - defaults to '-'
range-spec - number of the field you want (1-based offset)
may also be specified as a range (with -)
or group of ranges and fields (with &)
\end{verbatim}
\section{DB}
\subsection{Syntax}
\begin{verbatim}
DB(<family>/<key>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Read from or write to the Asterisk database
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will read from or write a value to the Asterisk database. On a
read, this function returns the corresponding value from the database, or blank
if it does not exist. Reading a database value will also set the variable
DB_RESULT. If you wish to find out if an entry exists, use the DB_EXISTS
function.
\end{verbatim}
\section{DB\_DELETE}
\subsection{Syntax}
\begin{verbatim}
DB_DELETE(<family>/<key>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Return a value from the database and delete it
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will retrieve a value from the Asterisk database
and then remove that key from the database. DB_RESULT
will be set to the key's value if it exists.
\end{verbatim}
\section{DB\_EXISTS}
\subsection{Syntax}
\begin{verbatim}
DB_EXISTS(<family>/<key>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Check to see if a key exists in the Asterisk database
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will check to see if a key exists in the Asterisk
database. If it exists, the function will return "1". If not,
it will return "0". Checking for existence of a database key will
also set the variable DB_RESULT to the key's value if it exists.
\end{verbatim}
\section{DEVSTATE}
\subsection{Syntax}
\begin{verbatim}
DEVSTATE(device)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Get or Set a device state
\end{verbatim}
\subsection{Description}
\begin{verbatim}
The DEVSTATE function can be used to retrieve the device state from any
device state provider. For example:
NoOp(SIP/mypeer has state ${DEVSTATE(SIP/mypeer)})
NoOp(Conference number 1234 has state ${DEVSTATE(MeetMe:1234)})
The DEVSTATE function can also be used to set custom device state from
the dialplan. The "Custom:" prefix must be used. For example:
Set(DEVSTATE(Custom:lamp1)=BUSY)
Set(DEVSTATE(Custom:lamp2)=NOT_INUSE)
You can subscribe to the status of a custom device state using a hint in
the dialplan:
exten => 1234,hint,Custom:lamp1
The possible values for both uses of this function are:
UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING
RINGINUSE | ONHOLD
\end{verbatim}
\section{DUNDILOOKUP}
\subsection{Syntax}
\begin{verbatim}
DUNDILOOKUP(number[|context[|options]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Do a DUNDi lookup of a phone number.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This will do a DUNDi lookup of the given phone number.
If no context is given, the default will be e164. The result of
this function will return the Technology/Resource found in the first result
in the DUNDi lookup. If no results were found, the result will be blank.
If the 'b' option is specified, the internal DUNDi cache will
be bypassed.
\end{verbatim}
\section{DUNDIQUERY}
\subsection{Syntax}
\begin{verbatim}
DUNDIQUERY(number[|context[|options]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Initiate a DUNDi query.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This will do a DUNDi lookup of the given phone number.
If no context is given, the default will be e164. The result of
this function will be a numeric ID that can be used to retrieve
the results with the DUNDIRESULT function. If the 'b' option is
is specified, the internal DUNDi cache will be bypassed.
\end{verbatim}
\section{DUNDIRESULT}
\subsection{Syntax}
\begin{verbatim}
DUNDIRESULT(id|resultnum)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Retrieve results from a DUNDIQUERY
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will retrieve results from a previous use
of the DUNDIQUERY function.
id - This argument is the identifier returned by the DUNDIQUERY function.
resultnum - This is the number of the result that you want to retrieve.
Results start at 1. If this argument is specified as "getnum",
then it will return the total number of results that are available.
\end{verbatim}
\section{ENUMLOOKUP}
\subsection{Syntax}
\begin{verbatim}
ENUMLOOKUP(number[|Method-type[|options[|record#[|zone-suffix]]]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
General or specific querying of NAPTR records for ENUM or ENUM-like DNS pointers
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Option 'c' returns an integer count of the number of NAPTRs of a certain RR type.
Combination of 'c' and Method-type of 'ALL' will return a count of all NAPTRs for the record.
Defaults are: Method-type=sip, no options, record=1, zone-suffix=e164.arpa
For more information, see doc/asterisk.pdf
\end{verbatim}
\section{ENUMQUERY}
\subsection{Syntax}
\begin{verbatim}
ENUMQUERY(number[|Method-type[|zone-suffix]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Initiate an ENUM query
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This will do a ENUM lookup of the given phone number.
If no method-tpye is given, the default will be sip. If no
zone-suffix is given, the default will be "e164.arpa".
The result of this function will be a numeric ID that can
be used to retrieve the results using the ENUMRESULT function.
\end{verbatim}
\section{ENUMRESULT}
\subsection{Syntax}
\begin{verbatim}
ENUMRESULT(id|resultnum)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Retrieve results from a ENUMQUERY
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will retrieve results from a previous use
of the ENUMQUERY function.
id - This argument is the identifier returned by the ENUMQUERY function.
resultnum - This is the number of the result that you want to retrieve.
Results start at 1. If this argument is specified as "getnum",
then it will return the total number of results that are available.
\end{verbatim}
\section{ENV}
\subsection{Syntax}
\begin{verbatim}
ENV(<envname>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets the environment variable specified
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{EVAL}
\subsection{Syntax}
\begin{verbatim}
EVAL(<variable>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Evaluate stored variables.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Using EVAL basically causes a string to be evaluated twice.
When a variable or expression is in the dialplan, it will be
evaluated at runtime. However, if the result of the evaluation
is in fact a variable or expression, using EVAL will have it
evaluated a second time. For example, if the variable ${MYVAR}
contains "${OTHERVAR}", then the result of putting ${EVAL(${MYVAR})}
in the dialplan will be the contents of the variable, OTHERVAR.
Normally, by just putting ${MYVAR} in the dialplan, you would be
left with "${OTHERVAR}".
\end{verbatim}
\section{EXISTS}
\subsection{Syntax}
\begin{verbatim}
EXISTS(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Existence Test: Returns 1 if exists, 0 otherwise
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{FIELDQTY}
\subsection{Syntax}
\begin{verbatim}
FIELDQTY(<varname>|<delim>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Count the fields, with an arbitrary delimiter
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{FILTER}
\subsection{Syntax}
\begin{verbatim}
FILTER(<allowed-chars>|<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Filter the string to include only the allowed characters
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{GLOBAL}
\subsection{Syntax}
\begin{verbatim}
GLOBAL(<varname>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets the global variable specified
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{GROUP}
\subsection{Syntax}
\begin{verbatim}
GROUP([category])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets the channel group.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets or sets the channel group.
\end{verbatim}
\section{GROUP\_COUNT}
\subsection{Syntax}
\begin{verbatim}
GROUP_COUNT([groupname][@category])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Counts the number of channels in the specified group
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Calculates the group count for the specified group, or uses the
channel's current group if not specifed (and non-empty).
\end{verbatim}
\section{GROUP\_LIST}
\subsection{Syntax}
\begin{verbatim}
GROUP_LIST()
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets a list of the groups set on a channel.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets a list of the groups set on a channel.
\end{verbatim}
\section{GROUP\_MATCH\_COUNT}
\subsection{Syntax}
\begin{verbatim}
GROUP_MATCH_COUNT(groupmatch[@category])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Counts the number of channels in the groups matching the specified pattern
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Calculates the group count for all groups that match the specified pattern.
Uses standard regular expression matching (see regex(7)).
\end{verbatim}
\section{HASH}
\subsection{Syntax}
\begin{verbatim}
HASH(hashname[|hashkey])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Implementation of a dialplan associative array
\end{verbatim}
\subsection{Description}
\begin{verbatim}
In two argument mode, gets and sets values to corresponding keys within a named
associative array. The single-argument mode will only work when assigned to from
a function defined by func_odbc.so.
\end{verbatim}
\section{HASHKEYS}
\subsection{Syntax}
\begin{verbatim}
HASHKEYS(<hashname>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Retrieve the keys of a HASH()
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns a comma-delimited list of the current keys of an associative array
defined by the HASH() function. Note that if you iterate over the keys of
the result, adding keys during iteration will cause the result of the HASHKEYS
function to change.
\end{verbatim}
\section{IAXPEER}
\subsection{Syntax}
\begin{verbatim}
IAXPEER(<peername|CURRENTCHANNEL>[|item])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets IAX peer information
\end{verbatim}
\subsection{Description}
\begin{verbatim}
If peername specified, valid items are:
- ip (default) The IP address.
- status The peer's status (if qualify=yes)
- mailbox The configured mailbox.
- context The configured context.
- expire The epoch time of the next expire.
- dynamic Is it dynamic? (yes/no).
- callerid_name The configured Caller ID name.
- callerid_num The configured Caller ID number.
- codecs The configured codecs.
- codec[x] Preferred codec index number 'x' (beginning with zero).
If CURRENTCHANNEL specified, returns IP address of current channel
\end{verbatim}
\section{IAXVAR}
\subsection{Syntax}
\begin{verbatim}
IAXVAR(<varname>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Sets or retrieves a remote variable
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{ICONV}
\subsection{Syntax}
\begin{verbatim}
ICONV(in-charset,out-charset,string)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Converts charsets of strings.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Converts string from in-charset into out-charset. For available charsets,
use 'iconv -l' on your shell command line.
Note: due to limitations within the API, ICONV will not currently work with
charsets with embedded NULLs. If found, the string will terminate.
\end{verbatim}
\section{IF}
\subsection{Syntax}
\begin{verbatim}
IF(<expr>?[<true>][:<false>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Conditional: Returns the data following '?' if true else the data following ':'
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{IFMODULE}
\subsection{Syntax}
\begin{verbatim}
IFMODULE(<modulename.so>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Checks if an Asterisk module is loaded in memory
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Checks if a module is loaded. Use the full module name
as shown by the list in "module list".
Returns "1" if module exists in memory, otherwise "0".
\end{verbatim}
\section{IFTIME}
\subsection{Syntax}
\begin{verbatim}
IFTIME(<timespec>?[<true>][:<false>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Temporal Conditional: Returns the data following '?' if true else the data following ':'
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{ISNULL}
\subsection{Syntax}
\begin{verbatim}
ISNULL(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
NULL Test: Returns 1 if NULL or 0 otherwise
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{KEYPADHASH}
\subsection{Syntax}
\begin{verbatim}
KEYPADHASH(<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Hash the letters in the string into the equivalent keypad numbers.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Example: ${KEYPADHASH(Les)} returns "537"
\end{verbatim}
\section{LEN}
\subsection{Syntax}
\begin{verbatim}
LEN(<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Returns the length of the argument given
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{LOCAL}
\subsection{Syntax}
\begin{verbatim}
LOCAL(<varname>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Variables local to the gosub stack frame
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{MAILBOX\_EXISTS}
\subsection{Syntax}
\begin{verbatim}
MAILBOX_EXISTS(<vmbox>[@<context>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Tell if a mailbox is configured
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns a boolean of whether the corresponding mailbox exists. If context
is not specified, defaults to the "default" context.
\end{verbatim}
\section{MATH}
\subsection{Syntax}
\begin{verbatim}
MATH(<number1><op><number2>[,<type_of_result>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Performs Mathematical Functions
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Perform calculation on number1 to number2. Valid ops are:
+,-,/,*,%,<<,>>,^,AND,OR,XOR,<,>,>=,<=,==
and behave as their C equivalents.
<type_of_result> - wanted type of result:
f, float - float(default)
i, int - integer,
h, hex - hex,
c, char - char
Example: Set(i=${MATH(123%16,int)}) - sets var i=11
\end{verbatim}
\section{MD5}
\subsection{Syntax}
\begin{verbatim}
MD5(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Computes an MD5 digest
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{MINIVMACCOUNT}
\subsection{Syntax}
\begin{verbatim}
MINIVMACCOUNT(<account>:item)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets MiniVoicemail account information
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Valid items are:
- path Path to account mailbox (if account exists, otherwise temporary mailbox)
- hasaccount 1 if static Minivm account exists, 0 otherwise
- fullname Full name of account owner
- email Email address used for account
- etemplate E-mail template for account (default template if none is configured)
- ptemplate Pager template for account (default template if none is configured)
- accountcode Account code for voicemail account
- pincode Pin code for voicemail account
- timezone Time zone for voicemail account
- language Language for voicemail account
- <channel variable name> Channel variable value (set in configuration for account)
\end{verbatim}
\section{MINIVMCOUNTER}
\subsection{Syntax}
\begin{verbatim}
MINIVMCOUNTER(<account>:name[:operand])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Reads or sets counters for MiniVoicemail message
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Valid operands for changing the value of a counter when assigning a value are:
- i Increment by value
- d Decrement by value
- s Set to value
The counters never goes below zero.
- The name of the counter is a string, up to 10 characters
- If account is given and it exists, the counter is specific for the account
- If account is a domain and the domain directory exists, counters are specific for a domain
The operation is atomic and the counter is locked while changing the value
The counters are stored as text files in the minivm account directories. It might be better to use
realtime functions if you are using a database to operate your Asterisk
\end{verbatim}
\section{ODBC\_ANTIGF}
\subsection{Syntax}
\begin{verbatim}
ODBC_ANTIGF(<arg1>[...[,<argN>]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Runs the referenced query with the specified arguments
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Runs the following query, as defined in func_odbc.conf, performing
substitution of the arguments into the query as specified by ${ARG1},
${ARG2}, ... ${ARGn}. This function may only be read, not set.
SQL:
SELECT COUNT(*) FROM exgirlfriends WHERE callerid='${SQL_ESC(${ARG1})}'
\end{verbatim}
\section{ODBC\_FETCH}
\subsection{Syntax}
\begin{verbatim}
ODBC_FETCH(<result-id>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Fetch a row from a multirow query
\end{verbatim}
\subsection{Description}
\begin{verbatim}
For queries which are marked as mode=multirow, the original query returns a
result-id from which results may be fetched. This function implements the
actual fetch of the results.
\end{verbatim}
\section{ODBC\_PRESENCE}
\subsection{Syntax}
\begin{verbatim}
ODBC_PRESENCE(<arg1>[...[,<argN>]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Runs the referenced query with the specified arguments
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Runs the following query, as defined in func_odbc.conf, performing
substitution of the arguments into the query as specified by ${ARG1},
${ARG2}, ... ${ARGn}. When setting the function, the values are provided
either in whole as ${VALUE} or parsed as ${VAL1}, ${VAL2}, ... ${VALn}.
Read:
SELECT location FROM presence WHERE id='${SQL_ESC(${ARG1})}'
Write:
UPDATE presence SET location='${SQL_ESC(${VAL1})}' WHERE id='${SQL_ESC(${ARG1})}'
\end{verbatim}
\section{ODBC\_SQL}
\subsection{Syntax}
\begin{verbatim}
ODBC_SQL(<arg1>[...[,<argN>]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Runs the referenced query with the specified arguments
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Runs the following query, as defined in func_odbc.conf, performing
substitution of the arguments into the query as specified by ${ARG1},
${ARG2}, ... ${ARGn}. This function may only be read, not set.
SQL:
${ARG1}
\end{verbatim}
\section{QUEUE\_MEMBER\_COUNT}
\subsection{Syntax}
\begin{verbatim}
QUEUE_MEMBER_COUNT(<queuename>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Count number of members answering a queue
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns the number of members currently associated with the specified queue.
\end{verbatim}
\section{QUEUE\_MEMBER\_LIST}
\subsection{Syntax}
\begin{verbatim}
QUEUE_MEMBER_LIST(<queuename>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Returns a list of interfaces on a queue
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns a comma-separated list of members associated with the specified queue.
\end{verbatim}
\section{QUEUE\_VARIABLES}
\subsection{Syntax}
\begin{verbatim}
QUEUE_VARIABLES(<queuename>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Return Queue information in variables
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Makes the following queue variables available.
QUEUEMAX maxmimum number of calls allowed
QUEUESTRATEGY the strategy of the queue
QUEUECALLS number of calls currently in the queue
QUEUEHOLDTIME current average hold time
QUEUECOMPLETED number of completed calls for the queue
QUEUEABANDONED number of abandoned calls
QUEUESRVLEVEL queue service level
QUEUESRVLEVELPERF current service level performance
Returns 0 if queue is found and setqueuevar is defined, -1 otherwise
\end{verbatim}
\section{QUEUE\_WAITING\_COUNT}
\subsection{Syntax}
\begin{verbatim}
QUEUE_WAITING_COUNT(<queuename>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Count number of calls currently waiting in a queue
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns the number of callers currently waiting in the specified queue.
\end{verbatim}
\section{QUOTE}
\subsection{Syntax}
\begin{verbatim}
QUOTE(<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Quotes a given string, escaping embedded quotes as necessary
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{RAND}
\subsection{Syntax}
\begin{verbatim}
RAND([min][|max])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Choose a random number in a range
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Choose a random number between min and max. Min defaults to 0, if not
specified, while max defaults to RAND_MAX (2147483647 on many systems).
Example: Set(junky=${RAND(1|8)});
Sets junky to a random number between 1 and 8, inclusive.
\end{verbatim}
\section{REALTIME}
\subsection{Syntax}
\begin{verbatim}
REALTIME(family|fieldmatch[|value[|delim1[|delim2]]]) on read
REALTIME(family|fieldmatch|value|field) on write
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
RealTime Read/Write Functions
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function will read or write values from/to a RealTime repository.
REALTIME(....) will read names/values from the repository, and
REALTIME(....)= will write a new value/field to the repository. On a
read, this function returns a delimited text string. The name/value
pairs are delimited by delim1, and the name and value are delimited
between each other with delim2. The default for delim1 is '|' and
the default for delim2 is '='. If there is no match, NULL will be
returned by the function. On a write, this function will always
return NULL.
\end{verbatim}
\section{REGEX}
\subsection{Syntax}
\begin{verbatim}
REGEX("<regular expression>" <data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Regular Expression
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns 1 if data matches regular expression, or 0 otherwise.
Please note that the space following the double quotes separating the regex from the data
is optional and if present, is skipped. If a space is desired at the beginning of the data,
then put two spaces there; the second will not be skipped.
\end{verbatim}
\section{SET}
\subsection{Syntax}
\begin{verbatim}
SET(<varname>=[<value>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
SET assigns a value to a channel variable
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{SHA1}
\subsection{Syntax}
\begin{verbatim}
SHA1(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Computes a SHA1 digest
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Generate a SHA1 digest via the SHA1 algorythm.
Example: Set(sha1hash=${SHA1(junky)})
Sets the asterisk variable sha1hash to the string '60fa5675b9303eb62f99a9cd47f9f5837d18f9a0'
which is known as his hash
\end{verbatim}
\section{SHELL}
\subsection{Syntax}
\begin{verbatim}
SHELL(<command>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Executes a command as if you were at a shell.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Returns the value from a system command
Example: Set(foo=${SHELL(echo "bar")})
Note: When using the SHELL() dialplan function, your "SHELL" is /bin/sh,
which may differ as to the underlying shell, depending upon your production
platform. Also keep in mind that if you are using a common path, you should
be mindful of race conditions that could result from two calls running
SHELL() simultaneously.
\end{verbatim}
\section{SIP\_HEADER}
\subsection{Syntax}
\begin{verbatim}
SIP_HEADER(<name>[,<number>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets the specified SIP header
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Since there are several headers (such as Via) which can occur multiple
times, SIP_HEADER takes an optional second argument to specify which header with
that name to retrieve. Headers start at offset 1.
\end{verbatim}
\section{SIPCHANINFO}
\subsection{Syntax}
\begin{verbatim}
SIPCHANINFO(item)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets the specified SIP parameter from the current channel
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Valid items are:
- peerip The IP address of the peer.
- recvip The source IP address of the peer.
- from The URI from the From: header.
- uri The URI from the Contact: header.
- useragent The useragent.
- peername The name of the peer.
- t38passthrough 1 if T38 is offered or enabled in this channel, otherwise 0
\end{verbatim}
\section{SIPPEER}
\subsection{Syntax}
\begin{verbatim}
SIPPEER(<peername>[|item])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets SIP peer information
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Valid items are:
- ip (default) The IP address.
- port The port number
- mailbox The configured mailbox.
- context The configured context.
- expire The epoch time of the next expire.
- dynamic Is it dynamic? (yes/no).
- callerid_name The configured Caller ID name.
- callerid_num The configured Caller ID number.
- callgroup The configured Callgroup.
- pickupgroup The configured Pickupgroup.
- codecs The configured codecs.
- status Status (if qualify=yes).
- regexten Registration extension
- limit Call limit (call-limit)
- curcalls Current amount of calls
Only available if call-limit is set
- language Default language for peer
- accountcode Account code for this peer
- useragent Current user agent id for peer
- codec[x] Preferred codec index number 'x' (beginning with zero).
\end{verbatim}
\section{SORT}
\subsection{Syntax}
\begin{verbatim}
SORT(key1:val1[...][,keyN:valN])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Sorts a list of key/vals into a list of keys, based upon the vals
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Takes a comma-separated list of keys and values, each separated by a colon, and returns a
comma-separated list of the keys, sorted by their values. Values will be evaluated as
floating-point numbers.
\end{verbatim}
\section{SPEECH}
\subsection{Syntax}
\begin{verbatim}
SPEECH(argument)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets information about speech recognition results.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets information about speech recognition results.
status: Returns 1 upon speech object existing, or 0 if not
spoke: Returns 1 if spoker spoke, or 0 if not
results: Returns number of results that were recognized
\end{verbatim}
\section{SPEECH\_ENGINE}
\subsection{Syntax}
\begin{verbatim}
SPEECH_ENGINE(name)=value
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Change a speech engine specific attribute.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Changes a speech engine specific attribute.
\end{verbatim}
\section{SPEECH\_GRAMMAR}
\subsection{Syntax}
\begin{verbatim}
SPEECH_GRAMMAR([nbest number/]result number)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets the matched grammar of a result if available.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets the matched grammar of a result if available.
\end{verbatim}
\section{SPEECH\_RESULTS\_TYPE}
\subsection{Syntax}
\begin{verbatim}
SPEECH_RESULTS_TYPE()=results type
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Sets the type of results that will be returned.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Sets the type of results that will be returned. Valid options are normal or nbest.
\end{verbatim}
\section{SPEECH\_SCORE}
\subsection{Syntax}
\begin{verbatim}
SPEECH_SCORE([nbest number/]result number)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets the confidence score of a result.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets the confidence score of a result.
\end{verbatim}
\section{SPEECH\_TEXT}
\subsection{Syntax}
\begin{verbatim}
SPEECH_TEXT([nbest number/]result number)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets the recognized text of a result.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets the recognized text of a result.
\end{verbatim}
\section{SPRINTF}
\subsection{Syntax}
\begin{verbatim}
SPRINTF(<format>|<arg1>[|...<argN>])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Format a variable according to a format string
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Parses the format string specified and returns a string matching that format.
Supports most options supported by sprintf(3). Returns a shortened string if
a format specifier is not recognized.
\end{verbatim}
\section{SQL\_ESC}
\subsection{Syntax}
\begin{verbatim}
SQL_ESC(<string>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Escapes single ticks for use in SQL statements
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Used in SQL templates to escape data which may contain single ticks (') which
are otherwise used to delimit data. For example:
SELECT foo FROM bar WHERE baz='${SQL_ESC(${ARG1})}'
\end{verbatim}
\section{STAT}
\subsection{Syntax}
\begin{verbatim}
STAT(<flag>,<filename>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Does a check on the specified file
\end{verbatim}
\subsection{Description}
\begin{verbatim}
flag may be one of the following:
d - Checks if the file is a directory
e - Checks if the file exists
f - Checks if the file is a regular file
m - Returns the file mode (in octal)
s - Returns the size (in bytes) of the file
A - Returns the epoch at which the file was last accessed
C - Returns the epoch at which the inode was last changed
M - Returns the epoch at which the file was last modified
\end{verbatim}
\section{STRFTIME}
\subsection{Syntax}
\begin{verbatim}
STRFTIME([<epoch>][|[timezone][|format]])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Returns the current date/time in a specified format.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{STRPTIME}
\subsection{Syntax}
\begin{verbatim}
STRPTIME(<datetime>|<timezone>|<format>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Returns the epoch of the arbitrary date/time string structured as described in the format.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This is useful for converting a date into an EPOCH time, possibly to pass to
an application like SayUnixTime or to calculate the difference between two
date strings.
Example:
${STRPTIME(2006-03-01 07:30:35|America/Chicago|%Y-%m-%d %H:%M:%S)} returns 1141219835
\end{verbatim}
\section{TIMEOUT}
\subsection{Syntax}
\begin{verbatim}
TIMEOUT(timeouttype)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Gets or sets timeouts on the channel. Timeout values are in seconds.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
Gets or sets various channel timeouts. The timeouts that can be
manipulated are:
absolute: The absolute maximum amount of time permitted for a call. A
setting of 0 disables the timeout.
digit: The maximum amount of time permitted between digits when the
user is typing in an extension. When this timeout expires,
after the user has started to type in an extension, the
extension will be considered complete, and will be
interpreted. Note that if an extension typed in is valid,
it will not have to timeout to be tested, so typically at
the expiry of this timeout, the extension will be considered
invalid (and thus control would be passed to the 'i'
extension, or if it doesn't exist the call would be
terminated). The default timeout is 5 seconds.
response: The maximum amount of time permitted after falling through a
series of priorities for a channel in which the user may
begin typing an extension. If the user does not type an
extension in this amount of time, control will pass to the
't' extension if it exists, and if not the call would be
terminated. The default timeout is 10 seconds.
\end{verbatim}
\section{TXTCIDNAME}
\subsection{Syntax}
\begin{verbatim}
TXTCIDNAME(<number>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
TXTCIDNAME looks up a caller name via DNS
\end{verbatim}
\subsection{Description}
\begin{verbatim}
This function looks up the given phone number in DNS to retrieve
the caller id name. The result will either be blank or be the value
found in the TXT record in DNS.
\end{verbatim}
\section{URIDECODE}
\subsection{Syntax}
\begin{verbatim}
URIDECODE(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Decodes a URI-encoded string according to RFC 2396.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{URIENCODE}
\subsection{Syntax}
\begin{verbatim}
URIENCODE(<data>)
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Encodes a string to URI-safe encoding according to RFC 2396.
\end{verbatim}
\subsection{Description}
\begin{verbatim}
(null)
\end{verbatim}
\section{VERSION}
\subsection{Syntax}
\begin{verbatim}
VERSION([info])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Return the Version info for this Asterisk
\end{verbatim}
\subsection{Description}
\begin{verbatim}
If there are no arguments, return the version of Asterisk in this format: SVN-branch-1.4-r44830M
If the argument is 'ASTERISK_VERSION_NUM', a string of digits is returned (right now fixed at 999999).
If the argument is 'BUILD_USER', the string representing the user's name whose account was used to configure Asterisk, is returned.
If the argument is 'BUILD_HOSTNAME', the string representing the name of the host on which Asterisk was configured, is returned.
If the argument is 'BUILD_MACHINE', the string representing the type of machine on which Asterisk was configured, is returned.
If the argument is 'BUILD_OS', the string representing the OS of the machine on which Asterisk was configured, is returned.
If the argument is 'BUILD_DATE', the string representing the date on which Asterisk was configured, is returned.
If the argument is 'BUILD_KERNEL', the string representing the kernel version of the machine on which Asterisk was configured, is returned .
Example: Set(junky=${VERSION()};
Sets junky to the string 'SVN-branch-1.6-r74830M', or possibly, 'SVN-trunk-r45126M'.
\end{verbatim}
\section{VMCOUNT}
\subsection{Syntax}
\begin{verbatim}
VMCOUNT(vmbox[@context][|folder])
\end{verbatim}
\subsection{Synopsis}
\begin{verbatim}
Counts the voicemail in a specified mailbox
\end{verbatim}
\subsection{Description}
\begin{verbatim}
context - defaults to "default"
folder - defaults to "INBOX"
\end{verbatim}