The ANSWER command waits for a period specified by the TIMEOUT parameter for an incoming telephone call on any one of a designated set of voice channels available at the time the command was invoked. The ANSWER command will not wait for incoming calls on voice channels that are marked as in-use at the time the command is invoked.
Furthermore, when the ANSWER command is invoked with the GROUP operand, any one channel satisfies the command and returns control to the caller with the handle to the answered channel. This answered channel must be released when you are done with the call (see the description of the RELEASECHANNEL command). This channel cannot reenter the set of channels on which any outstanding ANSWER command is waiting.
The ANSWER command can answer a call on:
When answering an incoming call, the ANSWER command:
This command has the following format:
ADDRESS VOX "ANSWER {CHANNEL(channelhandle)|GROUP(groupname|ALL)}
[SYSTEM(sysname)]
[ANSRING(ringnumber)]
[TIMEOUT(waittime|0|-1)]
[HOOKSTATE(hookstate)]
[PREFIX(varname)]
[CMDRESP(destination)]"
Specifies the channel handle (channelhandle)-identifies a physical channel-that the GETCHANNEL command returns.
A group name defining a group of specific, physical channel numbers that the ANSWER command monitors for an incoming call. (For more information about assigning channels to a group, see the description of the SETGROUP command.)
ALL enables the ANSWER command to monitor all groups (and, therefore, all channels) for a call.
(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
(Optional) Specifies the ring number on which to answer an incoming call.
Default: 1
(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
(Optional) Specifies the desired hook state after CA Automation Point detects a ring. Valid values are OFFHOOK and ONHOOK.
Default: OFFHOOK
(Optional) Specifies the name of a REXX stem variable (other than the default name) that contains the return information for the command.
For information about changing the default variable name, see ADDRESS VOX Return Information in this chapter.
Default: VOX.ANSWER
(Optional) Directs return information to a specific destination (destination). For a list of valid destination values, see ADDRESS VOX Return Information in this chapter.
Return Information:
After the ANSWER command executes, it sets the special REXX return code variable RC.
Examples:
numpagerservice = '9,555-1900'
numtocall = '9,555-1234'
/* Acquire exclusive access to a voice channel. */
address vox 'getchannel channelnum(1) prefix(handle)'
/* Dial the digital pager service and leave number to call. */
address vox 'call channel('handle') tonestring('numpagerservice')'
address vox 'sendtones tonestring('numtocall')'
/* Wait up to 10 minutes for an incoming call. */
address vox 'answer channel('handle') timeout(6000)'
/* Get the callers User Identification number. */
address vox 'playgetdigits channel('handle') file(entruid.vox) count(8) singlestring(yes) prefix(userid)'
/* Get the caller's Personal Identification Number (PIN). */
address vox 'playgetdigits channel('handle') file(entrpin.vox) count(8) singlestring(yes) prefix(pin)'
...
/* Verify the remote user has entered a valid user-ID/pin combination.*/
address vox 'verifyuser userid('userid') pin('pin')'
if RC == 0 then do
/* Explain the problem and list the options */
/* available for resolving the problem. */
address vox 'playgetdigits channel('handle') file(problem.vox options.vox) prefix(response)'
...
end
/* Release the voice channel. */
address vox 'releasechannelchannel('handle')'
/* HDCTRL.CMD */ signal on halt Name DoExit do forever /* Wait forever for an incoming call and */ /* any channel within the HELPDESK group.*/ address vox 'answer group(helpdesk) hookstate(onhook) prefix(handle) timeout(600)' if RC == 0 then do /* Call answered. Start the HELPDESK.CMD */ /* program to service the call. */ address vox 'startrexx program(helpdesk.cmd 'handle')' end end DoExit: /* Exit from the command shell so that CA Automation Point can "clean up." */ '@exit'
|
Copyright © 2011 CA.
All rights reserved.
|
|