S-T

From AstriPedia

Jump to: navigation, search

Contents

Index S-T of Asterisk Applications

SayAlpha

Synopsis

Say Alpha

Description

SayAlpha(string):

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

SayCountPL

Synopsis

Say the counting word the fits to a number

Description

Polish grammar has some funny rules for counting words. for example 1 zloty, 2 zlote, 5 zlotych. This application will take the words for 1, 2-4 and 5 and decide based on grammar rules which one to use with the number you pass to it.

Example: saycountpl(zloty,zlote,zlotych,122) will give: zlote

SayDigits

Synopsis

Say Digits

Description

SayDigits(digits): 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 the LANGUAGE function for more information on setting the language for the channel.

SayNumber

Synopsis

Say Number

Description

SayNumber(digits[,gender]): This application will play the sounds that correspond to the given number. Optionally, a gender may be specified. This will use the language that is currently set for the channel. See the LANGUAGE function for more information on setting the language for the channel.

SayPhonetic

Synopsis

Say Phonetic

Description

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

SayUnixTime

Synopsis

Says a specified time in a custom format

Description

SayUnixTime([unixtime][|[timezone][|format]])
  unixtime: time, in seconds since Jan 1, 1970.  May be negative.
             defaults to now.
  timezone: timezone, see /usr/share/zoneinfo for a list.
             defaults to machine default.
  format:   a format the time is to be said in.  See voicemail.conf.
             defaults to "ABdY 'digits/at' IMp"

SendDTMF

Synopsis

Sends arbitrary DTMF digits

Description

SendDTMF(digits[|timeout_ms]): Sends DTMF digits on a channel.
Accepted digits: 0-9, *#abcd, w (.5s pause)
The application will either pass the assigned digits or terminate if it encounters an error.

SendImage

Synopsis

Send an image file

Description

SendImage(filename): Sends an image on a channel. If the channel supports image transport but the image send fails, the channel will be hung up. Otherwise, the dialplan continues execution. The option string may contain the following character:

       'j' -- jump to priority n+101 if the channel doesn't support image transport
This application sets the following channel variable upon completion:
       SENDIMAGESTATUS         The status is the result of the attempt as a text string, one of
               OK | NOSUPPORT

SendText

Synopsis

Send a Text Message

Description

SendText(text[|options]): Sends text to current channel (callee). Result of transmission will be stored in the SENDTEXTSTATUS

channel variable:

     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. The option string many contain the following character: 'j' -- jump to n+101 priority if the channel doesn't support text transport

SendURL

Synopsis

Send a URL

Description

SendURL(URL[|option]): Requests client go to URL (IAX2) or sends the URL to the client (other channels).

Result is returned in the SENDURLSTATUS channel variable:

   SUCCESS       URL successfully sent to client
   FAILURE       Failed to send URL
   NOLOAD        Clien failed to load URL (wait enabled)
   UNSUPPORTED   Channel does not support URL transport

If the option 'wait' is specified, execution will wait for an acknowledgement that the URL has been loaded before continuing and will return -1 if the peer is unable to load the URL

Old behaviour (deprecated):

If the client does not support Asterisk "html" transport,
and there exists a step with priority n + 101, then execution will
continue at that step.
Otherwise, execution will continue at the next priority level.
SendURL only returns 0 if the URL was sent correctly  or if
the channel does not support HTML transport, and -1 otherwise.

Set

Synopsis

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

Description

Set(name1=value1|name2=value2|..[|options])

This function can be used to set the value of channel variables or dialplan functions. It will accept up to 24 name/value pairs. 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.

 Options:
   g - Set variable globally instead of on the channel
       (applies only to variables, not functions) 

SetAccount

Synopsis

Set the CDR Account Code

Description

SetAccount([account]):

This application will set the channel account code for billing purposes. SetAccount has been deprecated in favor of the Set(CDR(accountcode)=account).

SetAMAFlags

Synopsis

Set the AMA Flags

Description

SetAMAFlags([flag]): This channel will set the channel's AMA Flags for billing purposes.

SetCallerID

Synopsis

Set CallerID

Description

SetCallerID(clid[|a]): Set Caller*ID on a call to a new value. Sets ANI as well if a flag is used.

SetCallerPres

Synopsis

Set CallerID Presentation

