Hi,
The way the result_url works is that once the call has concluded, whether the caller has accepted the call, rejected the call, completed the call, hung up early, or what have you, the outbound system will post the following parameters to your result_url:
phone_number
call_id
message_reference
result
callee_type
attempts
last_attempt_timestamp
duration
Details on these parameters can be found here:
http://www.plumvoice.com/docs/dev/plumd ... l_callback
Here's a complete example, to give you a thorough example of how this works:
Let's say we have a very basic vxml script:
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<block>
<prompt> This is a test message </prompt>
</block>
</form>
</vxml>
All this script does is play "This is a test message" to the recipient.
Now, let's take a look at a simple php script to queue the outbound call:
Code: Select all
<?php
// initialize post params
$post_vars = array(
'phone_number'=>'destination_phone_number',
'login'=>'your_login',
'pin'=>'your_outbound_pin',
'start_url'=>"url_to_your_application",
'result_url'=>"url_to_your_script_to_process_post_call_params"
);
$ch = curl_init();
// set curl options
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, "http://outbound.plumvoice.com/webservice/queuecall.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_vars));
// execute curl request
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>
Doing so should produce the following output, indicating a successfully queued call:
Code: Select all
<?xml version="1.0"?>
<queuecall status="queued" call_id="32300833">
<login>your_login</login>
<pin>your_outbound_pin</pin>
<phone_number>destination_phone_number</phone_number>
<start_url>url_to_your_application</start_url>
<result_url>url_to_your_script_to_process_post_call_params</result_url>
</queuecall>
Now, let's create the most basic result_url script to simply dump the posted result parameters to a text file:
Code: Select all
<?php
$fh = fopen("/tmp/outboundtest.txt","w+");
fwrite($fh, var_export($_POST,TRUE));
fclose($fh);
All this script does is write the posted params to a text file in /tmp/outboundtext.txt on the server.
When this result_url is called at the end of the call, the result should be similar to:
Code: Select all
array (
'phone_number' => 'destination_phone_number',
'call_id' => '32299748',
'message_reference' => '',
'result' => 'completed',
'callee_type' => 'voice',
'attempts' => '2',
'last_attempt_timestamp' => 'Thu, 07 May 2015 14:08:01 -0400',
'duration' => '2',
)
The variables are posted automatically to your result_url. All you need to do is to supply a result_url when the call is queued.
With this being said, hopefully you should have a good understanding of how the outbound system works. However, you can get additional details about the outbound system at:
http://www.plumvoice.com/docs/dev/plumd ... nddevguide
With this being said, it seems that your result_url is malformed. The result_url must be a valid url that is on the web and can be accessed by our systems.
For debugging purposes, what result_url are you supplying when you queue your call? Note that you must include http:// at the beginning of your result_url for it to be accepted as valid.
Regards,
Plum Support