Update disa.lua (#2959)

Play user defined greeting befor asking of pin. Usage: <application action="set" data="sound_greeting=/mysounds/mygreeting.wav"/>
This commit is contained in:
borisk1976 2018-01-19 22:58:25 +05:00 committed by FusionPBX
parent 77684289b9
commit 3b30bd91e4
1 changed files with 7 additions and 0 deletions

View File

@ -43,6 +43,7 @@
--get and save the variables
if (session:ready()) then
sound_greeting = session:getVariable("sound_greeting");
pin_number = session:getVariable("pin_number");
sounds_dir = session:getVariable("sounds_dir");
caller_id_name = session:getVariable("caller_id_name");
@ -73,6 +74,12 @@
digit_max_length = "11";
end
--if the sound_greeting is provided then play it
if (session:ready() and sound_greeting) then
session:streamFile(sound_greeting);
session:sleep(200);
end
--if the pin number is provided then require it
if (session:ready() and pin_number) then
min_digits = string.len(pin_number);