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

Technical Questions Dev - Plum Contact Troy

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
mseelye
Posts: 5
Joined: Wed May 25, 2016 3:12 pm

Technical Questions Dev - Plum Contact Troy

Post by mseelye »

Hello, posting here by direction of Troy. These are some early questions I am trying to find answers for while I do my initial spike.

What version is the javascript interpreter? (ECMAScript engine) Are there multiple, and if so can you select them, and how?
(I noticed that things like array does not have .indexOf, which would indicate an older ECMAScript engine.)

Does the API support https?
(I didn't try it, but didn't see it in the docs.)

I cannot seem to get the Api to initiate an outbound call, even though the calls I make return 200. I have tried using “plumgroup” and “plumvoice”, as I have seen both in the docs, but neither seem to work. So, I'm not sure if I'm doing something wrong, or if something is configured incorrectly. (Note: the calls work when I initiate them manually through the dev portal with the same credentials.)

Regarding the API: Why does the API return 200 OK if the credentials are wrong, or if a call is not actually being initiated? Am I missing something in the response body that would indicate a call did not initiate?

Is it possible to select engines in the Dev Portal? (I don't need this just yet, but eventually I'll need to test Chinese - Mandarin and Cantonese)

I have several other questions, but these are currently the most pertinent.

Thank you!
-Mark
mark.seelye@altegrahealth.com

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

Re: Technical Questions Dev - Plum Contact Troy

Post by support »

Hi Mark,

Yes, the ECMAScript engine supported by the platform is slightly older. The specific version is ECMA-262 3rd edition.

Yes, there is an https version of the queue call api. You can use the url: https://outbound.plumvoice.com/webservice/queuecall.php and the parameters should be the same as the regular http version. Just in case you meant "does the platform support https start_urls", yes it will support both https and http start_urls.

Regarding the issues you're having queuing, we do see that outbound is enabled in your account and since you were able to initiate outbound calls through the ui that would also indicate that your account is configured correctly. Here's a basic php script that will queue a single call, you just need to replace the login, pin, phone_number, and start_url post parameters and then you should receive that call.

Code: Select all

<?php
// set parameters for the call
$post_vars = array(
	'phone_number'=>'tel:+19998887777', // destination number
	'login'=>'your_login', // your login for your hosting account
	'pin'=>'your_pin', // your outbound pin for your hosting account
	'start_url'=>"http://example.com/start.php", // the publicly available url for your vxml script to use in the outbound call
	);
// make the request to the queue calls api
$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);
$errors = curl_error($ch);
var_dump($errors);
curl_close($ch);
echo $result;
That should queue the call and output the response and any errors queuing. You should see the following response when you queue an outbound call:

Code: Select all

<?xml version="1.0"?>
<queuecall status="queued" call_id="40332201">
<login>your_login</login>
<pin>your_pin</pin>
<phone_number>tel:+19998887777</phone_number>
<start_url>http://example.com/start.php</start_url>
</queuecall>
a status of 'queued' indicated the request was accepted and the call is scheduled to go out. You should see any errors indicating failure to queue in this same response body, if that is the case.

Regarding the response body for failed queue attempts, here's a sample from us supplying invalid credentials when attempting to queue an outbound call:

Code: Select all

<?xml version="1.0"?>
<queuecall status="failed">
Internal system error. Invalid login or pin.
</queuecall>
The response body itself should be used as the indicator of whether or not the queue was successful, specifically the status attribute of the queuecall element.

Yes, you can select your ASR/TTS engine from within the DEV portal. This is set on a per-phone number basis, so to change this simply click Application -> Application Configuration. Click 'edit' for the phone number you wish to change. In this menu you should be able to change the ASR Engine and TTS Engines and click 'Save' to commit those changes for the phone number.

Hopefully that helps, but please let us know if you have any further questions.

Regards,
Plum Support

mseelye
Posts: 5
Joined: Wed May 25, 2016 3:12 pm

Re: Technical Questions Dev - Plum Contact Troy

Post by mseelye »

Thanks for the reply, I'll check my call initiation code as soon as I can. Hopefully I'll have some more questions soon as well.

Hmm, would make my life easier if the ECMAscript engine was newer, but I should be able to work around that. We only have a few grammars that use some ECMAScript ~4-5 features. We also have a general utility javascript file we include as well, I'll have to look over that and verify that it will work as well.

Thanks for your help, I'll continue posting progress/questions here - if that is ok.
-Mark

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

Re: Technical Questions Dev - Plum Contact Troy

Post by support »

Hi Mark,

