After the caller has hung up, is there any way for me to per
Posted: Wed Jun 11, 2003 4:13 pm
Use <catch> to trap the disconnect by catching the connection.disconnect event. For example:
This could be used to call the server script close_session.php to clean up and close session information on the server.
Note that any script called within a disconnect handler using catch must return valid VoiceXML or you run the risk of creating an infinite loop, since a fetch error also throws a connection.disconnect event.
Your clean-up script could return simply this:
Note that if your application uses several different VoiceXML pages, you can put the disconnect <catch> in the application root document so that it is active globally rather than reproduce the handler in each page.
Code: Select all
<catch event="connection.disconnect">
<!-- clean up -->
<submit next="close_session.php" namelist="session_id"/>
</catch>
Note that any script called within a disconnect handler using catch must return valid VoiceXML or you run the risk of creating an infinite loop, since a fetch error also throws a connection.disconnect event.
Your clean-up script could return simply this:
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<block>
<exit/>
</block>
</form>
</vxml>