We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Require examples for invoking queuecall and queuecalls

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
nsiram
Posts: 8
Joined: Wed Aug 19, 2009 9:08 am

Require examples for invoking queuecall and queuecalls

Post 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.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR code example for queuecall.php and queuecalls.php

Post 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
Last edited by support on Mon Jan 11, 2010 9:53 am, edited 2 times in total.

nsiram
Posts: 8
Joined: Wed Aug 19, 2009 9:08 am

Please provide example of resultURL and call tracking

Post 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.

Post Reply