Previous Topic: ANSWER CommandNext Topic: CALL Command


ANSWERPLAY Command

The ANSWERPLAY command waits for an incoming telephone call on a single channel and plays one or more prerecorded voice messages after answering the call. When answering an incoming call, the ANSWERPLAY command:

This command has the following formats:

Use the following syntax to answer a call and play a message from a non-indexed voice file:

ADDRESS VOX "ANSWERPLAY CHANNEL(channelhandle)
   FILE(filename_1[...filename_n])
   FILETYPE(NONINDEX)
   [SYSTEM(sysname)]
   [INTERRUPT(YES|NO)]
   [ANSRING(ringnumber)]
   [TIMEOUT(waittime|0|-1)]
   [HOOKSTATE(hookstate)]"

Use the following syntax to answer a call and play a message from a voice word library file:

ADDRESS VOX "ANSWERPLAY CHANNEL(channelhandle)
   FILE(filename)
   FILETYPE(WORDLIB)
   VAR(varname)
   [SYSTEM(sysname)]
   [INTERRUPT(YES|NO)]
   [ANSRING(ringnumber)]
   [TIMEOUT(waittime|0|-1)]
   [HOOKSTATE(hookstate)]"
CHANNEL

Identifies the physical channel (channelhandle) that the GETCHANNEL command returns.

Default: There is no default.

FILE

Specifies the name of a voice file or voice word library.

FILETYPE

Specifies the type of voice file to play. Valid values are:

Note: When specifying FILETYPE (WORDLIB), do not include a file extension on the FILE operand.

Default: NONINDEX

VAR

This operand is required only when specifying a voice word library on the FILETYPE operand.

For a voice word library, this specifies either a REXX regular variable or stem variable. When coding regular variables with the var keyword, only that variable is searched. With a stem variable, all numeric indexes for the stem are searched.

When coding a stem variable, varname should follow this format:

varname.0

The number of words in your message.

varname.1 through varname.n

Each variable contains one word from the voice word library.

SYSTEM

(Optional) Specifies the name of the system running the notification server to which you want to direct the command.

The sysname value can contain up to eight alphanumeric characters.

Default: The local system name

INTERRUPT

(Optional) Specifies whether CA Automation Point interrupts the currently playing voice message if it receives a tone digit (that is, if the remote party presses a key on the telephone keypad). Valid values are:

YES

Allows the interruption.

NO

Prevents the interruption.

Default: YES

ANSRING

(Optional) Specifies the ring number on which to answer an incoming call.

Default: 1

TIMEOUT

(Optional) Specifies the maximum amount of time to wait for rings (in 1/10-second units). Or, you can specify 0 (zero) to return immediately if no ring exists or -1 to wait indefinitely.

Default: -1

HOOKSTATE

(Optional) Specifies the desired hook state after CA Automation Point plays a voice message. Valid values are OFFHOOK and ONHOOK.

Default: OFFHOOK

Return Information:

After the ANSWERPLAY command executes, it sets the special REXX return code variable RC.

Usage Notes:

Rather than issuing the ANSWER command followed by a PLAY command, CA recommends issuing the single ANSWERPLAY command whenever possible to improve performance.

Example:

The following REXX code illustrates how to use the ANSWERPLAY command to answer a call and offer the caller four menu options:

GREETING=1
...
MAINMNU_OPT1=5
MAINMNU_OPT2=6
MAINMNU_OPT3=7
...

/* Acquire exclusive access to a voice channel.*/

address vox 'getchannel channelnum(1)'

/* Wait forever for an incoming call and play */
/* greeting message followed by the main menu */
/* comprised of four separate voice messages  */
/* from within an indexed voice file.         */

msg.0=4
msg.1=1
msg.2=5
msg.3=6
msg.4=7
address vox 'answerplay channel('handle') file(helpdesk.vap) filetype(index) var(msg.)'
...

/* Release the voice channel. */
address vox 'releasechannel channel('handle')'