CallXML 2.0 Development Guide Home  |  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.

<oncparesult>  element


The <oncparesult> element is an event handler for Call Progress Analyzer, (CPA), related events/results.  A CPA event/result can occur at any time while the CPA is active.  When encountered, the CallXML browser will interrupt the current block of execution, and process the corresponding <oncparesult> handler.

Note that while the <oncparesult> tag does not have any 'parent' elements per-se, it is considered a 'stepchild' element of <call> and <onanswer> tags. Logically speaking, the only time that <oncparesult> can be executed is after a <call> that specifies specific CPA parameters is placed, and after the <onanswer> event handler is executed upon callee pickup.

Also note that only one 'type' may be specified per tag; the following code would be considered invalid, and should be expected to throw a fatal error in the application:


<oncparesult type="beep, machine">
  <log value="got a machine"/>
</oncparesult>



usage

<oncparesult type="(beep|faxtone|human|machine|machinedetected|modem|sit|unknown)">


attributes

type Data Type: (beep|faxtone|human|machine|machinedetected|modem|sit|unknown) Default: none - attribute is required
The 'type' attribute is used to denote the event that is trapped from the Call Progress Analyzer return value, so that the developer may perform logic based on this result.



possible events

none


code samples

<oncparesult type>
<?php
header("Cache-Control: no-cache must-revalidate");
?>
<callxml version="2.0">
  <call value="<?php echo $phone?>"
        voxeo-cpa-runtime="1500ms"
        voxeo-cpa-maxtime="400ms"
        voxeo-cpa-maxsilence="1200ms"
        voxeo-cpa-maskevent="human,machine,beep,faxtone"
voxeo-cpa-maskstop="human,machine,beep,faxtone"
/>

  <onanswer>
    <log value="Call has been answered." />
    <wait value="15s" />
   
    <oncparesult type="machine">
      <log value="Answering party was a machine" />
      <text>I ain't talkin' to no stinkin' machine.</text>
    <wait value="15s" /> 
    </oncparesult>

    <oncparesult type="human">
      <log value="Answering party was human" />
      <text>I don't really like humans that much.</text>
    <wait value="15s" />
    </oncparesult>

    <oncparesult type="beep">
      <log value="Answering party had a Beep." />
      <text>Don't you beep at me!</text>
    <wait value="15s" />
    </oncparesult> 

    <oncparesult type="faxtone">
      <log value="Answering party had a faxtone." />
      <text>Stop that horrid screeching!</text>
        <wait value="15s" />
</oncparesult> 

    <oncparesult type="modem">
      <log value="Answering party had a modem." />
      <text>Modems are for the weak. Real men have broadband.</text>
    </oncparesult> 

    <oncparesult type="sit">
      <log value="Answering party had a sit tone." />
      <text>The number you reached was full of system errors.</text>
    <wait value="15s" />
    </oncparesult> 
  </onanswer>
 
  <onerror>
    <log value="Ewwww, an error has occurred." />
  </onerror>

  <oncallfailure>
    <log value="Your call did not complete." />
  </oncallfailure>
</callxml>



additional links

none


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

login



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