RecordVoiceToHost

Purpose

Use RecordVoiceToHost to enable voice data to be retrieved from a voice channel and passed to a custom server, to make the voice data available for speech recognition through a speech recognition application.


A screen capture of the Action RecordVoiceToHost window

Description

This action is similar to the SendData action, with additional result states.

When the channel process begins to execute this action, it controls the initial parameter transfer to the custom server, just as for SendData. But in addition, a request is issued to the device driver to begin remote recording. The device driver 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.

If required, you can use ReceiveData to receive a response from the custom server after a RecordVoiceToHost. If, however, the user hangs up before the RecordVoiceToHost, the ReceiveData returns the Host Not Open result, because the internally-generated SendData action has been issued.

The action can terminate for any of the following reasons:

RecordVoiceToHost causes an automatic fade out of any background music. You can override this by using the System: Music: Automatic fade before actions system variable (SV226).

If the recording of voice is interrupted by a DTMF user interrupt then all input is flushed as the action completes, and any queued DTMF, voice interrupt detection or fax tones are lost. If, however, the recording of voice is terminated by a timeout then all such input is retained.

Parameters

The stop key can be pressed to indicate that the user has finished speaking. The default stop key is the asterisk (*) on the telephone key pad, but can be reset to another key, using the Stop Key system parameter in the Application Server Interface parameters group. Alternatively, you can define more than one DTMF stop key by using SV183 (for more information see System: Play/Record: Alternate stop keys (RW) (SV183)).

The pause key can be pressed if the user needs to stop and then continue speaking. The default pause key is the number 8 on the telephone key pad, but can be reset to another key, using the Pause Key system parameter in the Application Server Interface parameters group. To start again after a pause, the user presses the pause key again.

If the caller does not press the pause key again to end a pause, recording starts again, provided the Maximum Record Time has not been reached and the custom server is still recording.

This mode of operation is primarily for recording voice messages to be sent to another Blueworx Voice Response system, or for continuous or dictation-mode speech recognition applications.

Possible results

Stopped by Host
The custom server stopped the action and no more voice data was required. This may occur, for example, because the custom server indicates the a speech recognition application has returned a result.
Stopped by DTMF
The caller pressed a DTMF key. Depending on parameter settings, this can be any DTMF or only the stop or pause keys. You must get and process the user interrupt. For example, the key pressed may represent the first digit of an account number that the caller is keying in, in which case, you should store it in a variable.
Timeout
Voice recording may stop for one of the following reasons, as identified by the value of the System: Action additional information system variable (SV180):
4
Too long a period of silence was detected.
5
The maximum record time was reached.
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 can occur for the following reasons, as identified by the value of the System: Action additional information system variable (SV180):
1
Too much parameter data sent to the custom server.
2
The custom server did not close the channel soon enough after recording was stopped. To avoid this, increase the value of the Remote Play / Record CA Time Out system parameter.
3
The custom server could not read the recorded data fast enough: the buffers were filled and so recording was stopped. To avoid this, increase the value of the Remote Play / Record Max 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 recording could not start.
Voice Channel Problem
A problem occurred on the voice channel, so voice recording could not continue.
Caller Hung Up
The caller hung up, so voice recording 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. "STOP_RECORD_ON_DTMF" or "RECORD_COMPATIBLE" (these parameters correspond to Interrupt With Any DTMF Key and Pause Key and Stop Key(s), see Interrupt with any DTMF key..)
  4. Maximum Record Time
  5. Server Command
  6. ... Parameters

For example:

label: "Check Edges"
        RecordVoiceToHost(CS_Request_Call, 20, "STOP_RECORD_ON_DTMF", 30,
                 read_rec, loc1_n)
          edge EDGE_RVTH_STOPPED_BY_DTMF:       stopped_by_dtmf
          edge EDGE_RVTH_STOPPED_BY_HOST:       stopped_by_host
          edge EDGE_RVTH_HOST_PROBLEM:   host_problem
          edge EDGE_RVTH_HOST_NOT_OPEN:         host_not_open
          edge EDGE_RVTH_LINE_PROBLEM:   line_problem
          edge EDGE_TIMEOUT:                       timeout
          edge EDGE_HUP:                                   hup
        ;
        RecordVoiceToHost(CS_Request_Call, 20, "RECORD_COMPATIBLE", in1_n,
                 read_rec, loc1_n);

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