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 problem with "*#" or "#"

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
soso
Posts: 62
Joined: Tue Apr 22, 2008 8:11 am

Grammar problem with "*#" or "#"

Post by soso »

Hi,

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

Thanks by advance.

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

IVR code for grammar problem

Post 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
Last edited by support on Tue Feb 16, 2010 1:51 pm, edited 2 times in total.

soso
Posts: 62
Joined: Tue Apr 22, 2008 8:11 am

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

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

IVR code for grammar problem

Post 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
Last edited by support on Wed Feb 24, 2010 12:58 pm, edited 4 times in total.

soso
Posts: 62
Joined: Tue Apr 22, 2008 8:11 am

Post by soso »

Hi,

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

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

IVR platform grammar

Post by support »

Hi,

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

Regards,
Plum Support
Last edited by support on Fri Jan 08, 2010 5:52 pm, edited 1 time in total.

soso
Posts: 62
Joined: Tue Apr 22, 2008 8:11 am

Post by soso »

Hi,

I've another problem with this grammar.

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

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

IVR platform does not support termchar property

Post 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

Post Reply