Page 1 of 1

grammer question

Posted: Fri Oct 17, 2008 6:46 pm
by jcooper
Hi,
I am trying to implement a grammar that allows the user to select more than 10 options. Below is the grammar I am using but it isn't working, i think, because there is no "11" key on the phone. How would i implement something like this?
Thanks,
JC

<grammar type="application/srgs+xml" root="ReadConfirm" mode="dtmf" version = "1.0">
<rule id="ReadConfirm" scope="private">
<one-of>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>*</item>
</one-of>
</rule>
</grammar>

IVR code example to test grammar

Posted: Mon Oct 20, 2008 9:38 am
by support
Hi,

Actually, your IVR grammar does "work" where if the user enters "11" on the touch tone keypad, it gets matched to "11" in the IVR <grammar>. You can use the following IVR code example to test this:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
<form>
  <field name="num">
    <grammar type="application/srgs+xml" root="ReadConfirm" mode="dtmf">
      <rule id="ReadConfirm" scope="private">
        <one-of>
          <item>1</item>
          <item>2</item>
          <item>3</item>
          <item>4</item>
          <item>5</item>
          <item>6</item>
          <item>7</item>
          <item>8</item>
          <item>9</item>
          <item>10</item>
          <item>11</item>
          <item>*</item>
        </one-of>
      </rule>
    </grammar>

    <prompt>
      Please enter a number greater than 10.
    </prompt>

    <filled>
      <prompt>
        You entered <value expr="num"/>.
      </prompt>
    </filled>

  </field>
</form>
</vxml>
If this is not what you want your IVR grammar to do, could you please further clarify what you would like your grammar to do?

Regards,
Plum Support

Posted: Tue Oct 21, 2008 6:13 pm
by jcooper
if you add the below to the filled tag it does not work.

<filled>
<if cond="num=='1'">
<prompt>this will work</prompt>
<elseif cond="num='11'"/>
<prompt>this will not work...</prompt>
<else/>
<prompt>...instead this will be read.</prompt>
</if>
</filled>

I've tried it with and without single quotes with no success. Please be advised I am using the Nuance OSR... and no, AT&T is not an option.

grammar ?

Posted: Tue Oct 21, 2008 6:52 pm
by jcooper
OK, I found the issue. It was putting a space between the 1.. so i entered: '11' and it came back with '1 1'.. cheeky. I've added a script tag:

Code: Select all

<script>
<![CDATA[
num = num.replace(/ /g,'');
]]></script>
which seems to work fine.