Table of Contents

Applications

174 applications total

Application Synopsis
AgentLogin Call agent login.
AgentMonitorOutgoing Record agent's outgoing call.
DAHDISendKeypadFacility Send digits out of band over a PRI.
DAHDISendCallreroutingFacility Send QSIG call rerouting facility over a PRI.
DAHDIAcceptR2Call Accept an R2 call if its not already accepted (you still need to answer it)
IAX2Provision Provision a calling IAXy with a given template.
SIPDtmfMode Change the dtmfmode for a SIP call.
SIPAddHeader Add a SIP header to the outbound call.
SIPRemoveHeader Remove SIP headers previously added with SIPAddHeader
ADSIProg Load Asterisk ADSI Scripts into phone
AlarmReceiver Provide support for receiving alarm reports from a burglar or fire alarm panel.
AMD Attempt to detect answering machines.
Authenticate Authenticate a user
NoCDR Tell Asterisk to not maintain a CDR for the current call
ChanIsAvail Check channel availability
ChannelRedirect Redirects given channel to a dialplan target
ChanSpy Listen to a channel, and optionally whisper into it.
ExtenSpy Listen to a channel, and optionally whisper into it.
DAHDIScan Scan DAHDI channels to monitor calls.
ConfBridge Conference bridge application.
ControlPlayback Play a file with fast forward and rewind.
DAHDIBarge Barge in (monitor) DAHDI channel.
DAHDIRAS Executes DAHDI ISDN RAS application.
DBdel Delete a key from the asterisk database.
DBdeltree Delete a family or keytree from the asterisk database.
Dial Attempt to connect to another device or endpoint and bridge the call.
RetryDial Place a call, retrying on failure allowing an optional exit extension.
Dictate Virtual Dictation Machine.
Pickup Directed extension call pickup.
PickupChan Pickup a ringing channel.
Directory Provide directory of voicemail extensions.
DISA Direct Inward System Access.
DumpChan Dump Info About The Calling Channel.
Echo Echo audio, video, DTMF back to the calling party
Exec Executes dialplan application.
TryExec Executes dialplan application, always returning.
ExecIf Executes dialplan application, conditionally.
SendFAX Send a Fax
ReceiveFAX Receive a Fax
Festival Say text to the user.
Flash Flashes a DAHDI Trunk.
FollowMe Find-Me/Follow-Me application.
ForkCDR Forks the Call Data Record.
GetCPEID Get ADSI CPE ID.
ICES Encode and stream using 'ices'.
SendImage Sends an image file.
IVRDemo IVR Demo Application.
JACK Jack Audio Connection Kit
Macro Macro Implementation.
MacroIf Conditional Macro implementation.
MacroExclusive Exclusive Macro Implementation.
MacroExit Exit from Macro.
MeetMe MeetMe conference bridge.
MeetMeCount MeetMe participant count.
MeetMeAdmin MeetMe conference administration.
MeetMeChannelAdmin MeetMe conference Administration (channel specific).
SLAStation Shared Line Appearance Station.
SLATrunk Shared Line Appearance Trunk.
Milliwatt Generate a Constant 1004Hz tone at 0dbm (mu-law).
MinivmRecord Receive Mini-Voicemail and forward via e-mail.
MinivmGreet Play Mini-Voicemail prompts.
MinivmNotify Notify voicemail owner about new messages.
MinivmDelete Delete Mini-Voicemail voicemail messages.
MinivmAccMess Record account specific messages.
MinivmMWI Send Message Waiting Notification to subscriber(s) of mailbox.
MixMonitor Record a call and mix the audio during the recording.
StopMixMonitor Stop recording a call through MixMonitor.
Morsecode Plays morse code.
MP3Player Play an MP3 file or stream.
NBScat Play an NBS local stream.
Originate Originate a call.
Page Page series of phones
ParkAndAnnounce Park and Announce.
Playback Play a file.
PlayTones Play a tone list.
StopPlayTones Stop playing a tone list.
PrivacyManager Require phone number to be entered, if no CallerID sent
Queue Queue a call for a call queue.
AddQueueMember Dynamically adds queue members.
RemoveQueueMember Dynamically removes queue members.
PauseQueueMember Pauses a queue member.
UnpauseQueueMember Unpauses a queue member.
QueueLog Writes to the queue_log file.
Read Read a variable.
ReadExten Read an extension into a variable.
ReadFile Read the contents of a text file into a channel variable.
Record Record to a file.
SayUnixTime Says a specified time in a custom format.
DateTime Says a specified time in a custom format.
SendDTMF Sends arbitrary DTMF digits
SendText Send a Text Message.
SetCallerPres Set CallerID Presentation.
Skel Simple one line explaination.
SMS Communicates with SMS service centres and SMS capable analogue phones.
SoftHangup Hangs up the requested channel.
SpeechCreate Create a Speech Structure.
SpeechActivateGrammar Activate a grammar.
SpeechStart Start recognizing voice in the audio stream.
SpeechBackground Play a sound file and wait for speech to be recognized.
SpeechDeactivateGrammar Deactivate a grammar.
SpeechProcessingSound Change background processing sound.
SpeechDestroy End speech recognition.
SpeechLoadGrammar Load a grammar.
SpeechUnloadGrammar Unload a grammar.
Gosub Jump to label, saving return address.
GosubIf Conditionally jump to label, saving return address.
Return Return from gosub routine.
StackPop Remove one address from gosub stack.
System Execute a system command.
TrySystem Try executing a system command.
BackgroundDetect Background a file with talk detect.
TestServer Execute Interface Test Server.
TestClient Execute Interface Test Client.
Transfer Transfer caller to remote extension.
SendURL Send a URL.
UserEvent Send an arbitrary event to the manager interface.
Verbose Send arbitrary text to verbose output.
Log Send arbitrary text to a selected log level.
VoiceMail Leave a Voicemail message.
VoiceMailMain Check Voicemail messages.
MailboxExists Check to see if Voicemail mailbox exists.
VMAuthenticate Authenticate with Voicemail passwords.
WaitForRing Wait for Ring Application.
WaitForSilence Waits for a specified amount of silence.
WaitForNoise Waits for a specified amount of noise.
WaitUntil Wait (sleep) until the current time is the given epoch.
While Start a while loop.
EndWhile End a while loop.
ExitWhile End a While loop.
ContinueWhile Restart a While loop.
Zapateller Block telemarketers with SIT.
ODBCFinish Clear the resultset of a sucessful multirow query.
ClearHash Clear the keys from a specified hashname.
Bridge Bridge two channels.
ParkedCall Answer a parked call.
Park Park yourself.
Answer Answer a channel if ringing.
BackGround Play an audio file while waiting for digits of an extension to go to.
Busy Indicate the Busy condition.
Congestion Indicate the Congestion condition.
ExecIfTime Conditional application execution based on the current time.
Goto Jump to a particular priority, extension, or context.
GotoIf Conditional goto.
GotoIfTime Conditional Goto based on the current time.
ImportVar Import a variable from a channel into a new variable.
Hangup Hang up the calling channel.
Incomplete Returns AST_PBX_INCOMPLETE value.
NoOp Do Nothing (No Operation).
Proceeding Indicate proceeding.
Progress Indicate progress.
RaiseException Handle an exceptional condition.
ResetCDR Resets the Call Data Record.
Ringing Indicate ringing tone.
SayAlpha Say Alpha.
SayDigits Say Digits.
SayNumber Say Number.
SayPhonetic Say Phonetic.
Set Set channel variable or function value.
MSet Set channel variable(s) or function value(s).
SetAMAFlags Set the AMA Flags.
Wait Waits for some time.
WaitExten Waits for an extension to be entered.
AGI Executes an AGI compliant application.
EAGI Executes an EAGI compliant application.
DeadAGI Executes AGI on a hungup channel.
JabberSend Send a Jabber Message
JabberStatus Retrieve the status of a jabber list member
Monitor Monitor a channel.
StopMonitor Stop monitoring a channel.
ChangeMonitor Change monitoring filename of a channel.
PauseMonitor Pause monitoring of a channel.
UnpauseMonitor Unpause monitoring of a channel.
ODBC_Commit Commits a currently open database transaction.
ODBC_Rollback Rollback a currently open database transaction.

AgentLogin

Synopsis

Call agent login.

Syntax

AgentLogin([AgentNo[,options]])

Arguments

AgentNo (no description)
options
s

silent login - do not announce the login ok segment after agent logged on/off

Description

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.

See also

Queue application
AddQueueMember application
RemoveQueueMember application
PauseQueueMember application
UnpauseQueueMember application
AGENT function
agents.conf file queues.conf file

AgentMonitorOutgoing

Synopsis

Record agent's outgoing call.

Syntax

AgentMonitorOutgoing([options])

Arguments

options
d

make the app return -1 if there is an error condition.

c

change the CDR so that the source of the call is Agent/agent_id

n

don't generate the warnings when there is no callerid or the agentid is not known. It's handy if you want to have one context for agent and non-agent calls.

Description

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.

See also

agents.conf file

DAHDISendKeypadFacility

Synopsis

Send digits out of band over a PRI.

Syntax

DAHDISendKeypadFacility(digits)

Arguments

digits (no description)

Description

This application will send the given string of digits in a Keypad Facility IE over the current channel.

DAHDISendCallreroutingFacility

Synopsis

Send QSIG call rerouting facility over a PRI.

Syntax

DAHDISendCallreroutingFacility(destination[,original[,reason]])

Arguments

destination

Destination number.

original

Original called number.

reason

Diversion reason, if not specified defaults to unknown

Description

This application will send a Callrerouting Facility IE over the current channel.

DAHDIAcceptR2Call

Synopsis

Accept an R2 call if its not already accepted (you still need to answer it)

Syntax

DAHDIAcceptR2Call(charge)

Arguments

charge

Yes or No.

Whether you want to accept the call with charge or without charge.

Description

This application will Accept the R2 call either with charge or no charge.

IAX2Provision

Synopsis

Provision a calling IAXy with a given template.

Syntax

IAX2Provision([template])

Arguments

template

If not specified, defaults to default.

Description

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.

SIPDtmfMode

Synopsis

Change the dtmfmode for a SIP call.

Syntax

SIPDtmfMode(mode)

Arguments

mode (no description)

Description

Changes the dtmfmode for a SIP call.

SIPAddHeader

Synopsis

Add a SIP header to the outbound call.

Syntax

SIPAddHeader(Header,Content)

Arguments

Header (no description)
Content (no description)

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.

SIPRemoveHeader

Synopsis

Remove SIP headers previously added with SIPAddHeader

Syntax

SIPRemoveHeader([Header])

Arguments

Header (no description)

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.

ADSIProg

Synopsis

Load Asterisk ADSI Scripts into phone

Syntax

ADSIProg([script])

Arguments

script

adsi script to use. If not given uses the default script asterisk.adsi

Description

This application programs an ADSI Phone with the given script

See also

GetCPEID application
adsi.conf file

AlarmReceiver

Synopsis

Provide support for receiving alarm reports from a burglar or fire alarm panel.

Syntax

AlarmReceiver()

Arguments

Description

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.

See also

alarmreceiver.conf file

AMD

Synopsis

Attempt to detect answering machines.

Syntax

AMD([initialSilence[,greeting[,afterGreetingSilence[,totalAnalysis Time[,miniumWordLength[,betweenWordSilence[,maximumNumberOfWords[,silenceThreshold[,maximumWordLength]]]]]]]]])

Arguments

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

Description

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.

See also

WaitForSilence application
WaitForNoise application

Authenticate

Synopsis

Authenticate a user

Syntax

Authenticate(password[,options[,maxdigits[,prompt]]])

Arguments

password

Password the user should know

options
a

Set the channels' account code to the password that is entered

d

Interpret the given path as database key, not a literal file

m

Interpret the given path as a file which contains a list of account codes and password hashes delimited with :, listed one per line in the file. When one of the passwords is matched, the channel will have its account code set to the corresponding account code in the file.

r

Remove the database key upon successful entry (valid with d only)

maxdigits

