DTMF 0 question

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

  • Author
  • Message
Offline

jverweij

  • Posts: 67
  • Joined: Thu Apr 27, 2017 11:29 am

DTMF 0 question

PostMon Jan 22, 2018 1:05 pm

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"
Offline

support

  • Posts: 3456
  • Joined: Mon Jun 02, 2003 3:47 pm
  • Location: Boston, MA

Re: DTMF 0 question

PostMon Jan 22, 2018 3:10 pm

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

Return to Plum DEV Q&A

Who is online

Users browsing this forum: No registered users and 1 guest