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

Grammar issue

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
shanthint@paydq.com
Posts: 84
Joined: Wed Apr 04, 2007 4:58 pm

Grammar issue

Post by shanthint@paydq.com »

Hello,
I am experiencing some problem with dtmf and voice input.
I need to have both inputs in the same field. but I am getting error.recognintion.nogrammar error.
code snippet is here.


<var name="custname" expr="'0'" />
<form id="getName">
<field name="name" >
<prompt bargein="false">
To confirm this payment
Please say your name.
To cancel the payment, Press 2
</prompt>
</field>

<filled>
<if cond="name$.inputmode=='voice'">
<assign name="custname" expr="name"/>
<goto next="#confName"/>

<else/>
<goto next="#getName"/>
</if>
</filled>

</form>


<form id="confName">

<field name="enter" type="boolean" >

<prompt>
<sentence>You entered <value expr="custname"/>.</sentence>
<sentence>If this is correct, Press 1.</sentence> Press 2 to enter the name again.

</prompt>

<filled>
<if cond="enter==false">
<clear namelist="custname" />
<goto next="#getName"/>
<else/>
<prompt>Success</prompt>
</if>
</filled>
</field>

</form>

What am I doing wrong here?
any help would be appreciated.
Thanks in advance.

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

Adjust IVR code by specifying a grammar within field

Post by support »

Hi,

The reason why you are getting this IVR issue is because you need to specify an IVR grammar within your field.

You can try using the following IVR example to help you adjust your IVR code:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
<var name="custname" expr="'0'"/>
<form id="getName">
<field name="name">
  <grammar src="http://vxml.plumgroup.com/grammars/firstname.php" root="ROOT" type="application/srgs+xml" mode="voice"/>
  <grammar type="application/srgs+xml" root="ROOT" mode="dtmf">
    <rule id="ROOT">
      <one-of>
        <item>2</item>
      </one-of>
    </rule>
  </grammar>
  <prompt bargein="false">
    To confirm this payment, please say your first name and spell it. To cancel the payment, Press 2.
  </prompt>
  <filled>
    <if cond="name$.inputmode=='voice'">
      <assign name="custname" expr="name"/>
      <goto next="#confName"/>
    <else/>
      <goto next="#getName"/>
    </if>
  </filled>
</field>
</form>


<form id="confName">

<field name="enter" type="boolean" >

<prompt>
<sentence>You entered <value expr="custname"/>.</sentence>
<sentence>If this is correct, Press 1.</sentence> Press 2 to enter the name again.

</prompt>

<filled>
<if cond="enter==false">
<clear namelist="custname" />
<goto next="#getName"/>
<else/>
<prompt>Success</prompt>
</if>
</filled>
</field>

</form>
</vxml>
Hope this helps.

Regards,
Plum Support
Last edited by support on Fri Feb 19, 2010 10:44 am, edited 3 times in total.

shanthint@paydq.com
Posts: 84
Joined: Wed Apr 04, 2007 4:58 pm

Post by shanthint@paydq.com »

Hi,
I tried the code you suggested. Our TTS engine can not recognize the voice input. It gives me the error 'Sorry, I didn't understand you.'
The press 2 works fine.
I am just wondering that whether it can the grammar from the URL you gave or not.

Thanks.

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

IVR grammar fix

Post by support »

Hi,

We tried testing the IVR grammar with the input, "John" and it worked fine for us.

You could try adjusting the sensitivity to a lower value to account for any background noise that might be causing the <nomatch>:

Code: Select all

<property name="sensitivity" value="0.3"/>
Hope this change in IVR code helps.

Regards,
Plum Support

Post Reply