maximum acceptable number of digits. Stops reading after maxdigits have been entered (without requiring the user to press the # key). Defaults to 0 - no limit - wait for the user press the # key.

prompt

Override the agent-pass prompt file.

Description

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.

See also

VMAuthenticate application
DISA application

NoCDR

Synopsis

Tell Asterisk to not maintain a CDR for the current call

Syntax

NoCDR()

Arguments

Description

This application will tell Asterisk not to maintain a CDR for the current call.

ChanIsAvail

Synopsis

Check channel availability

Syntax

ChanIsAvail(Technology/Resource[,options])

Arguments

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 Technology/Resource, where Technology represents a particular channel driver, and Resource represents a resource available to that particular channel driver.

options
a

Check for all available channels, not only the first one

s

Consider the channel unavailable if the channel is in use at all

t

Simply checks if specified channels exist in the channel list

Description

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

ChannelRedirect

Synopsis

Redirects given channel to a dialplan target

Syntax

ChannelRedirect([[channel,context,]extension,]priority)

Arguments

channel (no description)
context (no description)
extension (no description)
priority (no description)

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

ChanSpy

Synopsis

Listen to a channel, and optionally whisper into it.

Syntax

ChanSpy([chanprefix[,options]])

Arguments

chanprefix (no description)
options
b

Only spy on channels involved in a bridged call.

B

Instead of whispering on a single channel barge in on both channels involved in the call.

d

Override the typical numeric DTMF functionality and instead use DTMF to switch between spy modes.

spy mode

whisper mode

barge mode

g

Only spy on channels in which one or more of the groups listed in grp matches one or more groups from the SPYGROUP variable set on the channel to be spied upon.

both grp and SPYGROUP can contain either a single group or a colon-delimited list of groups, such as sales:support:accounting.

n

Say the name of the person being spied on if that person has recorded his/her name. If a context is specified, then that voicemail context will be searched when retrieving the name, otherwise the default context be used when searching for the name (i.e. if SIP/1000 is the channel being spied on and no mailbox is specified, then 1000 will be used when searching for the name).

q

Don't play a beep when beginning to spy on a channel, or speak the selected channel name.

r

Record the session to the monitor spool directory. An optional base for the filename may be specified. The default is chanspy.

s

Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.

v

Adjust the initial volume in the range from -4 to 4. A negative value refers to a quieter setting.

w

Enable whisper mode, so the spying channel can talk to the spied-on channel.

W

Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.

o

Only listen to audio coming from this channel.

X

Allow the user to exit ChanSpy to a valid single digit numeric extension in the current context or the context specified by the SPY_EXIT_CONTEXT channel variable. The name of the last channel that was spied on will be stored in the SPY_CHANNEL variable.

x

Specify a DTMF digit that can be used to exit the application.

c

Specify a DTMF digit that can be used to spy on the next available channel.

e

Enable enforced mode, so the spying channel can only monitor extensions whose name is in the ext : delimited list.

Description

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.

See also

ExtenSpy application

ExtenSpy

Synopsis

Listen to a channel, and optionally whisper into it.

Syntax

ExtenSpy(exten[,options])

Arguments

exten

Specify extension.

Optionally specify a context, defaults to default.

options
b

Only spy on channels involved in a bridged call.

B

Instead of whispering on a single channel barge in on both channels involved in the call.

d

Override the typical numeric DTMF functionality and instead use DTMF to switch between spy modes.

spy mode

whisper mode

barge mode

g

Only spy on channels in which one or more of the groups listed in grp matches one or more groups from the SPYGROUP variable set on the channel to be spied upon.

both grp and SPYGROUP can contain either a single group or a colon-delimited list of groups, such as sales:support:accounting.

n

Say the name of the person being spied on if that person has recorded his/her name. If a context is specified, then that voicemail context will be searched when retrieving the name, otherwise the default context be used when searching for the name (i.e. if SIP/1000 is the channel being spied on and no mailbox is specified, then 1000 will be used when searching for the name).

q

Don't play a beep when beginning to spy on a channel, or speak the selected channel name.

r

Record the session to the monitor spool directory. An optional base for the filename may be specified. The default is chanspy.

s

Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.

v

Adjust the initial volume in the range from -4 to 4. A negative value refers to a quieter setting.

w

Enable whisper mode, so the spying channel can talk to the spied-on channel.

W

Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.

o

Only listen to audio coming from this channel.

X

Allow the user to exit ChanSpy to a valid single digit numeric extension in the current context or the context specified by the SPY_EXIT_CONTEXT channel variable. The name of the last channel that was spied on will be stored in the SPY_CHANNEL variable.

x

Specify a DTMF digit that can be used to exit the application.

c

Specify a DTMF digit that can be used to spy on the next available channel.

e

Enable enforced mode, so the spying channel can only monitor extensions whose name is in the ext : delimited list.

Description

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.

See also

ChanSpy application

DAHDIScan

Synopsis

Scan DAHDI channels to monitor calls.

Syntax

DAHDIScan([group])

Arguments

group

Limit scanning to a channel group by setting this option.

Description

Allows a call center manager to monitor DAHDI channels in a convenient way. Use # to select the next channel and use * to exit.

ConfBridge

Synopsis

Conference bridge application.

Syntax

ConfBridge([confno[,options]])

Arguments

confno

The conference number

options
a

Set admin mode.

A

Set marked mode.

c

Announce user(s) count on joining a conference.

m

Set initially muted.

M

Enable music on hold when the conference has a single caller. Optionally, specify a musiconhold class to use. If one is not provided, it will use the channel's currently set music class, or default.

1

Do not play message when first person enters

s

Present menu (user or admin) when * is received (send to menu).

w

Wait until the marked user enters the conference.

q

Quiet mode (don't play enter/leave sounds).

Description

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.

ControlPlayback

Synopsis

Play a file with fast forward and rewind.

Syntax

ControlPlayback(filename[,skipms[,ff[,rew[,stop[,pause[,restart[,options]]]]]]])

Arguments

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
o

Start at time ms from the beginning of the file.

Description

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. -1 is end of file.

CPLAYBACKSTOPKEY

If the playback is stopped by the user this variable contains the key that was pressed.

DAHDIBarge

Synopsis

Barge in (monitor) DAHDI channel.

Syntax

DAHDIBarge([channel])

Arguments

channel

Channel to barge.

Description

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

Synopsis

Executes DAHDI ISDN RAS application.

Syntax

DAHDIRAS(args)

Arguments

args

A list of parameters to pass to the pppd daemon, separated by , characters.

Description

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.

DBdel

Synopsis

Delete a key from the asterisk database.

Syntax

DBdel(family,key)

Arguments

family (no description)
key (no description)

Description

This application will delete a key from the Asterisk database.

This application has been DEPRECATED in favor of the DB_DELETE function.

See also

DB_DELETE function
DBdeltree application
DB function

DBdeltree

Synopsis

Delete a family or keytree from the asterisk database.

Syntax

DBdeltree(family[,keytree])

Arguments

family (no description)
keytree (no description)

Description

This application will delete a family or keytree from the Asterisk database.

See also

DB_DELETE function
DBdel application
DB function

Dial

Synopsis

Attempt to connect to another device or endpoint and bridge the call.

Syntax

Dial(Technology/Resource[,timeout[,options[,URL]]])

Arguments

Technology/Resource

Specification of the device(s) to dial. These must be in the format of Technology/Resource, where Technology represents a particular channel driver, and Resource represents a resource available to that particular channel driver.

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
A

The file to play to the called party

Play an announcement to the called party, where x is the prompt to be played

C

Reset the call detail record (CDR) for this call.

c

If the Dial() application cancels this call, always set the flag to tell the channel driver that the call is answered elsewhere.

d

Allow the calling user to dial a 1 digit extension while waiting for a call to be answered. Exit to that extension if it exists in the current context, or the context defined in the EXITCONTEXT variable, if it exists.

D

Send the specified DTMF strings after the called party has answered, but before the call gets bridged. The called DTMF string is sent to the called party, and the calling DTMF string is sent to the calling party. Both arguments can be used alone. If progress is specified, its DTMF is sent immediately after receiving a PROGRESS message.

e

Execute the h extension for peer after the call ends

f

Force the callerid of the calling channel to be set as the extension associated with the channel using a dialplan hint. For example, some PSTNs do not allow CallerID to be set to anything other than the number assigned to the caller.

F

When the caller hangs up, transfer the called party to the specified destination and continue execution at that location.

F

Proceed with dialplan execution at the next priority in the current extension if the source channel hangs up.

g

Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up.

G

If the call is answered, transfer the calling party to the specified priority and the called party to the specified priority plus one.

You cannot use any additional action post answer options in conjunction with this option.

h

Allow the called party to hang up by sending the * DTMF digit.

H

Allow the calling party to hang up by hitting the * DTMF digit.

i

Asterisk will ignore any forwarding requests it may receive on this dial attempt.

I

Asterisk will ignore any connected line update requests or redirecting party update requests it may receiveon this dial attempt.

k

Allow the called party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf.

K

Allow the calling party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf.

L

Maximum call time, in milliseconds

Warning time, in milliseconds

Repeat time, in milliseconds

Limit the call to x milliseconds. Play a warning when y milliseconds are left. Repeat the warning every z milliseconds until time expires.

This option is affected by the following variables:

LIMIT_PLAYAUDIO_CALLER

yes

no

If set, this variable causes Asterisk to play the prompts to the caller.

LIMIT_PLAYAUDIO_CALLEE

yes

no

If set, this variable causes Asterisk to play the prompts to the callee.

LIMIT_TIMEOUT_FILE

filename

If specified, filename specifies the sound prompt to play when the timeout is reached. If not set, the time remaining will be announced.

LIMIT_CONNECT_FILE

filename

If specified, filename specifies the sound prompt to play when the call begins. If not set, the time remaining will be announced.

LIMIT_WARNING_FILE

filename

If specified, filename specifies the sound prompt to play as a warning when time x is reached. If not set, the time remaining will be announced.

m

Provide hold music to the calling party until a requested channel answers. A specific music on hold class (as defined in musiconhold.conf) can be specified.

M

Name of the macro that should be executed.

Macro arguments

Execute the specified macro for the called channel before connecting to the calling channel. Arguments can be specified to the Macro using ^ as a delimiter. The macro can set the variable MACRO_RESULT to specify the following actions after the macro is finished executing:

MACRO_RESULT

If set, this action will be taken after the macro finished executing.

ABORT

Hangup both legs of the call

CONGESTION

Behave as if line congestion was encountered

BUSY

Behave as if a busy signal was encountered

CONTINUE

Hangup the called party and allow the calling party to continue dialplan execution at the next priority

GOTO:<context>^<exten>^<priority>

Transfer the call to the specified destination.

You cannot use any additional action post answer options in conjunction with this option. Also, pbx services are not run on the peer (called) channel, so you will not be able to set timeouts via the TIMEOUT() function in this macro.

Be aware of the limitations that macros have, specifically with regards to use of the WaitExten application. For more information, see the documentation for Macro()

n

This option is a modifier for the call screening/privacy mode. (See the p and P options.) It specifies that no introductions are to be saved in the priv-callerintros directory.

N

This option is a modifier for the call screening/privacy mode. It specifies that if Caller*ID is present, do not screen the call.

o

Specify that the Caller*ID that was present on the calling channel be set as the Caller*ID on the called channel. This was the behavior of Asterisk 1.0 and earlier.

O

With mode either not specified or set to 1, the originator hanging up will cause the phone to ring back immediately.

With mode set to 2, when the operator flashes the trunk, it will ring their phone back.

Enables operator services mode. This option only works when bridging a DAHDI channel to another DAHDI channel only. if specified on non-DAHDI interfaces, it will be ignored. When the destination answers (presumably an operator services station), the originator no longer has control of their line. They may hang up, but the switch will not release their line until the destination party (the operator) hangs up.

p

This option enables screening mode. This is basically Privacy mode without memory.

P

Enable privacy mode. Use x as the family/key in the AstDB database if it is provided. The current extension is used if a database family/key is not specified.

r

Indicate ringing to the calling party, even if the called party isn't actually ringing. Pass no audio to the calling party until the called channel has answered.

S

Hang up the call x seconds after the called party has answered the call.

t

Allow the called party to transfer the calling party by sending the DTMF sequence defined in features.conf.

T

Allow the calling party to transfer the called party by sending the DTMF sequence defined in features.conf.

U

Name of the subroutine to execute via Gosub

Arguments for the Gosub routine

Execute via Gosub the routine x for the called channel before connecting to the calling channel. Arguments can be specified to the Gosub using ^ as a delimiter. The Gosub routine can set the variable GOSUB_RESULT to specify the following actions after the Gosub returns.

GOSUB_RESULT

ABORT

Hangup both legs of the call.

CONGESTION

Behave as if line congestion was encountered.

BUSY

Behave as if a busy signal was encountered.

CONTINUE

Hangup the called party and allow the calling party to continue dialplan execution at the next priority.

GOTO:<context>^<exten>^<priority>

Transfer the call to the specified priority. Optionally, an extension, or extension and priority can be specified.

You cannot use any additional action post answer options in conjunction with this option. Also, pbx services are not run on the peer (called) channel, so you will not be able to set timeouts via the TIMEOUT() function in this routine.

w

Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch recording in features.conf.

W

Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch recording in features.conf.

x

Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor in features.conf.

X

Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor in features.conf.

z

On a call forward, cancel any dial timeout which has been set for this call.

URL

The optional URL will be sent to the called party if the channel driver supports it.

Description

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

RetryDial

Synopsis

Place a call, retrying on failure allowing an optional exit extension.

Syntax

RetryDial(announce,sleep,retries,dialargs)

Arguments

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

Description

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.

Dictate

Synopsis

Virtual Dictation Machine.

Syntax

Dictate([base_dir[,filename]])

Arguments

base_dir (no description)
filename (no description)

Description

Start dictation machine using optional base_dir for files.

Pickup

Synopsis

Directed extension call pickup.

Syntax

Pickup(ext[,ext2])

Arguments

ext (no description)
ext2 (no description)

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

Synopsis

Pickup a ringing channel.

Syntax

PickupChan(channel[,channel2])

Arguments

channel (no description)
channel2 (no description)

Description

This will pickup a specified channel if ringing.

Directory

Synopsis

Provide directory of voicemail extensions.

Syntax

Directory([vm-context[,dial-context[,options]]])

Arguments

vm-context

This is the context within voicemail.conf to use for the Directory. If not specified and searchcontexts=no in voicemail.conf, then default will be assumed.

dial-context

This is the dialplan context to use when looking for an extension that the user has selected, or when jumping to the o or a extension.

options
e

In addition to the name, also read the extension number to the caller before presenting dialing options.

f

Allow the caller to enter the first name of a user in the directory instead of using the last name. If specified, the optional number argument will be used for the number of characters the user should enter.

l

Allow the caller to enter the last name of a user in the directory. This is the default. If specified, the optional number argument will be used for the number of characters the user should enter.

b

Allow the caller to enter either the first or the last name of a user in the directory. If specified, the optional number argument will be used for the number of characters the user should enter.

m

Instead of reading each name sequentially and asking for confirmation, create a menu of up to 8 names.

p

Pause for n milliseconds after the digits are typed. This is helpful for people with cellphones, who are not holding the receiver to their ear while entering DTMF.

Only one of the f, l, or b options may be specified. If more than one is specified, then Directory will act as if b was specified. The number of characters for the user to type defaults to 3.

Description

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.

DISA

Synopsis

Direct Inward System Access.

Syntax

DISA(passcode|filename[,context[,cid[,mailbox[,options]]]])

Arguments

passcode|filename

If you need to present a DISA dialtone without entering a password, simply set passcode to no-password

You may specified a filename instead of a passcode, this filename must contain individual passcodes

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 disa context. Presumably a normal system will have a special context set up for DISA use with some or a lot of restrictions.

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
n

The DISA application will not answer initially.

p

The extension entered will be considered complete when a # is entered.

Description

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 ;.

See also

Authenticate application
VMAuthenticate application

DumpChan

Synopsis

Dump Info About The Calling Channel.

Syntax

DumpChan([level])

Arguments

level

Minimun verbose level

Description

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.

See also

NoOp application
Verbose application

Echo

Synopsis

Echo audio, video, DTMF back to the calling party

Syntax

Echo()

Arguments

Description

Echos back any audio, video or DTMF frames read from the calling channel back to itself. Note: If '#' detected application exits

Exec

Synopsis

Executes dialplan application.

Syntax

Exec(appname)

Arguments

appname

Application name and arguments of the dialplan application to execute.

Description

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.

TryExec

Synopsis

Executes dialplan application, always returning.

Syntax

TryExec(appname)

Arguments

appname (no description)

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.

ExecIf

Synopsis

Executes dialplan application, conditionally.

Syntax

ExecIf(expression,execapp)

Arguments

expression (no description)
execapp (no description)

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.

SendFAX

Synopsis

Send a Fax

Syntax

SendFAX(filename[,a])

Arguments

filename

Filename of TIFF file to fax

a

Makes the application behave as the answering machine

(Default behavior is as calling machine)

Description

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

ReceiveFAX

Synopsis

Receive a Fax

Syntax

ReceiveFAX(filename[,c])

Arguments

filename

Filename of TIFF file save incoming fax

c

Makes the application behave as the calling machine

(Default behavior is as answering machine)

Description

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

Festival

Synopsis

Say text to the user.

Syntax

Festival(text[,intkeys])

Arguments

text (no description)
intkeys (no description)

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

Synopsis

Flashes a DAHDI Trunk.

Syntax

Flash()

Arguments

Description

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.

See also

SendDTMF application

FollowMe

Synopsis

Find-Me/Follow-Me application.

Syntax

FollowMe(followmeid[,options])

Arguments

followmeid (no description)
options
s

Playback the incoming status message prior to starting the follow-me step(s)

a

Record the caller's name so it can be announced to the callee on each step.

n

Playback the unreachable status message if we've run out of steps to reach the or the callee has elected not to be reachable.

Description

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

Synopsis

Forks the Call Data Record.

Syntax

ForkCDR([options])

Arguments

options
a

Update the answer time on the NEW CDR just after it's been inited. The new CDR may have been answered already. The reset that forkcdr does will erase the answer time. This will bring it back, but the answer time will be a copy of the fork/start time. It will only do this if the initial cdr was indeed already answered.

A

Lock the original CDR against the answer time being updated. This will allow the disposition on the original CDR to remain the same.

d

Copy the disposition forward from the old cdr, after the init.

D

Clear the dstchannel on the new CDR after reset.

e

End the original CDR. Do this after all the neccessry data is copied from the original CDR to the new forked CDR.

r

Do NOT reset the new cdr.

s(name=val)

Set the CDR var name in the original CDR, with value val.

T

Mark the original CDR with a DONT_TOUCH flag. setvar, answer, and end cdr funcs will obey this flag; normally they don't honor the LOCKED flag set on the original CDR record.

Using this flag may cause CDR's not to have their end times updated! It is suggested that if you specify this flag, you might wish to use the e flag as well!.

v

When the new CDR is forked, it gets a copy of the vars attached to the current CDR. The vars attached to the original CDR are removed unless this option is specified.

Description

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.

See also

CDR function
NoCDR application
ResetCDR application

GetCPEID

Synopsis

Get ADSI CPE ID.

Syntax

GetCPEID()

Arguments

Description

Obtains and displays ADSI CPE ID and other information in order to properly setup dahdi.conf for on-hook operations.

ICES

Synopsis

Encode and stream using 'ices'.

Syntax

ICES(config)

Arguments

config

ICES configuration file.

Description

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.

SendImage

Synopsis

Sends an image file.

Syntax

SendImage(filename)

Arguments

filename

Path of the filename (image) to send.

Description

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.

See also

SendText application
SendURL application

IVRDemo

Synopsis

IVR Demo Application.

Syntax

IVRDemo(filename)

Arguments

filename (no description)

Description

This is a skeleton application that shows you the basic structure to create your own asterisk applications and demonstrates the IVR demo.

JACK

Synopsis

Jack Audio Connection Kit

Syntax

JACK([options])

Arguments

options
s

Connect to the specified jack server name

i

Connect the output port that gets created to the specified jack input port

o

Connect the input port that gets created to the specified jack output port

c

By default, Asterisk will use the channel name for the jack client name.

Use this option to specify a custom client name.

Description

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.

Macro

Synopsis

Macro Implementation.

Syntax

Macro(name[,args])

Arguments

name

The name of the macro

args (no description)

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.

See also

MacroExit application
Goto application
Gosub application

MacroIf

Synopsis

Conditional Macro implementation.

Syntax

MacroIf(expr,destination)

Arguments

expr (no description)
destination (no description)

Description

Executes macro defined in macroiftrue if expr is true (otherwise macroiffalse if provided)

Arguments and return values as in application Macro()

See also

GotoIf application
GosubIf application
IF function

MacroExclusive

Synopsis

Exclusive Macro Implementation.

Syntax

MacroExclusive(name[,arg1[,arg2]])

Arguments

name

The name of the macro

arg1 (no description)
arg2 (no description)

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()

See also

Macro application

MacroExit

Synopsis

Exit from Macro.

Syntax

MacroExit()

Arguments

Description

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.

See also

Macro application

MeetMe

Synopsis

MeetMe conference bridge.

Syntax

MeetMe([confno[,options[,pin]]])

Arguments

confno

The conference number

options
a

Set admin mode.

A

Set marked mode.

b

Run AGI script specified in MEETME_AGI_BACKGROUND Default: conf-background.agi.

This does not work with non-DAHDI channels in the same conference).

c

Announce user(s) count on joining a conference.

C

Continue in dialplan when kicked out of conference.

d

Dynamically add conference.

D

Dynamically add conference, prompting for a PIN.

e

Select an empty conference.

E

Select an empty pinless conference.

F

Pass DTMF through the conference.

i

Announce user join/leave with review.

I

Announce user join/leave without review.

l

Set listen only mode (Listen only, no talking).

m

Set initially muted.

M

Enable music on hold when the conference has a single caller. Optionally, specify a musiconhold class to use. If one is not provided, it will use the channel's currently set music class, or default.

o

Set talker optimization - treats talkers who aren't speaking as being muted, meaning (a) No encode is done on transmission and (b) Received audio that is not registered as talking is omitted causing no buildup in background noise.

p

Allow user to exit the conference by pressing # (default) or any of the defined keys. If keys contain * this will override option s. The key used is set to channel variable MEETME_EXIT_KEY.

P

Always prompt for the pin even if it is specified.

q

Quiet mode (don't play enter/leave sounds).

r

Record conference (records as MEETME_RECORDINGFILE using format MEETME_RECORDINGFORMAT. Default filename is meetme-conf-rec-${CONFNO}-${UNIQUEID} and the default format is wav.

s

Present menu (user or admin) when * is received (send to menu).

t

Set talk only mode. (Talk only, no listening).

T

Set talker detection (sent to manager interface and meetme list).

W

Wait until the marked user enters the conference.

x

Close the conference when last marked user exits

X

Allow user to exit the conference by entering a valid single digit extension MEETME_EXIT_CONTEXT or the current context if that variable is not defined.

1

Do not play message when first person enters

S

Kick the user x seconds after he entered into the conference.

L

Limit the conference to x ms. Play a warning when y ms are left. Repeat the warning every z ms. The following special variables can be used with this option:

CONF_LIMIT_TIMEOUT_FILE

File to play when time is up.

CONF_LIMIT_WARNING_FILE

File to play as warning if y is defined. The default is to say the time remaining.

pin (no description)

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.

See also

MeetMeCount application
MeetMeAdmin application
MeetMeChannelAdmin application

MeetMeCount

Synopsis

MeetMe participant count.

Syntax

MeetMeCount(confno[,var])

Arguments

confno

Conference number.

var (no description)

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.

See also

MeetMe application

MeetMeAdmin

Synopsis

MeetMe conference administration.

Syntax

MeetMeAdmin(confno,command[,user])

Arguments

confno (no description)
command
e

Eject last user that joined.

E

Extend conference end time, if scheduled.

k

Kick one user out of conference.

K

Kick all users out of conference.

l

Unlock conference.

L

Lock conference.

m

Unmute one user.

M

Mute one user.

n

Unmute all users in the conference.

N

Mute all non-admin users in the conference.

r

Reset one user's volume settings.

R

Reset all users volume settings.

s

Lower entire conference speaking volume.

S

Raise entire conference speaking volume.

t

Lower one user's talk volume.

T

Raise one user's talk volume.

u

Lower one user's listen volume.

U

Raise one user's listen volume.

v

Lower entire conference listening volume.

V

Raise entire conference listening volume.

user (no description)

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.

See also

MeetMe application

MeetMeChannelAdmin

Synopsis

MeetMe conference Administration (channel specific).

Syntax

MeetMeChannelAdmin(channel,command)

Arguments

channel (no description)
command
k

Kick the specified user out of the conference he is in.

m

Unmute the specified user.

M

Mute the specified user.

Description

Run admin command for a specific channel in any coference.

SLAStation

Synopsis

Shared Line Appearance Station.

Syntax

SLAStation(station)

Arguments

station

Station name

Description

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

Synopsis

Shared Line Appearance Trunk.

Syntax

SLATrunk(trunk[,options])

Arguments

trunk

Trunk name

options
M

Play back the specified MOH class instead of ringing

Description

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

Milliwatt

Synopsis

Generate a Constant 1004Hz tone at 0dbm (mu-law).

Syntax

Milliwatt([options])

Arguments

options
o

Generate the tone at 1000Hz like previous version.

Description

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.

MinivmRecord

Synopsis

Receive Mini-Voicemail and forward via e-mail.

Syntax

MinivmRecord(mailbox[,options])

Arguments

mailbox

Voicemail username

Voicemail domain

options
0

Jump to the o extension in the current dialplan context.

*

Jump to the a extension in the current dialplan context.

g

Amount of gain to use

Use the specified amount of gain when recording the voicemail message. The units are whole-number decibels (dB).

Description

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

MinivmGreet

Synopsis

Play Mini-Voicemail prompts.

Syntax

MinivmGreet(mailbox[,options])

Arguments

mailbox

Voicemail username

Voicemail domain

options
b

Play the busy greeting to the calling party.

s

Skip the playback of instructions for leaving a message to the calling party.

u

Play the unavailable greeting.

Description

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

MinivmNotify

Synopsis

Notify voicemail owner about new messages.

Syntax

MinivmNotify(mailbox[,options])

Arguments

mailbox

Voicemail username

Voicemail domain

options
template

E-mail template to use for voicemail notification

Description

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

MinivmDelete

Synopsis

Delete Mini-Voicemail voicemail messages.

Syntax

MinivmDelete(filename)

Arguments

filename

File to delete

Description

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

MinivmAccMess

Synopsis

Record account specific messages.

Syntax

MinivmAccMess(mailbox[,options])

Arguments

mailbox

Voicemail username

Voicemail domain

options
u

Record the unavailable greeting.

b

Record the busy greeting.

t

Record the temporary greeting.

n

Account name.

Description

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.

FAILED is set if the file can't be created.

SUCCESS

FAILED

MinivmMWI

Synopsis

Send Message Waiting Notification to subscriber(s) of mailbox.

Syntax

MinivmMWI(mailbox,urgent,new,old)

Arguments

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.

Description

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.

MixMonitor

Synopsis

Record a call and mix the audio during the recording.

Syntax

MixMonitor(file[,options[,command]])

Arguments

file

If filename is an absolute path, uses that path, otherwise creates the file in the configured monitoring directory from asterisk.conf.

options
a

Append to the file instead of overwriting it.

b

Only save audio to the file while the channel is bridged.

Does not include conferences or sounds played to each bridged party

If you utilize this option inside a Local channel, you must make sure the Local channel is not optimized away. To do this, be sure to call your Local channel with the /n option. For example: Dial(Local/start@mycontext/n)

v

Adjust the heard volume by a factor of x (range -4 to 4)

V

Adjust the spoken volume by a factor of x (range -4 to 4)

W

Adjust both, heard and spoken volumes by a factor of x (range -4 to 4)

command

Will be executed when the recording is over.

Any strings matching ^{X} will be unescaped to X.

All variables will be evaluated at the time MixMonitor is called.

Description

Records the audio on the current channel to the specified file.

MIXMONITOR_FILENAME

Will contain the filename used to record.

See also

Monitor application
StopMixMonitor application
PauseMonitor application
UnpauseMonitor application

StopMixMonitor

Synopsis

Stop recording a call through MixMonitor.

Syntax

StopMixMonitor()

Arguments

Description

Stops the audio recording that was started with a call to MixMonitor() on the current channel.

See also

MixMonitor application

Morsecode

Synopsis

Plays morse code.

Syntax

Morsecode(string)

Arguments

string

String to playback as morse code to channel

Description

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

See also

SayAlpha application
SayPhonetic application

MP3Player

Synopsis

Play an MP3 file or stream.

Syntax

MP3Player(Location)

Arguments

Location

Location of the file to be played. (argument passed to mpg123)

Description

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.

NBScat

Synopsis

Play an NBS local stream.

Syntax

NBScat()

Arguments

Description

Executes nbscat to listen to the local NBS stream. User can exit by pressing any key.

Originate

Synopsis

Originate a call.

Syntax

Originate(tech_data,type,arg1[,arg2[,arg3]])

Arguments

tech_data

Channel technology and data for creating the outbound channel. For example, SIP/1234.

type

This should be app or exten, depending on whether the outbound channel should be connected to an application or extension.

arg1

If the type is app, then this is the application name. If the type is exten, then this is the context that the channel will be sent to.

arg2

If the type is app, then this is the data passed as arguments to the application. If the type is exten, then this is the extension that the channel will be sent to.

arg3

If the type is exten, then this is the priority that the channel is sent to. If the type is app, then this parameter is ignored.

Description

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

Synopsis

Page series of phones

Syntax

Page(Technology/Resource[,options[,timeout]])

Arguments

Technology/Resource

Specification of the device(s) to dial. These must be in the format of Technology/Resource, where Technology represents a particular channel driver, and Resource represents a resource available to that particular channel driver.

Optional extra devices to dial inparallel

If you need more then one enter them as Technology2/Resource2& Technology3/Resourse3&.....

options
d

Full duplex audio

i

Ignore attempts to forward the call

q

Quiet, do not play beep to caller

r

Record the page into a file (meetme option r)

s

Only dial a channel if its device state says that it is NOT_INUSE

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.

Description

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.

See also

MeetMe application

ParkAndAnnounce

Synopsis

Park and Announce.

Syntax

ParkAndAnnounce(announce_template,timeout,dial[,return_context])

Arguments

announce_template

Colon-separated list of files to announce. The word PARKED will be replaced by a say_digits of the extension in which the call is parked.

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 priority+1.

Description

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.

See also

Park application
ParkedCall application

Playback

Synopsis

Play a file.

Syntax

Playback(filenames[,options])

Arguments

filenames (no description)
options

Comma separated list of options

skip

Do not play if not answered

noanswer

Playback without answering, otherwise the channel will be answered before the sound is played.

Not all channel types support playing messages while still on hook.

Description

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

PlayTones

Synopsis

Play a tone list.

Syntax

PlayTones(arg)

Arguments

arg

Arg is either the tone name defined in the indications.conf configuration file, or a directly specified list of frequencies and durations.

Description

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.

See also

StopPlayTones application

StopPlayTones

Synopsis

Stop playing a tone list.

Syntax

StopPlayTones()

Arguments

Description

Stop playing a tone list, initiated by PlayTones().

See also

PlayTones application

PrivacyManager

Synopsis

Require phone number to be entered, if no CallerID sent

Syntax

PrivacyManager([maxretries[,minlength[,context]]])

Arguments

maxretries

Total tries caller is allowed to input a callerid. Defaults to 3.

minlength

Minimum allowable digits in the input callerid number. Defaults to 10.

context

Context to check the given callerid against patterns.

Description

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

See also

Zapateller application

Queue

Synopsis

Queue a call for a call queue.

Syntax

Queue(queuename[,options[,URL[,announceoverride[,timeout[,AGI[,macro[,gosub[,rule[,position]]]]]]]]])

Arguments

queuename (no description)
options
C

Mark all calls as "answered elsewhere" when cancelled.

c

Continue in the dialplan if the callee hangs up.

d

data-quality (modem) call (minimum delay).

h

Allow callee to hang up by pressing *.

H

Allow caller to hang up by pressing *.

n

No retries on the timeout; will exit this application and go to the next step.

i

Ignore call forward requests from queue members and do nothing when they are requested.

I

Asterisk will ignore any connected line update requests or any redirecting party update requests it may receive on this dial attempt.

r

Ring instead of playing MOH. Periodic Announcements are still made, if applicable.

t

Allow the called user to transfer the calling user.

T

Allow the calling user to transfer the call.

w

Allow the called user to write the conversation to disk via Monitor.

W

Allow the calling user to write the conversation to disk via Monitor.

k

Allow the called party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf.

K

Allow the calling party to enable parking of the call by sending the DTMF sequence defined for call parking in features.conf.

x

Allow the called user to write the conversation to disk via MixMonitor.

X

Allow the calling user to write the conversation to disk via MixMonitor.

URL

URL will be sent to the called party if the channel supports it.

announceoverride (no description)
timeout

Will cause the queue to fail out after a specified number of seconds, checked between each queues.conftimeout and retry cycle.

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. 1 would attempt to enter the caller at the head of the queue, and 3 would attempt to place the caller third in the queue.

Description

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

See also

AddQueueMember application
RemoveQueueMember application
PauseQueueMember application
UnpauseQueueMember application
AgentLogin application
QUEUE_MEMBER_COUNT function
QUEUE_MEMBER_LIST function
QUEUE_WAITING_COUNT function

AddQueueMember

Synopsis

Dynamically adds queue members.

Syntax

AddQueueMember(queuename[,interface[,penalty[,options[,membername[,stateinterface]]]]])

Arguments

queuename (no description)
interface (no description)
penalty (no description)
options (no description)
membername (no description)
stateinterface (no description)

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

See also

RemoveQueueMember application
PauseQueueMember application
UnpauseQueueMember application
AgentLogin application

RemoveQueueMember

Synopsis

Dynamically removes queue members.

Syntax

RemoveQueueMember(queuename[,interface[,options]])

Arguments

queuename (no description)
interface (no description)
options (no description)

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)

See also

Queue application
AddQueueMember application
PauseQueueMember application
UnpauseQueueMember application

PauseQueueMember

Synopsis

Pauses a queue member.

Syntax

PauseQueueMember([queuename,interface[,options[,reason]]])

Arguments

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.

Description

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)

See also

UnpauseQueueMember application

UnpauseQueueMember

Synopsis

Unpauses a queue member.

Syntax

UnpauseQueueMember([queuename,interface[,options[,reason]]])

Arguments

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.

Description

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)

