Page 1 of 1

Grammar problem with "*#" or "#"

Posted: Thu May 14, 2009 11:20 am
by soso
Hi,

How do I make a grammar with only "*#" or "#" for a field, and stop immediately after "#" or "*#"?

Thanks by advance.

IVR code for grammar problem

Posted: Thu May 14, 2009 11:44 am
by support
Hi,

For us to create a sample IVR code, could you please specify what you mean by "stop immediately after "# or "*#""? Do you mean to say that you want your IVR call to disconnect immediately after the user enters "#" or "*#"?

Regards,
Plum Support

Posted: Thu May 14, 2009 11:50 am
by soso
Sorry,

No. I want to when the user press "#" go to a next form. When it's press "*#", go to the previous form.

IVR code for grammar problem

Posted: Thu May 14, 2009 2:19 pm
by support
Hi,

Using the IVR tag, <form>, in your IVR code should help you achieve this.

formjumping.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">

<form id="previousform">
  <block>
    <prompt>
      This is the previous form.
    </prompt>
    <goto next="#middleform"/>
  </block>
</form>


<form id="middleform">
  <field name="input">
    <grammar root="ROOT" type="application/srgs+xml" mode="dtmf">
      <rule id="ROOT" scope="public">
        <one-of>
            <item repeat="0-255">
              <ruleref uri="#digit"/>
            </item>
          <item> "* #" </item>
          <item> "#" </item>
        </one-of>
      </rule>

      <rule id="digit" scope="public">
        <one-of>
          <item> 0 </item>
          <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> "*" </item>
          <item> "#" </item>
        </one-of>
      </rule>
    </grammar>

    <prompt>
      Please enter some digits.
    </prompt>
    <filled>
      <if cond="input == '* #'">
       <goto next="#previousform"/>
      <elseif cond="input == '#'"/>
       <goto next="#nextform"/>
      <else/>
        <prompt>
          You entered <value expr="input"/>. The field you entered did not contain a pound key.
        </prompt>
      </if>
    </filled>
  </field>
</form>

<form id="nextform">
  <block>
    <prompt>
      This is the next form.
    </prompt>
  </block>
</form>

</vxml> 
From this IVR example, if the user enters "* #" on his phone keypad, the user goes back to the form, "previousform". If the user enters "#" on his phone keypad, the user goes on to the next form, "nextform".

Hope this helps.

Regards,
Plum Support

Posted: Thu May 14, 2009 4:15 pm
by soso
Hi,

Thanks. Is there the "* #" equal "*#"? May I write the space?

IVR platform grammar

Posted: Fri May 15, 2009 8:50 am
by support
Hi,

Yes, you must write the space in. That is how the IVR platform sees the input, as "*#".

Regards,
Plum Support

Posted: Mon May 18, 2009 10:28 am
by soso
Hi,

I've another problem with this grammar.

May I use "termchar" with "#" or another ""?

IVR platform does not support termchar property

Posted: Mon May 18, 2009 10:35 am
by support
Hi,

No, you cannot use the IVR property, "termchar", as it is not supported: http://www.plumvoice.com/docs/dev/voice ... s:termchar

Regards,
Plum Support