Hi all,
I would like to know if I am doing something wrong. I have a simple playAndGetDigits in LUA. Once callers enter a valid number I simply repeat the number to them. What I am facing is: if callers enter the max number of allowed digits, followed by
This is a sample of my code:
Thanks!
I would like to know if I am doing something wrong. I have a simple playAndGetDigits in LUA. Once callers enter a valid number I simply repeat the number to them. What I am facing is: if callers enter the max number of allowed digits, followed by
*
, the say
command is skipped. What is the correct way to handle that situation?This is a sample of my code:
Code:
local min_digits = 4;
local max_digits = 5;
local max_tries = 2;
local timeout = 10000;
local terminators = '*#';
local interdigit_timeout = 2000;
local pattern = '^\\d{4,5}$'
local audio_to_play = instructions.wav;
local audio_to_play_if_invalid_input = wrong.wav;
local confirmation = confirm.wav;
caller_input = session:playAndGetDigits(min_digits, max_digits, max_tries, timeout, terminators, audio_to_play, audio_to_play_if_invalid_input, pattern, caller_input, interdigit_timeout);
session:streamFile(confirmation);
session:execute('say', 'en number iterated '..caller_input);
Thanks!
Last edited: