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

DTMF 0 question

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
jverweij
Posts: 79
Joined: Thu Apr 27, 2017 11:29 am

DTMF 0 question

Post by jverweij »

I want to allow a caller to press 0 at a boolean field, but I don't see a way to distinguish between pressing 0 and saying "no" because the output from the built-in boolean grammar includes zero.

I'd rather not re-implement a version of the boolean grammar myself to work around this problem. Is there a way I might accept a dtmf "0" at a boolean prompt but still distinguish between pressing "0" vs saying "no"?

The data we get back is either “1” or “0": pressing 1 or saying yes returns a “1”, pressing 2 or saying no returns a “0"

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

Re: DTMF 0 question

Post by support »

Hi,

It is possible to rewrite the value that is returned whenever you're working with an explicit grammar item. Here's a basic example where pressing 0 will return the string "skip".

Code: Select all

<field name="confirm" type="boolean">
  <grammar type="application/srgs+xml" root="ZERO" mode="dtmf">
    <rule id="ZERO">
      <one-of>
        <item> 0 <tag> SWI_literal='skip' </tag></item>
      </one-of>
    </rule>
  </grammar>

  <prompt> Press 1 or say yes. Press 2 or say no. Press 0 to skip. </prompt>

  <filled>
    <log> <value expr="confirm"/> </log>
  </filled>
</field>
The boolean responses are still the expected values. The value returned within the SWI_literal can be anything you'd like.

Regards,
Plum Support

Post Reply