| CallXML 2.0 Development Guide | Home | Frameset Home |
<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.<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.
<oncparesult type="beep, machine">
<log value="got a machine"/>
</oncparesult>
| 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. | ||
| <?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> |
| ANNOTATIONS: EXISTING POSTS |
| login |