A-C

From AstriPedia

Jump to: navigation, search
Index A-C of Asterisk Applications

Contents

AbsoluteTimeout

Synopsis

Set absolute maximum time of call

Description

AbsoluteTimeout(seconds):

This application will set the absolute maximum amount of time permitted for a call. A setting of 0 disables the timeout. AbsoluteTimeout has been deprecated in favor of Set(TIMEOUT(absolute)=timeout)

AddQueueMember

Synopsis

Dynamically adds queue members

Description

AddQueueMember(queuename[|interface[|penalty[|options]]]):

Dynamically adds interface to an existing queue. If the interface is already in the queue and there exists an n+101 priority then it will then jump to this priority. Otherwise it will return an error The option string may contain zero or more of the following characters:

'j' -- jump to +101 priority when appropriate.
This application sets the following channel variable upon completion:
AQMSTATUS    The status of the attempt to add a queue member as a text string, one of
ADDED | MEMBERALREADY | NOSUCHQUEUE
Example: AddQueueMember(techsupport|SIP/3000)

ADSIProg

Synopsis

Load Asterisk ADSI Scripts into phone

Description

ADSIProg(script):

This application programs an ADSI Phone with the given script. If nothing is specified, the default script (asterisk.adsi) is used.

AgentCallbackLogin

Synopsis

Call agent callback login

Description

AgentCallbackLogin([AgentNo][|[options][|[exten]@context]]):

Asks the agent to login to the system with callback. The agent's callback extension is called (optionally with the specified context). The option string may contain zero or more of the following characters:

     's' -- silent login - do not announce the login ok segment agent logged in/off

AgentLogin

Synopsis

Call agent login

Description

AgentLogin([AgentNo][|options]):

Asks the agent to login to the system. Always returns -1. While logged in, the agent can receive calls and will hear a 'beep' when a new call comes in. The agent can dump the call by pressing the star key. The option string may contain zero or more of the following characters:

's' -- silent login - do not announce the login ok segment after agent logged in/off

AgentMonitorOutgoing

Synopsis

Record agent's outgoing call

Description

AgentMonitorOutgoing([options]):

Tries to figure out the id of the agent who is placing outgoing call based on comparison of the callerid of the current interface and the global variable placed by the AgentCallbackLogin application. That's why it should be used only with the AgentCallbackLogin app. Uses the monitoring functions in chan_agent instead of Monitor application. That have to be configured in the agents.conf file.

Return value:
Normally the app returns 0 unless the options are passed. Also if the callerid or the agentid are not specified it'll look for n+101 priority.

Options:

       'd' - make the app return -1 if there is an error condition and there is
             no extension n+101
       '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.

AGI

Synopsis

Executes an AGI compliant application

Description

[E|Dead]AGI(command|args):

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. Returns -1 on hangup (except for DeadAGI) or if application requested hangup, or 0 on on-hangup exit. Using 'EAGI' provides enhanced AGI, with incoming audio available out of band on file descriptor 3

Use the CLI command 'show agi' to list available agi commands

             answer   Answer channel
     channel status   Returns status of the connected channel
       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
control stream file   Sends audio file on channel and allows the listner to control the stream
           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

AlarmReceiver

Synopsis

Provide support for receving alarm reports from a burglar or fire alarm panel

Description

AlarmReceiver():

Only 1 signalling format is supported at this time: Ademco Contact ID. 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.

Answer

Synopsis

Answer a channel if ringing

Description

Answer([delay]):

If the call has not been answered, this application will answer it. Otherwise, it has no effect on the call. If a delay is specified, Asterisk will wait this number of milliseconds before returning to the dialplan after answering the call.

AppendCDRUserField

Synopsis

Append to the CDR user field

[Description

AppendCDRUserField(value):

Append value to the CDR user field The Call Data Record (CDR) user field is an extra field you can use for data not stored anywhere else in the record. CDR records can be used for billing or storing other arbitrary data (I.E. telephone survey responses) Also see SetCDRUserField().

Authenticate

Synopsis

Authenticate a user

Description

Authenticate(password[|options]):

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. If the passsword is invalid, the 'j' option is specified, and priority n+101 exists, dialplan execution will continnue at this location.

 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
    j - Support jumping to n+101 if authentication fails
    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)