See also

PauseQueueMember application

QueueLog

Synopsis

Writes to the queue_log file.

Syntax

QueueLog(queuename,uniqueid,agent,event[,additionalinfo])

Arguments

queuename (no description)
uniqueid (no description)
agent (no description)
event (no description)
additionalinfo (no description)

Description

Allows you to write your own events into the queue log.

Example: QueueLog(101,${UNIQUEID},${AGENT},WENTONBREAK,600)

See also

Queue application

Read

Synopsis

Read a variable.

Syntax

Read(variable[,filenames[,maxdigits[,options[,attempts[,timeout]]]]])

Arguments

variable

The input digits will be stored in the given variable name.

filenames

file(s) to play before reading digits or tone with option i

maxdigits

Maximum acceptable number of digits. Stops reading after maxdigits have been entered (without requiring the user to press the # key).

Defaults to 0 - no limit - wait for the user press the # key. Any value below 0 means the same. Max accepted value is 255.

options
s

to return immediately if the line is not up.

i

to play filename as an indication tone from your indications.conf.

n

to read digits even if the line is not up.

attempts

If greater than 1, that many attempts will be made in the event no data is entered.

timeout

The number of seconds to wait for a digit response. If greater than 0, that value will override the default timeout. Can be floating point.

Description

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

See also

SendDTMF application

ReadExten

Synopsis

Read an extension into a variable.

Syntax

ReadExten(variable[,filename[,context[,option[,timeout]]]])

Arguments

variable (no description)
filename

File to play before reading digits or tone with option i

context

Context in which to match extensions.

option
s

Return immediately if the channel is not answered.

i

Play filename as an indication tone from your indications.conf

n

Read digits even if the channel is not answered.

timeout

An integer number of seconds to wait for a digit response. If greater than 0, that value will override the default timeout.

Description

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

Synopsis

Read the contents of a text file into a channel variable.

Syntax

ReadFile(varname,fileparams)

Arguments

varname

Result stored here.

fileparams

The name of the file to read.

Maximum number of characters to capture.

If not specified defaults to max.

Description

Read the contents of a text file into channel variable varname

ReadFile has been deprecated in favor of Set(varname=${FILE(file,0,length)})

See also

System application
Read application

Record

Synopsis

Record to a file.

Syntax

Record(filename[,silence[,maxduration[,options]]])

Arguments

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
a

Append to existing recording rather than replacing.

n

Do not answer, but record anyway if line not yet answered.

q

quiet (do not play a beep tone).

s

skip recording if the line is not yet answered.

t

use alternate '*' terminator key (DTMF) instead of default '#'

x

Ignore all terminator keys (DTMF) and keep recording until hangup.

k

Keep recording if channel hangs up.

Description

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.

SayUnixTime

Synopsis

Says a specified time in a custom format.

Syntax

SayUnixTime([unixtime[,timezone[,format]]])

Arguments

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 ABdY "digits/at" IMp

Description

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.

See also

STRFTIME function
STRPTIME function
IFTIME function

DateTime

Synopsis

Says a specified time in a custom format.

Syntax

DateTime([unixtime[,timezone[,format]]])

Arguments

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 ABdY "digits/at" IMp

Description

Say the date and time in a specified format.

SendDTMF

Synopsis

Sends arbitrary DTMF digits

Syntax

SendDTMF(digits[,timeout_ms[,duration_ms]])

Arguments

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

Description

DTMF digits sent to a channel with half second pause

It will pass all digits or terminate if it encounters an error.

See also

Read application

SendText

Synopsis

Send a Text Message.

Syntax

SendText(text)

Arguments

text (no description)

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.

See also

SendImage application
SendURL application

SetCallerPres

Synopsis

Set CallerID Presentation.

Syntax

SetCallerPres(presentation)

Arguments

presentation

Presentation Allowed, Not Screened.

Presentation Allowed, Passed Screen.

Presentation Allowed, Failed Screen.

Presentation Allowed, Network Number.

Presentation Prohibited, Not Screened.

Presentation Prohibited, Passed Screen.

Presentation Prohibited, Failed Screen.

Presentation Prohibited, Network Number.

Number Unavailable.

Description

Set Caller*ID presentation on a call.

Skel

Synopsis

Simple one line explaination.

Syntax

Skel(dummy[,options])

Arguments

dummy (no description)
options
a

Option A.

b

Option B.

c

Option C.

Description

This application is a template to build other applications from. It shows you the basic structure to create your own Asterisk applications.

SMS

Synopsis

Communicates with SMS service centres and SMS capable analogue phones.

Syntax

SMS(name[,options[,addr[,body]]])

Arguments

name

The name of the queue used in /var/spool/asterisk/sms

options
a

Answer, i.e. send initial FSK packet.

s

Act as service centre talking to a phone.

t

Use protocol 2 (default used is protocol 1).

p

Set the initial delay to N ms (default is 300). addr and body are a deprecated format to send messages out.

r

Set the Status Report Request (SRR) bit.

o

The body should be coded as octets not 7-bit symbols.

addr (no description)
body (no description)

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.

SoftHangup

Synopsis

Hangs up the requested channel.

Syntax

SoftHangup(Technology/Resource[,options])

Arguments

Technology/Resource (no description)
options
a

Hang up all channels on a specified device instead of a single resource

Description

Hangs up the requested channel. If there are no channels to hangup, the application will report it.

SpeechCreate

Synopsis

Create a Speech Structure.

Syntax

SpeechCreate(engine_name)

Arguments

engine_name (no description)

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.

SpeechActivateGrammar

Synopsis

Activate a grammar.

Syntax

SpeechActivateGrammar(grammar_name)

Arguments

grammar_name (no description)

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.

SpeechStart

Synopsis

Start recognizing voice in the audio stream.

Syntax

SpeechStart()

Arguments

Description

Tell the speech recognition engine that it should start trying to get results from audio being fed to it.

SpeechBackground

Synopsis

Play a sound file and wait for speech to be recognized.

Syntax

SpeechBackground(sound_file[,timeout[,options]])

Arguments

sound_file (no description)
timeout

Timeout integer in seconds. Note the timeout will only start once the sound file has stopped playing.

options
n

Don't answer the channel if it has not already been answered.

Description

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.

SpeechDeactivateGrammar

Synopsis

Deactivate a grammar.

Syntax

SpeechDeactivateGrammar(grammar_name)

Arguments

grammar_name

The grammar name to deactivate

Description

This deactivates the specified grammar so that it is no longer recognized.

SpeechProcessingSound

Synopsis

Change background processing sound.

Syntax

SpeechProcessingSound(sound_file)

Arguments

sound_file (no description)

Description

This changes the processing sound that SpeechBackground plays back when the speech recognition engine is processing and working to get results.

SpeechDestroy

Synopsis

End speech recognition.

Syntax

SpeechDestroy()

Arguments

Description

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

Synopsis

Load a grammar.

Syntax

SpeechLoadGrammar(grammar_name,path)

Arguments

grammar_name (no description)
path (no description)

Description

Load a grammar only on the channel, not globally.

SpeechUnloadGrammar

Synopsis

Unload a grammar.

Syntax

SpeechUnloadGrammar(grammar_name)

Arguments

grammar_name (no description)

Description

Unload a grammar.

Gosub

Synopsis

Jump to label, saving return address.

Syntax

Gosub([[context,]exten,]priority)

Arguments

context (no description)
exten (no description)
priority (no description)

Description

Jumps to the label specified, saving the return address.

See also

GosubIf application
Macro application
Goto application
Return application
StackPop application

GosubIf

Synopsis

Conditionally jump to label, saving return address.

Syntax

GosubIf(condition,destination)

Arguments

condition (no description)
destination (no description)

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.

See also

Gosub application
Return application
MacroIf application
IF function
GotoIf application

Return

Synopsis

Return from gosub routine.

Syntax

Return([value])

Arguments

value

Return value.

Description

Jumps to the last label on the stack, removing it. The return value, if any, is saved in the channel variable GOSUB_RETVAL.

See also

Gosub application
StackPop application

StackPop

Synopsis

Remove one address from gosub stack.

Syntax

StackPop()

Arguments

Description

Removes last label on the stack, discarding it.

See also

Return application
Gosub application

System

Synopsis

Execute a system command.

Syntax

System(command)

Arguments

command

Command to execute

Description

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.

TrySystem

Synopsis

Try executing a system command.

Syntax

TrySystem(command)

Arguments

command

Command to execute

Description

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.

BackgroundDetect

Synopsis

Background a file with talk detect.

Syntax

BackgroundDetect(filename[,sil[,min[,max[,analysistime]]]])

Arguments

filename (no description)
sil

If not specified, defaults to 1000.

min

If not specified, defaults to 100.

max

If not specified, defaults to infinity.

analysistime

If not specified, defaults to infinity.

Description

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.

TestServer

Synopsis

Execute Interface Test Server.

Syntax

TestServer()

Arguments

Description

Perform test server function and write call report. Results stored in /var/log/asterisk/testreports/<testid>-server.txt

See also

TestClient application

TestClient

Synopsis

Execute Interface Test Client.

Syntax

TestClient(testid)

Arguments

testid

An ID to identify this test.

Description

Executes test client with given testid. Results stored in /var/log/asterisk/testreports/<testid>-client.txt

See also

TestServer application

Transfer

Synopsis

Transfer caller to remote extension.

Syntax

Transfer(dest)

Arguments

dest (no description)

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.

SendURL

Synopsis

Send a URL.

Syntax

SendURL(URL[,option])

Arguments

URL (no description)
option
w

Execution will wait for an acknowledgement that the URL has been loaded before continuing.

Description

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.

See also

SendImage application
SendText application

UserEvent

Synopsis

Send an arbitrary event to the manager interface.

Syntax

UserEvent(eventname[,body])

Arguments

eventname (no description)
body (no description)

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.

Verbose

Synopsis

Send arbitrary text to verbose output.

Syntax

Verbose([level,]message)

Arguments

level

Must be an integer value. If not specified, defaults to 0.

message

Output text message.

Description

Sends an arbitrary text message to verbose output.

Log

Synopsis

Send arbitrary text to a selected log level.

Syntax

Log([level,]message)

Arguments

level

Level must be one of ERROR, WARNING, NOTICE, DEBUG, VERBOSE or DTMF.

message

Output text message.

Description

Sends an arbitrary text message to a selected log level.

VoiceMail

Synopsis

Leave a Voicemail message.

Syntax

VoiceMail(mailboxs[,options])

Arguments

mailboxs (no description)
options
b

Play the busy greeting to the calling party.

d

Accept digits for a new extension in context c, if played during the greeting. Context defaults to the current context.

g

Use the specified amount of gain when recording the voicemail message. The units are whole-number decibels (dB). Only works on supported technologies, which is DAHDI only.

s

Skip the playback of instructions for leaving a message to the calling party.

u

Play the unavailable greeting.

U

Mark message as URGENT.

P

Mark message as PRIORITY.

Description

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:

Jump to the o extension in the current dialplan context.

Jump to the a extension in the current dialplan context.

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

Synopsis

Check Voicemail messages.

Syntax

VoiceMailMain(mailbox[,options])

Arguments

mailbox (no description)
options
p

Consider the mailbox parameter as a prefix to the mailbox that is entered by the caller.

g

Use the specified amount of gain when recording a voicemail message. The units are whole-number decibels (dB).

s

Skip checking the passcode for the mailbox.

a

Skip folder prompt and go directly to folder specified. Defaults to INBOX.

Description

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.

MailboxExists

Synopsis

Check to see if Voicemail mailbox exists.

Syntax

MailboxExists(mailbox[,options])

Arguments

mailbox (no description)
options

None options.

Description

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

VMAuthenticate

Synopsis

Authenticate with Voicemail passwords.

Syntax

VMAuthenticate(mailbox[,options])

Arguments

mailbox (no description)
options
s

Skip playing the initial prompts.

Description

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.

WaitForRing

Synopsis

Wait for Ring Application.

Syntax

WaitForRing(timeout)

Arguments

timeout (no description)

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

Synopsis

Waits for a specified amount of silence.

Syntax

WaitForSilence(silencerequired[,iterations[,timeout]])

Arguments

silencerequired (no description)
iterations

If not specified, defaults to 1.

timeout

Is specified only to avoid an infinite loop in cases where silence is never achieved.

Description

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.

See also

WaitForNoise application

WaitForNoise

Synopsis

Waits for a specified amount of noise.

Syntax

WaitForNoise(noiserequired[,iterations[,timeout]])

Arguments

noiserequired (no description)
iterations

If not specified, defaults to 1.

timeout

Is specified only to avoid an infinite loop in cases where silence is never achieved.

Description

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.

See also

WaitForSilence application

WaitUntil

Synopsis

Wait (sleep) until the current time is the given epoch.

Syntax

WaitUntil(epoch)

Arguments

epoch (no description)

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

Synopsis

Start a while loop.

Syntax

While(expr)

Arguments

expr (no description)

Description

Start a While Loop. Execution will return to this point when EndWhile() is called until expr is no longer true.

See also

EndWhile application
ExitWhile application
ContinueWhile application

EndWhile

Synopsis

End a while loop.

Syntax

EndWhile()

Arguments

Description

Return to the previous called While().

See also

While application
ExitWhile application
ContinueWhile application

ExitWhile

Synopsis

End a While loop.

Syntax

ExitWhile()

Arguments

Description

Exits a While() loop, whether or not the conditional has been satisfied.

See also

While application
EndWhile application
ContinueWhile application

ContinueWhile

Synopsis

Restart a While loop.

Syntax

ContinueWhile()

Arguments

Description

Returns to the top of the while loop and re-evaluates the conditional.

See also

While application
EndWhile application
ExitWhile application

Zapateller

Synopsis

Block telemarketers with SIT.

Syntax

Zapateller(options)

Arguments

options

Comma delimited list of options.

answer

Causes the line to be answered before playing the tone.

nocallerid

Causes Zapateller to only play the tone if there is no callerid information available.

Description

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

ODBCFinish

Synopsis

Clear the resultset of a sucessful multirow query.

Syntax

ODBCFinish(result-id)

Arguments

result-id (no description)

Description

For queries which are marked as mode=multirow, this will clear any remaining rows of the specified resultset.

ClearHash

Synopsis

Clear the keys from a specified hashname.

Syntax

ClearHash(hashname)

Arguments

hashname (no description)

Description

Clears all keys out of the specified hashname.

Bridge

Synopsis

Bridge two channels.

Syntax

Bridge(channel[,options])

Arguments

channel

The current channel is bridged to the specified channel.

options
p

Play a courtesy tone to channel.

Description

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

ParkedCall

Synopsis

Answer a parked call.

Syntax

ParkedCall(exten)

Arguments

exten (no description)

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.

See also

Park application
ParkAndAnnounce application

Park

Synopsis

Park yourself.

Syntax

Park([timeout[,return_context[,return_exten[,return_priority[,options]]]]])

Arguments

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.

r

Send ringing instead of MOH to the parked call.

R

Randomize the selection of a parking space.

s

Silence announcement of the parking space number.

Description

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.

See also

ParkAndAnnounce application
ParkedCall application

Answer

Synopsis

Answer a channel if ringing.

Syntax

Answer([delay[,nocdr]])

Arguments

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.

Description

If the call has not been answered, this application will answer it. Otherwise, it has no effect on the call.

See also

Hangup application

BackGround

Synopsis

Play an audio file while waiting for digits of an extension to go to.

Syntax

BackGround(filenames[,options[,langoverride[,context]]])

Arguments

filenames (no description)
options
s

Causes the playback of the message to be skipped if the channel is not in the up state (i.e. it hasn't been answered yet). If this happens, the application will return immediately.

n

Don't answer the channel before playing the files.

m

Only break if a digit hit matches a one digit extension in the destination context.

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.

Description

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

See also

ControlPlayback application
WaitExten application
BackgroundDetect application
TIMEOUT function

Busy

Synopsis

Indicate the Busy condition.

Syntax

Busy([timeout])

Arguments

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.

Description

This application will indicate the busy condition to the calling channel.

See also

Congestion application
Progess application
Playtones application
Hangup application

Congestion

Synopsis

Indicate the Congestion condition.

Syntax

Congestion([timeout])

Arguments

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.

Description

This application will indicate the congestion condition to the calling channel.

See also

Busy application
Progess application
Playtones application
Hangup application

ExecIfTime

Synopsis

Conditional application execution based on the current time.

Syntax

ExecIfTime(day_condition,appname)

Arguments

day_condition (no description)
appname (no description)

Description

This application will execute the specified dialplan application, with optional arguments, if the current time matches the given time specification.

See also

Exec application
TryExec application

Goto

Synopsis

Jump to a particular priority, extension, or context.

Syntax

Goto([[context,]extensions,]priority)

Arguments

context (no description)
extensions (no description)
priority (no description)

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!

See also

GotoIf application
GotoIfTime application
Gosub application
Macro application

GotoIf

Synopsis

Conditional goto.

Syntax

GotoIf(condition,destination)

Arguments

condition (no description)
destination

Continue at labeliftrue if the condition is true.

Continue at labeliffalse if the condition is false.

Description

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!.

See also

Goto application
GotoIfTime application
GosubIf application
MacroIf application

GotoIfTime

Synopsis

Conditional Goto based on the current time.

Syntax

GotoIfTime(condition,destination)

Arguments

condition (no description)
destination (no description)

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.

See also

GotoIf application
IFTIME function

ImportVar

Synopsis

Import a variable from a channel into a new variable.

Syntax

ImportVar(newvar,vardata)

Arguments

newvar (no description)
vardata (no description)

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.

See also

Set application

Hangup

Synopsis

Hang up the calling channel.

Syntax

Hangup([causecode])

Arguments

causecode

If a causecode is given the channel's hangup cause will be set to the given value.

Description

This application will hang up the calling channel.

See also

Answer application
Busy application
Congestion application

Incomplete

Synopsis

Returns AST_PBX_INCOMPLETE value.

Syntax

Incomplete([n])

Arguments

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.

Description

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.

NoOp

Synopsis

Do Nothing (No Operation).

Syntax

NoOp([text])

Arguments

text

Any text provided can be viewed at the Asterisk CLI.

Description

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.

See also

Verbose application
Log application

Proceeding

Synopsis

Indicate proceeding.

Syntax

Proceeding()

Arguments

Description

This application will request that a proceeding message be provided to the calling channel.

Progress

Synopsis

Indicate progress.

Syntax

Progress()

Arguments

Description

This application will request that in-band progress information be provided to the calling channel.

See also

Busy application
Congestion application
Ringing application
Playtones application

RaiseException

Synopsis

Handle an exceptional condition.

Syntax

RaiseException(reason)

Arguments

reason (no description)

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.

See also

Exception function

ResetCDR

Synopsis

Resets the Call Data Record.

Syntax

ResetCDR([options])

Arguments

options
w

Store the current CDR record before resetting it.

a

Store any stacked records.

v

Save CDR variables.

e

Enable CDR only (negate effects of NoCDR).

Description

This application causes the Call Data Record to be reset.

See also

ForkCDR application
NoCDR application

Ringing

Synopsis

Indicate ringing tone.

Syntax

Ringing()

Arguments

Description

This application will request that the channel indicate a ringing tone to the user.

See also

Busy application
Congestion application
Progress application
Playtones application

SayAlpha

Synopsis

Say Alpha.

Syntax

SayAlpha(string)

Arguments

string (no description)

Description

This application will play the sounds that correspond to the letters of the given string.

See also

SayDigits application
SayNumber application
SayPhonetic application
CHANNEL function

SayDigits

Synopsis

Say Digits.

Syntax

SayDigits(digits)

Arguments

digits (no description)

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.

See also

SayAlpha application
SayNumber application
SayPhonetic application
CHANNEL function

SayNumber

Synopsis

Say Number.

Syntax

SayNumber(digits[,gender])

Arguments

digits (no description)
gender (no description)

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.

See also

SayAlpha application
SayDigits application
SayPhonetic application
CHANNEL function

SayPhonetic

Synopsis

Say Phonetic.

Syntax

SayPhonetic(string)

Arguments

string (no description)

Description

This application will play the sounds from the phonetic alphabet that correspond to the letters in the given string.

See also

SayAlpha application
SayDigits application
SayNumber application

Set

Synopsis

Set channel variable or function value.

Syntax

Set(name,value)

Arguments

name (no description)
value (no description)

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.

See also

MSet application
GLOBAL function
SET function
ENV function

MSet

Synopsis

Set channel variable(s) or function value(s).

Syntax

MSet(set1[,set2])

Arguments

set1 (no description)
set2 (no description)

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.

See also

Set application

SetAMAFlags

Synopsis

Set the AMA Flags.

Syntax

SetAMAFlags([flag])

Arguments

flag (no description)

Description

This application will set the channel's AMA Flags for billing purposes.

See also

CDR function

Wait

Synopsis

Waits for some time.

Syntax

Wait(seconds)

Arguments

seconds

Can be passed with fractions of a second. For example, 1.5 will ask the application to wait for 1.5 seconds.

Description

This application waits for a specified number of seconds.

WaitExten

Synopsis

Waits for an extension to be entered.

Syntax

WaitExten([seconds[,options]])

Arguments

seconds

Can be passed with fractions of a second. For example, 1.5 will ask the application to wait for 1.5 seconds.

options
m

Provide music on hold to the caller while waiting for an extension.

Specify the class for music on hold.

Description

This application waits for the user to enter a new extension for a specified number of seconds.

See also

Background application
TIMEOUT function

AGI

Synopsis

Executes an AGI compliant application.

Syntax

AGI(command[,args])

Arguments

command (no description)
args (no description)

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

See also

EAGI application
DeadAGI application

EAGI

Synopsis

Executes an EAGI compliant application.

Syntax

EAGI()

Arguments

Description

Using 'EAGI' provides enhanced AGI, with incoming audio available out of band on file descriptor 3.

See also

AGI application
DeadAGI application

DeadAGI

Synopsis

Executes AGI on a hungup channel.

Syntax

DeadAGI()

Arguments

Description

See also

AGI application
EAGI application

JabberSend

Synopsis

Send a Jabber Message

Syntax

JabberSend(Jabber,JID,Message)

Arguments

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.

Description

Allows user to send a message to a receipent via XMPP.

JabberStatus

Synopsis

Retrieve the status of a jabber list member

Syntax

JabberStatus(Jabber,JID,Variable)

Arguments

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.

Description

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 Variablewill be one of the following.

Online.

Chatty.

Away.

Extended Away.

Do Not Disturb.

Offline.

Not In Roster.

Monitor

Synopsis

Monitor a channel.

Syntax

Monitor([file_format[,fname_base[,options]]])

Arguments

file_format

optional, if not set, defaults to wav

fname_base

if set, changes the filename used to the one specified.

options
m

when the recording ends mix the two leg files into one and delete the two leg files. If the variable MONITOR_EXEC is set, the application referenced in it will be executed instead of soxmix/sox and the raw leg files will NOT be deleted automatically. soxmix/sox or MONITOR_EXEC is handed 3 arguments, the two leg files and a target mixed file name which is the same as the leg file names only without the in/out designator.

If MONITOR_EXEC_ARGS is set, the contents will be passed on as additional arguments to MONITOR_EXEC. Both MONITOR_EXEC and the Mix flag can be set from the administrator interface.

b

Don't begin recording unless a call is bridged to another channel.

i

Skip recording of input stream (disables m option).

o

Skip recording of output stream (disables m option).

Description

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.

See also

StopMonitor application

StopMonitor

Synopsis

Stop monitoring a channel.

Syntax

StopMonitor()

Arguments

Description

Stops monitoring a channel. Has no effect if the channel is not monitored.

ChangeMonitor

Synopsis

Change monitoring filename of a channel.

Syntax

ChangeMonitor(filename_base)

Arguments

filename_base

The new filename base to use for monitoring this channel.

Description

Changes monitoring filename of a channel. Has no effect if the channel is not monitored.

PauseMonitor

Synopsis

Pause monitoring of a channel.

Syntax

PauseMonitor()

Arguments

Description

Pauses monitoring of a channel until it is re-enabled by a call to UnpauseMonitor.

See also

UnpauseMonitor application

UnpauseMonitor

Synopsis

Unpause monitoring of a channel.

Syntax

UnpauseMonitor()

Arguments

Description

Unpauses monitoring of a channel on which monitoring had previously been paused with PauseMonitor.

See also

PauseMonitor application

ODBC_Commit

Synopsis

Commits a currently open database transaction.

Syntax

ODBC_Commit([transaction ID])

Arguments

transaction ID (no description)

Description

Commits the database transaction specified by transaction ID or the current active transaction, if not specified.

ODBC_Rollback

Synopsis

Rollback a currently open database transaction.

Syntax

ODBC_Rollback([transaction ID])

Arguments

transaction ID (no description)

Description

Rolls back the database transaction specified by transaction ID or the current active transaction, if not specified.

Functions

121 functions total

Function Synopsis
AGENT Gets information about an Agent
IAXPEER Gets IAX peer information.
IAXVAR Sets or retrieves a remote variable.
SIP_HEADER Gets the specified SIP header.
SIPPEER Gets SIP peer information.
SIPCHANINFO Gets the specified SIP parameter from the current channel.
CHECKSIPDOMAIN Checks if domain is a local domain.
QUEUE_VARIABLES Return Queue information in variables.
QUEUE_MEMBER Count number of members answering a queue.
QUEUE_MEMBER_COUNT Count number of members answering a queue.
QUEUE_WAITING_COUNT Count number of calls currently waiting in a queue.
QUEUE_MEMBER_LIST Returns a list of interfaces on a queue.
QUEUE_MEMBER_PENALTY Gets or sets queue members penalty.
VALID_EXTEN Determine whether an extension exists or not.
SPEECH_SCORE Gets the confidence score of a result.
SPEECH_TEXT Gets the recognized text of a result.
SPEECH_GRAMMAR Gets the matched grammar of a result if available.
SPEECH_ENGINE Change a speech engine specific attribute.
SPEECH_RESULTS_TYPE Sets the type of results that will be returned.
SPEECH Gets information about speech recognition results.
LOCAL Manage variables local to the gosub stack frame.
LOCAL_PEEK Retrieve variables hidden by the local gosub stack frame.
MAILBOX_EXISTS Tell if a mailbox is configured.
AES_ENCRYPT Encrypt a string with AES given a 16 character key.
AES_DECRYPT Decrypt a string encoded in base64 with AES given a 16 character key.
AUDIOHOOK_INHERIT Set whether an audiohook may be inherited to another channel
BASE64_ENCODE Encode a string in base64.
BASE64_DECODE Decode a base64 string.
BLACKLIST Check if the callerid is on the blacklist.
CALLERID Gets or sets Caller*ID data on the channel.
CALLERPRES Gets or sets Caller*ID presentation on the channel.
CDR Gets or sets a CDR variable.
CHANNELS Gets the list of channels, optionally filtering by a regular expression.
CHANNEL Gets/sets various pieces of information about the channel.
AST_CONFIG Retrieve a variable from a configuration file.
CONNECTEDLINE Gets or sets Connected Line data on the channel.
SORT Sorts a list of key/vals into a list of keys, based upon the vals.
CUT Slices and dices strings, based upon a named delimiter.
DB Read from or write to the Asterisk database.
DB_EXISTS Check to see if a key exists in the Asterisk database.
DB_DELETE Return a value from the database and delete it.
DEVICE_STATE Get or Set a device state.
HINT Get the devices set for a dialplan hint.
DIALGROUP Manages a group of users for dialing.
DIALPLAN_EXISTS Checks the existence of a dialplan target.
ENUMQUERY Initiate an ENUM query.
ENUMRESULT Retrieve results from a ENUMQUERY.
ENUMLOOKUP General or specific querying of NAPTR records for ENUM or ENUM-like DNS pointers.
TXTCIDNAME TXTCIDNAME looks up a caller name via DNS.
ENV Gets or sets the environment variable specified.
STAT Does a check on the specified file.
FILE Obtains the contents of a file.
EXTENSION_STATE Get an extension's state.
GLOBAL Gets or sets the global variable specified.
SHARED Gets or sets the shared variable specified.
GROUP_COUNT Counts the number of channels in the specified group.
GROUP_MATCH_COUNT Counts the number of channels in the groups matching the specified pattern.
GROUP Gets or sets the channel group.
GROUP_LIST Gets a list of the groups set on a channel.
ICONV Converts charsets of strings.
LOCK Attempt to obtain a named mutex.
TRYLOCK Attempt to obtain a named mutex.
UNLOCK Unlocks a named mutex.
ISNULL Check if a value is NULL.
SET SET assigns a value to a channel variable.
EXISTS Test the existence of a value.
IF Check for an expresion.
IFTIME Temporal Conditional.
IMPORT Retrieve the value of a variable from another channel.
MATH Performs Mathematical Functions.
INC Increments the value of a variable, while returning the updated value to the dialplan
DEC Decrements the value of a variable, while returning the updated value to the dialplan
MD5 Computes an MD5 digest.
IFMODULE Checks if an Asterisk module is loaded in memory.
ODBC_FETCH Fetch a row from a multirow query.
SQL_ESC Escapes single ticks for use in SQL statements.
RAND Choose a random number in a range.
REALTIME RealTime Read/Write Functions.
REALTIME_STORE RealTime Store Function.
REALTIME_DESTROY RealTime Destroy Function.
REALTIME_FIELD RealTime query function.
REALTIME_HASH RealTime query function.
REDIRECTING Gets or sets Redirecting data on the channel.
SHA1 Computes a SHA1 digest.
SHELL Executes a command as if you were at a shell.
AGC Apply automatic gain control to audio on a channel.
DENOISE Apply noise reduction to audio on a channel.
SPRINTF Format a variable according to a format string.
FIELDQTY Count the fields with an arbitrary delimiter
LISTFILTER Remove an item from a list, by name.
FILTER Filter the string to include only the allowed characters
REGEX Check string against a regular expression.
HASH Implementation of a dialplan associative array
HASHKEYS Retrieve the keys of the HASH() function.
KEYPADHASH Hash the letters in string into equivalent keypad numbers.
ARRAY Allows setting multiple variables at once.
STRPTIME Returns the epoch of the arbitrary date/time string structured as described by the format.
STRFTIME Returns the current date/time in the specified format.
EVAL Evaluate stored variables
TOUPPER Convert string to all uppercase letters.
TOLOWER Convert string to all lowercase letters.
LEN Return the length of the string given.
QUOTE Quotes a given string, escaping embedded quotes as necessary
SHIFT Removes and returns the first item off of a variable containing delimited text
POP Removes and returns the last item off of a variable containing delimited text
PUSH Appends one or more values to the end of a variable containing delimited text
UNSHIFT Inserts one or more values to the beginning of a variable containing delimited text
TIMEOUT Gets or sets timeouts on the channel. Timeout values are in seconds.
URIENCODE Encodes a string to URI-safe encoding according to RFC 2396.
URIDECODE Decodes a URI-encoded string according to RFC 2396.
VERSION Return the Version info for this Asterisk.
VMCOUNT Count the voicemails in a specified mailbox.
VOLUME Set the TX or RX volume of a channel.
EXCEPTION Retrieve the details of the current dialplan exception.
CALENDAR_BUSY Determine if the calendar is marked busy at this time.
CALENDAR_EVENT Get calendar event notification data from a notification call.
CALENDAR_QUERY Query a calendar server and store the data on a channel
CALENDAR_QUERY_RESULT Retrieve data from a previously run CALENDAR_QUERY() call
CALENDAR_WRITE Write an event to a calendar
JABBER_STATUS Retrieve the status of a jabber list member
ODBC Controls ODBC transaction properties.

AGENT

Synopsis

Gets information about an Agent

Syntax

AGENT(agentid[,item])

Arguments

agentid (no description)
item

The valid items to retrieve are:

(default) The status of the agent (LOGGEDIN | LOGGEDOUT)

The password of the agent

The name of the agent

MusicOnHold class

The name of the active channel for the Agent (AgentLogin)

Description

IAXPEER

Synopsis

Gets IAX peer information.

Syntax

IAXPEER(peername[,item])

Arguments

peername

If peername is specified to this value, return the IP address of the endpoint of the current channel

item

If peername is specified, valid items are:

(default) The IP address.

The peer's status (if qualify=yes)

The configured mailbox.

The configured context.

The epoch time of the next expire.

Is it dynamic? (yes/no).

The configured Caller ID name.

The configured Caller ID number.

The configured codecs.

Preferred codec index number x (beginning with 0)

Description

See also

SIPPEER function

IAXVAR

Synopsis

Sets or retrieves a remote variable.

Syntax

IAXVAR(varname)

Arguments

varname (no description)

Description

SIP_HEADER

Synopsis

Gets the specified SIP header.

Syntax

SIP_HEADER(name[,number])

Arguments

name (no description)
number

If not specified, defaults to 1.

Description

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.

SIPPEER

Synopsis

Gets SIP peer information.

Syntax

SIPPEER(peername[,item])

Arguments

peername (no description)
item

(default) The ip address.

The port number.

The configured mailbox.

The configured context.

The epoch time of the next expire.

Is it dynamic? (yes/no).

The configured Caller ID name.

The configured Caller ID number.

The configured Callgroup.

The configured Pickupgroup.

The configured codecs.

Status (if qualify=yes).

Registration extension.

Call limit (call-limit).

Configured call level for signalling busy.

Current amount of calls. Only available if call-limit is set.

Default language for peer.

Account code for this peer.

Current user agent id for peer.

A channel variable configured with setvar for this peer.

Preferred codec index number x (beginning with zero).

Description

SIPCHANINFO

Synopsis

Gets the specified SIP parameter from the current channel.

Syntax

SIPCHANINFO(item)

Arguments

item

The IP address of the peer.

The source IP address of the peer.

The URI from the From: header.

The URI from the Contact: header.

The useragent.

The name of the peer.

1 if T38 is offered or enabled in this channel, otherwise 0.

Description

CHECKSIPDOMAIN

Synopsis

Checks if domain is a local domain.

Syntax

CHECKSIPDOMAIN(domain)

Arguments

domain (no description)

Description

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.

QUEUE_VARIABLES

Synopsis

Return Queue information in variables.

Syntax

QUEUE_VARIABLES(queuename)

Arguments

queuename

Maxmimum number of calls allowed.

The strategy of the queue.

Number of calls currently in the queue.

Current average hold time.

Number of completed calls for the queue.

Number of abandoned calls.

Queue service level.

Current service level performance.

Description

Makes the following queue variables available.

Returns 0 if queue is found and setqueuevar is defined, -1 otherwise.

QUEUE_MEMBER

Synopsis

Count number of members answering a queue.

Syntax

QUEUE_MEMBER(queuename,option)

Arguments

queuename (no description)
option

Returns the number of logged-in members for the specified queue.

Returns the number of logged-in members for the specified queue available to take a call.

Returns the total number of members for the specified queue.

Description

Returns the number of members currently associated with the specified queuename.

QUEUE_MEMBER_COUNT

Synopsis

Count number of members answering a queue.

Syntax

QUEUE_MEMBER_COUNT(queuename)

Arguments

queuename (no description)

Description

Returns the number of members currently associated with the specified queuename.

This function has been deprecated in favor of the QUEUE_MEMBER() function

See also

QUEUE_MEMBER_LIST function

QUEUE_WAITING_COUNT

Synopsis

Count number of calls currently waiting in a queue.

Syntax

QUEUE_WAITING_COUNT([queuename])

Arguments

queuename (no description)

Description

Returns the number of callers currently waiting in the specified queuename.

QUEUE_MEMBER_LIST

Synopsis

Returns a list of interfaces on a queue.

Syntax

QUEUE_MEMBER_LIST(queuename)

Arguments

queuename (no description)

Description

Returns a comma-separated list of members associated with the specified queuename.

See also

QUEUE_MEMBER_COUNT function

QUEUE_MEMBER_PENALTY

Synopsis

Gets or sets queue members penalty.

Syntax

QUEUE_MEMBER_PENALTY(queuename,interface)

Arguments

queuename (no description)
interface (no description)

Description

Gets or sets queue members penalty.

VALID_EXTEN

Synopsis

Determine whether an extension exists or not.

Syntax

VALID_EXTEN([context,extension[,priority]])

Arguments

context

Defaults to the current context

extension (no description)
priority

Priority defaults to 1.

Description

Returns a true value if the indicated context, extension, and priority exist.

SPEECH_SCORE

Synopsis

Gets the confidence score of a result.

Syntax

SPEECH_SCORE([nbest_number,]result_number)

Arguments

nbest_number (no description)
result_number (no description)

Description

Gets the confidence score of a result.

SPEECH_TEXT

Synopsis

Gets the recognized text of a result.

Syntax

SPEECH_TEXT([nbest_number,]result_number)

Arguments

nbest_number (no description)
result_number (no description)

Description

Gets the recognized text of a result.

SPEECH_GRAMMAR

Synopsis

Gets the matched grammar of a result if available.

Syntax

SPEECH_GRAMMAR([nbest_number,]result_number)

Arguments

nbest_number (no description)
result_number (no description)

Description

Gets the matched grammar of a result if available.

SPEECH_ENGINE

Synopsis

Change a speech engine specific attribute.

Syntax

SPEECH_ENGINE(name)

Arguments

name (no description)

Description

Changes a speech engine specific attribute.

SPEECH_RESULTS_TYPE

Synopsis

Sets the type of results that will be returned.

Syntax

SPEECH_RESULTS_TYPE()

Arguments

Description

Sets the type of results that will be returned. Valid options are normal or nbest.

SPEECH

Synopsis

Gets information about speech recognition results.

Syntax

SPEECH(argument)

Arguments

argument

Returns 1 upon speech object existing, or 0 if not

Returns 1 if spoker spoke, or 0 if not

Returns number of results that were recognized.

Description

Gets information about speech recognition results.

LOCAL

Synopsis

Manage variables local to the gosub stack frame.

Syntax

LOCAL(varname)

Arguments

varname (no description)

Description

Read and write a variable local to the gosub stack frame, once we Return() it will be lost (or it will go back to whatever value it had before the Gosub()).

See also

Gosub application
GosubIf application
Return application

LOCAL_PEEK

Synopsis

Retrieve variables hidden by the local gosub stack frame.

Syntax

LOCAL_PEEK(n,varname)

Arguments

n (no description)
varname (no description)

Description

Read a variable varname hidden by n levels of gosub stack frames. Note that ${LOCAL_PEEK(0,foo)} is the same as foo, since the value of n peeks under 0 levels of stack frames; in other words, 0 is the current level. If n exceeds the available number of stack frames, then an empty string is returned.

See also

Gosub application
GosubIf application
Return application

MAILBOX_EXISTS

Synopsis

Tell if a mailbox is configured.

Syntax

MAILBOX_EXISTS(mailbox[,context])

Arguments

mailbox (no description)
context (no description)

Description

Returns a boolean of whether the corresponding mailbox exists. If context is not specified, defaults to the default context.

AES_ENCRYPT

Synopsis

Encrypt a string with AES given a 16 character key.

Syntax

AES_ENCRYPT(key,string)

Arguments

key

AES Key

string

Input string

Description

Returns an AES encrypted string encoded in base64.

AES_DECRYPT

Synopsis

Decrypt a string encoded in base64 with AES given a 16 character key.

Syntax

AES_DECRYPT(key,string)

Arguments

key

AES Key

string

Input string.

Description

Returns the plain text string.

AUDIOHOOK_INHERIT

Synopsis

Set whether an audiohook may be inherited to another channel

Syntax

AUDIOHOOK_INHERIT(source)

Arguments

source

The built-in sources in Asterisk are

Note that the names are not case-sensitive

Description

By enabling audiohook inheritance on the channel, you are giving permission for an audiohook to be inherited by a descendent channel. Inheritance may be be disabled at any point as well.

Example scenario:

exten => 2000,1,MixMonitor(blah.wav)

exten => 2000,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)

exten => 2000,n,Dial(SIP/2000)

exten => 4000,1,Dial(SIP/4000)

exten => 5000,1,MixMonitor(blah2.wav)

exten => 5000,n,Dial(SIP/5000)

In this basic dialplan scenario, let's consider the following sample calls

Call 1: Caller dials 2000. The person who answers then executes an attended

transfer to 4000.

Result: Since extension 2000 set MixMonitor to be inheritable, after the

transfer to 4000 has completed, the call will continue to be recorded to blah.wav

Call 2: Caller dials 5000. The person who answers then executes an attended

transfer to 4000.

Result: Since extension 5000 did not set MixMonitor to be inheritable, the

recording will stop once the call has been transferred to 4000.

BASE64_ENCODE

Synopsis

Encode a string in base64.

Syntax

BASE64_ENCODE(string)

Arguments

string

Input string

Description

Returns the base64 string.

BASE64_DECODE

Synopsis

Decode a base64 string.

Syntax

BASE64_DECODE(string)

Arguments

string

Input string.

Description

Returns the plain text string.

BLACKLIST

Synopsis

Check if the callerid is on the blacklist.

Syntax

BLACKLIST()

Arguments

Description

Uses astdb to check if the Caller*ID is in family blacklist. Returns 1 or 0.

See also

DB function

CALLERID

Synopsis

Gets or sets Caller*ID data on the channel.

Syntax

CALLERID(datatype[,CID])

Arguments

datatype

The allowable datatypes are:

CID

Optional Caller*ID

Description

Gets or sets Caller*ID data on the channel. Uses channel callerid by default or optional callerid, if specified.

CALLERPRES

Synopsis

Gets or sets Caller*ID presentation on the channel.

Syntax

CALLERPRES()

Arguments

Description

Gets or sets Caller*ID presentation on the channel. The following values are valid:

Presentation Allowed, Not Screened.

Presentation Allowed, Passed Screen.

Presentation Allowed, Failed Screen.

Presentation Allowed, Network Number.

Presentation Prohibited, Not Screened.

Presentation Prohibited, Passed Screen.

Presentation Prohibited, Failed Screen.

Presentation Prohibited, Network Number.

Number Unavailable.

CDR

Synopsis

Gets or sets a CDR variable.

Syntax

CDR(name[,options])

Arguments

name

CDR field name:

Caller ID.

Last application arguments.

ANSWERED, NO ANSWER, BUSY.

Source.

Time the call started.

DOCUMENTATION, BILL, IGNORE, etc.

Destination.

Time the call was answered.

The channel's account code.

Destination context.

Time the call ended.

The channel's unique id.

Destination channel.

Duration of the call.

The channel's user specified field.

Last application.

Duration of the call once it was answered.

Channel name.

options
l

Uses the most recent CDR on a channel with multiple records

r

Searches the entire stack of CDRs on the channel.

s

Skips any CDR's that are marked 'LOCKED' due to forkCDR() calls. (on setting/writing CDR vars only)

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.

Description

All of the CDR field names 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.

For setting CDR values, the l flag does not apply to setting the accountcode, userfield, or amaflags.

Raw values for disposition:

NO ANSWER

BUSY

FAILED

ANSWERED

Raw values for amaflags:

OMIT

BILLING

DOCUMENTATION

Example: exten => 1,1,Set(CDR(userfield)=test)

CHANNELS

Synopsis

Gets the list of channels, optionally filtering by a regular expression.

Syntax

CHANNELS([regular_expression])

Arguments

regular_expression (no description)

Description

Gets the list of channels, optionally filtering by a regular_expression. If no argument is provided, all known channels are returned. The regular_expression must correspond to the POSIX.2 specification, as shown in regex(7). The list returned will be space-delimited.

CHANNEL

Synopsis

Gets/sets various pieces of information about the channel.

Syntax

CHANNEL(item)

Arguments

item

Standard items (provided by all channel technologies) are:

R/O format currently being read.

R/O format used natively for audio.

R/O format currently being written.

R/W call groups for call pickup.

R/O technology used for channel.

R/W language for sounds played.

R/W class (from musiconhold.conf) for hold music.

The name of the channel

R/W parkinglot for parking.

R/W set rxgain level on channel drivers that support it.

R/O state for channel

R/W zone for indications played

R/W ISDN Transfer Capability, one of:

R/W set txgain level on channel drivers that support it.

R/O format used natively for video

R/W whether or not context tracing is enabled, only available if CHANNEL_TRACE is defined.

chan_sip provides the following additional options:

R/O Get the IP address of the peer.

R/O Get the source IP address of the peer.

R/O Get the URI from the From: header.

R/O Get the URI from the Contact: header.

R/O Get the useragent.

R/O Get the name of the peer.

R/O 1 if T38 is offered or enabled in this channel, otherwise 0

R/O 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_maxjitter Local calculated jitter (maximum)

local_minjitter Local calculated jitter (minimum)

local_normdevjitterLocal calculated jitter (normal deviation)

local_stdevjitter Local calculated jitter (standard deviation)

local_count Number of received packets

remote_ssrc Remote SSRC (stream ID)

remote_lostpacketsRemote lost packets

remote_jitter Remote reported jitter

remote_maxjitter Remote calculated jitter (maximum)

remote_minjitter Remote calculated jitter (minimum)

remote_normdevjitterRemote calculated jitter (normal deviation)

remote_stdevjitterRemote calculated jitter (standard deviation)

remote_count Number of transmitted packets

remote_ssrc Remote SSRC (stream ID)

remote_lostpacketsRemote lost packets

remote_jitter Remote reported jitter

remote_maxjitter Remote calculated jitter (maximum)

remote_minjitter Remote calculated jitter (minimum)

remote_normdevjitterRemote calculated jitter (normal deviation)

remote_stdevjitterRemote calculated jitter (standard deviation)

remote_count Number of transmitted packets

rtt Round trip time

maxrtt Round trip time (maximum)

minrtt Round trip time (minimum)

normdevrtt Round trip time (normal deviation)

stdevrtt Round trip time (standard deviation)

all All statistics (in a form suited to logging, but not for parsing)

R/O 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 Get or set the OSP token information for a call.

R/O Get the peer's ip address.

R/O Get the peer's username.

Description

Gets/sets various pieces of information about the channel, additional item may be available from the channel driver; see its documentation for details. Any item requested that is not available on the current channel will return an empty string.

AST_CONFIG

Synopsis

Retrieve a variable from a configuration file.

Syntax

AST_CONFIG(config_file,category,variable_name)

Arguments

config_file (no description)
category (no description)
variable_name (no description)

Description

This function reads a variable from an Asterisk configuration file.

CONNECTEDLINE

Synopsis

Gets or sets Connected Line data on the channel.

Syntax

CONNECTEDLINE(datatype[,i])

Arguments

datatype

The allowable datatypes are:

i

If set, this will prevent the channel from sending out protocol messages because of the value being set

Description

Gets or sets Connected Line data on the channel.

SORT

Synopsis

Sorts a list of key/vals into a list of keys, based upon the vals.

Syntax

SORT(keyval[,keyvaln])

Arguments

keyval (no description)
keyvaln (no description)

Description

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.

CUT

Synopsis

Slices and dices strings, based upon a named delimiter.

Syntax

CUT(varname,char-delim,range-spec)

Arguments

varname

Variable you want cut

char-delim

Delimiter, 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 &)

