Page 1 of 1

11# versus 111#

Posted: Tue Mar 01, 2005 7:26 pm
by candide
Hello Plum,

I'd like to include, say option 11# and 111# with global scope LINK. But with the following code, whenever 111# is entered, option 11# is understood instead. How should I reconstruct the grammar? Thanks!

Code: Select all

<link next="#option11">
	<grammar mode="dtmf">^((11){11})["#"{}]$</grammar>
</link>
<link next="#option111">
	<grammar mode="dtmf">^((111){111})["#"{}]$</grammar>
</link>

Posted: Tue Mar 01, 2005 7:53 pm
by candide
In fact, I have tried

Code: Select all

^11"#"$ 
vs.

Code: Select all

^111"#"$ 
and

Code: Select all

^11("#")$ 
vs.

Code: Select all

^111("#")$ 
which give me the same result...

IVR example using 2 global links that will detect difference

Posted: Wed Mar 02, 2005 11:07 am
by support
Hello,

The IVR code you posted should be working, however, without the full source or at least a list of active IVR grammars it is difficult to determine exactly what the problem is. Below is a working IVR example of using two global <link> that will detect the difference between 11 and 111. Also, it is not necessary to provide a '#' at the end of an IVR grammar, the match will still occur without it. Keep in mind that local grammars take precedence over globally linked grammars, so you must not have a local grammar that can match the same value as your global link.

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
  <link dtmf="^11$" next="#pressed11"/>
  <link dtmf="^111$" next="#pressed111"/>

  <form id="form1">
    <field name="field1">
      <prompt>Please enter 2, 11, or 111</prompt>
      <grammar>2</grammar>
      <filled>
        You pressed 2.
        <goto next="#form1"/>
      </filled>
    </field>
  </form>

  <form id="pressed11">
    <block>
      You pressed 11.
      <goto next="#form1"/>
    </block>
  </form>

  <form id="pressed111">
    <block>
      You pressed 111.
      <goto next="#form1"/>
    </block>
  </form>
</vxml>

Hope This Helps!
Plum Support