Closing a speech recognition or TTS session from VoiceXML

You can use the <object> element to close a speech recognition or text-to-speech session directly from a VoiceXML document.

Purpose

Typically, you would use this technique to close a speech recognition or text-to-speech session directly from a VoiceXML document to optimize the use of speech recognition and TTS engines.

Parameters

name
value
setSpeechAction
closeSession
setSpeechResource
ASR
Closes the open speech recognition engine sessions assigned to the call.
TTS
Closes the open text-to-speech engine sessions assigned to the call.
ALL
Close all the open speech recognition engine and TTS engine sessions assigned to the call.
If a voice application needs to transfer a call in response to a particular speech recognition utterance, before the application transfers the call, you would use the <object> element as follows to close all the open speech recognition engine and TTS engine sessions assigned to the call:
<object name="speechcontrol"
        classid="method://com.ibm.wvr.vxml2.NativeAppSupport/controlSpeech"
        type="javacode-ext">
<param name="setSpeechAction" value="closeSession"/>
<param name="setSpeechResource" value="ALL"/>
</object>