Description

Cut out information from a string (varname), based upon a named delimiter.

DB

Synopsis

Read from or write to the Asterisk database.

Syntax

DB(family,key)

Arguments

family (no description)
key (no description)

Description

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.

See also

DBdel application
DB_DELETE function
DBdeltree application
DB_EXISTS function

DB_EXISTS

Synopsis

Check to see if a key exists in the Asterisk database.

Syntax

DB_EXISTS(family,key)

Arguments

family (no description)
key (no description)

Description

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.

See also

DB function

DB_DELETE

Synopsis

Return a value from the database and delete it.

Syntax

DB_DELETE(family,key)

Arguments

family (no description)
key (no description)

Description

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.

See also

DBdel application
DB function
DBdeltree application

DEVICE_STATE

Synopsis

Get or Set a device state.

Syntax

DEVICE_STATE(device)

Arguments

device (no description)

Description

The DEVICE_STATE function can be used to retrieve the device state from any device state provider. For example:

NoOp(SIP/mypeer has state ${DEVICE_STATE(SIP/mypeer)})

NoOp(Conference number 1234 has state ${DEVICE_STATE(MeetMe:1234)})

The DEVICE_STATE function can also be used to set custom device state from the dialplan. The Custom: prefix must be used. For example:

Set(DEVICE_STATE(Custom:lamp1)=BUSY)