Of course, please feel free to post any further questions.

Regards,
Plum Support

mseelye
Posts: 5
Joined: Wed May 25, 2016 3:12 pm

Re: Technical Questions Dev - Plum Contact Troy

Post by mseelye »

So, must have read the docs wrong. I thought the API was expecting the login, pin, etc. as query string parameters - however I see now that they are sent as part of the post data as name/value pairs (aka multipart form data). I suppose this is to directly suppose html forms.

The odd thing about this though is if you post a bunch of garbage, or nothing at all, you still get a 200 OK response. I would think and would prefer if it returned a 400 (Bad Request) or something other thank 200 OK. It is rather misleading, especially since the response body is streamed.

I'll continue testing though, I'll definitely have more questions as I work through some of this.

Thank you for your help!
-Mark

mseelye
Posts: 5
Joined: Wed May 25, 2016 3:12 pm

Re: Technical Questions Dev - Plum Contact Troy

Post by mseelye »

Hello,
I have a quick question regarding the capture of, and playback of dates.

http://www.plumvoice.com/docs/dev/devel ... ce:grammar

In the grammar docs it says dates will come back as yyyymmdd and then it says:

"... If the value is subsequently used in <say-as> with the interpret-as value “vxml:date”, it will be spoken as date phrase appropriate to the current language. "

When I pass, for example, 20160619, regardless of what I put in the say-as attributes, it seems to always interpret it as a number. If I format it as 06/19/2016 it says the date correctly. Are the docs incorrect, or am I doing something wrong?

Thanks,
-Mark

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

Re: Technical Questions Dev - Plum Contact Troy

Post by support »

Hi Mark,

Thank you for this find. Our current documentation is not accurate where it states that you can pass the built-in date grammar result directly into a say-as tag. None of our current TTS engines will properly transform

Code: Select all

<say-as type="date">20160619</say-as>
into a proper date.

We will be updating our documentation to ensure its accuracy.

Regards,
Plum Support

mseelye
Posts: 5
Joined: Wed May 25, 2016 3:12 pm

Re: Technical Questions Dev - Plum Contact Troy

Post by mseelye »

Ok, sorry for the long hiatus - I'm back on this for a bit (although I'll be off it again for a few weeks).

In any case, I came across this comment in the docs:
"NOTE: If an outbound campaign has too many calls to place and these calls don't all go out, steps 3-5 for “Outbound process for an unsuccessful call” do not occur. However, result_url does get called since the outbound platform clears the expired calls and performs the callback. In this case, the posted callee_type that gets returned to result_url is an empty string."

How many calls are too many calls?

We plan on sending the calls one by one every 10 seconds or so, since our system (which is about 7 years old now) internally schedules and throttles the calls. In any case we won't be taking advantage of the "batched calls". The volume depends on the day, and what our throttles are set at for our various programs (what some might call campaigns).

Other questions:

I've noticed there is a long pause before the vxml seems to kick in. Example: The phone rings, I answer and say, "Hello" - I usually have time to get out 2 more "hellos" before I hear the first bit of content. Is this typical or do I possibly have something misconfigured.

On that note, next question, does Plum have some sort of built-in answering machine/VM detection. Or, save that, any best practices to use for answering machine/Vm detection.

That is all I have for now, I will likely have more questions as we get further into testing. Jake, my boss, may have questions around setting up the next steps of testing environments, and requesting numbers, etc.

Thanks,
-Mark

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

Re: Technical Questions Dev - Plum Contact Troy

Post by support »

Hi Mark,

That particular comment from the documentation is actually outdated. We have since upgraded our outbound architecture to utilize a queue to place your outbound calls, and will never drop calls because there are too many of them. You are, however, rate-limited to the allowed number of concurrent calls listed in your contract with us, so there is a possibility you may "lose" a call if you set an expire timestamp to some time before the queue has a chance to place the call.

The long pause before the vxml kicks in may be caused by a delay in fetching your VXML script. If it takes a second or two to reach and fetch your start VXML script, it may result in a 1-2 second pause before you hear anything over the phone. Is there a significant difference between receiving an outbound call and placing an inbound call to the IVR?

Callee type detection is enabled for your account, and is another reason you may hear a pause at the beginning of the call. Our callee type detection listens to the first moments of the call to try and recognize whether an answering machine or live person answered. It then sends this result as a POST variable to your start script. You can find some information on this feature in our outbound documentation. This forum post also contains some useful links containing other users attempts at using callee type detection.

We hope this information helps but let us know if you have any additional questions!

Regards,
Plum Support

Post Reply