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

New to VXML - Small Application Issue

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
sixseats
Posts: 7
Joined: Wed Aug 10, 2011 2:48 pm

New to VXML - Small Application Issue

Post by sixseats »

Hi there.

I am New to VXML and need to create an app for this new project I am working on. I basically have my IVR app complete – or pretty close to it. I just need a bit of help to figure out a couple of small issues I am having. I can talk to my database, pass back all the info as needed, etc but for some reason the system will not wait long enough to take my input for a 10-13 digit number. I look at the log files and it is not registering the proper input of voucher number, even though it is basiclly the same VXML code I tested with a similar app I copied online.

This is the XML it is trying to process:

If you need any more info or want to email me offline so i can send you more secure data needed to test, please send me an email and let me know.

Thank you so much for any help you can supply!

Dennis
Last edited by sixseats on Thu Aug 11, 2011 6:34 am, edited 1 time in total.

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

Re: New to VXML - Small Application Issue

Post by support »

Hi Dennis,

To increase the time for the IVR system to take an input for a 10-13 digit number, you can use the interdigittimeout property to increase the timeout value while waiting for DTMF inputs.

Below is an example of how you can implement this for your code:

interdigittimeoutexample.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\"?>\n";
?>
<vxml version="2.0">
  <form>
    <field name="cardnumber" type="digits?minlength=10;maxlength=13">
      <property name="interdigittimeout" value="3s"/>
      <prompt>
        Please enter your 10 to 13 digit card number.
      </prompt>

      <filled>
        <prompt>
          You entered <say-as type="digits"> <value expr="cardnumber"/> </say-as>.
        </prompt>
      </filled>
    </field>
  </form>
</vxml>
Hope this helps.

Regards,
Plum Support

sixseats
Posts: 7
Joined: Wed Aug 10, 2011 2:48 pm

Re: New to VXML - Small Application Issue

Post by sixseats »

Ah, perfect. That worked! Now that I got past that, i have one more thing I cannot seem to figure out. This one seems a bit more complex. Below is some VXML. I would like the following to happen:

* Need to get input in dollars and cents instead of just all the digits since when "4045" is repeated, it is repeated as 4 thousand forty five when it is really not. The other way to do this is to just divide it by 100 client side (ex: lastresult$.utterance / 100). Could not figure out how to do either though in the examples and documentation.

* The true/false if the value entered seems to not work on the IF condition. When i push "9" for "y" (yes), it just reprompts me.

* Finally, if the total amount that they just entered is NOT correct, i need to go back to the start of the "totalbill" field. I tried to use an "id", but that seems to just work for Forms.

Thank you so much for the help! This is the final info needed to complete the app.

Dennis


----------------------------------------------------------------
<form id="TotalBillInput">

<field name="totalbill" type="currency">
<prompt bargein="true">Thank You. Finally, using your keypad, please enter the Total Dollar Amount of the Bill before tax and tip. For example, if the bill is 40 dollars and 45 cents, enter four zero four five.</prompt>
<filled>
<log expr="'*** FILLED ***'"/>
<log expr="'*** totalbill =' + totalbill + '***'"/>

</filled>
</field>

<field name="totalbillconfirm" type="boolean">
<prompt bargein="true">Please confirm the total bill before tax and tip is <say-as interpret-as="vxml:digits"><value expr="lastresult$.utterance"/></say-as>.</prompt>
<filled>
<if cond="totalbillconfirm=='n'">
<!--NEED TO RE PROMPT FOR BILL AMOUNT AGAIN - GO BACK TO FIRST FIELD-->
<elseif cond="totalbillconfirm=='y'"/>

<prompt bargein="false">Thanks.</prompt>
<log expr="'*** FILLED ***'"/>
<log expr="'*** totalbill =' + totalbill + '***'"/>
<assign name="voucherid" expr="9"/>
<submit next="redeem.asp" method="post" namelist="totalbill voucherid"/>
</if>
</filled>
</field>

</form>
----------------------------------------------------------------

sixseats
Posts: 7
Joined: Wed Aug 10, 2011 2:48 pm

Re: New to VXML - Small Application Issue

Post by sixseats »

Hi there. Just an update. I fixed the true/false issue. The first and last bullets are the only issues now.

Thanks!

Dennis

---------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
<form id="TotalBillInput">
<field name="totalbill" type="currency">
<prompt bargein="true">Thank You. Finally, using your keypad, please enter the Total Dollar Amount of the Bill before tax and tip. For example, if the bill is 40 dollars and 45 cents, enter four zero four five.</prompt>
<filled>
<log expr="'*** FILLED ***'"/>
<log expr="'*** totalbill =' + totalbill + '***'"/>