Set(DEVICE_STATE(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

HINT

Synopsis

Get the devices set for a dialplan hint.

Syntax

HINT(extension[,options])

Arguments

extension (no description)
options
n

Retrieve name on the hint instead of list of devices.

Description

The HINT function can be used to retrieve the list of devices that are mapped to a dialplan hint. For example:

NoOp(Hint for Extension 1234 is ${HINT(1234)})

DIALGROUP

Synopsis

Manages a group of users for dialing.

Syntax

DIALGROUP(group[,op])

Arguments

group (no description)
op

The operation name, possible values are:

add - add a channel name or interface (write-only)

del - remove a channel name or interface (write-only)

Description

Presents an interface meant to be used in concert with the Dial application, by presenting a list of channels which should be dialled when referenced.

When DIALGROUP is read from, the argument is interpreted as the particular group for which a dial should be attempted. When DIALGROUP is written to with no arguments, the entire list is replaced with the argument specified.

Functionality is similar to a queue, except that when no interfaces are available, execution may continue in the dialplan. This is useful when you want certain people to be the first to answer any calls, with immediate fallback to a queue when the front line people are busy or unavailable, but you still want front line people to log in and out of that group, just like a queue.

Example:

exten => 1,1,Set(DIALGROUP(mygroup,add)=SIP/10)

exten => 1,n,Set(DIALGROUP(mygroup,add)=SIP/20)

exten => 1,n,Dial(${DIALGROUP(mygroup)})

DIALPLAN_EXISTS

Synopsis

Checks the existence of a dialplan target.

Syntax

DIALPLAN_EXISTS(context[,extension[,priority]])

Arguments

context (no description)
extension (no description)
priority (no description)

Description

This function returns 1 if the target exits. Otherwise, it returns 0.

ENUMQUERY

Synopsis

Initiate an ENUM query.

Syntax

ENUMQUERY(number[,method-type[,zone-suffix]])

Arguments

number (no description)
method-type

If no method-type is given, the default will be sip.

zone-suffix

If no zone-suffix is given, the default will be e164.arpa

Description

This will do a ENUM lookup of the given phone number.

ENUMRESULT

Synopsis

Retrieve results from a ENUMQUERY.

Syntax

ENUMRESULT(id,resultnum)

Arguments

id

The identifier returned by the ENUMQUERY function.

resultnum

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.

Description

This function will retrieve results from a previous use of the ENUMQUERY function.

ENUMLOOKUP

Synopsis

General or specific querying of NAPTR records for ENUM or ENUM-like DNS pointers.

Syntax

ENUMLOOKUP(number[,method-type[,options[,record#[,zone-suffix]]]])

Arguments

number (no description)
method-type

If no method-type is given, the default will be sip.

options
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.

u

Returns the full URI and does not strip off the URI-scheme.

s

Triggers ISN specific rewriting.

i

Looks for branches into an Infrastructure ENUM tree.

d

for a direct DNS lookup without any flipping of digits.

record#

If no record# is given, defaults to 1.

zone-suffix

If no zone-suffix is given, the default will be e164.arpa

Description

For more information see doc/asterisk.pdf.

TXTCIDNAME

Synopsis

TXTCIDNAME looks up a caller name via DNS.

Syntax

TXTCIDNAME(number[,zone-suffix])

Arguments

number (no description)
zone-suffix

If no zone-suffix is given, the default will be e164.arpa

Description

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.

ENV

Synopsis

Gets or sets the environment variable specified.

Syntax

ENV(varname)

Arguments

varname

Environment variable name

Description

STAT

Synopsis

Does a check on the specified file.

Syntax

STAT(flag,filename)

Arguments

flag

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.

filename (no description)

Description

FILE

Synopsis

Obtains the contents of a file.

Syntax

FILE(filename,offset,length)

Arguments

filename (no description)
offset

Maybe specified as any number. If negative, offset specifies the number of bytes back from the end of the file.

length

If specified, will limit the length of the data read to that size. If negative, trims length bytes from the end of the file.

Description

EXTENSION_STATE

Synopsis

Get an extension's state.

Syntax

EXTENSION_STATE(extension[,context])

Arguments

extension (no description)
context

If it is not specified defaults to default.

Description

The EXTENSION_STATE function can be used to retrieve the state from any hinted extension. For example:

NoOp(1234@default has state ${EXTENSION_STATE(1234)})

NoOp(4567@home has state ${EXTENSION_STATE(4567@home)})

The possible values returned by this function are:

UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING | RINGINUSE | HOLDINUSE | ONHOLD

GLOBAL

Synopsis

Gets or sets the global variable specified.

Syntax

GLOBAL(varname)

Arguments

varname

Global variable name

Description

Set or get the value of a global variable specified in varname

SHARED

Synopsis

Gets or sets the shared variable specified.

Syntax

SHARED(varname[,channel])

Arguments

varname

Variable name

channel

If not specified will default to current channel. It is the complete channel name: SIP/12-abcd1234 or the prefix only SIP/12.

Description

Implements a shared variable area, in which you may share variables between channels.

The variables used in this space are separate from the general namespace of the channel and thus SHARED(foo) and foo represent two completely different variables, despite sharing the same name.

Finally, realize that there is an inherent race between channels operating at the same time, fiddling with each others' internal variables, which is why this special variable namespace exists; it is to remind you that variables in the SHARED namespace may change at any time, without warning. You should therefore take special care to ensure that when using the SHARED namespace, you retrieve the variable and store it in a regular channel variable before using it in a set of calculations (or you might be surprised by the result).

GROUP_COUNT

Synopsis

Counts the number of channels in the specified group.

Syntax

GROUP_COUNT([groupname[,category]])

Arguments

groupname

Group name.

category

Category name

Description

Calculates the group count for the specified group, or uses the channel's current group if not specifed (and non-empty).

GROUP_MATCH_COUNT

Synopsis

Counts the number of channels in the groups matching the specified pattern.

Syntax

GROUP_MATCH_COUNT(groupmatch[,category])

Arguments

groupmatch

A standard regular expression used to match a group name.

category

Category name.

Description

Calculates the group count for all groups that match the specified pattern. Uses standard regular expression matching (see regex(7)).

GROUP

Synopsis

Gets or sets the channel group.

Syntax

GROUP([category])

Arguments

category

Category name.

Description

category can be employed for more fine grained group management. Each channel can only be member of exactly one group per category.

GROUP_LIST

Synopsis

Gets a list of the groups set on a channel.

Syntax

GROUP_LIST()

Arguments

Description

Gets a list of the groups set on a channel.

ICONV

Synopsis

Converts charsets of strings.

Syntax

ICONV(in-charset,out-charset,string)

Arguments

in-charset

Input charset

out-charset

Output charset

string

String to convert, from in-charset to out-charset

Description

Converts string from in-charset into out-charset. For available charsets, use iconv -l on your shell command line.

Due to limitations within the API, ICONV will not currently work with charsets with embedded NULLs. If found, the string will terminate.

LOCK

Synopsis

Attempt to obtain a named mutex.

Syntax

LOCK(lockname)

Arguments

lockname (no description)

Description

Attempts to grab a named lock exclusively, and prevents other channels from obtaining the same lock. LOCK will wait for the lock to become available. Returns 1 if the lock was obtained or 0 on error.

To avoid the possibility of a deadlock, LOCK will only attempt to obtain the lock for 3 seconds if the channel already has another lock.

TRYLOCK

Synopsis

Attempt to obtain a named mutex.

Syntax

TRYLOCK(lockname)

Arguments

lockname (no description)

Description

Attempts to grab a named lock exclusively, and prevents other channels from obtaining the same lock. Returns 1 if the lock was available or 0 otherwise.

UNLOCK

Synopsis

Unlocks a named mutex.

Syntax

UNLOCK(lockname)

Arguments

lockname (no description)

Description

Unlocks a previously locked mutex. Returns 1 if the channel had a lock or 0 otherwise.

It is generally unnecessary to unlock in a hangup routine, as any locks held are automatically freed when the channel is destroyed.

ISNULL

Synopsis

Check if a value is NULL.

Syntax

ISNULL(data)

Arguments

data (no description)

Description

Returns 1 if NULL or 0 otherwise.

SET

Synopsis

SET assigns a value to a channel variable.

Syntax

SET(varname[,value])

Arguments

varname (no description)
value (no description)

Description

EXISTS

Synopsis

Test the existence of a value.

Syntax

EXISTS(data)

Arguments

data (no description)

Description

Returns 1 if exists, 0 otherwise.

IF

Synopsis

Check for an expresion.

Syntax

IF(expresion,retvalue)

Arguments

expresion (no description)
retvalue (no description)

Description

Returns the data following ? if true, else the data following :

IFTIME

Synopsis

Temporal Conditional.

Syntax

IFTIME(timespec,retvalue)

Arguments

timespec (no description)
retvalue (no description)

Description

Returns the data following ? if true, else the data following :

IMPORT

Synopsis

Retrieve the value of a variable from another channel.

Syntax

IMPORT(channel,variable)

Arguments

channel (no description)
variable (no description)

Description

MATH

Synopsis

Performs Mathematical Functions.

Syntax

MATH(expression[,type])

Arguments

expression

Is of the form: number1opnumber2 where the possible values for op are:

+,-,/,*,%,<<,>>,^,AND,OR,XOR,<,%gt;,>=,<=,== (and behave as their C equivalents)

type

Wanted type of result:

f, float - float(default)

i, int - integer

h, hex - hex

c, char - char

Description

Performs mathematical functions based on two parameters and an operator. The returned value type is type

Example: Set(i=${MATH(123%16,int)}) - sets var i=11

INC

Synopsis

Increments the value of a variable, while returning the updated value to the dialplan

Syntax

INC(variable)

Arguments

variable

The variable name to be manipulated, without the braces.

Description

Increments the value of a variable, while returning the updated value to the dialplan

Example: INC(MyVAR) - Increments MyVar

Note: INC(${MyVAR}) - Is wrong, as INC expects the variable name, not its value

DEC

Synopsis

Decrements the value of a variable, while returning the updated value to the dialplan

Syntax

DEC(variable)

Arguments

variable

The variable name to be manipulated, without the braces.

Description

Decrements the value of a variable, while returning the updated value to the dialplan

Example: DEC(MyVAR) - Increments MyVar

Note: DEC(${MyVAR}) - Is wrong, as INC expects the variable name, not its value

MD5

Synopsis

Computes an MD5 digest.

Syntax

MD5(data)

Arguments

data (no description)

Description

Computes an MD5 digest.

IFMODULE

Synopsis

Checks if an Asterisk module is loaded in memory.

Syntax

IFMODULE(modulename.so)

Arguments

modulename.so

Module name complete with .so

Description

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

ODBC_FETCH

Synopsis

Fetch a row from a multirow query.

Syntax

ODBC_FETCH(result-id)

Arguments

result-id (no description)

Description

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.

This also sets ODBC_FETCH_STATUS.

ODBC_FETCH_STATUS

SUCESS

If rows are available.

FAILURE

If no rows are available.

SQL_ESC

Synopsis

Escapes single ticks for use in SQL statements.

Syntax

SQL_ESC(string)

Arguments

string (no description)

Description

Used in SQL templates to escape data which may contain single ticks ' which are otherwise used to delimit data.

Example: SELECT foo FROM bar WHERE baz='${SQL_ESC(${ARG1})}'

RAND

Synopsis

Choose a random number in a range.

Syntax

RAND([min[,max]])

Arguments

min (no description)
max (no description)

Description

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.

REALTIME

Synopsis

RealTime Read/Write Functions.

Syntax

REALTIME(family,fieldmatch[,value[,delim1|field[,delim2]]])

Arguments

family (no description)
fieldmatch (no description)
value (no description)
delim1|field

Use delim1 with delim2 on read and field without delim2 on write

If we are reading and delim1 is not specified, defaults to ,

delim2

Parameter only used when reading, if not specified defaults to =

Description

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. If there is no match, NULL will be returned by the function. On a write, this function will always return NULL.

REALTIME_STORE

Synopsis

RealTime Store Function.

Syntax

REALTIME_STORE(family,field1,fieldN,field30)

Arguments

family (no description)
field1 (no description)
fieldN (no description)
field30 (no description)

Description

This function will insert a new set of values into the RealTime repository. If RT engine provides an unique ID of the stored record, REALTIME_STORE(...)=.. creates channel variable named RTSTOREID, which contains value of unique ID. Currently, a maximum of 30 field/value pairs is supported.

REALTIME_DESTROY

Synopsis

RealTime Destroy Function.

Syntax

REALTIME_DESTROY(family,fieldmatch[,value[,delim1[,delim2]]])

Arguments

family (no description)
fieldmatch (no description)
value (no description)
delim1 (no description)
delim2 (no description)

Description

This function acts in the same way as REALTIME(....) does, except that it destroys the matched record in the RT engine.

REALTIME_FIELD

Synopsis

RealTime query function.

Syntax

REALTIME_FIELD(family,fieldmatch,value,fieldname)

Arguments

family (no description)
fieldmatch (no description)
value (no description)
fieldname (no description)

Description

This function retrieves a single item, fieldname from the RT engine, where fieldmatch contains the value value. When written to, the REALTIME_FIELD() function performs identically to the REALTIME() function.

REALTIME_HASH

Synopsis

RealTime query function.

Syntax

REALTIME_HASH(family,fieldmatch,value)

Arguments

family (no description)
fieldmatch (no description)
value (no description)

Description

This function retrieves a single record from the RT engine, where fieldmatch contains the value value and formats the output suitably, such that it can be assigned to the HASH() function. The HASH() function then provides a suitable method for retrieving each field value of the record.

REDIRECTING

Synopsis

Gets or sets Redirecting data on the channel.

Syntax

REDIRECTING(datatype[,i])

Arguments

datatype

The allowable datatypes are:

i

If set, this will prevent the channel from sending out protocol messages because of the value being set

Description

Gets or sets Redirecting data on the channel. The allowable values for the reason field are the following:

Unknown

Call Forwarding Busy

Call Forwarding No Reply

Callee is Unavailable

Time of Day

Do Not Disturb

Call Deflection

Follow Me

Called DTE Out-Of-Order

Callee is Away

Call Forwarding By The Called DTE

Call Forwarding Unconditional

SHA1

Synopsis

Computes a SHA1 digest.

Syntax

SHA1(data)

Arguments

data

Input string

Description

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

SHELL

Synopsis

Executes a command as if you were at a shell.

Syntax

SHELL(command)

Arguments

command

This is the argument to the function, the command you want to pass to the shell.

Description

Returns the value from a system command

Example: Set(foo=${SHELL(echo \bar\)})

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.

AGC

Synopsis

Apply automatic gain control to audio on a channel.

Syntax

AGC(channeldirection)

Arguments

channeldirection

This can be either rx or tx

Description

The AGC function will apply automatic gain control to the audio on the channel that it is executed on. Using rx for audio received and tx for audio transmitted to the channel. When using this function you set a target audio level. It is primarily intended for use with analog lines, but could be useful for other channels as well. The target volume is set with a number between 1-32768. The larger the number the louder (more gain) the channel will receive.

Examples:

exten => 1,1,Set(AGC(rx)=8000)

exten => 1,2,Set(AGC(tx)=off)

DENOISE

Synopsis

Apply noise reduction to audio on a channel.

Syntax

DENOISE(channeldirection)

Arguments

channeldirection

This can be either rx or tx the values that can be set to this are either on and off

Description

The DENOISE function will apply noise reduction to audio on the channel that it is executed on. It is very useful for noisy analog lines, especially when adjusting gains or using AGC. Use rx for audio received from the channel and tx to apply the filter to the audio being sent to the channel.

Examples:

exten => 1,1,Set(DENOISE(rx)=on)

exten => 1,2,Set(DENOISE(tx)=off)

SPRINTF

Synopsis

Format a variable according to a format string.

Syntax

SPRINTF(format,arg1[,arg2[,argN]])

Arguments

format (no description)
arg1 (no description)
arg2 (no description)
argN (no description)

Description

Parses the format string specified and returns a string matching that format. Supports most options found in sprintf(3). Returns a shortened string if a format specifier is not recognized.

See also

FIELDQTY

Synopsis

Count the fields with an arbitrary delimiter

Syntax

FIELDQTY(varname,delim)

Arguments

varname (no description)
delim (no description)

Description

The delimiter may be specified as a special or extended ASCII character, by encoding it. The characters \n, \r, and \t are all recognized as the newline, carriage return, and tab characters, respectively. Also, octal and hexadecimal specifications are recognized by the patterns \0nnn and \xHH, respectively. For example, if you wanted to encode a comma as the delimiter, you could use either \054 or \x2C.

Example: If ${example} contains ex-amp-le, then ${FIELDQTY(example,-)} returns 3.

LISTFILTER

Synopsis

Remove an item from a list, by name.

Syntax

LISTFILTER(varname,delim,value)

Arguments

varname (no description)
delim (no description)
value (no description)

Description

Remove value from the list contained in the varname variable, where the list delimiter is specified by the delim parameter. This is very useful for removing a single channel name from a list of channels, for example.

FILTER

Synopsis

Filter the string to include only the allowed characters

Syntax

FILTER(allowed-chars,string)

Arguments

allowed-chars (no description)
string (no description)

Description

Permits all characters listed in allowed-chars, filtering all others outs. In addition to literally listing the characters, you may also use ranges of characters (delimited by a -

Hexadecimal characters started with a \x(i.e. \x20)

Octal characters started with a \0 (i.e. \040)

Also \t,\n and \r are recognized.

If you want the - character it needs to be prefixed with a \

REGEX

Synopsis

Check string against a regular expression.

Syntax

REGEX("regular expression",string)

Arguments

"regular expression" (no description)
string (no description)

Description

Return 1 on regular expression match 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.

HASH

Synopsis

Implementation of a dialplan associative array

Syntax

HASH(hashname[,hashkey])

Arguments

hashname (no description)
hashkey (no description)

Description

In two arguments 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

HASHKEYS

Synopsis

Retrieve the keys of the HASH() function.

Syntax

HASHKEYS(hashname)

Arguments

hashname (no description)

Description

Returns a comma-delimited list of the current keys of the 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.

KEYPADHASH

Synopsis

Hash the letters in string into equivalent keypad numbers.

Syntax

KEYPADHASH(string)

Arguments

string (no description)

Description

Example: ${KEYPADHASH(Les)} returns "537"

ARRAY

Synopsis

Allows setting multiple variables at once.

Syntax

ARRAY(var1[,var2[,varN]])

Arguments

var1 (no description)
var2 (no description)
varN (no description)

Description

The comma-delimited list passed as a value to which the function is set will be interpreted as a set of values to which the comma-delimited list of variable names in the argument should be set.

Example: Set(ARRAY(var1,var2)=1,2) will set var1 to 1 and var2 to 2

STRPTIME

Synopsis

Returns the epoch of the arbitrary date/time string structured as described by the format.

Syntax

STRPTIME(datetime,timezone,format)

Arguments

datetime (no description)
timezone (no description)
format (no description)

Description

This is useful for converting a date into EPOCH time, possibly to pass to an application like SayUnixTime or to calculate the difference between the two date strings

Example: ${STRPTIME(2006-03-01 07:30:35,America/Chicago,%Y-%m-%d %H:%M:%S)} returns 1141219835

STRFTIME

Synopsis

Returns the current date/time in the specified format.

Syntax

STRFTIME([epoch[,timezone[,format]]])

Arguments

epoch (no description)
timezone (no description)
format (no description)

Description

STRFTIME supports all of the same formats as the underlying C function strftime(3). It also supports the following format: %[n]q - fractions of a second, with leading zeros.

Example: %3q will give milliseconds and %1q will give tenths of a second. The default is set at milliseconds (n=3). The common case is to use it in combination with %S, as in %S.%3q.

See also

EVAL

Synopsis

Evaluate stored variables

Syntax

EVAL(variable)

Arguments

variable (no description)

Description

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 results of the evaluation is in fact another variable or expression, using EVAL will have it evaluated a second time.

Example: If the MYVAR contains OTHERVAR, then the result of ${EVAL( MYVAR)} in the dialplan will be the contents of OTHERVAR. Normally just putting MYVAR in the dialplan the result would be OTHERVAR.

TOUPPER

Synopsis

Convert string to all uppercase letters.

Syntax

TOUPPER(string)

Arguments

string (no description)

Description

Example: ${TOUPPER(Example)} returns "EXAMPLE"

TOLOWER

Synopsis

Convert string to all lowercase letters.

Syntax

TOLOWER(string)

Arguments

string (no description)

Description

Example: ${TOLOWER(Example)} returns "example"

LEN

Synopsis

Return the length of the string given.

Syntax

LEN(string)

Arguments

string (no description)

Description

Example: ${LEN(example)} returns 7

QUOTE

Synopsis

Quotes a given string, escaping embedded quotes as necessary

Syntax

QUOTE(string)

Arguments

string (no description)

Description

Example: ${QUOTE(ab"c"de)} will return "abcde"

SHIFT

Synopsis

Removes and returns the first item off of a variable containing delimited text

Syntax

SHIFT(varname[,delimiter])

Arguments

varname (no description)
delimiter (no description)

Description

Example:

exten => s,1,Set(array=one,two,three)

exten => s,n,While($["${SET(var=${SHIFT(array)})}" != ""])

exten => s,n,NoOp(var is ${var})

exten => s,n,EndWhile

This would iterate over each value in array, left to right, and would result in NoOp(var is one), NoOp(var is two), and NoOp(var is three) being executed.

POP

Synopsis

Removes and returns the last item off of a variable containing delimited text

Syntax

POP(varname[,delimiter])

Arguments

varname (no description)
delimiter (no description)

Description

Example:

exten => s,1,Set(array=one,two,three)

exten => s,n,While($["${SET(var=${POP(array)})}" != ""])

exten => s,n,NoOp(var is ${var})

exten => s,n,EndWhile

This would iterate over each value in array, right to left, and would result in NoOp(var is three), NoOp(var is two), and NoOp(var is one) being executed.

PUSH

Synopsis

Appends one or more values to the end of a variable containing delimited text

Syntax

PUSH(varname[,delimiter])

Arguments

varname (no description)
delimiter (no description)

Description

Example: Set(PUSH(array)=one,two,three) would append one, two, and three to the end of the values stored in the variable "array".

UNSHIFT

Synopsis

Inserts one or more values to the beginning of a variable containing delimited text

Syntax

UNSHIFT(varname[,delimiter])

Arguments

varname (no description)
delimiter (no description)

Description

Example: Set(UNSHIFT(array)=one,two,three) would insert one, two, and three before the values stored in the variable "array".

TIMEOUT

Synopsis

Gets or sets timeouts on the channel. Timeout values are in seconds.

Syntax

TIMEOUT(timeouttype)

Arguments

timeouttype

The timeout that will be manipulated. The possible timeout types are: absolute, digit or response

Description

The timeouts that can be manipulated are:

absolute: The absolute maximum amount of time permitted for a call. 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.

URIENCODE

Synopsis

Encodes a string to URI-safe encoding according to RFC 2396.

Syntax

URIENCODE(data)

Arguments

data

Input string to be encoded.

Description

Returns the encoded string defined in data.

URIDECODE

Synopsis

Decodes a URI-encoded string according to RFC 2396.

Syntax

URIDECODE(data)

Arguments

data

Input string to be decoded.

Description

Returns the decoded URI-encoded data string.

VERSION

Synopsis

Return the Version info for this Asterisk.

Syntax

VERSION([info])

Arguments

info

The possible values are:

A string of digits is returned (right now fixed at 999999).

The string representing the user's name whose account was used to configure Asterisk, is returned.

The string representing the name of the host on which Asterisk was configured, is returned.

The string representing the type of machine on which Asterisk was configured, is returned.

The string representing the OS of the machine on which Asterisk was configured, is returned.

The string representing the date on which Asterisk was configured, is returned.

The string representing the kernel version of the machine on which Asterisk was configured, is returned.

Description

If there are no arguments, return the version of Asterisk in this format: SVN-branch-1.4-r44830M

Example: Set(junky=${VERSION()};

Sets junky to the string SVN-branch-1.6-r74830M, or possibly, SVN-trunk-r45126M.

VMCOUNT

Synopsis

Count the voicemails in a specified mailbox.

Syntax

VMCOUNT(vmbox[,folder])

Arguments

vmbox

If not specified, defaults to default.

folder

If not specified, defaults to INBOX

Description

Count the number of voicemails in a specified mailbox, you could also specify the context and the mailbox folder.

Example: exten => s,1,Set(foo=${VMCOUNT(125)})

VOLUME

Synopsis

Set the TX or RX volume of a channel.

Syntax

VOLUME(direction)

Arguments

direction

Must be TX or RX.

Description

The VOLUME function can be used to increase or decrease the tx or rx gain of any channel.

For example:

Set(VOLUME(TX)=3)

Set(VOLUME(RX)=2)

EXCEPTION

Synopsis

Retrieve the details of the current dialplan exception.

Syntax

EXCEPTION(field)

Arguments

field

The following fields are available for retrieval:

INVALID, ERROR, RESPONSETIMEOUT, ABSOLUTETIMEOUT, or custom value set by the RaiseException() application

The context executing when the exception occurred.

The extension executing when the exception occurred.

The numeric priority executing when the exception occurred.

Description

Retrieve the details (specified field) of the current dialplan exception.

See also

RaiseException application

CALENDAR_BUSY

Synopsis

Determine if the calendar is marked busy at this time.

Syntax

CALENDAR_BUSY(calendar)

Arguments

calendar (no description)

Description

Check the specified calendar's current busy status.

CALENDAR_EVENT

Synopsis

Get calendar event notification data from a notification call.

Syntax

CALENDAR_EVENT(field)

Arguments

field

The VEVENT SUMMARY property or Exchange event 'subject'

The text description of the event

The organizer of the event

The location of the eventt

The name of the calendar associated with the event

The unique identifier for this event

The start time of the event

The end time of the event

The busy state of the event 0=FREE, 1=TENTATIVE, 2=BUSY

Description

Whenever a calendar event notification call is made, the event data may be accessed with this function.

CALENDAR_QUERY

Synopsis

Query a calendar server and store the data on a channel

Syntax

CALENDAR_QUERY(calendar[,start[,end]])

Arguments

calendar

The calendar that should be queried

start

The start time of the query (in seconds since epoch)

end

The end time of the query (in seconds since epoch)

Description

Get a list of events in the currently accessible timeframe of the calendar The function returns the id for accessing the result with CALENDAR_QUERY_RESULT()

CALENDAR_QUERY_RESULT

Synopsis

Retrieve data from a previously run CALENDAR_QUERY() call

Syntax

CALENDAR_QUERY_RESULT(id,field[,entry])

Arguments

id

The query ID returned by CALENDAR_QUERY

field

number of events occurring during time range

A summary of the event

The full event description

The event organizer

The event location

The name of the calendar associted with the event

The unique identifier for the event

The start time of the event (in seconds since epoch)

The end time of the event (in seconds since epoch)

The busy status of the event 0=FREE, 1=TENTATIVE, 2=BUSY

entry

Return data from a specific event returned by the query

Description

After running CALENDAR_QUERY and getting a result id, calling CALENDAR_QUERY with that id and a field will return the data for that field. If multiple events matched the query, and entry is provided, information from that event will be returned.

CALENDAR_WRITE

Synopsis

Write an event to a calendar

Syntax

CALENDAR_WRITE(calendar,field)

Arguments

calendar

The calendar to write to

field

A summary of the event

The full event description

The event organizer

The event location

The unique identifier for the event

The start time of the event (in seconds since epoch)

The end time of the event (in seconds since epoch)

The busy status of the event 0=FREE, 1=TENTATIVE, 2=BUSY

Description

Example: CALENDAR_WRITE(calendar,field1,field2,field3)=val1,val2,val3

The field and value arguments can easily be set/passed using the HASHKEYS() and HASH() functions

JABBER_STATUS

Synopsis

Retrieve the status of a jabber list member

Syntax

JABBER_STATUS(sender,buddy[,resource])

Arguments

sender

XMPP/Jabber ID (Name) of sender.

buddy

XMPP/Jabber JID (Name) of recipient.

resource

Client or transport Asterisk users to connect to Jabber.

Description

Retrieves the numeric status associated with the specified buddy JID. The return value will be one of the following.

Online.

Chatty.

Away.

Extended Away.

Do Not Disturb.

Offline.

Not In Roster.

ODBC

Synopsis

Controls ODBC transaction properties.

Syntax

ODBC(property[,argument])

Arguments

property

Gets or sets the active transaction ID. If set, and the transaction ID does not exist and a database name is specified as an argument, it will be created.

Controls whether a transaction will be automatically committed when the channel hangs up. Defaults to false. If a transaction ID is specified in the optional argument, the property will be applied to that ID, otherwise to the current active ID.

Controls the data isolation on uncommitted transactions. May be one of the following: read_committed, read_uncommitted, repeatable_read, or serializable. Defaults to the database setting in res_odbc.conf or read_committed if not specified. If a transaction ID is specified as an optional argument, it will be applied to that ID, otherwise the current active ID.

argument (no description)

Description

The ODBC() function allows setting several properties to influence how a connected database processes transactions.

Manager Interface Actions

85 actions total

Action Synopsis
Agents Lists agents and their status.
AgentLogoff Sets an agent as no longer logged in.
DAHDITransfer Transfer DAHDI Channel.
DAHDIHangup Hangup DAHDI Channel.
DAHDIDialOffhook Dial over DAHDI channel while offhook.
DAHDIDNDon Toggle DAHDI channel Do Not Disturb status ON.
DAHDIDNDoff Toggle DAHDI channel Do Not Disturb status OFF.
DAHDIShowChannels Show status DAHDI channels.
DAHDIRestart Fully Restart DAHDI channels (terminates calls).
IAXpeers List IAX peers.
IAXpeerlist List IAX Peers.
IAXnetstats Show IAX Netstats.
IAXregistry Show IAX registrations.
SIPpeers List SIP peers (text format).
SIPshowpeer show SIP peer (text format).
SIPqualifypeer Qualify SIP peers.
SIPshowregistry Show SIP registrations (text format).
SIPnotify Send a SIP notify.
SKINNYdevices List SKINNY devices (text format).
SKINNYshowdevice Show SKINNY device (text format).
SKINNYlines List SKINNY lines (text format).
SKINNYshowline Show SKINNY line (text format).
MeetmeMute Mute a Meetme user.
MeetmeUnmute Unmute a Meetme user.
MeetmeList List participants in a conference.
Queues Queues.
QueueStatus Show queue status.
QueueSummary Show queue summary.
QueueAdd Add interface to queue.
QueueRemove Remove interface from queue.
QueuePause Makes a queue member temporarily unavailable.
QueueLog Adds custom entry in queue_log.
QueuePenalty Set the penalty for a queue member.
QueueRule Queue Rules.
QueueReload Reload a queue, queues, or any sub-section of a queue or queues.
QueueReset Reset queue statistics.
PlayDTMF Play DTMF signal on a specific channel.
VoicemailUsersList List All Voicemail User Information.
DBGet Get DB Entry.
DBPut Put DB entry.
DBDel Delete DB entry.
DBDelTree Delete DB Tree.
ParkedCalls List parked calls.
Park Park a channel.
Bridge Bridge two channels already in the PBX.
Ping Keepalive command.
Events Control Event Flow.
Logoff Logoff Manager.
Login Login Manager.
Challenge Generate Challenge for MD5 Auth.
Hangup Hangup channel.
Status List channel status.
Setvar Set a channel variable.
Getvar Gets a channel variable.
GetConfig Retrieve configuration.
GetConfigJSON Retrieve configuration (JSON format).
UpdateConfig Update basic configuration.
CreateConfig Creates an empty file in the configuration directory.
ListCategories List categories in configuration file.
Redirect Redirect (transfer) a call.
Atxfer Attended transfer.
Originate Originate a call.
Command Execute Asterisk CLI Command.
ExtensionState Check Extension Status.
AbsoluteTimeout Set absolute timeout.
MailboxStatus Check mailbox.
MailboxCount Check Mailbox Message Count.
ListCommands List available manager commands.
SendText Send text message to channel.
UserEvent Send an arbitrary event.
WaitEvent Wait for an event to occur.
CoreSettings Show PBX core settings (version etc).
CoreStatus Show PBX core status variables.
Reload Send a reload event.
CoreShowChannels List currently active channels.
ModuleLoad Module management.
ModuleCheck Check if module is loaded.
ShowDialPlan La merde se produit.
AGI Add an AGI command to execute by Async AGI.
JabberSend Sends a message to a Jabber Client.
Monitor Monitor a channel.
StopMonitor Stop monitoring a channel.
ChangeMonitor Change monitoring filename of a channel.
PauseMonitor Pause monitoring of a channel.
UnpauseMonitor Unpause monitoring of a channel.

Agents

Synopsis

Lists agents and their status.

Syntax

Agents()

Arguments

Description

Will list info about all possible agents.

AgentLogoff

Synopsis

Sets an agent as no longer logged in.

Syntax

AgentLogoff(Agent[,Soft])

Arguments

Agent

Agent ID of the agent to log off.

Soft

Set to true to not hangup existing calls.

Description

Sets an agent as no longer logged in.

DAHDITransfer

Synopsis

Transfer DAHDI Channel.

Syntax

DAHDITransfer(DAHDIChannel)

Arguments

DAHDIChannel

DAHDI channel name to transfer.

Description

Transfer a DAHDI channel.

DAHDIHangup

Synopsis

Hangup DAHDI Channel.

Syntax

DAHDIHangup(DAHDIChannel)

Arguments

DAHDIChannel

DAHDI channel name to hangup.

Description

Hangup a DAHDI channel.

DAHDIDialOffhook

Synopsis

Dial over DAHDI channel while offhook.

Syntax

DAHDIDialOffhook(DAHDIChannel,Number)

Arguments

DAHDIChannel (no description)
Number (no description)

Description

DAHDIDNDon

Synopsis

Toggle DAHDI channel Do Not Disturb status ON.

Syntax

DAHDIDNDon(DAHDIChannel)

Arguments

DAHDIChannel (no description)

Description

DAHDIDNDoff

Synopsis

Toggle DAHDI channel Do Not Disturb status OFF.

Syntax

DAHDIDNDoff(DAHDIChannel)

Arguments

DAHDIChannel (no description)

Description

DAHDIShowChannels

Synopsis

Show status DAHDI channels.

Syntax

DAHDIShowChannels(DAHDIChannel)

Arguments

DAHDIChannel (no description)

Description

DAHDIRestart

Synopsis

Fully Restart DAHDI channels (terminates calls).

Syntax

DAHDIRestart()

Arguments

Description

IAXpeers

Synopsis

List IAX peers.

Syntax

IAXpeers()

Arguments

Description

IAXpeerlist

Synopsis

List IAX Peers.

Syntax

IAXpeerlist()

Arguments

Description

List all the IAX peers.

IAXnetstats

Synopsis

Show IAX Netstats.

Syntax

IAXnetstats()

Arguments

Description

Show IAX channels network statistics.

IAXregistry

Synopsis

Show IAX registrations.

Syntax

IAXregistry()

Arguments

Description

Show IAX registrations.

SIPpeers

Synopsis

List SIP peers (text format).

Syntax

SIPpeers()

Arguments

Description

Lists SIP peers in text format with details on current status. Peerlist will follow as separate events, followed by a final event called PeerlistComplete.

SIPshowpeer

Synopsis

show SIP peer (text format).

Syntax

SIPshowpeer(Peer)

Arguments

Peer

The peer name you want to check.

Description

Show one SIP peer with details on current status.

SIPqualifypeer

Synopsis

Qualify SIP peers.

Syntax

SIPqualifypeer(Peer)

Arguments

Peer

The peer name you want to qualify.

Description

Qualify a SIP peer.

SIPshowregistry

Synopsis

Show SIP registrations (text format).

Syntax

SIPshowregistry()

Arguments

Description

Lists all registration requests and status. Registrations will follow as separate events. followed by a final event called RegistrationsComplete.

SIPnotify

Synopsis

Send a SIP notify.

Syntax

SIPnotify(Channel,Variable)

Arguments

Channel

Peer to receive the notify.

Variable

At least one variable pair must be specified. name=value

Description

Sends a SIP Notify event.

All parameters for this event must be specified in the body of this request via multiple Variable: name=value sequences.

SKINNYdevices

Synopsis

List SKINNY devices (text format).

Syntax

SKINNYdevices()

Arguments

Description

Lists Skinny devices in text format with details on current status. Devicelist will follow as separate events, followed by a final event called DevicelistComplete.

SKINNYshowdevice

Synopsis

Show SKINNY device (text format).

Syntax

SKINNYshowdevice(Device)

Arguments

Device

The device name you want to check.

Description

Show one SKINNY device with details on current status.

SKINNYlines

Synopsis

List SKINNY lines (text format).

Syntax

SKINNYlines()

Arguments

Description

Lists Skinny lines in text format with details on current status. Linelist will follow as separate events, followed by a final event called LinelistComplete.

SKINNYshowline

Synopsis

Show SKINNY line (text format).

Syntax

SKINNYshowline(Line)

Arguments

Line

The line name you want to check.

Description

Show one SKINNY line with details on current status.

MeetmeMute

Synopsis

Mute a Meetme user.

Syntax

MeetmeMute(Meetme,Usernum)

Arguments

Meetme (no description)
Usernum (no description)

Description

MeetmeUnmute

Synopsis

Unmute a Meetme user.

Syntax

MeetmeUnmute(Meetme,Usernum)

Arguments

Meetme (no description)
Usernum (no description)

Description

MeetmeList

Synopsis

List participants in a conference.

Syntax

MeetmeList(Conference)

Arguments

Conference

Conference number.

Description

Lists all users in a particular MeetMe conference. MeetmeList will follow as separate events, followed by a final event called MeetmeListComplete.

Queues

Synopsis

Queues.

Syntax

Queues()

Arguments

Description

QueueStatus

Synopsis

Show queue status.

Syntax

QueueStatus([Queue[,Member]])

Arguments

Queue (no description)
Member (no description)

Description

QueueSummary

Synopsis

Show queue summary.

Syntax

QueueSummary([Queue])

Arguments

Queue (no description)

Description

QueueAdd

Synopsis

Add interface to queue.

Syntax

QueueAdd(Queue,Interface[,Penalty[,Paused[,MemberName[,StateInterface]]]])

Arguments

Queue (no description)
Interface (no description)
Penalty (no description)
Paused (no description)
MemberName (no description)
StateInterface (no description)

Description

QueueRemove

Synopsis

Remove interface from queue.

Syntax

QueueRemove(Queue,Interface)

Arguments

Queue (no description)
Interface (no description)

Description

QueuePause

Synopsis

Makes a queue member temporarily unavailable.

Syntax

QueuePause(Interface,Paused[,Queue[,Reason]])

Arguments

Interface (no description)
Paused (no description)
Queue (no description)
Reason (no description)

Description

QueueLog

Synopsis

Adds custom entry in queue_log.

Syntax

QueueLog(Queue,Event[,Uniqueid[,Interface[,Message]]])

Arguments

Queue (no description)
Event (no description)
Uniqueid (no description)
Interface (no description)
Message (no description)

Description

QueuePenalty

Synopsis

Set the penalty for a queue member.

Syntax

QueuePenalty(Interface,Penalty[,Queue])

Arguments

Interface (no description)
Penalty (no description)
Queue (no description)

Description

QueueRule

Synopsis

Queue Rules.

Syntax

QueueRule([Rule])

Arguments

Rule (no description)

Description

QueueReload

Synopsis

Reload a queue, queues, or any sub-section of a queue or queues.

Syntax

QueueReload([Queue[,Members[,Rules[,Parameters]]]])

Arguments

Queue (no description)
Members (no description)
Rules (no description)
Parameters (no description)

Description

QueueReset

Synopsis

Reset queue statistics.

Syntax

QueueReset([Queue])

Arguments

Queue (no description)

Description

PlayDTMF

Synopsis

Play DTMF signal on a specific channel.

Syntax

PlayDTMF(Channel,Digit)

Arguments

Channel

Channel name to send digit to.

Digit

The DTMF digit to play.

Description

Plays a dtmf digit on the specified channel.

VoicemailUsersList

Synopsis

List All Voicemail User Information.

Syntax

VoicemailUsersList()

Arguments

Description

DBGet

Synopsis

Get DB Entry.

Syntax

DBGet(Family,Key)

Arguments

Family (no description)
Key (no description)

Description

DBPut

Synopsis

Put DB entry.

Syntax

DBPut(Family,Key[,Val])

Arguments

Family (no description)
Key (no description)
Val (no description)

Description

DBDel

Synopsis

Delete DB entry.

Syntax

DBDel(Family,Key)

Arguments

Family (no description)
Key (no description)

Description

DBDelTree

Synopsis

Delete DB Tree.

Syntax

DBDelTree(Family[,Key])

Arguments

Family (no description)
Key (no description)

Description

ParkedCalls

Synopsis

List parked calls.

Syntax

ParkedCalls()

Arguments

Description

List parked calls.

Park

Synopsis

Park a channel.

Syntax

Park(Channel,Channel2[,Timeout])

Arguments

Channel

Channel name to park.

Channel2

Channel to announce park info to (and return to if timeout).

Timeout

Number of milliseconds to wait before callback.

Description

Park a channel.

Bridge

Synopsis

Bridge two channels already in the PBX.

Syntax

Bridge(Channel1,Channel2[,Tone])

Arguments

Channel1

Channel to Bridge to Channel2.

Channel2

Channel to Bridge to Channel1.

Tone

Play courtesy tone to Channel 2.

Description

Bridge together two channels already in the PBX.

Ping

Synopsis

Keepalive command.

Syntax

Ping()

Arguments

Description

A 'Ping' action will ellicit a 'Pong' response. Used to keep the manager connection open.

Events

Synopsis

Control Event Flow.

Syntax

Events(EventMask)

Arguments

EventMask

If all events should be sent.

If no events should be sent.

To select which flags events should have to be sent.

Description

Enable/Disable sending of events to this manager client.

Logoff

Synopsis

Logoff Manager.

Syntax

Logoff()

Arguments

Description

Logoff the current manager session.

Login

Synopsis

Login Manager.

Syntax

Login([ActionID])

Arguments

ActionID

ActionID for this transaction. Will be returned.

Description

Login Manager.

Challenge

Synopsis

Generate Challenge for MD5 Auth.

Syntax

Challenge()

Arguments

Description

Generate a challenge for MD5 authentication.

Hangup

Synopsis

Hangup channel.

Syntax

Hangup(Channel[,Cause])

Arguments

Channel

The channel name to be hangup.

Cause

Numeric hangup cause.

Description

Hangup a channel.

Status

Synopsis

List channel status.

Syntax

Status(Channel[,Variables])

Arguments

Channel

The name of the channel to query for status.

Variables

Comma , separated list of variable to include.

Description

Will return the status information of each channel along with the value for the specified channel variables.

Setvar

Synopsis

Set a channel variable.

Syntax

Setvar([Channel,]Variable,Value)

Arguments

Channel

Channel to set variable for.

Variable

Variable name.

Value

Variable value.

Description

Set a global or local channel variable.

Getvar

Synopsis

Gets a channel variable.

Syntax

Getvar([Channel,]Variable)

Arguments

Channel

Channel to read variable from.

Variable

Variable name.

Description

Get the value of a global or local channel variable.

GetConfig

Synopsis

Retrieve configuration.

Syntax

GetConfig(Filename[,Category])

Arguments

Filename

Configuration filename (e.g. foo.conf).

Category

Category in configuration file.

Description

This action will dump the contents of a configuration file by category and contents or optionally by specified category only.

GetConfigJSON

Synopsis

Retrieve configuration (JSON format).

Syntax

GetConfigJSON(Filename)

Arguments

Filename

Configuration filename (e.g. foo.conf).

Description

This action will dump the contents of a configuration file by category and contents in JSON format. This only makes sense to be used using rawman over the HTTP interface.

UpdateConfig

Synopsis

Update basic configuration.

Syntax

UpdateConfig(SrcFilename,DstFilename[,Reload[,Action-XXXXXX[,Cat-XXXXXX[,Var-XXXXXX[,Value-XXXXXX[,Match-XXXXXX[,Line-XXXXXX]]]]]]])

Arguments

SrcFilename

Configuration filename to read (e.g. foo.conf).

DstFilename

Configuration filename to write (e.g. foo.conf)

Reload

Whether or not a reload should take place (or name of specific module).

Action-XXXXXX

Action to take.

X's represent 6 digit number beginning with 000000.

Cat-XXXXXX

Category to operate on.

Var-XXXXXX

Variable to work on.

Value-XXXXXX

Value to work on.

Match-XXXXXX

Extra match required to match line.

Line-XXXXXX

Line in category to operate on (used with delete and insert actions).

Description

This action will modify, create, or delete configuration elements in Asterisk configuration files.

CreateConfig

Synopsis

Creates an empty file in the configuration directory.

Syntax

CreateConfig(Filename)

Arguments

Filename

The configuration filename to create (e.g. foo.conf).

Description

This action will create an empty file in the configuration directory. This action is intended to be used before an UpdateConfig action.

ListCategories

Synopsis

List categories in configuration file.

Syntax

ListCategories(Filename)

Arguments

Filename

Configuration filename (e.g. foo.conf).

Description

This action will dump the categories in a given file.

Redirect

Synopsis

Redirect (transfer) a call.

Syntax

Redirect([Channel,ExtraChannel,]Exten,Context,Priority)

Arguments

Channel

Channel to redirect.

ExtraChannel

Second call leg to transfer (optional).

Exten

Extension to transfer to.

Context

Context to transfer to.

Priority

Priority to transfer to.

Description

Redirect (transfer) a call.

Atxfer

Synopsis

Attended transfer.

Syntax

Atxfer(Channel,Exten,Context,Priority)

Arguments

Channel

Transferer's channel.

Exten

Extension to transfer to.

Context

Context to transfer to.

Priority

Priority to transfer to.

Description

Attended transfer.

Originate

Synopsis

Originate a call.

Syntax

Originate(Channel[,Exten[,Context[,Priority[,Application[,Data[,Timeout[,CallerID[,Variable[,Account[,Async]]]]]]]]]])

Arguments

Channel

Channel name to call.

Exten

Extension to use (requires Context and Priority)

Context

Context to use (requires Exten and Priority)

Priority

Priority to use (requires Exten and Context)

Application

Application to execute.

Data

Data to use (requires Application).

Timeout

How long to wait for call to be answered (in ms).

CallerID

Caller ID to be set on the outgoing channel.

Variable

Channel variable to set, multiple Variable: headers are allowed.

Account

Account code.

Async

Set to true for fast origination.

Description

Generates an outgoing call to a Extension/Context/Priority or Application/Data

Command

Synopsis

Execute Asterisk CLI Command.

Syntax

Command(Command)

Arguments

Command

Asterisk CLI command to run.

Description

Run a CLI command.

ExtensionState

Synopsis

Check Extension Status.

Syntax

ExtensionState(Exten,Context)

Arguments

Exten

Extension to check state on.

Context

Context for extension.

Description

Report the extension state for given extension. If the extension has a hint, will use devicestate to check the status of the device connected to the extension.

Will return an Extension Status message. The response will include the hint for the extension and the status.

AbsoluteTimeout

Synopsis

Set absolute timeout.

Syntax

AbsoluteTimeout(Channel,Timeout)

Arguments

Channel

Channel name to hangup.

Timeout

Maximum duration of the call (sec).

Description

Hangup a channel after a certain time. Acknowledges set time with Timeout Set message.

MailboxStatus

Synopsis

Check mailbox.

Syntax

MailboxStatus(Mailbox)

Arguments

Mailbox

Full mailbox ID mailbox@vm-context.

Description

Checks a voicemail account for status.

Returns number of messages.

Message: Mailbox Status.

Mailbox: mailboxid.

Waiting: count.

MailboxCount

Synopsis

Check Mailbox Message Count.

Syntax

MailboxCount(Mailbox)

Arguments

Mailbox

Full mailbox ID mailbox@vm-context.

Description

Checks a voicemail account for new messages.

Returns number of urgent, new and old messages.

Message: Mailbox Message Count

Mailbox: mailboxid

UrgentMessages: count

NewMessages: count

OldMessages: count

ListCommands

Synopsis

List available manager commands.

Syntax

ListCommands()

Arguments

Description

Returns the action name and synopsis for every action that is available to the user.

SendText

Synopsis

Send text message to channel.

Syntax

SendText(Channel,Message)

Arguments

Channel

Channel to send message to.

Message

Message to send.

Description

Sends A Text Message to a channel while in a call.

UserEvent

Synopsis

Send an arbitrary event.

Syntax

UserEvent(UserEvent[,Header1[,HeaderN]])

Arguments

UserEvent

Event string to send.

Header1

Content1.

HeaderN

ContentN.

Description

Send an event to manager sessions.

WaitEvent

Synopsis

Wait for an event to occur.

Syntax

WaitEvent(Timeout)

Arguments

Timeout

Maximum time (in seconds) to wait for events, -1 means forever.

Description

This action will ellicit a Success response. Whenever a manager event is queued. Once WaitEvent has been called on an HTTP manager session, events will be generated and queued.

CoreSettings

Synopsis

Show PBX core settings (version etc).

Syntax

CoreSettings()

Arguments

Description

Query for Core PBX settings.

CoreStatus

Synopsis

Show PBX core status variables.

Syntax

CoreStatus()

Arguments

Description

Query for Core PBX status.

Reload

Synopsis

Send a reload event.

Syntax

Reload([Module])

Arguments

Module

Name of the module to reload.

Description

Send a reload event.

CoreShowChannels

Synopsis

List currently active channels.

Syntax

CoreShowChannels()

Arguments

Description

List currently defined channels and some information about them.

ModuleLoad

Synopsis

Module management.

Syntax

ModuleLoad([Module,]LoadType)

Arguments

Module

Asterisk module name (including .so extension) or subsystem identifier:

LoadType

The operation to be done on module.

If no module is specified for a reload loadtype, all modules are reloaded.

Description

Loads, unloads or reloads an Asterisk module in a running system.

ModuleCheck

Synopsis

Check if module is loaded.

Syntax

ModuleCheck(Module)

Arguments

Module

Asterisk module name (not including extension).

Description

Checks if Asterisk module is loaded. Will return Success/Failure. For success returns, the module revision number is included.

ShowDialPlan

Synopsis

La merde se produit.

Syntax

ShowDialPlan([Extension[,Context]])

Arguments

Extension

Show a specific extension.

Context

Show a specific context.

Description

Show dialplan contexts and extensions. Be aware that showing the full dialplan may take a lot of capacity.

AGI

Synopsis

Add an AGI command to execute by Async AGI.

Syntax

AGI(Channel,Command[,CommandID])

Arguments

Channel

Channel that is currently in Async AGI.

Command

Application to execute.

CommandID

This will be sent back in CommandID header of AsyncAGI exec event notification.

Description

Add an AGI command to the execute queue of the channel in Async AGI.

JabberSend

Synopsis

Sends a message to a Jabber Client.

Syntax

JabberSend(Jabber,JID,Message)

Arguments

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.

Description

Sends a message to a Jabber Client.

Monitor

Synopsis

Monitor a channel.

Syntax

Monitor(Channel[,File[,Format[,Mix]]])

Arguments

Channel

Used to specify the channel to record.

File

Is the name of the file created in the monitor spool directory. Defaults to the same name as the channel (with slashes replaced with dashes).

Format

Is the audio recording format. Defaults to wav.

Mix

Boolean parameter as to whether to mix the input and output channels together after the recording is finished.

Description

This action may be used to record the audio on a specified channel.

StopMonitor

Synopsis

Stop monitoring a channel.

Syntax

StopMonitor(Channel)

Arguments

Channel

The name of the channel monitored.

Description

This action may be used to end a previously started 'Monitor' action.

ChangeMonitor

Synopsis

Change monitoring filename of a channel.

Syntax

ChangeMonitor(Channel,File)

Arguments

Channel

Used to specify the channel to record.

File

Is the new name of the file created in the monitor spool directory.

Description

This action may be used to change the file started by a previous 'Monitor' action.

PauseMonitor

Synopsis

Pause monitoring of a channel.

Syntax

PauseMonitor(Channel)

Arguments

Channel

Used to specify the channel to record.

Description

This action may be used to temporarily stop the recording of a channel.

UnpauseMonitor

Synopsis

Unpause monitoring of a channel.

Syntax

UnpauseMonitor(Channel)

Arguments

Channel

Used to specify the channel to record.

Description

This action may be used to re-enable recording of a channel after calling PauseMonitor.

AGI Commands

46 commands total

Command Synopsis
answer Answer channel
asyncagi break Interrupts Async AGI
channel status Returns status of the connected channel.
control stream file Sends audio file on channel and allows the listner to control the stream.
database del Removes database key/value
database deltree Removes database keytree/value
database get Gets database value
database put Adds/updates database value
exec Executes a given Application
get data Prompts for DTMF on a channel
get full variable Evaluates a channel expression
get option Stream file, prompt for DTMF, with timeout.
get variable Gets a channel variable.
hangup Hangup the current channel.
noop Does nothing.
receive char Receives one character from channels supporting it.
receive text Receives text from channels supporting it.
record file Records to a given file.
say alpha Says a given character string.
say digits Says a given digit string.
say number Says a given number.
say phonetic Says a given character string with phonetics.
say date Says a given date.
say time Says a given time.
say datetime Says a given time as specfied by the format given.
send image Sends images to channels supporting it.
send text Sends text to channels supporting it.
set autohangup Autohangup channel in some time.
set callerid Sets callerid for the current channel.
set context Sets channel context.
set extension Changes channel extension.
set music Enable/Disable Music on hold generator
set priority Set channel dialplan priority.
set variable Sets a channel variable.
stream file Sends audio file on channel.
tdd mode Toggles TDD mode (for the deaf).
verbose Logs a message to the asterisk verbose log.
wait for digit Waits for a digit to be pressed.
speech create Creates a speech object.
speech set Sets a speech engine setting.
speech destroy Destroys a speech object.
speech load grammar Loads a grammar.
speech unload grammar Unloads a grammar.
speech activate grammar Activates a grammar.
speech deactivate grammar Deactivates a grammar.
speech recognize Recognizes speech.

answer

Synopsis

Answer channel

Syntax

answer()

Arguments

Description

Answers channel if not already in answer state. Returns -1 on channel failure, or 0 if successful.

See also

asyncagi break

Synopsis

Interrupts Async AGI

Syntax

asyncagi break()

Arguments

Description

Interrupts expected flow of Async AGI commands and returns control to previous source (typically, the PBX dialplan).

See also

channel status

Synopsis

Returns status of the connected channel.

Syntax

channel status([channelname])

Arguments

channelname (no description)

Description

Returns the status of the specified channelname. If no channel name is given then returns the status of the current channel.

Return values:

Channel is down and available.

Channel is down, but reserved.

Channel is off hook.

Digits (or equivalent) have been dialed.

Line is ringing.

Remote end is ringing.

Line is up.

Line is busy.

control stream file

Synopsis

Sends audio file on channel and allows the listner to control the stream.

Syntax

control stream file(filename,escape_digits[,skipms[,ffchar[,rewchr[,pausechr]]]])

Arguments

filename

The file extension must not be included in the filename.

escape_digits (no description)
skipms (no description)
ffchar

Defaults to *

rewchr

Defaults to #

pausechr (no description)

Description

Send the given file, allowing playback to be controled by the given digits, if any. Use double quotes for the digits if you wish none to be permitted. Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed, or -1 on error or if the channel was disconnected.

database del

Synopsis

Removes database key/value

Syntax

database del(family,key)

Arguments

family (no description)
key (no description)

Description

Deletes an entry in the Asterisk database for a given family and key.

Returns 1 if successful, 0 otherwise.

database deltree

Synopsis

Removes database keytree/value

Syntax

database deltree(family[,keytree])

Arguments

family (no description)
keytree (no description)

Description

Deletes a family or specific keytree within a family in the Asterisk database.

Returns 1 if successful, 0 otherwise.

database get

Synopsis

Gets database value

Syntax

database get(family,key)

Arguments

family (no description)
key (no description)

Description

Retrieves an entry in the Asterisk database for a given family and key.

Returns 0 if key is not set. Returns 1 if key is set and returns the variable in parenthesis.

Example return code: 200 result=1 (testvariable)

database put

Synopsis

Adds/updates database value

Syntax

database put(family,key,value)

Arguments

family (no description)
key (no description)
value (no description)

Description

Adds or updates an entry in the Asterisk database for a given family, key, and value.

Returns 1 if successful, 0 otherwise.

exec

Synopsis

Executes a given Application

Syntax

exec(application,options)

Arguments

application (no description)
options (no description)

Description

Executes application with given options.

Returns whatever the application returns, or -2 on failure to find application.

get data

Synopsis

Prompts for DTMF on a channel

Syntax

get data(file[,timeout[,maxdigits]])

Arguments

file (no description)
timeout (no description)
maxdigits (no description)

Description

Stream the given file, and recieve DTMF data.

Returns the digits received from the channel at the other end.

get full variable

Synopsis

Evaluates a channel expression

Syntax

get full variable(variablename[,channel name])

Arguments

variablename (no description)
channel name (no description)

Description

Returns 0 if variablename is not set or channel does not exist. Returns 1 if variablename is set and returns the variable in parenthesis. Understands complex variable names and builtin variables, unlike GET VARIABLE.

Example return code: 200 result=1 (testvariable)

get option

Synopsis

Stream file, prompt for DTMF, with timeout.

Syntax

get option(filename,escape_digits[,timeout])

Arguments

filename (no description)
escape_digits (no description)
timeout (no description)

Description

Behaves similar to STREAM FILE but used with a timeout option.

See also

get variable

Synopsis

Gets a channel variable.

Syntax

get variable(variablename)

Arguments

variablename (no description)

Description

Returns 0 if variablename is not set. Returns 1 if variablename is set and returns the variable in parentheses.

Example return code: 200 result=1 (testvariable)

hangup

Synopsis

Hangup the current channel.

Syntax

hangup([channelname])

Arguments

channelname (no description)

Description

Hangs up the specified channel. If no channel name is given, hangs up the current channel

noop

Synopsis

Does nothing.

Syntax

noop()

Arguments

Description

Does nothing.

receive char

Synopsis

Receives one character from channels supporting it.

Syntax

receive char(timeout)

Arguments

timeout

The maximum time to wait for input in milliseconds, or 0 for infinite. Most channels

Description

Receives a character of text on a channel. Most channels do not support the reception of text. Returns the decimal value of the character if one is received, or 0 if the channel does not support text reception. Returns -1 only on error/hangup.

receive text

Synopsis

Receives text from channels supporting it.

Syntax

receive text(timeout)

Arguments

timeout

The timeout to be the maximum time to wait for input in milliseconds, or 0 for infinite.

Description

Receives a string of text on a channel. Most channels do not support the reception of text. Returns -1 for failure or 1 for success, and the string in parenthesis.

record file

Synopsis

Records to a given file.

Syntax

record file(filename,format,escape_digits,timeout[,offset samples[,BEEP[,s=silence]]])

Arguments

filename (no description)
format (no description)
escape_digits (no description)
timeout (no description)
offset samples (no description)
BEEP (no description)
s=silence (no description)

Description

Record to a file until a given dtmf digit in the sequence is received. Returns -1 on hangup or error. The format will specify what kind of file will be recorded. The timeout is the maximum record time in milliseconds, or -1 for no timeout. offset samples is optional, and, if provided, will seek to the offset without exceeding the end of the file. silence is the number of seconds of silence allowed before the function returns despite the lack of dtmf digits or reaching timeout. silence value must be preceeded by s= and is also optional.

say alpha

Synopsis

Says a given character string.

Syntax

say alpha(number,escape_digits)

Arguments

number (no description)
escape_digits (no description)

Description

Say a given character string, returning early if any of the given DTMF digits are received on the channel. Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup.

say digits

Synopsis

Says a given digit string.

Syntax

say digits(number,escape_digits)

Arguments

number (no description)
escape_digits (no description)

Description

Say a given digit string, returning early if any of the given DTMF digits are received on the channel. Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup.

say number

Synopsis

Says a given number.

Syntax

say number(number,escape_digits[,gender])

Arguments

number (no description)
escape_digits (no description)
gender (no description)

Description

Say a given number, returning early if any of the given DTMF digits are received on the channel. Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup.

say phonetic

Synopsis

Says a given character string with phonetics.

Syntax

say phonetic(string,escape_digits)

Arguments

string (no description)
escape_digits (no description)

Description

Say a given character string with phonetics, returning early if any of the given DTMF digits are received on the channel. Returns 0 if playback completes without a digit pressed, the ASCII numerical value of the digit if one was pressed, or -1 on error/hangup.

say date

Synopsis

Says a given date.

Syntax

say date(date,escape_digits)

Arguments

date

Is number of seconds elapsed since 00:00:00 on January 1, 1970. Coordinated Universal Time (UTC).

escape_digits (no description)

Description

Say a given date, returning early if any of the given DTMF digits are received on the channel. Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup.

say time

Synopsis

Says a given time.

Syntax

say time(time,escape_digits)

Arguments

time

Is number of seconds elapsed since 00:00:00 on January 1, 1970. Coordinated Universal Time (UTC).

escape_digits (no description)

Description

Say a given time, returning early if any of the given DTMF digits are received on the channel. Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup.

say datetime

Synopsis

Says a given time as specfied by the format given.

Syntax

say datetime(time,escape_digits[,format[,timezone]])

Arguments

time

Is number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC)

escape_digits (no description)
format

Is the format the time should be said in. See voicemail.conf (defaults to ABdY 'digits/at' IMp).

timezone

Acceptable values can be found in /usr/share/zoneinfo Defaults to machine default.

Description

Say a given time, returning early if any of the given DTMF digits are received on the channel. Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup.

send image

Synopsis

Sends images to channels supporting it.

Syntax

send image(image)

Arguments

image (no description)

Description

Sends the given image on a channel. Most channels do not support the transmission of images. Returns 0 if image is sent, or if the channel does not support image transmission. Returns -1 only on error/hangup. Image names should not include extensions.

send text

Synopsis

Sends text to channels supporting it.

Syntax

send text(text to send)

Arguments

text to send

Text consisting of greater than one word should be placed in quotes since the command only accepts a single argument.

Description

Sends the given text on a channel. Most channels do not support the transmission of text. Returns 0 if text is sent, or if the channel does not support text transmission. Returns -1 only on error/hangup.

set autohangup

Synopsis

Autohangup channel in some time.

Syntax

set autohangup(time)

Arguments

time (no description)

Description

Cause the channel to automatically hangup at time seconds in the future. Of course it can be hungup before then as well. Setting to 0 will cause the autohangup feature to be disabled on this channel.

set callerid

Synopsis

Sets callerid for the current channel.

Syntax

set callerid(number)

Arguments

number (no description)

Description

Changes the callerid of the current channel.

set context

Synopsis

Sets channel context.

Syntax

set context(desired context)

Arguments

desired context (no description)

Description

Sets the context for continuation upon exiting the application.

set extension

Synopsis

Changes channel extension.

Syntax

set extension(new extension)

Arguments

new extension (no description)

Description

Changes the extension for continuation upon exiting the application.

set music

Synopsis

Enable/Disable Music on hold generator

Syntax

set music(,class)

Arguments

(no description)
class (no description)

Description

Enables/Disables the music on hold generator. If class is not specified, then the default music on hold class will be used.

Always returns 0.

set priority

Synopsis

Set channel dialplan priority.

Syntax

set priority(priority)

Arguments

priority (no description)

Description

Changes the priority for continuation upon exiting the application. The priority must be a valid priority or label.

set variable

Synopsis

Sets a channel variable.

Syntax

set variable(variablename,value)

Arguments

variablename (no description)
value (no description)

Description

Sets a variable to the current channel.

stream file

Synopsis

Sends audio file on channel.

Syntax

stream file(filename,escape_digits[,sample offset])

Arguments

filename

File name to play. The file extension must not be included in the filename.

escape_digits

Use double quotes for the digits if you wish none to be permitted.

sample offset

If sample offset is provided then the audio will seek to sample offset before play starts.

Description

Send the given file, allowing playback to be interrupted by the given digits, if any. Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed, or -1 on error or if the channel was disconnected.

See also

tdd mode

Synopsis

Toggles TDD mode (for the deaf).

Syntax

tdd mode(boolean)

Arguments

boolean (no description)

Description

Enable/Disable TDD transmission/reception on a channel. Returns 1 if successful, or 0 if channel is not TDD-capable.

verbose

Synopsis

Logs a message to the asterisk verbose log.

Syntax

verbose(message,level)

Arguments

message (no description)
level (no description)

Description

Sends message to the console via verbose message system. level is the the verbose level (1-4). Always returns 1

wait for digit

Synopsis

Waits for a digit to be pressed.

Syntax

wait for digit(timeout)

Arguments

timeout (no description)

Description

Waits up to timeout milliseconds for channel to receive a DTMF digit. Returns -1 on channel failure, 0 if no digit is received in the timeout, or the numerical value of the ascii of the digit if one is received. Use -1 for the timeout value if you desire the call to block indefinitely.

speech create

Synopsis

Creates a speech object.

Syntax

speech create(engine)

Arguments

engine (no description)

Description

Create a speech object to be used by the other Speech AGI commands.

speech set

Synopsis

Sets a speech engine setting.

Syntax

speech set(name,value)

Arguments

name (no description)
value (no description)

Description

Set an engine-specific setting.

speech destroy

Synopsis

Destroys a speech object.

Syntax

speech destroy()

Arguments

Description

Destroy the speech object created by SPEECH CREATE.

See also

speech load grammar

Synopsis

Loads a grammar.

Syntax

speech load grammar(grammar name,path to grammar)

Arguments

grammar name (no description)
path to grammar (no description)

Description

Loads the specified grammar as the specified name.

speech unload grammar

Synopsis

Unloads a grammar.

Syntax

speech unload grammar(grammar name)

Arguments

grammar name (no description)

Description

Unloads the specified grammar.

speech activate grammar

Synopsis

Activates a grammar.

Syntax

speech activate grammar(grammar name)

Arguments

grammar name (no description)

Description

Activates the specified grammar on the speech object.

speech deactivate grammar

Synopsis

Deactivates a grammar.

Syntax

speech deactivate grammar(grammar name)

Arguments

grammar name (no description)

Description

Deactivates the specified grammar on the speech object.

speech recognize

Synopsis

Recognizes speech.

Syntax

speech recognize(prompt,timeout[,offset])

Arguments

prompt (no description)
timeout (no description)
offset (no description)

Description

Plays back given prompt while listening for speech and dtmf.