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>