0

The VXML menu has the options 1, 2, 3, 9, and '#'. The customers will assume that if they press 0, it would take them to the transfer to service center.

But 0 in this menu won't take them to service center, the requirement is to ignore 0 DTMF and keep playing the prompt without warning them.

This menu's bargien property has to be true. I am required to make the prompt menu where users are able to press any mentioning DTMF above to interrupt it and goto next, but I have to set the program to ignore DTMF 0.

kaya3
  • 47,440
  • 4
  • 68
  • 97
Nick
  • 41
  • 2

1 Answers1

0

Please try this code.
Key point is "bargeintype" property and grammar rule.

VXML's form

<form id="sample">
    <field name="menu_result">
        <property name="bargein" value="true" />
        <property name="bargeintype" value="hotword" /><!-- Important! -->
        <property name="inputmodes" value="dtmf" />
        <property name="timeout" value="5s" />
        <property name="interdigittimeout" value="0s" />
        <property name="termchar" value="D" />
        <prompt>
            Please push either of 1, 2, 3, 9 or pound sign button.
            Other button is ignored.
        </prompt>
        <grammar src="special_menu.grxml" />
        <filled>
            <assign name="result" expr="menu_result.slice(-1)"/><!-- Get last 1 digit -->
            <goto next="#next_form"/>
        </filled>
        <noinput><prompt>No input error.</prompt></noinput>
        <nomatch><prompt>No match error.</prompt></nomatch>
    </field>
</form>

special_menu.grxml

<?xml version="1.0" encoding="UTF-8"?>
<grammar
    version="1.0"
    mode="dtmf"
    root="main"
    xmlns="http://www.w3.org/2001/06/grammar"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <rule id="main">
        <item repeat="0-">
            <one-of><item>4</item><item>5</item><item>6</item><item>7</item><item>8</item><item>*</item></one-of>
        </item>
        <one-of>
            <item>1</item><item>2</item><item>3</item><item>9</item><item>#</item>
        </one-of>
    </rule>
</grammar>
Bladean Mericle
  • 524
  • 2
  • 13