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

Webservice Communication and logic.

Questions and answers about Plum Survey

Moderators: admin, support

Post Reply
evanl@peopleclues.com
Posts: 24
Joined: Wed Oct 29, 2008 10:25 am

Webservice Communication and logic.

Post by evanl@peopleclues.com »

We are looking for the possibility of using the survey application to do the following:
User calls in, enter identification information, the webservice is called, we return either 1 or 0 based on if the identification information exists in our databases, and if it does, end the survey, if it is a new set of information, continue with the survey.

I have set up a test survey in the format below.

Page 1:
Enter the language you would like to use:
English - Skips to Page 2
Spanish - Skips to Page 3

Page 2:
1. Enter the Store Number (Digits)

2. Enter last 4 digits of your social security number (Digits)

Webservice call, with Choice Text below (According to Matt, this is the string we return via the webservice, and based on this text, we can perform skip logic)
1 - Skip to Page 4
0 - none

3. English_q_1

4. English_q_2

5. English_q_3

Webservice call
This page jumps to: Finish Survey

Page 3:
Spanish questions...
This page jumps to: Finish Survey

Page 4:
Text prompt: You have already taken the assessment. Thank you.
This page jumps to: Finish Survey

This current set up doesn't seem to work, because the first webservice call on page 2 does not execute until the end of the page, the same time as the last web service call.

Hi Ted, I got the response from Grae from you yesterday, stating that I would have to split the English and Spanish questions on to 2 pages, page 1 contains the identification questions, second page contains the questions. However, the issues then becomes if I have them on 2 separate pages, there is no way for me to identify the answers coming across the wire. Meaning on the second page containing questions, I can't as the user to re-type their ID which they just entered on the previous page.

You mentioned adding a page break, does that mean creating a new page?

Thanks, and looking forward to your answer.

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

IVR survey to fit your needs

Post by support »

Hi Evan,

We've thought this through a little more and have written out a way to make your IVR survey that we think will fit your needs.

Code: Select all

------ENGLISH SURVEY-----

Page 1:

Enter the language you would like to use:
English - Skips to Page 2
Spanish - Skips to Page 4

Page 2:

1. Enter the Store Number (Digits)

2. Enter last 4 digits of your social security number (Digits)

Webservice call, with Choice Text below (According to Matt, this is the string we return via the webservice, and based on this text, we can perform skip logic)
1 - Skip to Page 5
0 - Skip to Page 3

Page 3:

1. English_q_1

2. English_q_2

3. English_q_3

This page jumps to: Finish Survey

Page 4 (JUMP TO SPANISH VERSION):

Tranfer to: local number with Spanish Survey deployed
This page jumps to: Finish Survey

Page 5:

Text prompt: You have already taken the assessment. Thank you.
This page jumps to: Finish Survey 

------SPANISH SURVEY-----

Page 1:

1. Enter the Store Number (Digits)

2. Enter last 4 digits of your social security number (Digits)

Webservice call, with Choice Text below (According to Matt, this is the string we return via the webservice, and based on this text, we can perform skip logic)
1 - Skip to Page 3
0 - Skip to Page 2

Page 2:

1. Spanish_q_1

2. Spanish_q_2

3. Spanish_q_3

This page jumps to: Finish Survey

Page 3:

Text prompt: You have already taken the assessment. Thank you.
This page jumps to: Finish Survey
By breaking out the Spanish part into a separate IVR survey you be able to take full advantage of the Spanish TTS and grammar engines and record Spanish versions of transitional language that our IVR survey tool inserts inbetween the questions.

Finally, to answer your issue about tying together two separate IVR calls to your webservices: currently this would be best handled by implenting your webservices as VXML subdialogs. A subdialog is generally even easier to create than a SOAP service, and the details can be found in our Surveys documentation. Our platform's call to your subdialogs will accept and store cookies for HTTP Set-Cookie headers, which will be resent for each subsequent subdialog fetch until the end of the IVR survey. In this way you can have each progression through your subdialogs proceed like a typical cookied session on a website, and you can incrementally save the data received on your end, indexed by your session ID.

We are considering supporting cookies for our SOAP requests as well, would this be preferable? For instance, does your SOAP server allow you to send a Set-Cookie header that would be used to identify future related requests?
Last edited by support on Thu Mar 04, 2010 5:00 pm, edited 3 times in total.

evanl@peopleclues.com
Posts: 24
Joined: Wed Oct 29, 2008 10:25 am

Post by evanl@peopleclues.com »

So there is no way to have the webservice/subdialog call on the same pages as the questions, and skip the rest of the page if certain value is returned by the webservice/subdialog, because both of these will be executed after the entire page is done, even though you can place them anywhere in the actual survey building interface.

the only way then to synch up the answers of the first page, and the second page is to use the same session?

So now the question becomes, how to distinguish between 2 separate phone callers and 2 subdialog call to our code? It is all coming from you system, and correct me if I'm wrong, when your code first call our code with the first subdialog call, it'll create a session. When a second caller calls in, and get to their subdialog call to our code, it is coming from your code again, so it will be using the same session then.

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

IVR code uses cookies extensively throughout the survey

Post by support »

