Yet another LUA question: playAndGetDigits followed by star

Status
Not open for further replies.

ewdpb

Member
Oct 3, 2019
151
19
18
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 *, 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:

ewdpb

Member
Oct 3, 2019
151
19
18
I wish I could. This is my connectivity path:

PSTN --> Alcatel OmniPCX --> Audiocodes SBC --> FusionPBX

The pound key is already being used on the Alcatel globally. Whenever anyone presses the pound key it transfers the call to an operator. They claim they cannot change the behavior for our calls. I think they should be able to but I cannot force them.

Thanks for the reply!
 
Status
Not open for further replies.