The SETHOOK command explicitly sets a voice channel's hook switch state to either on-hook or off-hook.
In most cases, you need to issue the SETHOOK command only when your REXX program contains code for collecting ANI digits. The telephone company's switching office sends ANI digits between the ring signals of an incoming call, requiring the ANSWER (or ANSWERPLAY) command to keep the line in an on-hook state. After the ANI digits have been collected, the SETHOOK command sets the line to an off-hook state so that CA Automation Point can answer the call.
This command has the following format:
ADDRESS VOX "SETHOOK CHANNEL(channelhandle) HOOKSTATE(ONHOOK|OFFHOOK) [SYSTEM(sysname)]"
Specifies the channel handle (channelhandle)-identifying some physical channel-that the GETCHANNEL command returns.
Specifies the hook state that you want to set. Valid values are:
Analogous to hanging up (replacing a telephone handset to end a call).
Analogous to picking up a telephone handset to place a call.
(Optional) Specifies the name of the system that is 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.
Return Information:
After the SETHOOK command executes, it sets the special REXX return code variable RC.
Example:
The following REXX code illustrates the SETHOOK command. The code segment collects ANI digits (which must occur while the line is still in an on-hook state), and then answers the call and plays a greeting.
/* Get exclusive access to a specific voice channel. */
address vox 'getchannel channelnum(1) prefix(handle)'
/* Wait for an incoming call. Leave the line in an on-hook */
/* state so that we can collect ANI digits. */
address vox 'answer channel('handle') hookstate(onhook)'
/* Send a wink signal to central office (CO) switch. */
address vox 'wink channel('handle')'
/* Collect the ANI (or "caller ID") digits. */
address vox 'getdigits channel('handle') count(7) singlestring(yes) prefix(phonenum)'
...
/* Answer the incoming call by finally taking the line off-hook. */
address vox 'sethook channel('handle') hookstate(offhook)'
...
/* Play the system greeting message. */
address vox 'play channel('handle') file(greeting.vox)'
/* Release the voice channel. */
address vox 'releasechannel channel('handle')'
|
Copyright © 2011 CA.
All rights reserved.
|
|