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

11# versus 111#

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
candide
Posts: 3
Joined: Thu Jun 10, 2004 9:16 pm

11# versus 111#

Post 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>

candide
Posts: 3
Joined: Thu Jun 10, 2004 9:16 pm

Post 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...

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

IVR example using 2 global links that will detect difference

Post 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

Post Reply