Description

SetCallerPres(presentation): Set Caller*ID presentation on a call.

Valid presentations are:

     allowed_not_screened    : Presentation Allowed, Not Screened
     allowed_passed_screen   : Presentation Allowed, Passed Screen
     allowed_failed_screen   : Presentation Allowed, Failed Screen
     allowed                 : Presentation Allowed, Network Number
     prohib_not_screened     : Presentation Prohibited, Not Screened
     prohib_passed_screen    : Presentation Prohibited, Passed Screen
     prohib_failed_screen    : Presentation Prohibited, Failed Screen
     prohib                  : Presentation Prohibited, Network Number
     unavailable             : Number Unavailable

SetCDRUserField

Synopsis

Set the CDR user field

Description

SetCDRUserField(value):

Set the CDR 'user field' to value. 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 AppendCDRUserField().

SetCIDName

Synopsis

Set CallerID Name

Description

SetCIDName(cname[|a]):

Set Caller*ID Name on a call to a new value, while preserving the original Caller*ID number. This is useful for providing additional information to the called party. SetCIDName has been deprecated in favor of the function CALLERID(name)

SetCIDNum

Synopsis

Set CallerID Number

Description

SetCIDNum(cnum[|a]):

Set Caller*ID Number on a call to a new value, while preserving the original Caller*ID name. This is useful for providing additional information to the called party. Sets ANI as well if a flag is used. SetCIDNum has been deprecated in favor of the function CALLERID(number)

SetGlobalVar

Synopsis

Set a global variable to a given value

Description

SetGlobalVar(variable=value): This application sets a given global variable to the specified value.

SetGroup

Synopsis

Set the channel's group

Description

Usage: SetGroup(groupname[@category])

Sets the channel group to the specified value. Equivalent to Set(GROUP=group). Always returns 0.

SetLanguage

Synopsis

Set the channel's preferred language

Description

SetLanguage(language):

This will set the channel language to the given value. This information is used for the syntax in generation of numbers, and to choose a sound file in the given language, when it is available.

For example, if language is set to 'fr' and the file 'demo-congrats' is requested to be played, if the file 'fr/demo-congrats' exists, then it will play that file. If not, it will play the normal 'demo-congrats'. For some language codes, SetLanguage also changes the syntax of some Asterisk functions, like SayNumber. SetLanguage has been deprecated in favor of Set(LANGUAGE()=language)

SetMusicOnHold

Synopsis

Set default Music On Hold class

Description

SetMusicOnHold(class):

Sets the default class for music on hold for a given channel. When music on hold is activated, this class will be used to select which music is played.

SetRDNIS

Synopsis

Set RDNIS Number

Description

SetRDNIS(cnum): Set RDNIS Number on a call to a new value. SetRDNIS has been deprecated in favor of the function CALLERID(rdnis)

SetTransferCapability

Synopsis

Set ISDN Transfer Capability

Description

SetTransferCapability(transfercapability): Set the ISDN Transfer Capability of a call to a new value.

Valid Transfer Capabilities are:

 SPEECH             : 0x00 - Speech (default, voice calls)
 DIGITAL            : 0x08 - Unrestricted digital information (data calls)
 RESTRICTED_DIGITAL : 0x09 - Restricted digital information
 3K1AUDIO           : 0x10 - 3.1kHz Audio (fax calls)
 DIGITAL_W_TONES    : 0x11 - Unrestricted digital information with tones/announcements
 VIDEO              : 0x18 - Video:

SetVar

Synopsis

Set channel variable(s)

Description

SetVar(name1=value1|name2=value2|..[|options]):

This application has been deprecated in favor of using the Set application.

SIPAddHeader

Synopsis

Add a SIP header to the outbound call

Description

SIPAddHeader(Header: Content) Adds a header to a SIP call placed with DIAL. Remember to user the X-header if you are adding non-standard SIP headers, like "X-Asterisk-Accountcode:". Use this with care. Adding the wrong headers may jeopardize the SIP dialog. Always returns 0

SIPDtmfMode

Synopsis

Change the dtmfmode for a SIP call

Description

SIPDtmfMode(inband|info|rfc2833): Changes the dtmfmode for a SIP call

SIPGetHeader

Synopsis

Get a SIP header from an incoming call

