After the caller has hung up, is there any way for me to per

Answers to common Plum DEV questions

Moderators: admin, support

  • Author
  • Message
Offline

support

  • Posts: 3627
  • Joined: Mon Jun 02, 2003 3:47 pm
  • Location: Boston, MA

After the caller has hung up, is there any way for me to per

PostWed Jun 11, 2003 4:13 pm

Use <catch> to trap the disconnect by catching the connection.disconnect event. For example:
Code: Select all
<catch event="connection.disconnect">
  <!-- clean up -->
  <submit next="close_session.php" namelist="session_id"/>
</catch>

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:
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form>
  <block>
    <exit/>
  </block>
</form>
</vxml>


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.

Return to Plum DEV FAQs

Who is online

Users browsing this forum: No registered users and 1 guest

cron