开发者

"Press * to cancel" on date entry with Nuance OSDM?

I'm currently wo开发者_JS百科rking on a VXML 2.0 app that uses Nuance OSDMs with GRXML grammars.

One of our prompts asks the caller to enter a date of birth, but if they don't have one handy, they can either say "cancel" or press the asterisk. It's a Date OSDM, and I've added an additional command grammar to handle the "cancel" or the asterisk for speech and DTMF entry, respectively.

Saying "cancel" works; the Date grammar is bypassed, the command grammar activates, and the code runs just as I expect. The asterisk, however, is a different story. When I run a debug call and press the asterisk key on my telephone, it's handled as a nomatch. Combing through the OSDM handbook, it appears that DTMF entry on Nuance Date OSDMs is run through the builtin DTMF digit grammar, with a range of 2-8 digits.

The handbook also states the following: "If a parallelgrammar is specified, the OSDM matches the DTMF input to both the DTMF collection grammar and the parallelgrammar. If a DTMF character matches both grammars, the parallelgrammar match is returned."

So, I'm thinking that the digit grammar has "*" as a baked-in termination character, and it's overriding my explicit declaration that only "#" can be a termination character:

  1. I press the asterisk.
  2. The DTMF digit grammar gets activated.
  3. The DTMF digit grammar results in a blank, because the asterisk is a term character, and no other input was made.
  4. Blank is OOG, because the length is 2-8 digits.
  5. Nomatch is returned.

I'm stuck using the OSDM, as its operation is vital to the way that our application does event logging. However, I can get creative with responding to the asterisk.

Is there another way to get the asterisk to be counted as valid input, and either have it reach my custom command grammar, or bypass the call to the OSDM and handle it myself?


The solution was to use a custom command grammar, separate from the existing global command grammar.

The OSDM responds with "COMMAND", in place of "SUCCESS", which requires a bit of silliness in the post-processing, but it's not too ugly.

This:
<date-osdm name="ClaimDate">
<dmname value="ClaimDate"/>
<collection_commandgrammar name="Generic_command.grxml"/>
<collection_dtmfcommandgrammar name="Generic_command_dtmf.grxml"/>

In place of this (the name of the grammar isn't code-significant, it just has different content):
<date-osdm name="ClaimDate">
<dmname value="ClaimDate"/>
<collection_parallelgrammar1 name="Generic_inputs.grxml"/>
<collection_dtmfparallelgrammar1 name="Generic_inputs_dtmf.grxml"/>

And viola! It works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