BackGround

Synopsis

Play a file while awaiting extension

Description

Background(filename1[&filename2...][|options[|langoverride][|context]]):

This application will play the given list of files 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. The 'langoverride' option explicity specifies which language to attempt to use for the requested sound files. If a 'context' is specified, this is the dialplan context that this application will use when exiting to a dialed extension. If one of the requested sound files does not exist, call processing will be terminated.

 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

BackgroundDetect

Synopsis

Background a file with talk detect

Description

 BackgroundDetect(filename[|sil[|min|[max]]]):

Plays back a given 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 then the audio playback is aborted and processing jumps to the 'talk' extension if available. If unspecified, sil, min, and max default to 1000, 100, and infinity respectively.

Busy

Synopsis

Indicate the Busy condition

Description

Busy([timeout]):

This application will indicate the busy condition to the calling channel. If the optional timeout is 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.

ChangeMonitor

Synopsis

Change monitoring filename of a channel

Description

ChangeMonitor(filename_base)

Changes monitoring filename of a channel. Has no effect if the channel is not monitored The argument is the new filename base to use for monitoring this channel.

ChanIsAvail

Synopsis

Check channel availability

Description

ChanIsAvail(Technology/resource[&Technology2/resource2...][|options]):

This application will check to see if any of the specified channels are available.
The following variables will be set by this application:

 ${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
 Options:
   s - Consider the channel unavailable if the channel is in use at all
   j - Support jumping to priority n+101 if no channel is available

ChanSpy

Synopsis

Listen to the audio of an active channel

Description

ChanSpy([chanprefix][|options]):

This application is used to listen to the audio from an active 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'.
 Options:
   b - Only spy on channels involved in a bridged call.
   g(grp) - Match only channels where their ${SPYGROUP} variable is set to
            'grp'.
   q - Don't play a beep when beginning to spy on a channel.
   r[(basename)] - Record the session to the monitor spool directory. An
                   optional base for the filename may be specified. The
                   default is 'chanspy'.
   v([value]) - Adjust the initial volume in the range from -4 to 4. A
                negative value refers to a quieter setting.

CheckGroup

Synopsis

Check the channel count of a group against a limit

Description

Usage: CheckGroup(max[@category][|options])

Checks that the current number of total channels in the current channel's group does not exceed 'max'. If the number does not exceed 'max', we continue to the next step. The option string may contain zero of the following character:

     'j' -- jump to n+101 priority if the number does in fact exceed max,
            and priority n+101 exists. Execuation then continues at that
            step, otherwise -1 is returned.
 This application sets the following channel variable upon successful completion:
       CHECKGROUPSTATUS  The status of the check that the current channel's
                        group does not exceed 'max'. It's value is one of
               OK | OVERMAX

Congestion

Synopsis

Indicate the Congestion condition

Description

Congestion([timeout]):

This application will indicate the congenstion condition to the calling channel. If the optional timeout is 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.

ControlPlayback

Synopsis

Play a file with fast forward and rewind

Description

ControlPlayback(file[|skipms[|ff[|rew[|stop[|pause[|restart|options]]]]]]]):

This application will play back the given filename.
By default, the '*' key can be used to rewind, and the '#' key can be used to fast-forward.

Parameters:
 skipms  - This is number of milliseconds to skip when rewinding or
           fast-forwarding.
 ff      - Fast-forward when this DTMF digit is received.
 rew     - Rewind when this DTMF digit is received.
 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:

 j - Jump to priority n+101 if the requested file is not found.
 This application sets the following channel variable upon completion:
 CPLAYBACKSTATUS -  This variable contains the status of the attempt as a text
                    string, one of: SUCCESS | USERSTOPPED | ERROR

Cut

Synopsis

Splits a variable's contents using the specified delimiter

Description

Cut(newvar=varname,delimiter,fieldspec):

This application will split the contents of a variable based on the given delimeter and store the result in a new variable.

Parameters:
 newvar    - new variable created from result string
 varname   - variable you want cut
 delimiter - defaults to '-'
 fieldspec - number of the field you want (1-based offset)
             may also be specified as a range (with -)
             or group of ranges and fields (with &)

This application has been deprecated in favor of the CUT function.

Personal tools