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

accept month by saying month name or pressing number

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
msh
Posts: 9
Joined: Thu Aug 29, 2013 1:19 pm

accept month by saying month name or pressing number

Post by msh »

Is it possible to have srgs+xml configured to allow a user to either say the month or corresponding number? EG: say "august' or accept button press 8?

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

Re: accept month by saying month name or pressing number

Post by support »

Hi,

Yes, it is possible to have srgs+xml allow either voice or dtmf input. This can be done by defining both the voice and dtmf grammar input for the desired field.

Here is an example using two values. You can capture either the dtmf input or voice input by using conditionals within the <filled> tag, as displayed in the code. In this snippet, entering 1 or saying january will match the same conditional.

Code: Select all

<form>
    <field name="month">
      <grammar type="application/srgs+xml" root="NUMBERS" mode="dtmf">
        <rule id="NUMBERS">
        <one-of>
          <item>1</item>
          <item>2</item>
        </one-of>
      </rule>
      </grammar>
      <grammar type="application/srgs+xml" root="UTTERANCE" mode="voice">
        <rule id="UTTERANCE">
        <one-of>
          <item>january</item>
          <item>february</item>
        </one-of>
      </rule>
      </grammar>
      <prompt>
        Either say or enter a month
      </prompt>
      <filled>
        <if cond="month==1 || month=='january'">
          <!-- here you can handle input for january/1 -->
          You entered <value expr="month"/>
        <elseif cond="month==2 || month=='february'"/>
          <!-- here you can handle input for february/2 -->
          You entered <value expr="month"/>
        </if>
      </filled>
      <nomatch>
        You did not say a month.
        <reprompt/>
      </nomatch>
      <noinput>
        You did not enter anything.
        <reprompt/>
      </noinput>
    </field>
  </form>
Let us know if you have any further questions concerning this topic.

Best Regards,
Plum Support

Post Reply