Page 1 of 1
how to call a result URL after an INCOMING call
Posted: Fri Jul 29, 2011 2:32 pm
by magicsoft
The PLUM service allows you to set a result URL that gets called with certain information after an outbound call is completed. Is there any way to set it up so that a result URL is triggered after an INCOMING call is completed?
Thanks,
Andrew
Re: how to call a result URL after an INCOMING call
Posted: Fri Jul 29, 2011 3:22 pm
by support
Hi Andrew,
It would be possible to do post-call processing similar to the result_url. Your inbound application will need to detect whenever the user disconnects by catching any connection.disconnect.hangup events.
Inbound Application:
Code: Select all
<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\"?>\n";
?>
<vxml version="2.0" application="root.php">
<form>
<block>
<prompt> Current application. </prompt>
<goto next="next_script.php"/>
</block>
</form>
<catch error="connection.disconnect.hangup">
<goto next="post_call.php"/>
</catch>
</vxml>
post_call.php:
Code: Select all
<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\"?>\n";
?>
<vxml version="2.0" application="root.php">
<form>
<!-- Collect the information you would like to submit to your back end-->
<submit next="http://localhost/example/process_call.php" namelist="var1 var2 etc" method="post"/>
<block>
<exit/>
</block>
</form>
</vxml>
Once you've collected all of the data you would like, you would then be able to submit that data to your back-end. After that you would just end the call.
Please note that if, for any reason, your application attempts to queue any prompts, an error will be thrown.
Regards,
Plum Support