</filled>
</field>

<field name="totalbillconfirm" type="digits?minlength=1;maxlength=1">
<prompt bargein="true">Please confirm the total bill before tax and tip is <say-as interpret-as="vxml:digits"><value expr="lastresult$.utterance"/></say-as>. Press 1 for yes, 2 for no.</prompt>
<filled>
<if cond="totalbillconfirm=='1'">
<prompt bargein="false">Thanks.</prompt>
<log expr="'*** FILLED ***'"/>

<log expr="'*** totalbill =' + totalbill + '***'"/>
<assign name="voucherid" expr="9"/>
<submit next="ss_redeemvoucher.asp" method="post" namelist="totalbill voucherid"/>
<elseif cond="totalbillconfirm=='2'"/>
<log expr="'*** NEED TO RE PROMPT FOR BILL AMOUNT AGAIN ***'"/>
</if>
</filled>
</field>
</form>
</vxml>

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

Re: New to VXML - Small Application Issue

Post by support »

Hi Dennis,

For the built-in currency grammar the star key denotes when the user should enter the decimal point. You should correct your example prompt to say "For example, if the bill is 40 dollars and 45 cents, enter four zero star four five."

You should be able to utilize the built-in boolean grammar value. This grammar looks for 4 values. DTMF entries: 1 and 2 as well as Voice entries: "Yes" and "No". To limit this to DTMF you could utilize the mode within the grammar tag.

Code: Select all

<field name="totalbillconfirm">
  <grammar src="builtin:dtmf/boolean" mode="dtmf"/>
To return to the totalbill field, you should be able to add in a goto to the form "TotalBillInput":

Code: Select all

<else/>
  <log expr="'*** NEED TO RE PROMPT FOR BILL AMOUNT AGAIN ***'"/>
  <goto next="#TotalBillInput"/>
</if>
Hope this helps!

Regards,
Plum Support

sixseats
Posts: 7
Joined: Wed Aug 10, 2011 2:48 pm

Re: New to VXML - Small Application Issue

Post by sixseats »

Awesome, thanks so much! Most of this worked. The only thing that did not is when I repeat back the amount just entered, it is thinking the star is a multiplier and says "times" (i think that is the word it says, definitely thinking it is multiplying though) instead of signifying a period. Here is the VXML:

-------------------------------------------------------------------
<field name="totalbill" type="currency">

<prompt bargein="true">Finally, using your keypad, please enter the Total Dollar Amount of the Bill before tax and tip using the star key for a period. For example, if the bill is 40 dollars and 45 cents, enter four zero star four five.</prompt>
<filled>
<log expr="'*** FILLED ***'"/>
<log expr="'*** totalbill =' + totalbill + '***'"/>
</filled>
</field>

<field name="totalbillconfirm" type="digits?minlength=1;maxlength=1">
<prompt bargein="true">Please confirm the total bill before tax and tip is <value expr="lastresult$.utterance"/>. Press 1 for yes, 2 for no.</prompt>

<filled>
<if cond="totalbillconfirm=='1'">
<log expr="'*** FILLED ***'"/>
<log expr="'*** totalbill =' + totalbill + '***'"/>
<assign name="voucherid" expr="9"/>
<submit next="redeem.asp" method="post" namelist="totalbill voucherid"/>
<elseif cond="totalbillconfirm=='2'"/>
<log expr="'*** RE PROMPT FOR BILL AMOUNT AGAIN ***'"/>
<goto next="#TotalBillInput"/>

</if>
</filled>
</field>
-------------------------------------------------------------------

Thanks again! Hopefully this is the last time!

Dennis

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

Re: New to VXML - Small Application Issue

Post by support »

Hi Dennis,

The reason why you're not properly hearing the output is because you're utilizing the IVR's lastresult$.utterance value. This returns the literal string entered into the phone, in this case "40*45". To hear the properly formatted amount you should reference the totalbill value instead.

Code: Select all

<prompt bargein="true">
  Please confirm the total bill before tax and tip is 
  <say-as type="currency">
    $<value expr="totalbill"/>
  </say-as>
  .
</prompt>
To make sure the amount is read as currency we use the say-as tag along with a $ sign. The dollar sign is necessary because of the different way the TTS engines handle the currency type.

Hope this helps!

Regards,
Plum Support

sixseats
Posts: 7
Joined: Wed Aug 10, 2011 2:48 pm

