CallXML 2.0 Development GuideHome  |  Frameset Home

This documentation is for CallXML 2, which has been superceded by CallXML 3. The CallXML 2 language is not being updated any longer. CallXML 3, however, has many new features and is actively being enhanced. If you're writing a new CallXML application, you should use CallXML 3. Click here for the CallXML 3.0 documentation.
<onerror>  element

When certain errors occur an <onError> event is generated. This gives the CallXML developer a way to handle error conditions that may occur while CallXML actions are executing.


usage
<onerror next="(navigation identifier)" type="(error-event type)">


attributes
nextData Type: (navigation identifier)Default: none - attribute is optional
The 'next' attribute sets the URL the CallXML platform will go to when the container ends.
typeData Type: (error-event type)Default: none - attribute is optional
The 'type' attribute, when used in conjunction with the <onerror> element is used for fine-grained event handling for specific circumstances. When a specific error is thrown, the callXML browser will look for a specific <onerror type> matching the event thrown, and execute the code contained within. If no specific handlers are present, the browser will then execute any generic <onerror> elements that are present and execute the code within.

The allowable values for this atribute are:
  • unknown - General error not fitting into any other category
  • internal - Server error -- alert Voxeo support
  • document - Document was unable to be fetched for all the reasons web servers are unavailable
  • telephony - Unable to issue a telephony event such as <call> or <playaudio> or <ftp>
  • serverbusy - No sessions available on the server for <run> or <answer> etc
  • lineactive  - Trying to issue a telephony event such as <answer> on an already active line
  • linenotactive - Trying to issue a telephony event such as <getdigits> or <playaudio> on a non-active line
  • invalidconference - Bad target conference
  • badnumber - Outbound destination returs a SIT tone
  • event -  When certain errors occur an <onError> event is generated. This gives the CallXML developer a way to handle error conditions that may occur while CallXML actions are executing.



possible events
none


code samples
<Onerror>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="2.0">
  <block label="B1">
    <text>
      lets toss some errors to the application,
      and we will see how event handling works.
    </text>
    <goto value="#B2"/>
  </block>

  <block label="B2">
    <!-- INSERT BAD CODE HERE -->
  </block>

  <!-- NOTE THAT EVENT HANDLERS MUST BE BELOW EXECUTABLE CONTENT -->

  <onerror type="document">
    <log value="=== RECEIVED A DOCUMENT ERROR: ==="/>
    <log value="=== SESSION.LASTERROR: $session.lasterror; ==="/>
  </onerror>

  <onerror type="execution">
    <log value="=== RECEIVED A EXECUTION ERROR: ==="/>
    <log value="=== SESSION.LASTERROR: $session.lasterror; ==="/>
  </onerror>

  <onerror type="linenotactive">
    <log value="=== RECEIVED A LINENOTACTIVE ERROR: ==="/>
    <log value="=== SESSION.LASTERROR: $session.lasterror; ==="/>
  </onerror>

  <onerror type="lineactive">
    <log value="=== RECEIVED A LINEACTIVE ERROR: ==="/>
    <log value="=== SESSION.LASTERROR: $session.lasterror; ==="/>
  </onerror>

</callxml>




additional links
none


  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login



© 2008 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site