Description

SIPGetHeader(var=headername[|options]):

Sets a channel variable to the content of a SIP header

 Options:
   j - Jump to priority n+101 if the requested header isn't found.
 This application sets the following channel variable upon completion:
     SIPGETSTATUS - This variable will contain the status of the attempt
                    FOUND | NOTFOUND

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

SMS

Synopsis

Communicates with SMS service centres and SMS capable analogue phones

Description

SMS(name|[a][s]):

SMS handles exchange of SMS data with a call to/from SMS capabale 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 Typical usage is to use to handle called from the SMS service centre CLI, or to set up a call using 'outgoing' or manager interface to connect service centre to SMS() name is the name of the queue used in /var/spool/asterisk/sms Arguments:

a: answer, i.e. send initial FSK packet.
s: act as service centre talking to a phone.

Messages are processed as per text file message queues. smsq (a separate software) is a command to generate message queues and send messages.

SoftHangup

Synopsis

Soft Hangup Application

Description

SoftHangup(Technology/resource|options)

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

- 'options' may contain the following letter:
    'a' : hang up all channels on a specified device instead of a single resource

Sort

Synopsis

Sorts a list of keywords and values

Description

Sort(newvar=key1:val1[,key2:val2[[...],keyN:valN]]):

This application will sort the list provided in ascending order. The result will be stored in the specified variable name. This application has been deprecated in favor of the SORT function.

StackPop

Synopsis

Remove one address from gosub stack

Description

StackPop() Removes last label on the stack, discarding it.

StartMusicOnHold

Synopsis

Play Music On Hold

Description

StartMusicOnHold(class):

Starts playing music on hold, uses default music class for channel. Starts playing music specified by class. If omitted, the default music source for the channel will be used. Always returns 0.

StopMonitor

Synopsis

Stop monitoring a channel

Description

StopMonitor

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

StopMusicOnHold

Synopsis

Stop Playing Music On Hold

Description

StopMusicOnHold: Stops playing music on hold.

StopPlayTones

Synopsis

Stop playing a tone list

Description

Stop playing a tone list

System

Synopsis

Execute a system command

Description

System(command):

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:

  FAILURE      Could not execute the specified command
  SUCCESS      Specified command successfully executed

Old behaviour: If the command itself executes but is in error, and if there exists a priority n + 101, where 'n' is the priority of the current instance, then the channel will be setup to continue at that priority level. Note that this jump functionality has been deprecated and will only occur if the global priority jumping option is enabled in extensions.conf.

TestClient

Synopsis

Execute Interface Test Client

Description

TestClient(testid):

Executes test client with given testid.

Results stored in var/log/asterisk/testreports/<testid>-client.txt

TestServer

Synopsis

Execute Interface Test Server

Description

TestServer(): Perform test server function and write call report.

Results stored in /var/log/asterisk/testreports/<testid>-server.txt

Transfer

Synopsis

Transfer caller to remote extension

Description

Transfer([Tech/]dest[|options]):

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:

SUCCESS    Transfer succeeded
FAILURE   Transfer failed
UNSUPPORTED   Transfer unsupported by channel driver

The option string many contain the following character: 'j' -- jump to n+101 priority if the channel transfer attempt fails

TrySystem

Synopsis

Try executing a system command

Description

TrySystem(command):

Executes a command by using system(). on any situation. Result of execution is returned in the SYSTEMSTATUS channel variable:

FAILURE    Could not execute the specified command
SUCCESS    Specified command successfully executed
APPERROR    Specified command successfully executed, but returned error code

Old behaviour:

If the command itself executes but is in error, and if there exists a priority n + 101, where 'n' is the priority of the current instance, then the channel will be setup to continue at that priority level. Otherwise, System will terminate.

TXTCIDName

Synopsis

Lookup caller name from TXT record

Description

TXTCIDName(<CallerIDNumber>[|options]):

Looks up a Caller Name via DNS and sets the variable 'TXTCIDNAME'. TXTCIDName will either be blank or return the value found in the TXT record in DNS.

The option string may contain the following character:

'j' -- jump to n+101 priority if the lookup fails
This application sets the following channel variable upon completion:
 TXTCIDNAMESTATUS The status of the lookup as a text string, one of
     SUCCESS | FAILED