Page 1 of 1
Require examples for invoking queuecall and queuecalls
Posted: Thu Aug 20, 2009 3:11 pm
by nsiram
Can you please provide some examples on the parameters to pass and how to invoke the queuecall and queuecalls webservices. Especially require examples of startURL and resultURL formats.
Do you also have some examples of how to invoke the webservices from a JSP page.
I have tried to invoke queuecall providing a PHP file as the startURL and get a serious error.
IVR code example for queuecall.php and queuecalls.php
Posted: Thu Aug 20, 2009 4:12 pm
by support
Hi,
Here are some IVR code examples to help you get started:
test.php (start_URL):
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form>
<block>
<prompt>
Hello. This is a test phone number. Good bye.
</prompt>
</block>
</form>
</vxml>
outboundqueuecall.php:
Code: Select all
<?php
// utility function for posting to a given webservice
function curl_post($url, $post_vars) {
//initialize curl
$ch = curl_init();
//set the necessary curl options
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_vars);
//execute the call to the backend script, retrieve the results
$xmlstr = curl_exec($ch);
curl_close($ch);
return $xmlstr;
}
$post_vars="login=xxxxxx&pin=xxxxxxxx&phone_number=tel:+1xxxxxxxxxx&start_url=http://www.example.com/test.php";
$xml = curl_post("http://outbound.plumgroup.com/webservice/queuecall.php", $post_vars);
echo $xml;
?>
outboundqueuecalls.php:
Code: Select all
<?php
$params['login'] = "xxxxxx";
$params['pin'] = "xxxxxxxx";
$params['campaign_name'] = "callnumbers";
$params['max_retries'] = "2";
$params['retry_interval'] = "300";
$params['phone_list'] = "@path/to/file/phonenumbers.txt"; //some local file on server
$params['call_parameters'] = "lang=en_us";
$params['start_url'] = "http://www.example.com/test.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, "http://outbound.plumgroup.com/webservice/queuecalls.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
echo $result;
curl_close($ch);
?>
phonenumbers.txt:
Code: Select all
xxx-xxx-xxxx
xxx-xxx-xxxx
xxx-xxx-xxxx
xxx-xxx-xxxx
Hope these IVR code examples help.
For more information, you can go here:
http://www.plumvoice.com/docs/dev/plumd ... nddevguide
Regards,
Plum Support
Please provide example of resultURL and call tracking
Posted: Fri Aug 21, 2009 10:19 am
by nsiram
Can you please provide an example of the resultURL as well.
I would also like to know how I can track whether the call is answered.
Please provide some examples for how to 1) track the call placed and 2) Check how many calls were made and how many hits are remaining on our account.