So there is no way to have the webservice/subdialog call on the same pages as the questions, and skip the rest of the page if certain value is returned by the webservice/subdialog, because both of these will be executed after the entire page is done, even though you can place them anywhere in the actual IVR survey building interface.
Correct. This actually isn't specific to webservices or subdialogs; skip logic is always calculated and performed at the end of each page, even for other question types. We delay the execution of the webservices until the end of the page because they aren't interactive components.
when your code first call our code with the first subdialog call, it'll create a session. When a second caller calls in, and get to their subdialog call to our code, it is coming from your code again, so it will be using the same session then.
Actually, every caller to our IVR system gets a totally different "browser"; so each caller automatically has their own separate, empty cookie jar and will store separate IVR session ID's that you set in HTTP Set-cookie: headers.

These cookie jars are destroyed at the end of the IVR call.

Our own code uses cookies extensively throughout the course of an IVR survey to track state, and these will always be kept separate for each caller.
Last edited by support on Thu Mar 04, 2010 5:02 pm, edited 3 times in total.

evanl@peopleclues.com
Posts: 24
Joined: Wed Oct 29, 2008 10:25 am

Post by evanl@peopleclues.com »

So, I set up the survey now like this

Page 1
Text Prompt - Thank you for coming.

subdialog call with no choice text so it can call over to our code and start the session.

the rest is the same as before.

Why is it telling me "You have answered yes to zero questions" on page 1? Does it mean I can't just have an invisible call to the subdialog to kick start the session with out the system reading something?

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

IVR link to subdialog documentation

Post by support »

You need to specify the URL of the subdialog on your IVR server... it sounds like you are just running our sample subdialog, which has that piece of dialog.

It's like a webservice; instead of putting in the WSDL, you put in the URL of a page on your server that returns VXML code.

I recommend you read the IVR subdialog documentation: http://survey.plumvoice.com/admin/docs/ ... dialog.htm

OR, if you are more comfortable with webservices, we can momentarily enable cookies on our SOAP calls to your IVR server, so you can hand us some session cookies and each IVR call will have different IVR session cookies for the webservice calls. Is this preferable? We understand that putting together a subdialog, which requires some VXML knowledge, may not be optimal.
Last edited by support on Thu Mar 04, 2010 5:03 pm, edited 4 times in total.

evanl@peopleclues.com
Posts: 24
Joined: Wed Oct 29, 2008 10:25 am

Post by evanl@peopleclues.com »

Thanks, just figured it out that I forgot to paste in the URL. I guess I've been staring at the system too long. I was just about to delete the post.

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

enabled cookies for our IVR survey SOAP clients now

Post by support »

Just to let you know, we've enabled cookies for our IVR survey SOAP clients now. You can now set cookies with your SOAP services and we will remember them and hand them back to you. Cookies are not restricted to just IVR subdialogs anymore.

Using SOAP services might be an easier way to do things... if it is, we hope we've helped you develop your IVR survey faster!

The docs at http://survey.plumvoice.com/admin/docs/ ... .htm?frame now show you how you might run a SOAP service in PHP that utilizes start_session() and the $_SESSION superglobals to remember things between SOAP calls.

What happens is, start_session() in PHP sends a HTTP header to our server's SOAP client like so:

Code: Select all

Set-Cookie: PHPSESSID=018ce45ca4f6950531412d038594cc14; path=/
and then we resend this cookie for subsequent IVR calls to this webservice, the SOAP server code automatically reads this cookie, and restores everything in $_SESSION that you had set in the preceding webservice run.

This will apply just as easily to a SOAP server constructed in any other language/framework, as long as you can send some sort of IVR session cookie in the HTTP headers of your response.

Hope this helps!
Last edited by support on Thu Mar 04, 2010 5:03 pm, edited 4 times in total.

evanl@peopleclues.com
Posts: 24
Joined: Wed Oct 29, 2008 10:25 am

Confirmation on something

Post by evanl@peopleclues.com »

Hi there. Here's another issue. Our customer's current IVR system allows them to use 1 and 3 for true/false answers. This is to basically to prevent the end user from fat fingering their answers. Is there a way to do this in the survey system? I tried to use a multiple choice question, and populating choices 1 and 3, and leaving choice 2 blank, but the system still reads choice number 2.

If there is no way for the TTS system to skip it, would it be possible to do a work around using a blank voice file for choice number 2. By loading a voice file it should over ride the TTS from activating correct? If the voice file is blank, it should just play it and moves on to choice 3? Let me know if you think this will work, or maybe can test it out on your side for me?

Another question, is there a way for the user to have the question repeated?

Thanks for all your help so far!

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

IVR questions answered

Post by support »

Your workaround could work if you muted the audio for "...press 2" and "To select:". You'd have to then realize that this text would be muted everywhere it would shows up in your IVR survey (the preview function is helpful to see what this entails). Therefore, in your recordings for the other choices, you would have to include language for "To select" or something grammatically equivalent at the beginning of the sentence. Also you would not be able to use a choice anywhere in your IVR survey where the user is supposed to "press 2" without including suitable language at the end of the recording of its choice text.

You may find that this is rather confusing to manage, and perhaps you might want to mute "To select" and all the "... press #" prompts, and just include instructions on which number to press in the recordings of all your choice texts.

To answer the last part of your IVR post, the question is automatically repeated if the user doesn't respond. If you want to clear out the answer for a bunch of IVR questions and repeat them all, have the page skip to the beginning of itself and everything will be repeated. You will have to implement some kind of skip logic to prevent this from turning into an infinite loop.

Post Reply