PlayVoiceFromHost

Purpose

Use PlayVoiceFromHost to enable voice data to be sent to a voice channel by a custom server, so that it can be played down the telephone line.


A screen capture of the Action PlayVoiceFromHost window

Description

The voice data could, for example, have been retrieved from another Blueworx Voice Response or generated by a speech synthesis application. The action is similar to the SendData action, with additional parameters and result states.

When the channel process begins to execute this action, it controls the initial parameter transfer to the custom server, just as with the SendData action. But in addition, a request is sent to the device driver to begin remote playing. The latter returns a handle to the channel process. The handle is attached to the data packet that the channel process sends to the custom server. As with the SendData action, the time on the data packet is set from the Host Response Time Limit parameter on the action.

For the PlayVoiceFromHost action to succeed, the voice channel must already be connectedthis is achieved through the successful completion of either an AnswerCall or a Makecall action. For an incoming call, the voice channel can also be connected prior to an AnswerCall action, if the system parameter Connect Voice Channel Before Answer is enabled (this parameter is only available if you are logged on as field).

If required, you can use ReceiveData to receive a response from the custom server after a PlayVoiceFromHost action. But if the user hangs up before the PlayVoiceFromHost, or if no voice data was played, the ReceiveData returns the Host Not Open result because the internally-generated SendData action has not been issued.

The action terminates when one of the following events occurs:

PlayVoiceFromHost can be used with background music to produce a voice-over effect. If you don't want background music playing at the same time as the voice data, precede this action with a ControlMusic action and set the fade time to 100.

Unless you set Interrupt with Any DTMF key, all input is flushed both before this action starts, and when it completes. As a result, any queued DTMF, voice interrupt detection or fax tones are lost.

Parameters

Possible results

Stopped by Host
The custom server stopped the action. This may occur, for example, because the custom server has completed: all the voice data has been played. At the state table level, this implies the action completed successfully. Specific detail of the reasons for termination should be trapped and reported within the custom server.
Stopped by DTMF
The caller pressed a DTMF key or spoke.

The system variable System: Action additional information (SV180) will be set with one of the following values:

0
The action completed without interruption.
1
The caller pressed a DTMF key; play was interrupted. The key pressed is written to the System: Play/Record: Actual stop key system variable (SV184).
2
Voice was detected; play was interrupted. Use WaitEvent to flush the voice event from the queue (see WaitEvent). Detection of voice interrupt is enabled by setting SV217 to 1 (see System: Voice interrupt detection: On/Off (RW) (SV217) ).
3
Fax tone was detected; play was interrupted. Detection of fax tone is enabled by setting SV227for possible values see System: Fax detection (SV227).
4
A custom server event occurred; play was interrupted. To retrieve the event, use the WaitEvent state table action (see WaitEvent). Detection of a custom server event is enabled by setting SV546 to 1 (see System: Host Interrupt Detection: On/Off (RW) (SV546) ).
Note: If you want to use the information in SV180, you must check it immediately after a state table action because it is reset by other actions.
Host Problem
This may occur for a number of reasons. The cause is reported in the System: Action additional information system variable (SV180). Possible values are:
1
Too much parameter data sent to the custom server
2
The custom server did not close the channel soon enough after playing was stopped. To avoid this, increase the value of the Remote Play/Record CA Time Out system parameter.
3
The custom server did not provide voice data soon enough at the start of the action or after a restart (which may occur because of an underrun condition). To avoid this, either increase the value of the Idle Time parameter or decrease the value of the Remote Play/Record Min Data system parameter.
Note: If you want to use the information in SV180, you must check it immediately after a state table action because it is reset by other actions.
Host Not Open
The requested custom server has not been activated (using the OpenHostServerLink action) so voice playing could not start.
Voice Channel Problem
A problem occurred on the voice channel, so voice playing could not continue.
Caller Hung Up
The caller hung up, so voice playing stopped.

ASCII syntax

When using an ASCII editor, code this action with these parameters in the following order:

  1. Server Name
  2. Host Response Time Limit
  3. "FORCE_PLAY"
    • or "STOP_PLAY_ON_DTMF"
    • or "PAUSE_AND_STOP_KEYS"
  4. Idle Time
  5. Server Command
  6. ... Parameters

For example:

"Check Edges"
        PlayVoiceFromHost(CS_Request_Call, 10, "FORCE_PLAY", IO
                 read_rec, in1_n)
                   edge EDGE_PVFH_STOPPED_BY_HOST:       stopped_by_host
                   edge EDGE_PVFH_STOPPED_BY_DTMF:       stopped_by_dtmf
                   edge EDGE_PVFH_HOST_PROBLEM:   host_problem
                   edge EDGE_PVFH_HOST_NOT_OPEN:         host_not_open
                   edge EDGE_PVFH_LINE_PROBLEM:   line_problem
                   edge EDGE_HUP:                                       hup
        ;
        PlayVoiceFromHost(CS_Request_Call, 10, "STOP_PLAY_ON_DTMF", IO
                 read_rec, in1_n);
        PlayVoiceFromHost(CS_Request_Call, 10, "PAUSE_AND_STOP_KEYS", IO
                 read_rec, in1_n);

The parameters and edges are described above under "Parameters" and "Possible results". For more information, see Testing a state table using the debugger.