ADSIProg([script])
script | adsi script to use. If not given uses the default script asterisk.adsi |
This application programs an ADSI Phone with the given script
AGI(command[,arg1[,arg2[,...]]])
command | (no description) |
args | (no description) |
Executes an Asterisk Gateway Interface compliant
program on a channel. AGI allows Asterisk to launch external programs written
in any language to control a telephony channel, play audio, read DTMF digits,
etc. by communicating with the AGI protocol on stdin and
stdout. As of 1.6.0
, this channel will
not stop dialplan execution on hangup inside of this application. Dialplan
execution will continue normally, even upon hangup until the AGI application
signals a desire to stop (either by exiting or, in the case of a net script, by
closing the connection). A locally executed AGI script will receive SIGHUP on
hangup from the channel except when using DeadAGI. A fast AGI server will
correspondingly receive a HANGUP in OOB data. Both of these signals may be disabled
by setting the AGISIGHUP channel variable to no
before executing the AGI application.
Use the CLI command agi show commnands
to list available agi
commands.
This application sets the following channel variable upon completion:
AGISTATUS |
The status of the attempt to the run the AGI script text string, one of: SUCCESS FAILURE NOTFOUND HANGUP |
AMD([initialSilence[,greeting[,afterGreetingSilence[,totalAnalysis Time[,miniumWordLength[,betweenWordSilence[,maximumNumberOfWords[,silenceThreshold[,maximumWordLength]]]]]]]]])
initialSilence |
Is maximum initial silence duration before greeting. If this is exceeded set as MACHINE |
greeting |
is the maximum length of a greeting. If this is exceeded set as MACHINE |
afterGreetingSilence |
Is the silence after detecting a greeting. If this is exceeded set as HUMAN |
totalAnalysis Time |
Is the maximum time allowed for the algorithm to decide HUMAN or MACHINE |
miniumWordLength | Is the minimum duration of Voice considered to be a word |
betweenWordSilence | Is the minimum duration of silence after a word to consider the audio that follows to be a new word |
maximumNumberOfWords |
Is the maximum number of words in a greeting If this is exceeded set as MACHINE |
silenceThreshold | How long do we consider silence |
maximumWordLength |
Is the maximum duration of a word to accept. If exceeded set as MACHINE |
This application attempts to detect answering machines at the beginning of outbound calls. Simply call this application after the call has been answered (outbound only, of course).
When loaded, AMD reads amd.conf and uses the parameters specified as default values. Those default values get overwritten when the calling AMD with parameters.
This application sets the following channel variables:
AMDSTATUS |
This is the status of the answering machine detection MACHINE HUMAN NOTSURE HANGUP |
AMDCAUSE |
Indicates the cause that led to the conclusion TOOLONG Total Time.INITIALSILENCE Silence Duration - Initial Silence.HUMAN Silence Duration - afterGreetingSilence.LONGGREETING Voice Duration - Greeting.MAXWORDLENGTH Word Count - maximum number of words. |
AddQueueMember(queuename[,interface[,penalty[,options[,membername[,stateinterface]]]]])
queuename | (no description) |
interface | (no description) |
penalty | (no description) |
options | (no description) |
membername | (no description) |
stateinterface | (no description) |
Dynamically adds interface to an existing queue. If the interface is already in the queue it will return an error.
This application sets the following channel variable upon completion:
AQMSTATUS |
The status of the attempt to add a queue member as a text string. ADDED MEMBERALREADY NOSUCHQUEUE |
AgentLogin([AgentNo[,options]])
AgentNo | (no description) | ||
options |
|
Asks the agent to login to the system. Always returns -1
.
While logged in, the agent can receive calls and will hear a beep
when a new call comes in. The agent can dump the call by pressing the star key.
AgentMonitorOutgoing([options])
options |
|
Tries to figure out the id of the agent who is placing outgoing call based on comparison of the callerid of the current interface and the global variable placed by the AgentCallbackLogin application. That's why it should be used only with the AgentCallbackLogin app. Uses the monitoring functions in chan_agent instead of Monitor application. That has to be configured in the agents.conf file.
Normally the app returns 0
unless the options are passed.
AlarmReceiver()
This application should be called whenever there is an alarm panel calling in to dump its events. The application will handshake with the alarm panel, and receive events, validate them, handshake them, and store them until the panel hangs up. Once the panel hangs up, the application will run the system command specified by the eventcmd setting in alarmreceiver.conf and pipe the events to the standard input of the application. The configuration file also contains settings for DTMF timing, and for the loudness of the acknowledgement tones.
Only 1 signalling format is supported at this time: Ademco Contact ID.
Answer([delay[,nocdr]])
delay | Asterisk will wait this number of milliseconds before returning to the dialplan after answering the call. |
nocdr | Asterisk will send an answer signal to the calling phone, but will not set the disposition or answer time in the CDR for this call. |
If the call has not been answered, this application will answer it. Otherwise, it has no effect on the call.
Authenticate(password[,options[,maxdigits[,prompt]]])
password | Password the user should know |
||||||||
options |
|
||||||||
maxdigits | maximum acceptable number of digits. Stops reading after
maxdigits have been entered (without requiring the user to press the |
||||||||
prompt | Override the agent-pass prompt file. |
This application asks the caller to enter a given password in order to continue dialplan execution.
If the password begins with the /
character,
it is interpreted as a file which contains a list of valid passwords, listed 1 password per line in the file.
When using a database key, the value associated with the key can be anything.
Users have three attempts to authenticate before the channel is hung up.
BackGround(filename1[&filename2[&...]][,options[,langoverride[,context]]])
filenames | (no description) | ||||||
options |
|
||||||
langoverride | Explicitly specifies which language to attempt to use for the requested sound files. |
||||||
context | This is the dialplan context that this application will use when exiting to a dialed extension. |
This application will play the given list of files (do not put extension)
while waiting for an extension to be dialed by the calling channel. To continue waiting
for digits after this application has finished playing files, the WaitExten
application should be used.
If one of the requested sound files does not exist, call processing will be terminated.
This application sets the following channel variable upon completion:
BACKGROUNDSTATUS |
The status of the background attempt as a text string. SUCCESS FAILED |
BackgroundDetect(filename[,sil[,min[,max[,analysistime]]]])
filename | (no description) |
sil | If not specified, defaults to |
min | If not specified, defaults to |
max | If not specified, defaults to |
analysistime | If not specified, defaults to |
Plays back filename
, waiting for interruption from a given digit (the digit
must start the beginning of a valid extension, or it will be ignored). During
the playback of the file, audio is monitored in the receive direction, and if
a period of non-silence which is greater than min
ms yet less than
max
ms is followed by silence for at least sil
ms,
which occurs during the first analysistime
ms, then the audio playback is
aborted and processing jumps to the talk
extension, if available.
Bridge(channel[,options])
channel | The current channel is bridged to the specified |
||
options |
|
Allows the ability to bridge two channels via the dialplan.
This application sets the following channel variable upon completion:
BRIDGERESULT |
The result of the bridge attempt as a text string. SUCCESS FAILURE LOOP NONEXISTENT INCOMPATIBLE |
Busy([timeout])
timeout | If specified, the calling channel will be hung up after the specified number of seconds. Otherwise, this application will wait until the calling channel hangs up. |
This application will indicate the busy condition to the calling channel.
ChanIsAvail([Technology2/Resource2[&...]][,options])
Technology/Resource |
Optional extra devices to check If you need more then one enter them as Technology2/Resource2&Technology3/Resourse3&..... Specification of the device(s) to check. These must be in the format of
|
||||||
options |
|
This application will check to see if any of the specified channels are available.
This application sets the following channel variables:
AVAILCHAN |
The name of the available channel, if one exists |
AVAILORIGCHAN |
The canonical channel name that was used to create the channel |
AVAILSTATUS |
The status code for the available channel |
ChanSpy([chanprefix[,options]])
chanprefix | (no description) | ||||||||||||||||||||||||||||||||||||||
options |
|
This application is used to listen to the audio from an Asterisk channel. This includes the audio
coming in and "out of the channel being spied on. If the chanprefix
parameter is specified,
only channels beginning with this string will be spied upon.
While spying, the following actions may be performed:
- Dialing #
cycles the volume level.
- Dialing *
will stop spying and look for another channel to spy on.
- Dialing a series of digits followed by #
builds a channel name to append
to 'chanprefix'. For example, executing ChanSpy(Agent) and then dialing the digits '1234#'
while spying will begin spying on the channel 'Agent/1234'. Note that this feature will be overridden if the 'd' option
is used
The X
option supersedes the three features above in that if a valid
single digit extension exists in the correct context ChanSpy will exit to it.
This also disables choosing a channel based on chanprefix
and a digit sequence.
ChangeMonitor(filename_base)
filename_base | The new filename base to use for monitoring this channel. |
Changes monitoring filename of a channel. Has no effect if the channel is not monitored.
ChannelRedirect(channel,[context,]extension,]priority)
channel | (no description) |
context | (no description) |
extension | (no description) |
priority | (no description) |
Sends the specified channel to the specified extension priority
This application sets the following channel variables upon completion
CHANNELREDIRECT_STATUS |
NOCHANNEL SUCCESS Are set to the result of the redirection |
ClearHash(hashname)
hashname | (no description) |
Clears all keys out of the specified hashname
.
ConfBridge([confno[,options]])
confno | The conference number |
||||||||||||||||||
options |
|
Enters the user into a specified conference bridge. The user can exit the conference by hangup only.
The join sound can be set using the CONFBRIDGE_JOIN_SOUND
variable and the leave sound can be set using the CONFBRIDGE_LEAVE_SOUND
variable. These can be unique to the caller.
Congestion([timeout])
timeout | If specified, the calling channel will be hung up after the specified number of seconds. Otherwise, this application will wait until the calling channel hangs up. |
This application will indicate the congestion condition to the calling channel.
ContinueWhile()
Returns to the top of the while loop and re-evaluates the conditional.
ControlPlayback(filename[,skipms[,ff[,rew[,stop[,pause[,restart[,options]]]]]]])
filename | (no description) | ||
skipms | This is number of milliseconds to skip when rewinding or fast-forwarding. |
||
ff | Fast-forward when this DTMF digit is received. (defaults to |
||
rew | Rewind when this DTMF digit is received. (defaults to |
||
stop | Stop playback when this DTMF digit is received. |
||
pause | Pause playback when this DTMF digit is received. |
||
restart | Restart playback when this DTMF digit is received. |
||
options |
|
This application will play back the given filename
.
It sets the following channel variables upon completion:
CPLAYBACKSTATUS |
Contains the status of the attempt as a text string SUCCESS USERSTOPPED ERROR |
CPLAYBACKOFFSET |
Contains the offset in ms into the file where playback
was at when it stopped. |
CPLAYBACKSTOPKEY |
If the playback is stopped by the user this variable contains the key that was pressed. |
DAHDIAcceptR2Call(charge)
charge |
Yes or No. Whether you want to accept the call with charge or without charge. |
This application will Accept the R2 call either with charge or no charge.
DAHDIBarge([channel])
channel | Channel to barge. |
Barges in on a specified DAHDI channel
or prompts
if one is not specified. Returns -1
when caller user hangs
up and is independent of the state of the channel being monitored.
DAHDIRAS(args)
args | A list of parameters to pass to the pppd daemon,
separated by |
Executes a RAS server using pppd on the given channel. The channel must be a clear channel (i.e. PRI source) and a DAHDI channel to be able to use this function (No modem emulation is included).
Your pppd must be patched to be DAHDI aware.
DAHDIScan([group])
group | Limit scanning to a channel |
Allows a call center manager to monitor DAHDI channels in a
convenient way. Use #
to select the next channel and use *
to exit.
DAHDISendCallreroutingFacility(destination[,original[,reason]])
destination | Destination number. |
original | Original called number. |
reason | Diversion reason, if not specified defaults to |
This application will send a Callrerouting Facility IE over the current channel.
DAHDISendKeypadFacility(digits)
digits | (no description) |
This application will send the given string of digits in a Keypad Facility IE over the current channel.
DBdel(family/key)
family | (no description) |
key | (no description) |
This application will delete a key
from the Asterisk
database.
This application has been DEPRECATED in favor of the DB_DELETE function.
DBdeltree(family[/keytree])
family | (no description) |
keytree | (no description) |
This application will delete a family
or keytree
from the Asterisk database.
DISA(passcode|filename[,context[,cid[,mailbox[@context][,options]]]])
passcode|filename |
If you need to present a DISA dialtone without entering a password,
simply set You may specified a |
||||
context | Specifies the dialplan context in which the user-entered extension
will be matched. If no context is specified, the DISA application defaults
to the |
||||
cid | Specifies a new (different) callerid to be used for this call. |
||||
mailbox | Will cause a stutter-dialtone (indication dialrecall) to be used, if the specified mailbox contains any new messages. |
||||
options |
|
The DISA, Direct Inward System Access, application allows someone from
outside the telephone switch (PBX) to obtain an internal system
dialtone and to place calls from it as if they were placing a call from
within the switch.
DISA plays a dialtone. The user enters their numeric passcode, followed by
the pound sign #
. If the passcode is correct, the user is then given
system dialtone within context
on which a call may be placed.
If the user enters an invalid extension and extension i
exists in the specified
context
, it will be used.
Be aware that using this may compromise the security of your PBX.
The arguments to this application (in extensions.conf) allow either
specification of a single global passcode
(that everyone uses), or
individual passcodes contained in a file (filename
).
The file that contains the passcodes (if used) allows a complete
specification of all of the same arguments available on the command
line, with the sole exception of the options. The file may contain blank
lines, or comments starting with #
or ;
.
DateTime([unixtime[,timezone[,format]]])
unixtime | time, in seconds since Jan 1, 1970. May be negative. Defaults to now. |
timezone | timezone, see /usr/share/zoneinfo for a list. Defaults to machine default. |
format | a format the time is to be said in. See voicemail.conf.
Defaults to |
Say the date and time in a specified format.
DeadAGI(command[,arg1[,arg2[,...]]])
command | (no description) |
args | (no description) |
Executes an Asterisk Gateway Interface compliant
program on a channel. AGI allows Asterisk to launch external programs written
in any language to control a telephony channel, play audio, read DTMF digits,
etc. by communicating with the AGI protocol on stdin and
stdout. As of 1.6.0
, this channel will
not stop dialplan execution on hangup inside of this application. Dialplan
execution will continue normally, even upon hangup until the AGI application
signals a desire to stop (either by exiting or, in the case of a net script, by
closing the connection). A locally executed AGI script will receive SIGHUP on
hangup from the channel except when using DeadAGI. A fast AGI server will
correspondingly receive a HANGUP in OOB data. Both of these signals may be disabled
by setting the AGISIGHUP channel variable to no
before executing the AGI application.
Use the CLI command agi show commnands
to list available agi
commands.
This application sets the following channel variable upon completion:
AGISTATUS |
The status of the attempt to the run the AGI script text string, one of: SUCCESS FAILURE NOTFOUND HANGUP |
Dial(Technology/Resource[&Technology2/Resource2[&...]][,timeout[,options[,URL]]])
Technology/Resource |
Specification of the device(s) to dial. These must be in the format of
Optional extra devices to dial in parallel If you need more then one enter them as Technology2/Resource2&Technology3/Resourse3&..... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
timeout |
Specifies the number of seconds we attempt to dial the specified devices If not specified, this defaults to 136 years. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
URL | The optional URL will be sent to the called party if the channel driver supports it. |
This application will place calls to one or more specified channels. As soon as one of the requested channels answers, the originating channel will be answered, if it has not already been answered. These two channels will then be active in a bridged call. All other channels that were requested will then be hung up.
Unless there is a timeout specified, the Dial application will wait indefinitely until one of the called channels answers, the user hangs up, or if all of the called channels are busy or unavailable. Dialplan executing will continue if no requested channels can be called, or if the timeout expires. This application will report normal termination if the originating channel hangs up, or if the call is bridged and either of the parties in the bridge ends the call.
If the OUTBOUND_GROUP variable is set, all peer channels created by this application will be put into that group (as in Set(GROUP()=...). If the OUTBOUND_GROUP_ONCE variable is set, all peer channels created by this application will be put into that group (as in Set(GROUP()=...). Unlike OUTBOUND_GROUP, however, the variable will be unset after use.
This application sets the following channel variables:
DIALEDTIME |
This is the time from dialing a channel until when it is disconnected. |
ANSWEREDTIME |
This is the amount of time for actual call. |
DIALSTATUS |
This is the status of the call CHANUNAVAIL CONGESTION NOANSWER BUSY ANSWER CANCEL DONTCALL For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'Go Away' script.TORTURE For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'torture' script.INVALIDARGS |
Dictate([base_dir[,filename]])
base_dir | (no description) |
filename | (no description) |
Start dictation machine using optional base_dir
for files.
Directory([vm-context[,dial-context[,options]]])
vm-context | This is the context within voicemail.conf to use for the Directory. If not specified and
|
||||||||||||
dial-context | This is the dialplan context to use when looking for an
extension that the user has selected, or when jumping to the
|
||||||||||||
options |
Only one of the |
This application will present the calling channel with a directory of extensions from which they can search by name. The list of names and corresponding extensions is retrieved from the voicemail configuration file, voicemail.conf.
This application will immediately exit if one of the following DTMF digits are received and the extension to jump to exists:
0
- Jump to the 'o' extension, if it exists.
*
- Jump to the 'a' extension, if it exists.
DumpChan([level])
level | Minimun verbose level |
Displays information on channel and listing of all channel
variables. If level
is specified, output is only
displayed when the verbose level is currently set to that number
or greater.
EAGI(command[,arg1[,arg2[,...]]])
command | (no description) |
args | (no description) |
Using 'EAGI' provides enhanced AGI, with incoming audio available out of band on file descriptor 3.
Executes an Asterisk Gateway Interface compliant
program on a channel. AGI allows Asterisk to launch external programs written
in any language to control a telephony channel, play audio, read DTMF digits,
etc. by communicating with the AGI protocol on stdin and
stdout. As of 1.6.0
, this channel will
not stop dialplan execution on hangup inside of this application. Dialplan
execution will continue normally, even upon hangup until the AGI application
signals a desire to stop (either by exiting or, in the case of a net script, by
closing the connection). A locally executed AGI script will receive SIGHUP on
hangup from the channel except when using DeadAGI. A fast AGI server will
correspondingly receive a HANGUP in OOB data. Both of these signals may be disabled
by setting the AGISIGHUP channel variable to no
before executing the AGI application.
Use the CLI command agi show commnands
to list available agi
commands.
This application sets the following channel variable upon completion:
AGISTATUS |
The status of the attempt to the run the AGI script text string, one of: SUCCESS FAILURE NOTFOUND HANGUP |
Echo()
Echos back any audio, video or DTMF frames read from the calling channel back to itself. Note: If '#' detected application exits
EndWhile()
Return to the previous called While()
.
Exec(appname(arguments))
appname | Application name and arguments of the dialplan application to execute. |
Allows an arbitrary application to be invoked even when not hard coded into the dialplan. If the underlying application terminates the dialplan, or if the application cannot be found, Exec will terminate the dialplan.
To invoke external applications, see the application System. If you would like to catch any error instead, see TryExec.
ExecIf(expression?appiftrue(args)[:appiffalse(args)])
expression | (no description) |
execapp | (no description) |
If expr
is true, execute and return the
result of appiftrue(args)
.
If expr
is true, but appiftrue
is not found,
then the application will return a non-zero value.
ExecIfTime(times,weekdays,mdays,months[,timezone]?appname[(appargs)])
day_condition | (no description) |
appname | (no description) |
This application will execute the specified dialplan application, with optional arguments, if the current time matches the given time specification.
ExitWhile()
Exits a While()
loop, whether or not the conditional has been satisfied.
ExtenSpy(exten[@context][,options])
exten |
Specify extension. Optionally specify a context, defaults to |
||||||||||||||||||||||||||||||||||||||
options |
|
This application is used to listen to the audio from an Asterisk channel. This includes the audio coming in and out of the channel being spied on. Only channels created by outgoing calls for the specified extension will be selected for spying. If the optional context is not supplied, the current channel's context will be used.
While spying, the following actions may be performed:
- Dialing #
cycles the volume level.
- Dialing *
will stop spying and look for another channel to spy on.
The X
option supersedes the three features above in that if a valid
single digit extension exists in the correct context ChanSpy will exit to it.
This also disables choosing a channel based on chanprefix
and a digit sequence.
Festival(text[,intkeys])
text | (no description) |
intkeys | (no description) |
Connect to Festival, send the argument, get back the waveform, play it to the user,
allowing any given interrupt keys to immediately terminate and return the value, or
any
to allow any number back (useful in dialplan).
Flash()
Performs a flash on a DAHDI trunk. This can be used to access features provided on an incoming analogue circuit such as conference and call waiting. Use with SendDTMF() to perform external transfers.
FollowMe(followmeid[,options])
followmeid | (no description) | ||||||
options |
|
This application performs Find-Me/Follow-Me functionality for the caller
as defined in the profile matching the followmeid
parameter in
followme.conf. If the specified followmeid
profile doesn't exist in followme.conf, execution will be returned
to the dialplan and call execution will continue at the next priority.
Returns -1 on hangup.
ForkCDR([options])
options |
|
Causes the Call Data Record to fork an additional cdr record starting from the time of the fork call. This new cdr record will be linked to end of the list of cdr records attached to the channel. The original CDR has a LOCKED flag set, which forces most cdr operations to skip it, except for the functions that set the answer and end times, which ignore the LOCKED flag. This allows all the cdr records in the channel to be 'ended' together when the channel is closed.
The CDR() func (when setting CDR values) normally ignores the LOCKED flag also, but has options to vary its behavior. The 'T' option (described below), can override this behavior, but beware the risks.
First, this app finds the last cdr record in the list, and makes a copy of it. This new copy will be the newly forked cdr record. Next, this new record is linked to the end of the cdr record list. Next, The new cdr record is RESET (unless you use an option to prevent this)
This means that:
1. All flags are unset on the cdr record
2. the start, end, and answer times are all set to zero.
3. the billsec and duration fields are set to zero.
4. the start time is set to the current time.
5. the disposition is set to NULL.
Next, unless you specified the v
option, all variables will be removed from
the original cdr record. Thus, the v
option allows any CDR variables to be replicated
to all new forked cdr records. Without the v
option, the variables on the original
are effectively moved to the new forked cdr record.
Next, if the s
option is set, the provided variable and value are set on the
original cdr record.
Next, if the a
option is given, and the original cdr record has an answer time
set, then the new forked cdr record will have its answer time set to its start time. If the old answer
time were carried forward, the answer time would be earlier than the start time, giving strange
duration and billsec times.
If the d
option was specified, the disposition is copied from
the original cdr record to the new forked cdr. If the D
option was specified,
the destination channel field in the new forked CDR is erased. If the e
option
was specified, the 'end' time for the original cdr record is set to the current time. Future hang-up or
ending events will not override this time stamp. If the A
option is specified,
the original cdr record will have it ANS_LOCKED flag set, which prevent future answer events from updating
the original cdr record's disposition. Normally, an ANSWERED
event would mark all cdr
records in the chain as ANSWERED
. If the T
option is specified,
the original cdr record will have its DONT_TOUCH
flag set, which will force the
cdr_answer, cdr_end, and cdr_setvar functions to leave that cdr record alone.
And, last but not least, the original cdr record has its LOCKED flag set. Almost all internal CDR functions (except for the funcs that set the end, and answer times, and set a variable) will honor this flag and leave a LOCKED cdr record alone. This means that the newly created forked cdr record will be affected by events transpiring within Asterisk, with the previously noted exceptions.
GetCPEID()
Obtains and displays ADSI CPE ID and other information in order to properly setup dahdi.conf for on-hook operations.
Gosub([context,]exten,]priority[(arg1[,...][,argN])])
context | (no description) |
exten | (no description) |
priority | (no description) |
Jumps to the label specified, saving the return address.
GosubIf(condition?[labeliftrue[(arg1[,...][,argN])][:labeliffalse[(arg1[,...][,argN])]]])
condition | (no description) |
destination | (no description) |
If the condition is true, then jump to labeliftrue. If false, jumps to labeliffalse, if specified. In either case, a jump saves the return point in the dialplan, to be returned to with a Return.
Goto([context,]extensions,]priority)
context | (no description) |
extensions | (no description) |
priority | (no description) |
This application will set the current context, extension, and priority in the channel structure.
After it completes, the pbx engine will continue dialplan execution at the specified location.
If no specific extension
, or extension
and
context
, are specified, then this application will
just set the specified priority
of the current extension.
At least a priority
is required as an argument, or the goto will
return a -1
, and the channel and call will be terminated.
If the location that is put into the channel information is bogus, and asterisk cannot
find that location in the dialplan, then the execution engine will try to find and execute the code in
the i
(invalid) extension in the current context. If that does not exist, it will try to execute the
h
extension. If either or neither the h
or i
extensions
have been defined, the channel is hung up, and the execution of instructions on the channel is terminated.
What this means is that, for example, you specify a context that does not exist, then
it will not be possible to find the h
or i
extensions,
and the call will terminate!
GotoIf(condition?[labeliftrue[:labeliffalse]])
condition | (no description) |
destination |
Continue at Continue at |
This application will set the current context, extension, and priority in the channel structure
based on the evaluation of the given condition. After this application completes, the
pbx engine will continue dialplan execution at the specified location in the dialplan.
The labels are specified with the same syntax as used within the Goto application.
If the label chosen by the condition is omitted, no jump is performed, and the execution passes to the
next instruction. If the target location is bogus, and does not exist, the execution engine will try
to find and execute the code in the i
(invalid) extension in the current context.
If that does not exist, it will try to execute the h
extension.
If either or neither the h
or i
extensions have been defined,
the channel is hung up, and the execution of instructions on the channel is terminated.
Remember that this command can set the current context, and if the context specified
does not exist, then it will not be able to find any 'h' or 'i' extensions there, and
the channel and call will both be terminated!.
GotoIfTime(times,weekdays,mdays,months[,timezone]?[labeliftrue[:labeliffalse]])
condition | (no description) |
destination | (no description) |
This application will set the context, extension, and priority in the channel structure
based on the evaluation of the given time specification. After this application completes,
the pbx engine will continue dialplan execution at the specified location in the dialplan.
If the current time is within the given time specification, the channel will continue at
labeliftrue
. Otherwise the channel will continue at labeliffalse
.
If the label chosen by the condition is omitted, no jump is performed, and execution passes to the next
instruction. If the target jump location is bogus, the same actions would be taken as for Goto
.
Further information on the time specification can be found in examples
illustrating how to do time-based context includes in the dialplan.
Hangup([causecode])
causecode | If a |
This application will hang up the calling channel.
IAX2Provision([template])
template | If not specified, defaults to |
Provisions the calling IAXy (assuming the calling entity is in fact an IAXy) with the
given template
. Returns -1
on error
or 0
on success.
ICES(config)
config | ICES configuration file. |
Streams to an icecast server using ices (available separately). A configuration file must be supplied for ices (see contrib/asterisk-ices.xml).
ICES version 2 client and server required.
IVRDemo(filename)
filename | (no description) |
This is a skeleton application that shows you the basic structure to create your own asterisk applications and demonstrates the IVR demo.
ImportVar(newvar=channelname,variable)
newvar | (no description) |
vardata | (no description) |
This application imports a variable
from the specified
channel
(as opposed to the current one) and stores it as a variable
(newvar
) in the current channel (the channel that is calling this
application). Variables created by this application have the same inheritance properties as those
created with the Set
application.
Incomplete([n])
n |
If specified, then Incomplete will not attempt to answer the channel first. Most channel types need to be in Answer state in order to receive DTMF. |
Signals the PBX routines that the previous matched extension is incomplete and that further input should be allowed before matching can be considered to be complete. Can be used within a pattern match when certain criteria warrants a longer match.
JACK([options])
options |
|
When executing this application, two jack ports will be created; one input and one output. Other applications can be hooked up to these ports to access audio coming from, or being send to the channel.
JabberSend(Jabber,JID,Message)
Jabber | Client or transport Asterisk uses to connect to Jabber. |
JID | XMPP/Jabber JID (Name) of recipient. |
Message | Message to be sent to the buddy. |
Allows user to send a message to a receipent via XMPP.
JabberStatus(Jabber,JID,Variable)
Jabber | Client or transport Asterisk users to connect to Jabber. |
JID | XMPP/Jabber JID (Name) of recipient. |
Variable | Variable to store the status of requested user. |
This application is deprecated. Please use the JABBER_STATUS() function instead.
Retrieves the numeric status associated with the specified buddy JID
.
The return value in the Variable
will be one of the following.
1 |
Online. |
2 |
Chatty. |
3 |
Away. |
4 |
Extended Away. |
5 |
Do Not Disturb. |
6 |
Offline. |
7 |
Not In Roster. |
Log([level,]message)
level | Level must be one of |
message | Output text message. |
Sends an arbitrary text message to a selected log level.
MP3Player(Location)
Location | Location of the file to be played. (argument passed to mpg123) |
Executes mpg123 to play the given location, which typically would be a filename or a URL. User can exit by pressing any key on the dialpad, or by hanging up.
MSet(name1=value1[,name2=value2[,...]])
set1 | (no description) |
set2 | (no description) |
This function can be used to set the value of channel variables or dialplan functions.
When setting variables, if the variable name is prefixed with _
,
the variable will be inherited into channels created from the current channel
If the variable name is prefixed with __
, the variable will be
inherited into channels created from the current channel and all children channels.
MSet behaves in a similar fashion to the way Set worked in 1.2/1.4 and is thus
prone to doing things that you may not expect. For example, it strips surrounding
double-quotes from the right-hand side (value). If you need to put a separator
character (comma or vert-bar), you will need to escape them by inserting a backslash
before them. Avoid its use if possible.
Macro(name[,arg1[,arg2[,...]]])
name | The name of the macro |
args | (no description) |
Executes a macro using the context macro-name
,
jumping to the s
extension of that context and executing each step,
then returning when the steps end.
The calling extension, context, and priority are stored in MACRO_EXTEN, MACRO_CONTEXT and MACRO_PRIORITY respectively. Arguments become ARG1, ARG2, etc in the macro context.
If you Goto out of the Macro context, the Macro will terminate and control will be returned at the location of the Goto.
If MACRO_OFFSET is set at termination, Macro will attempt to continue at priority MACRO_OFFSET + N + 1 if such a step exists, and N + 1 otherwise.
Because of the way Macro is implemented (it executes the priorities contained within it via sub-engine), and a fixed per-thread memory stack allowance, macros are limited to 7 levels of nesting (macro calling macro calling macro, etc.); It may be possible that stack-intensive applications in deeply nested macros could cause asterisk to crash earlier than this limit. It is advised that if you need to deeply nest macro calls, that you use the Gosub application (now allows arguments like a Macro) with explict Return() calls instead.
Use of the application WaitExten
within a macro will not function
as expected. Please use the Read
application in order to read DTMF from a channel
currently executing a macro.
MacroExclusive(name[,arg1[,arg2[,...]]])
name | The name of the macro |
arg1 | (no description) |
arg2 | (no description) |
Executes macro defined in the context macro-name
.
Only one call at a time may run the macro. (we'll wait if another call is busy
executing in the Macro)
Arguments and return values as in application Macro()
Use of the application WaitExten
within a macro will not function
as expected. Please use the Read
application in order to read DTMF from a channel
currently executing a macro.
MacroExit()
Causes the currently running macro to exit as if it had ended normally by running out of priorities to execute. If used outside a macro, will likely cause unexpected behavior.
MacroIf(expr?macroiftrue[,arg1[,...]][:macroiffalse[,arg1[,...]]])
expr | (no description) |
destination | (no description) |
Executes macro defined in macroiftrue
if
expr
is true (otherwise macroiffalse
if provided)
Arguments and return values as in application Macro()
Use of the application WaitExten
within a macro will not function
as expected. Please use the Read
application in order to read DTMF from a channel
currently executing a macro.
MailboxExists(mailbox[@context][,options])
mailbox | (no description) |
options | None options. |
Check to see if the specified mailbox
exists. If no voicemail
context
is specified, the default
context
will be used.
This application will set the following channel variable upon completion:
VMBOXEXISTSSTATUS |
This will contain the status of the execution of the MailboxExists application. Possible values include: SUCCESS FAILED |
MeetMe([confno[,options[,pin]]])
confno | The conference number |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pin | (no description) |
Enters the user into a specified MeetMe conference. If the confno
is omitted, the user will be prompted to enter one. User can exit the conference by hangup, or
if the p
option is specified, by pressing #
.
The DAHDI kernel modules and at least one hardware driver (or dahdi_dummy)
must be present for conferencing to operate properly. In addition, the chan_dahdi channel driver
must be loaded for the i
and r
options to operate at
all.
MeetMeAdmin(confno,command[,user])
confno | (no description) | ||||||||||||||||||||||||||||||||||||||||
command |
|
||||||||||||||||||||||||||||||||||||||||
user | (no description) |
Run admin command
for conference confno
.
Will additionally set the variable MEETMEADMINSTATUS with one of the following values:
MEETMEADMINSTATUS |
NOPARSE Invalid arguments.NOTFOUND User specified was not found.FAILED Another failure occurred.OK The operation was completed successfully. |
MeetMeChannelAdmin(channel,command)
channel | (no description) | ||||||
command |
|
Run admin command
for a specific
channel
in any coference.
MeetMeCount(confno[,var])
confno | Conference number. |
var | (no description) |
Plays back the number of users in the specified MeetMe conference.
If var
is specified, playback will be skipped and the value
will be returned in the variable. Upon application completion, MeetMeCount will hangup
the channel, unless priority n+1
exists, in which case priority progress will
continue.
Milliwatt([options])
options |
|
Previous versions of this application generated the tone at 1000Hz. If for
some reason you would prefer that behavior, supply the o
option to get the
old behavior.
MinivmAccMess(username@domain[,options])
mailbox |
Voicemail username Voicemail domain |
||||||||
options |
|
This application is part of the Mini-Voicemail system, configured in minivm.conf.
Use this application to record account specific audio/video messages for busy, unavailable and temporary messages.
Account specific directories will be created if they do not exist.
MVM_ACCMESS_STATUS |
This is the result of the attempt to record the specified greeting.
SUCCESS FAILED |
MinivmDelete(filename)
filename | File to delete |
This application is part of the Mini-Voicemail system, configured in minivm.conf.
It deletes voicemail file set in MVM_FILENAME or given filename.
MVM_DELETE_STATUS |
This is the status of the delete operation. SUCCESS FAILED |
MinivmGreet(username@domain[,options])
mailbox |
Voicemail username Voicemail domain |
||||||
options |
|
This application is part of the Mini-Voicemail system, configured in minivm.conf.
MinivmGreet() plays default prompts or user specific prompts for an account.
Busy and unavailable messages can be choosen, but will be overridden if a temporary message exists for the account.
MVM_GREET_STATUS |
This is the status of the greeting playback. SUCCESS USEREXIT FAILED |
MinivmMWI(username@domain,urgent,new,old)
mailbox |
Voicemail username Voicemail domain |
urgent | Number of urgent messages in mailbox. |
new | Number of new messages in mailbox. |
old | Number of old messages in mailbox. |
This application is part of the Mini-Voicemail system, configured in minivm.conf.
MinivmMWI is used to send message waiting indication to any devices whose channels have subscribed to the mailbox passed in the first parameter.
MinivmNotify(username@domain[,options])
mailbox |
Voicemail username Voicemail domain |
||
options |
|
This application is part of the Mini-Voicemail system, configured in minivm.conf.
MiniVMnotify forwards messages about new voicemail to e-mail and pager. If there's no user account for that address, a temporary account will be used with default options (set in minivm.conf).
If the channel variable MVM_COUNTER is set, this will be used in the message file name and available in the template for the message.
If no template is given, the default email template will be used to send email and default pager template to send paging message (if the user account is configured with a paging address.
MVM_NOTIFY_STATUS |
This is the status of the notification attempt SUCCESS FAILED |
MinivmRecord(username@domain[,options])
mailbox |
Voicemail username Voicemail domain |
||||||
options |
|
This application is part of the Mini-Voicemail system, configured in minivm.conf
MiniVM records audio file in configured format and forwards message to e-mail and pager.
If there's no user account for that address, a temporary account will be used with default options.
The recorded file name and path will be stored in MVM_FILENAME and the duration of the message will be stored in MVM_DURATION
If the caller hangs up after the recording, the only way to send the message and clean up is to
execute in the h
extension. The application will exit if any of the following DTMF digits
are received and the requested extension exist in the current context.
MVM_RECORD_STATUS |
This is the status of the record operation SUCCESS USEREXIT FAILED |
MixMonitor(filename.extension[,options[,command]])
file | If |
||||||||||
options |
|
||||||||||
command |
Will be executed when the recording is over. Any strings matching All variables will be evaluated at the time MixMonitor is called. |
Records the audio on the current channel to the specified file.
MIXMONITOR_FILENAME |
Will contain the filename used to record. |
Monitor([file_format[:urlbase][,fname_base[,options]]])
file_format | optional, if not set, defaults to |
||||||||
fname_base | if set, changes the filename used to the one specified. |
||||||||
options |
|
Used to start monitoring a channel. The channel's input and output voice packets are logged to files until the channel hangs up or monitoring is stopped by the StopMonitor application.
By default, files are stored to /var/spool/asterisk/monitor/.
Returns -1
if monitor files can't be opened or if the channel is
already monitored, otherwise 0
.
Morsecode(string)
string | String to playback as morse code to channel |
Plays the Morse code equivalent of the passed string.
This application uses the following variables:
MORSEDITLEN |
Use this value in (ms) for length of dit |
MORSETONE |
The pitch of the tone in (Hz), default is 800 |
NBScat()
Executes nbscat to listen to the local NBS stream. User can exit by pressing any key.
NoCDR()
This application will tell Asterisk not to maintain a CDR for the current call.
NoOp([text])
text | Any text provided can be viewed at the Asterisk CLI. |
This application does nothing. However, it is useful for debugging purposes.
This method can be used to see the evaluations of variables or functions without having any effect.
ODBCFinish(result-id)
result-id | (no description) |
For queries which are marked as mode=multirow, this will clear any remaining rows of the specified resultset.
ODBC_Commit([transaction ID])
transaction ID | (no description) |
Commits the database transaction specified by transaction ID
or the current active transaction, if not specified.
ODBC_Rollback([transaction ID])
transaction ID | (no description) |
Rolls back the database transaction specified by transaction ID
or the current active transaction, if not specified.
Originate(tech_data,type,arg1[,arg2[,arg3]])
tech_data | Channel technology and data for creating the outbound channel. For example, SIP/1234. |
type | This should be |
arg1 | If the type is |
arg2 | If the type is |
arg3 | If the type is |
This application originates an outbound call and connects it to a specified extension or application. This application will block until the outgoing call fails or gets answered. At that point, this application will exit with the status variable set and dialplan processing will continue.
This application sets the following channel variable before exiting:
ORIGINATE_STATUS |
This indicates the result of the call origination. FAILED SUCCESS BUSY CONGESTION HANGUP RINGING UNKNOWN In practice, you should never see this value. Please report it to the issue tracker if you ever see it. |
Page(Technology/Resource[&Technology2/Resource2[&...]][,options[,timeout]])
Technology/Resource |
Specification of the device(s) to dial. These must be in the format of
Optional extra devices to dial inparallel If you need more then one enter them as Technology2/Resource2& Technology3/Resourse3&..... |
||||||||||
options |
|
||||||||||
timeout | Specify the length of time that the system will attempt to connect a call. After this duration, any intercom calls that have not been answered will be hung up by the system. |
Places outbound calls to the given technology
/resource
and dumps them into a conference bridge as muted participants. The original
caller is dumped into the conference as a speaker and the room is
destroyed when the original callers leaves.
Park([timeout[,return_context[,return_exten[,return_priority[,options]]]]])
timeout | A custom parking timeout for this parked call. |
||||||
return_context | The context to return the call to after it times out. |
||||||
return_exten | The extension to return the call to after it times out. |
||||||
return_priority | The priority to return the call to after it times out. |
||||||
options |
A list of options for this parked call.
|
Used to park yourself (typically in combination with a supervised
transfer to know the parking space). This application is always
registered internally and does not need to be explicitly added
into the dialplan, although you should include the parkedcalls
context (or the context specified in features.conf).
If you set the PARKINGEXTEN variable to an extension in your parking context, Park() will park the call on that extension, unless it already exists. In that case, execution will continue at next priority.
ParkAndAnnounce(announce[:announce1[:...]],timeout,dial[,return_context])
announce_template | Colon-separated list of files to announce. The word
|
timeout | Time in seconds before the call returns into the return context. |
dial | The app_dial style resource to call to make the announcement. Console/dsp calls the console. |
return_context | The goto-style label to jump the call back into after
timeout. Default |
Park a call into the parkinglot and announce the call to another channel.
The variable PARKEDAT will contain the parking extension into which the call was placed. Use with the Local channel to allow the dialplan to make use of this information.
ParkedCall(exten)
exten | (no description) |
Used to connect to a parked call. This application is always
registered internally and does not need to be explicitly added
into the dialplan, although you should include the parkedcalls
context. If no extension is provided, then the first available
parked call will be acquired.
PauseMonitor()
Pauses monitoring of a channel until it is re-enabled by a call to UnpauseMonitor.
PauseQueueMember([queuename,interface[,options[,reason]]])
queuename | (no description) |
interface | (no description) |
options | (no description) |
reason | Is used to add extra information to the appropriate queue_log entries and manager events. |
Pauses (blocks calls for) a queue member. The given interface will be paused in the given queue. This prevents any calls from being sent from the queue to the interface until it is unpaused with UnpauseQueueMember or the manager interface. If no queuename is given, the interface is paused in every queue it is a member of. The application will fail if the interface is not found.
This application sets the following channel variable upon completion:
PQMSTATUS |
The status of the attempt to pause a queue member as a text string. PAUSED NOTFOUND |
Example: PauseQueueMember(,SIP/3000)
Pickup(extension[@context][&extension2[@context2][&...]])
ext | (no description) |
ext2 | (no description) |
This application can pickup any ringing channel that is calling
the specified extension
. If no context
is specified, the current context will be used. If you use the special string PICKUPMARK
for the context parameter, for example 10@PICKUPMARK, this application
tries to find a channel which has defined a PICKUPMARK
channel variable with the same value as extension
(in this example, 10
). When no parameter is specified, the application
will pickup a channel matching the pickup group of the active channel.
PickupChan(channel[,channel2[,...]])
channel | (no description) |
channel2 | (no description) |
This will pickup a specified channel
if ringing.
PlayTones(arg)
arg | Arg is either the tone name defined in the indications.conf configuration file, or a directly specified list of frequencies and durations. |
Plays a tone list. Execution will continue with the next step in the dialplan immediately while the tones continue to play.
See the sample indications.conf for a description of the specification of a tonelist.
Playback(filename[&filename2[&...]][,options])
filenames | (no description) | ||||
options |
Comma separated list of options
|
Plays back given filenames (do not put extension of wav/alaw etc). The playback command answer the channel if no options are specified. If the file is non-existant it will fail
This application sets the following channel variable upon completion:
PLAYBACKSTATUS |
The status of the playback attempt as a text string. SUCCESS FAILED |
See Also: Background (application) -- for playing sound files that are interruptible
WaitExten (application) -- wait for digits from caller, optionally play music on hold
PrivacyManager([maxretries[,minlength[,context]]])
maxretries | Total tries caller is allowed to input a callerid. Defaults to |
minlength | Minimum allowable digits in the input callerid number. Defaults to |
context | Context to check the given callerid against patterns. |
If no Caller*ID is sent, PrivacyManager answers the channel and asks
the caller to enter their phone number. The caller is given
maxretries
attempts to do so. The application does
nothing if Caller*ID was received on the channel.
The application sets the following channel variable upon completion:
PRIVACYMGRSTATUS |
The status of the privacy manager's attempt to collect a phone number from the user. SUCCESS FAILED |
Proceeding()
This application will request that a proceeding message be provided to the calling channel.
Progress()
This application will request that in-band progress information be provided to the calling channel.
Queue(queuename[,options[,URL[,announceoverride[,timeout[,AGI[,macro[,gosub[,rule[,position]]]]]]]]])
queuename | (no description) | ||||||||||||||||||||||||||||||||||
options |
|
||||||||||||||||||||||||||||||||||
URL |
|
||||||||||||||||||||||||||||||||||
announceoverride | (no description) | ||||||||||||||||||||||||||||||||||
timeout | Will cause the queue to fail out after a specified number of
seconds, checked between each queues.conf |
||||||||||||||||||||||||||||||||||
AGI | Will setup an AGI script to be executed on the calling party's channel once they are connected to a queue member. |
||||||||||||||||||||||||||||||||||
macro | Will run a macro on the calling party's channel once they are connected to a queue member. |
||||||||||||||||||||||||||||||||||
gosub | Will run a gosub on the calling party's channel once they are connected to a queue member. |
||||||||||||||||||||||||||||||||||
rule | Will cause the queue's defaultrule to be overridden by the rule specified. |
||||||||||||||||||||||||||||||||||
position | Attempt to enter the caller into the queue at the numerical position specified. |
In addition to transferring the call, a call may be parked and then picked up by another user.
This application will return to the dialplan if the queue does not exist, or any of the join options cause the caller to not enter the queue.
This application sets the following channel variable upon completion:
QUEUESTATUS |
The status of the call as a text string. TIMEOUT FULL JOINEMPTY LEAVEEMPTY JOINUNAVAIL LEAVEUNAVAIL CONTINUE |
QueueLog(queuename,uniqueid,agent,event[,additionalinfo])
queuename | (no description) |
uniqueid | (no description) |
agent | (no description) |
event | (no description) |
additionalinfo | (no description) |
Allows you to write your own events into the queue log.
Example: QueueLog(101,${UNIQUEID},${AGENT},WENTONBREAK,600)
RaiseException(reason)
reason | (no description) |
This application will jump to the e
extension in the current context, setting the
dialplan function EXCEPTION(). If the e
extension does not exist, the call will hangup.
Read(variable[,filename[&filename2[&...]][,maxdigits[,options[,attempts[,timeout]]]]])
variable | The input digits will be stored in the given |
||||||
filenames | file(s) to play before reading digits or tone with option i |
||||||
maxdigits |
Maximum acceptable number of digits. Stops reading after
Defaults to |
||||||
options |
|
||||||
attempts | If greater than |
||||||
timeout | The number of seconds to wait for a digit response. If greater
than |
Reads a #-terminated string of digits a certain number of times from the
user in to the given variable
.
This application sets the following channel variable upon completion:
READSTATUS |
This is the status of the read operation. OK ERROR HANGUP INTERRUPTED SKIPPED TIMEOUT |
ReadExten(variable[,filename[,context[,option[,timeout]]]])
variable | (no description) | ||||||
filename | File to play before reading digits or tone with option |
||||||
context | Context in which to match extensions. |
||||||
option |
|
||||||
timeout | An integer number of seconds to wait for a digit response. If
greater than |
Reads a #
terminated string of digits from the user into the given variable.
Will set READEXTENSTATUS on exit with one of the following statuses:
READEXTENSTATUS |
OK A valid extension exists in ${variable}.TIMEOUT No extension was entered in the specified time. Also sets ${variable} to "t".INVALID An invalid extension, ${INVALID_EXTEN}, was entered. Also sets ${variable} to "i".SKIP Line was not up and the option 's' was specified.ERROR Invalid arguments were passed. |
ReadFile(varname=file[,length])
varname | Result stored here. |
fileparams |
The name of the file to read. Maximum number of characters to capture. If not specified defaults to max. |
Read the contents of a text file into channel variable varname
ReadFile has been deprecated in favor of Set(varname=${FILE(file,0,length)})
ReceiveFAX(filename[,c])
filename | Filename of TIFF file save incoming fax |
c |
Makes the application behave as the calling machine (Default behavior is as answering machine) |
Receives a FAX from the channel into the given filename overwriting the file if it already exists.
File created will be in TIFF format.
This application sets the following channel variables:
LOCALSTATIONID |
To identify itself to the remote end |
LOCALHEADERINFO |
To generate a header line on each page |
FAXSTATUS |
SUCCESS FAILED |
FAXERROR |
Cause of failure |
REMOTESTATIONID |
The CSID of the remote side |
FAXPAGES |
Number of pages sent |
FAXBITRATE |
Transmission rate |
FAXRESOLUTION |
Resolution of sent fax |
Record(filename.format[,silence[,maxduration[,options]]])
filename | Is the format of the file type to be recorded (wav, gsm, etc). |
||||||||||||||
silence | Is the number of seconds of silence to allow before returning. |
||||||||||||||
maxduration | Is the maximum recording duration in seconds. If missing or 0 there is no maximum. |
||||||||||||||
options |
|
If filename contains %d
, these characters will be replaced with a number
incremented by one each time the file is recorded.
Use core show file formats to see the available formats on your system
User can press #
to terminate the recording and continue to the next priority.
If the user hangs up during a recording, all data will be lost and the application will terminate.
RECORDED_FILE |
Will be set to the final filename of the recording. |
RECORD_STATUS |
This is the final status of the command DTMF A terminating DTMF was received ('#' or '*', depending upon option 't')SILENCE The maximum silence occurred in the recording.SKIP The line was not yet answered and the 's' option was specified.TIMEOUT The maximum length was reached.HANGUP The channel was hung up.ERROR An unrecoverable error occurred, which resulted in a WARNING to the logs. |
RemoveQueueMember(queuename[,interface[,options]])
queuename | (no description) |
interface | (no description) |
options | (no description) |
If the interface is NOT in the queue it will return an error.
This application sets the following channel variable upon completion:
RQMSTATUS |
REMOVED NOTINQUEUE NOSUCHQUEUE |
Example: RemoveQueueMember(techsupport,SIP/3000)
ResetCDR([options])
options |
|
This application causes the Call Data Record to be reset.
RetryDial(announce,sleep,retries,dialargs)
announce | Filename of sound that will be played when no channel can be reached |
sleep | Number of seconds to wait after a dial attempt failed before a new attempt is made |
retries |
Number of retries When this is reached flow will continue at the next priority in the dialplan |
dialargs | Same format as arguments provided to the Dial application |
This application will attempt to place a call using the normal Dial application.
If no channel can be reached, the announce
file will be played.
Then, it will wait sleep
number of seconds before retrying the call.
After retries
number of attempts, the calling channel will continue at the next priority in the dialplan.
If the retries
setting is set to 0, this application will retry endlessly.
While waiting to retry a call, a 1 digit extension may be dialed. If that
extension exists in either the context defined in EXITCONTEXT or the current
one, The call will jump to that extension immediately.
The dialargs
are specified in the same format that arguments are provided
to the Dial application.
Return([value])
value | Return value. |
Jumps to the last label on the stack, removing it. The return value
, if
any, is saved in the channel variable GOSUB_RETVAL.
Ringing()
This application will request that the channel indicate a ringing tone to the user.
SIPAddHeader(Header:Content)
Header | (no description) |
Content | (no description) |
Adds a header to a SIP call placed with DIAL.
Remember to use the X-header if you are adding non-standard SIP
headers, like X-Asterisk-Accountcode:
. Use this with care.
Adding the wrong headers may jeopardize the SIP dialog.
Always returns 0
.
SIPDtmfMode(mode)
mode | (no description) |
Changes the dtmfmode for a SIP call.
SIPRemoveHeader([Header])
Header | (no description) |
SIPRemoveHeader() allows you to remove headers which were previously added with SIPAddHeader(). If no parameter is supplied, all previously added headers will be removed. If a parameter is supplied, only the matching headers will be removed.
For example you have added these 2 headers:
SIPAddHeader(P-Asserted-Identity: sip:foo@bar);
SIPAddHeader(P-Preferred-Identity: sip:bar@foo);
// remove all headers
SIPRemoveHeader();
// remove all P- headers
SIPRemoveHeader(P-);
// remove only the PAI header (note the : at the end)
SIPRemoveHeader(P-Asserted-Identity:);
Always returns 0
.
SLAStation(station)
station | Station name |
This application should be executed by an SLA station. The argument depends
on how the call was initiated. If the phone was just taken off hook, then the argument
station
should be just the station name. If the call was
initiated by pressing a line key, then the station name should be preceded by an underscore
and the trunk name associated with that line button.
For example: station1_line1
On exit, this application will set the variable SLASTATION_STATUS to one of the following values:
SLASTATION_STATUS |
FAILURE CONGESTION SUCCESS |
SLATrunk(trunk[,options])
trunk | Trunk name |
||
options |
|
This application should be executed by an SLA trunk on an inbound call. The channel calling
this application should correspond to the SLA trunk with the name trunk
that is being passed as an argument.
On exit, this application will set the variable SLATRUNK_STATUS to one of the following values:
SLATRUNK_STATUS |
FAILURE SUCCESS UNANSWERED RINGTIMEOUT |
SMS(name[,options[,addr[,body]]])
name | The name of the queue used in /var/spool/asterisk/sms |
||||||||||||
options |
|
||||||||||||
addr | (no description) | ||||||||||||
body | (no description) |
SMS handles exchange of SMS data with a call to/from SMS capable phone or SMS PSTN service center. Can send and/or receive SMS messages. Works to ETSI ES 201 912; compatible with BT SMS PSTN service in UK and Telecom Italia in Italy.
Typical usage is to use to handle calls from the SMS service centre CLI, or to set up a call using
outgoing
or manager interface to connect service centre to SMS().
"Messages are processed as per text file message queues. smsq (a separate software) is a command to generate message queues and send messages.
The protocol has tight delay bounds. Please use short frames and disable/keep short the jitter buffer on the ATA to make sure that respones (ACK etc.) are received in time.
SayAlpha(string)
string | (no description) |
This application will play the sounds that correspond to the letters of the
given string
.
SayDigits(digits)
digits | (no description) |
This application will play the sounds that correspond to the digits of the given number. This will use the language that is currently set for the channel.
SayNumber(digits[,gender])
digits | (no description) |
gender | (no description) |
This application will play the sounds that correspond to the given digits
.
Optionally, a gender
may be specified. This will use the language that is currently
set for the channel. See the LANGUAGE() function for more information on setting the language for the channel.
SayPhonetic(string)
string | (no description) |
This application will play the sounds from the phonetic alphabet that correspond to the
letters in the given string
.
SayUnixTime([unixtime[,timezone[,format]]])
unixtime | time, in seconds since Jan 1, 1970. May be negative. Defaults to now. |
timezone | timezone, see /usr/share/zoneinfo for a list. Defaults to machine default. |
format | a format the time is to be said in. See voicemail.conf.
Defaults to |
Uses some of the sound files stored in /var/lib/asterisk/sounds to construct a phrase saying the specified date and/or time in the specified format.
SendDTMF(digits[,timeout_ms[,duration_ms]])
digits | List of digits 0-9,*#,abcd |
timeout_ms | Amount of time to wait in ms between tones. (defaults to .25s) |
duration_ms | Duration of each digit |
DTMF digits sent to a channel with half second pause
It will pass all digits or terminate if it encounters an error.
SendFAX(filename[,a])
filename | Filename of TIFF file to fax |
a |
Makes the application behave as the answering machine (Default behavior is as calling machine) |
Send a given TIFF file to the channel as a FAX.
This application sets the following channel variables:
LOCALSTATIONID |
To identify itself to the remote end |
LOCALHEADERINFO |
To generate a header line on each page |
FAXSTATUS |
SUCCESS FAILED |
FAXERROR |
Cause of failure |
REMOTESTATIONID |
The CSID of the remote side |
FAXPAGES |
Number of pages sent |
FAXBITRATE |
Transmission rate |
FAXRESOLUTION |
Resolution of sent fax |
SendImage(filename)
filename | Path of the filename (image) to send. |
Send an image file on a channel supporting it.
Result of transmission will be stored in SENDIMAGESTATUS
SENDIMAGESTATUS |
SUCCESS Transmission succeeded.FAILURE Transmission failed.UNSUPPORTED Image transmission not supported by channel. |
SendText(text)
text | (no description) |
Sends text
to current channel (callee).
Result of transmission will be stored in the SENDTEXTSTATUS
SENDTEXTSTATUS |
SUCCESS Transmission succeeded.FAILURE Transmission failed.UNSUPPORTED Text transmission not supported by channel. |
At this moment, text is supposed to be 7 bit ASCII in most channels.
SendURL(URL[,option])
URL | (no description) | ||
option |
|
Requests client go to URL
(IAX2) or sends the
URL to the client (other channels).
Result is returned in the SENDURLSTATUS channel variable:
SENDURLSTATUS |
SUCCESS URL successfully sent to client.FAILURE Failed to send URL.NOLOAD Client failed to load URL (wait enabled).UNSUPPORTED Channel does not support URL transport. |
SendURL continues normally if the URL was sent correctly or if the channel does not support HTML transport. Otherwise, the channel is hung up.
Set(name=value)
name | (no description) |
value | (no description) |
This function can be used to set the value of channel variables or dialplan functions.
When setting variables, if the variable name is prefixed with _
,
the variable will be inherited into channels created from the current channel.
If the variable name is prefixed with __
, the variable will be
inherited into channels created from the current channel and all children channels.
If (and only if), in /etc/asterisk/asterisk.conf, you have
a [compat]
category, and you have app_set = 1.6
under that,then
the behavior of this app changes, and does not strip surrounding quotes from the right hand side as
it did previously in 1.4. The app_set = 1.6
is only inserted if make samples
is executed, or if users insert this by hand into the asterisk.conf file.
The advantages of not stripping out quoting, and not caring about the separator characters (comma and vertical bar)
were sufficient to make these changes in 1.6. Confusion about how many backslashes would be needed to properly
protect separators and quotes in various database access strings has been greatly
reduced by these changes.
SetAMAFlags([flag])
flag | (no description) |
This application will set the channel's AMA Flags for billing purposes.
SetCallerPres(presentation)
presentation |
|
Set Caller*ID presentation on a call.
Skel(dummy[,options])
dummy | (no description) | ||||||
options |
|
This application is a template to build other applications from. It shows you the basic structure to create your own Asterisk applications.
SoftHangup(Technology/Resource[,options])
Technology/Resource | (no description) | ||
options |
|
Hangs up the requested channel. If there are no channels to hangup, the application will report it.
SpeechActivateGrammar(grammar_name)
grammar_name | (no description) |
This activates the specified grammar to be recognized by the engine. A grammar tells the speech recognition engine what to recognize, and how to portray it back to you in the dialplan. The grammar name is the only argument to this application.
SpeechBackground(sound_file[,timeout[,options]])
sound_file | (no description) | ||
timeout | Timeout integer in seconds. Note the timeout will only start once the sound file has stopped playing. |
||
options |
|
This application plays a sound file and waits for the person to speak. Once they start speaking playback of the file stops, and silence is heard. Once they stop talking the processing sound is played to indicate the speech recognition engine is working. Once results are available the application returns and results (score and text) are available using dialplan functions.
The first text and score are ${SPEECH_TEXT(0)} AND ${SPEECH_SCORE(0)} while the second are ${SPEECH_TEXT(1)} and ${SPEECH_SCORE(1)}.
The first argument is the sound file and the second is the timeout integer in seconds.
SpeechCreate(engine_name)
engine_name | (no description) |
This application creates information to be used by all the other applications. It must be called before doing any speech recognition activities such as activating a grammar. It takes the engine name to use as the argument, if not specified the default engine will be used.
SpeechDeactivateGrammar(grammar_name)
grammar_name | The grammar name to deactivate |
This deactivates the specified grammar so that it is no longer recognized.
SpeechDestroy()
This destroys the information used by all the other speech recognition applications. If you call this application but end up wanting to recognize more speech, you must call SpeechCreate() again before calling any other application.
SpeechLoadGrammar(grammar_name,path)
grammar_name | (no description) |
path | (no description) |
Load a grammar only on the channel, not globally.
SpeechProcessingSound(sound_file)
sound_file | (no description) |
This changes the processing sound that SpeechBackground plays back when the speech recognition engine is processing and working to get results.
SpeechStart()
Tell the speech recognition engine that it should start trying to get results from audio being fed to it.
SpeechUnloadGrammar(grammar_name)
grammar_name | (no description) |
Unload a grammar.
StackPop()
Removes last label on the stack, discarding it.
StopMixMonitor()
Stops the audio recording that was started with a call to MixMonitor()
on the current channel.
StopMonitor()
Stops monitoring a channel. Has no effect if the channel is not monitored.
StopPlayTones()
Stop playing a tone list, initiated by PlayTones().
System(command)
command | Command to execute |
Executes a command by using system(). If the command fails, the console should report a fallthrough.
Result of execution is returned in the SYSTEMSTATUS channel variable:
SYSTEMSTATUS |
FAILURE Could not execute the specified command.SUCCESS Specified command successfully executed. |
TestClient(testid)
testid | An ID to identify this test. |
Executes test client with given testid
. Results stored in
/var/log/asterisk/testreports/<testid>-client.txt
TestServer()
Perform test server function and write call report. Results stored in /var/log/asterisk/testreports/<testid>-server.txt
Transfer([[Tech/]destination)
dest | (no description) |
Requests the remote caller be transferred to a given destination. If TECH (SIP, IAX2, LOCAL etc) is used, only an incoming call with the same channel technology will be transfered. Note that for SIP, if you transfer before call is setup, a 302 redirect SIP message will be returned to the caller.
The result of the application will be reported in the TRANSFERSTATUS channel variable:
TRANSFERSTATUS |
SUCCESS Transfer succeeded.FAILURE Transfer failed.UNSUPPORTED Transfer unsupported by channel driver. |
TryExec(appname(arguments))
appname | (no description) |
Allows an arbitrary application to be invoked even when not hard coded into the dialplan. To invoke external applications see the application System. Always returns to the dialplan. The channel variable TRYSTATUS will be set to one of:
TRYSTATUS |
SUCCESS If the application returned zero.FAILED If the application returned non-zero.NOAPP If the application was not found or was not specified. |
TrySystem(command)
command | Command to execute |
Executes a command by using system().
Result of execution is returned in the SYSTEMSTATUS channel variable:
SYSTEMSTATUS |
FAILURE Could not execute the specified command.SUCCESS Specified command successfully executed.APPERROR Specified command successfully executed, but returned error code. |
UnpauseMonitor()
Unpauses monitoring of a channel on which monitoring had previously been paused with PauseMonitor.
UnpauseQueueMember([queuename,interface[,options[,reason]]])
queuename | (no description) |
interface | (no description) |
options | (no description) |
reason | Is used to add extra information to the appropriate queue_log entries and manager events. |
Unpauses (resumes calls to) a queue member. This is the counterpart to PauseQueueMember()
and operates exactly the same way, except it unpauses instead of pausing the given interface.
This application sets the following channel variable upon completion:
UPQMSTATUS |
The status of the attempt to unpause a queue member as a text string. UNPAUSED NOTFOUND |
Example: UnpauseQueueMember(,SIP/3000)
UserEvent(eventname[,body])
eventname | (no description) |
body | (no description) |
Sends an arbitrary event to the manager interface, with an optional
body
representing additional arguments. The
body
may be specified as
a |
delimited list of headers. Each additional
argument will be placed on a new line in the event. The format of the
event will be:
Event: UserEvent
UserEvent: <specified event name>
[body]
If no body
is specified, only Event and UserEvent headers will be present.
VMAuthenticate([mailbox[@context]][,options])
mailbox | (no description) | ||
options |
|
This application behaves the same way as the Authenticate application, but the passwords
are taken from voicemail.conf. If the mailbox
is
specified, only that mailbox's password will be considered valid. If the mailbox
is not specified, the channel variable AUTH_MAILBOX will be set with the authenticated
mailbox.
Verbose([level,]message)
level | Must be an integer value. If not specified, defaults to 0. |
message | Output text message. |
Sends an arbitrary text message to verbose output.
VoiceMail(mailbox[@context][&mailbox[@context][&...]][,options])
mailboxs | (no description) | ||||||||||||||
options |
|
This application allows the calling party to leave a message for the specified list of mailboxes. When multiple mailboxes are specified, the greeting will be taken from the first mailbox specified. Dialplan execution will stop if the specified mailbox does not exist.
The Voicemail application will exit if any of the following DTMF digits are received:
0 |
Jump to the |
* |
Jump to the |
This application will set the following channel variable upon completion:
VMSTATUS |
This indicates the status of the execution of the VoiceMail application. SUCCESS USEREXIT FAILED |
VoiceMailMain([mailbox[@context]][,options])
mailbox | (no description) | ||||||||
options |
|
This application allows the calling party to check voicemail messages. A specific
mailbox
, and optional corresponding context
,
may be specified. If a mailbox
is not provided, the calling party will
be prompted to enter one. If a context
is not specified, the
default
context will be used.
Wait(seconds)
seconds | Can be passed with fractions of a second. For example, |
This application waits for a specified number of seconds
.
WaitExten([seconds[,options]])
seconds | Can be passed with fractions of a second. For example, |
||
options |
|
This application waits for the user to enter a new extension for a specified number
of seconds
.
Use of the application WaitExten
within a macro will not function
as expected. Please use the Read
application in order to read DTMF from a channel
currently executing a macro.
WaitForNoise(noiserequired[,iterations[,timeout]])
noiserequired | (no description) |
iterations | If not specified, defaults to |
timeout | Is specified only to avoid an infinite loop in cases where silence is never achieved. |
Waits for up to noiserequired
milliseconds of noise,
iterations
times. An optional timeout
specified the number of seconds to return after, even if we do not receive the specified amount of noise.
Use timeout
with caution, as it may defeat the purpose of this application, which
is to wait indefinitely until noise is detected on the line.
WaitForRing(timeout)
timeout | (no description) |
Returns 0
after waiting at least timeout
seconds,
and only after the next ring has completed. Returns 0
on success or
-1
on hangup.
WaitForSilence(silencerequired[,iterations[,timeout]])
silencerequired | (no description) |
iterations | If not specified, defaults to |
timeout | Is specified only to avoid an infinite loop in cases where silence is never achieved. |
Waits for up to silencerequired
milliseconds of silence,
iterations
times. An optional timeout
specified the number of seconds to return after, even if we do not receive the specified amount of silence.
Use timeout
with caution, as it may defeat the purpose of this application, which
is to wait indefinitely until silence is detected on the line. This is particularly useful for reverse-911-type
call broadcast applications where you need to wait for an answering machine to complete its spiel before
playing a message.
Typically you will want to include two or more calls to WaitForSilence when dealing with an answering machine; first waiting for the spiel to finish, then waiting for the beep, etc.
Examples:
WaitForSilence(500,2) will wait for 1/2 second of silence, twice
WaitForSilence(1000) will wait for 1 second of silence, once
WaitForSilence(300,3,10) will wait for 300ms silence, 3 times, and returns after 10 sec, even if silence is not detected
Sets the channel variable WAITSTATUS to one of these values:
WAITSTATUS |
SILENCE if exited with silence detected.TIMEOUT if exited without silence detected after timeout. |
WaitUntil(epoch)
epoch | (no description) |
Waits until the given epoch
.
Sets WAITUNTILSTATUS to one of the following values:
WAITUNTILSTATUS |
OK Wait succeeded.FAILURE Invalid argument.HANGUP Channel hungup before time elapsed.PAST Time specified had already past. |
While(expr)
expr | (no description) |
Start a While Loop. Execution will return to this point when
EndWhile()
is called until expr is no longer true.
Zapateller(options)
options |
Comma delimited list of options.
|
Generates special information tone to block telemarketers from calling you.
This application will set the following channel variable upon completion:
ZAPATELLERSTATUS |
This will contain the last action accomplished by the Zapateller application. Possible values include: NOTHING ANSWERED ZAPPED |