The following documentation involves events that are related to disconnecting:
When is the User Considered Disconnected?
The user is considered disconnected if:
<disconnect> and
disconnects the user (currently, the user is not considered
disconnected in this case). <transfer bridge="false"/>
In the first two cases, the telephone.disconnect.hangup event
is thrown; in the third case, the telephone.disconnect.transfer
event is thrown.
Special Disconnect Cases
Case 1: A disconnect occurs (the user hangs up) while a VoiceXML page is in the process of being fetched for one of the following tags:
<choice><goto><link><subdialog><submit>Behaviour:
telephone.disconnect.hangup
event in the original page, not the fetched page. The event will be
thrown in the same scope as the <goto>,
<link>, <subdialog>, or
<submit> in the original page. Note that the fetched
VoiceXML page will not be executed.
Case 2: A disconnect occurs (the user hangs up) during the fetch of the initial page.
Behaviour:
The interpreter will wait for the initial page to be returned, compile it, and then throw the telephone.disconnect.hangup/connection.disconnect.hangup
event upon entering the initial page.
Expected Disconnection Behaviour
The application can define <catch> event handlers to process
the disconnect event. According to the VoiceXML specification:
"Under certain circumstances (in particular, while the VoiceXML interpreter is processing a disconnect event) the interpreter may continue executing in the final processing state after there is no longer a connection to allow the interpreter to interact with the end user. The purpose of this state is to allow the VoiceXML application to perform any necessary final cleanup, such as submitting information to the application server... The VoiceXML interpreter must exit if the VoiceXML application [encounters an input tag] while in the final processing state. Aside from this restriction, execution of the VoiceXML application continues normally while in the final processing state [until the end of the application is reached]."
Note: In the executed <catch> event handler, the event
attribute will be any of: telephone, telephone.disconnect,
telephone.disconnect.hangup, or telephone.disconnect.transfer,
depending on which event handlers are defined in the application, and which
one first matches (or first matches a prefix of) the disconnect event that was
thrown.
Notes
telephone.disconnect.hangup in an
application, it will simply be treated as a developer-defined event.
Throwing the event will not cause the call to actually be disconnected.