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

No POSTs on outbound calls, only GETs

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
tom.rhoads@elynxtech.com
Posts: 8
Joined: Thu Aug 13, 2009 3:30 pm

No POSTs on outbound calls, only GETs

Post by tom.rhoads@elynxtech.com »

I do not receive POSTs on outbound calls when using the URL http://outbound.plumgroup.com/webservice/queuecall.php. Instead of POSTs, I always receive GETs. In the "result_url question" forum post it was stated that
The first time result_url gets called is during a GET request where the URLs for start_url and result_url are validated when calls are queued. This GET request includes no variables, which explains why you see no data.

The second time result_url gets called is when the call completes and the outbound system sends a POST request with all the variables and results that you see.
I don't have these results when using the http://outbound.plumgroup.com/webservice/queuecall.php URL. The results I have are
  • 1. When the call is queued.
    • a. Get to the URL in start_url
      b. Get to the URL in result_url
    2. When the call is answered
    • a. Get to the URL in start_url
I never receive any POSTs, they are always GETs. I do not receive notification when the call has completed unless I add a catch for the disconnect. To receive notification on the call disconnect I added a catch on the connection.disconnect event and set the method to POST. When the call is disconnected I receive a Get to the URL specified in the submit for the catch event. Shouldn't I receive a POST if I specified a POST? My catch setting is this

Code: Select all

   <catch event="connection.disconnect">
      <submit next="http://MyDomain/ Disconnect.aspx?Disconnect=1&AlarmID=12345" namelist="disconnectmsg" method="post" enctype="multipart/form-data"/> 
    </catch>
Your outbound documentation states that the following steps are the flow for an outbound call. I have noted the events that do not occur with **I do not get this**
  • 1. Your code performs an HTTP POST to queuecall.php which includes
    a phone number, start_url and result_url.
    2. The Plum outbound system places the call into a queue of possible
    calls to dial.
    3. When an outbound channel on the VoiceXML systems becomes
    available and your call is at the top of the queue, the call is placed.
    4. The call is connected successfully and the callee type detection
    begins (if enabled).
    5. **I do not get this** The result of the callee type detection as well
    as all the parameters defined in the Outbound API (i.e.
    phone_number, message_reference, call_parameters) are posted to
    your start_url.
    6. A standard VoiceXML session continues from here.
    7. The call completes, all VXML execution is completed.
    8. The VoiceXML system notifies the outbound system that the call is
    complete.
    9. **I do not get this** The outbound system posts a request to
    result_url including all the parameters defined in the Outbound API.

I looked at my call log online and I had an error in the disconnect catch but I corrected it. The log says POSTs are executed but I do not see them. Please let me know what I am doing wrong.

Thank you for your help.

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

IVR outbound queuecall example

Post by support »

Hi Tom,

Could you please provide us with more context (such as your IVR code) as to how you are sending your IVR outbound data to queuecall.php and what you are seeing be returned?

Here's an IVR example that may help you:

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&result_url=storeresults.php";
$xml = curl_post("http://outbound.plumgroup.com/webservice/queuecall.php", $post_vars);
echo $xml;
?> 
test.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");

$callid = $_POST['call_id'];
$calleetype = $_POST['callee_type'];

?>
<vxml version="2.0">

<form>

<block>
<prompt>
Your call identification number is <?php echo($callid)?>.
Your callee type is <?php echo($calleetype)?>.
</prompt>
</block>

</form>
</vxml> 
storeresults.php:

Code: Select all

<?php
$File = "storeresults.txt";
$Handle = fopen($File, 'a+');
$Date = date("r");
$Result = $_POST['result'];
$Callid = $_POST['call_id'];
$Data = "$Date $Callid $Result\n";
fwrite($Handle, $Data);
print "Data Written";
fclose($Handle);
?> 
Hope this helps.

Regards,
Plum Support
Last edited by support on Tue Feb 16, 2010 12:09 pm, edited 4 times in total.

tom.rhoads@elynxtech.com
Posts: 8
Joined: Thu Aug 13, 2009 3:30 pm

No POSTs on outbound calls, only GETs

Post by tom.rhoads@elynxtech.com »

I found the problem. It was a .NET issue with the .ASPX file working with the code behind. I had to remove this from the .ASPX file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>

Post Reply