When using # (hash) as valid input in IVR menu or getInput() function the Plivo Cloud returns empty digits, altough this is considered a valid digit according to their docs: https://www.plivo.com/docs/xml/getdigits/

Comments

tamerzg’s picture

From plivo support:

"In there is an attribute " finishOnKey " which has the default value "#" .So you need to change it to something else , that's why it's giving you an empty $_REQUEST['digits']."

Actually Plivo doesn't allow empty finishOnKey (end_key in our case) value, but it defaults to # which then can't be used in getdigits. I fixed some of the scripts which where using pound key as valid digit, but had empty end_key (switched end_key to * or something else not used in valid digit).

But real problem is with addRunIvrMenu() in where we allow any digit as valid input (1234567890*#) while Plivo must use one of digits for end_key.

$input_options = array(
      '1' => 'conference',
      '2' => 'weather report',
      '3' => 'sms',
      '4' => 'record',
      '5' => 'callback',
      '#' => 'hang up',
      'i' => 'hang up',
      't' => 'hang up'
    );
    $invalid_msg = t('Invalid option selected.');
    $script->addRunIvrMenu($options_menu, $input_options, $invalid_msg);

Looking at code that generates ivr menu at voipscript.inc line 1152:

$script->addGetInput("^VoipPrompt::decode(%_menu_options)", 1, '', '%_timeout');

we see third param passed for end_key is empty.
Above code will work for other servers but not Plivo. This is more of design issue than a bug.
What should we do? If we remove # key as valid from ivr menu and set end_key as this:

$script->addGetInput("^VoipPrompt::decode(%_menu_options)", 1, '#', '%_timeout');

that would affect all servers.

Or should we just mention in docs that in case of Plivo we can't use # as valid IVR menu option?

Or just warn that ivr_menu can't work

tamerzg’s picture

Status: Active » Fixed

After further talking with Plivo support, it seems we should use "none" value for finishOnKey when it should be empty.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.