Re: New to VXML - Small Application Issue

Post by sixseats »

Perfect, it worked! I had that yesterday and I thought it was the issue on something else so i removed it. I guess it really was correct!

All set. Great service - I appreciate it!

Dennis

sixseats
Posts: 7
Joined: Wed Aug 10, 2011 2:48 pm

Re: New to VXML - Small Application Issue

Post by sixseats »

Hi again. I am really sorry to email, but I have been messing around trying to figure this out for a few hours now. Need to call in the big guns :)

Everything goes well with the code below, but after I press "1" to confirm, I get an error. The VXML being processed is valid - I checked it using your validator. This is the error info (VXML is below it). Any assistance would be great. Like I said, everything else is working, not sure where this error really came from!

Thanks a million.

Dennis


============================================================
<?xml version='1.0'?><speak>For example, if the bill is 40 dollars and 45 cents, enter four<break size="medium" time="100"/> zero<break size="medium" time="100"/> star<break size="medium" time="100"/> four<break size="medium" time="100"/> five<break size="medium" time="100"/> pound sign.</speak>
---------
VXI::field_element - activating grammars for form = 'TotalBillInput' formitem = 'totalbill'
VXI::do_recognition()
PromptManager::Play()
starting playback: bargein=true, inputmodes="dtmf speech"
Newly queued prompts are now being played

Thu 11 Aug 2011 01:04:15 PM EDT:
dtmf input: 12*45#
Found grammar match
hypothesis #0: 12.45 (0.9990)
LOCAL: *** FILLED ***
LOCAL: *** totalbill =12.45***
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>Please confirm the total bill before tax and tip is <say-as type="currency"> $ 12.45</say-as> . Press 1 for yes, 2 for no.</speak>
---------
VXI::field_element - activating grammars for form = 'TotalBillInput' formitem = 'totalbillconfirm'
VXI::do_recognition()
PromptManager::Play()
starting playback: bargein=true, inputmodes="dtmf speech"
Newly queued prompts are now being played

Thu 11 Aug 2011 01:04:24 PM EDT:
dtmf input: 1
Found grammar match
hypothesis #0: 1 (0.9990)
LOCAL: *** FILLED ***
LOCAL: *** Total Bill Confirmed ***
VXI::assign_element(name="voucherid" expr = "9")
VXI::assign_element(name="merchantlocationid" expr = "2")
VXI::assign_element(name="generalsitename" expr = "SixSeats")
ReferenceError: SixSeats is not defined line 1
received event: error.semantic.ecmascript:
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
============================================================



This is the VXML:

============================================================
<form id="TotalBillInput">

<field name="totalbill" type="currency">
<property name="interdigittimeout" value="3s"/>
<prompt bargein="true">Finally, using your keypad, please enter the Total Dollar Amount of the Bill before taxes and gratuity.</prompt>
<prompt bargein="true">Please press the star key to enter the decimal point followed by the pound sign.</prompt>
<prompt bargein="true">For example, if the bill is 40 dollars and 45 cents, enter four<break time="100"/>zero<break time="100"/>star<break time="100"/>four<break time="100"/>five<break time="100"/>pound sign.</prompt>

<filled>
<log expr="'*** FILLED ***'"/>
<log expr="'*** totalbill =' + totalbill + '***'"/>
</filled>
</field>

<field name="totalbillconfirm" type="digits?minlength=1;maxlength=1">
<prompt bargein="true">Please confirm the total bill before tax and tip is <say-as type="currency">$<value expr="totalbill"/></say-as>. Press 1 for yes, 2 for no.</prompt>
<filled>

<if cond="totalbillconfirm=='1'">
<log expr="'*** FILLED ***'"/>
<log expr="'*** Total Bill Confirmed ***'"/>
<assign name="voucherid" expr="9"/>
<assign name="merchantlocationid" expr="2"/>
<assign name="generalsitename" expr="SixSeats"/>
<submit next="ss_redeemvoucher.asp" method="post" namelist="voucherid merchantlocationid generalsitename totalbill"/>
<else/>
<log expr="'*** RE PROMPT FOR BILL AMOUNT AGAIN ***'"/>

<goto next="#TotalBillInput"/>
</if>
</filled>
</field>
</form>
============================================================

sixseats
Posts: 7
Joined: Wed Aug 10, 2011 2:48 pm

Re: New to VXML - Small Application Issue

Post by sixseats »

Hi there - just to let you know, i figured this out. string values need to be wrapped in ' '. Sorry again - I am finished! Thanks again for the help.

Dennis

Post Reply