Update directory.lua
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
-- directory.lua
|
-- directory.lua
|
||||||
-- Part of FusionPBX
|
-- Part of FusionPBX
|
||||||
-- Copyright (C) 2012 Mark J Crane <markjcrane@fusionpbx.com>
|
-- Copyright (C) 2012-2016 Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
-- All rights reserved.
|
-- All rights reserved.
|
||||||
--
|
--
|
||||||
-- Redistribution and use in source and binary forms, with or without
|
-- Redistribution and use in source and binary forms, with or without
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
-- notice, this list of conditions and the following disclaimer in the
|
-- notice, this list of conditions and the following disclaimer in the
|
||||||
-- documentation and/or other materials provided with the distribution.
|
-- documentation and/or other materials provided with the distribution.
|
||||||
--
|
--
|
||||||
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
-- THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||||
-- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
-- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
-- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
-- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
-- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
-- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||||
@@ -79,10 +79,6 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--debug
|
|
||||||
debug["info"] = false;
|
|
||||||
debug["sql"] = false;
|
|
||||||
|
|
||||||
--prepare the api object
|
--prepare the api object
|
||||||
api = freeswitch.API();
|
api = freeswitch.API();
|
||||||
|
|
||||||
@@ -195,9 +191,18 @@
|
|||||||
dtmf_digits = session:playAndGetDigits(min_digits, max_digits, max_tries, digit_timeout, "#", sounds_dir.."/voicemail/vm-press.wav", "", "\\d+");
|
dtmf_digits = session:playAndGetDigits(min_digits, max_digits, max_tries, digit_timeout, "#", sounds_dir.."/voicemail/vm-press.wav", "", "\\d+");
|
||||||
end
|
end
|
||||||
if (string.len(dtmf_digits) == 0) then
|
if (string.len(dtmf_digits) == 0) then
|
||||||
digit_timeout = "3000";
|
|
||||||
dtmf_digits = session:playAndGetDigits(min_digits, max_digits, max_tries, digit_timeout, "#", sounds_dir.."/digits/1.wav", "", "\\d+");
|
dtmf_digits = session:playAndGetDigits(min_digits, max_digits, max_tries, digit_timeout, "#", sounds_dir.."/digits/1.wav", "", "\\d+");
|
||||||
end
|
end
|
||||||
|
if (string.len(dtmf_digits) == 0) then
|
||||||
|
dtmf_digits = session:playAndGetDigits(min_digits, max_digits, max_tries, digit_timeout, "#", sounds_dir.."/directory/dir-for_next.wav", "", "\\d+");
|
||||||
|
end
|
||||||
|
if (string.len(dtmf_digits) == 0) then
|
||||||
|
dtmf_digits = session:playAndGetDigits(min_digits, max_digits, max_tries, digit_timeout, "#", sounds_dir.."/voicemail/vm-press.wav", "", "\\d+");
|
||||||
|
end
|
||||||
|
if (string.len(dtmf_digits) == 0) then
|
||||||
|
digit_timeout = "5000";
|
||||||
|
dtmf_digits = session:playAndGetDigits(min_digits, max_digits, max_tries, digit_timeout, "#", sounds_dir.."/digits/6.wav", "", "\\d+");
|
||||||
|
end
|
||||||
return dtmf_digits;
|
return dtmf_digits;
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -260,17 +265,19 @@
|
|||||||
session:streamFile(file_location);
|
session:streamFile(file_location);
|
||||||
else
|
else
|
||||||
--announce the first and last names
|
--announce the first and last names
|
||||||
if (speak_mod ~= nil and speak_voice ~= nil) then
|
if (row.first_name ~= nil and row.first_name ~= '') then
|
||||||
session:execute("speak",speak_mod.."|"..speak_voice.."|"..row.first_name);
|
if (speak_mod ~= nil and speak_voice ~= nil) then
|
||||||
else
|
session:execute("speak", speak_mod.."|"..speak_voice.."|"..row.first_name);
|
||||||
session:execute("say", "en name_spelled iterated "..row.first_name);
|
else
|
||||||
|
session:execute("say", default_language.." name_spelled iterated "..row.first_name);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
--session:execute("sleep", "500");
|
--session:execute("sleep", "500");
|
||||||
if (row.last_name ~= nil) then
|
if (row.last_name ~= nil and row.last_name ~= '') then
|
||||||
if (speak_mod ~= nil and speak_voice ~= nil) then
|
if (speak_mod ~= nil and speak_voice ~= nil) then
|
||||||
session:execute("speak",speak_mod.."|"..speak_voice.."|"..row.last_name);
|
session:execute("speak", speak_mod.."|"..speak_voice.."|"..row.last_name);
|
||||||
else
|
else
|
||||||
session:execute("say", "en name_spelled iterated "..row.last_name);
|
session:execute("say", default_language.." name_spelled iterated "..row.last_name);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -289,28 +296,30 @@
|
|||||||
session:streamFile(voicemail_dir.."/"..row.extension.."/recorded_name.wav");
|
session:streamFile(voicemail_dir.."/"..row.extension.."/recorded_name.wav");
|
||||||
else
|
else
|
||||||
--announce the first and last names
|
--announce the first and last names
|
||||||
if (speak_mod ~= nil and speak_voice ~= nil) then
|
if (row.first_name ~= nil and row.first_name ~= '') then
|
||||||
session:execute("speak",speak_mod.."|"..speak_voice.."|"..row.first_name);
|
if (speak_mod ~= nil and speak_voice ~= nil) then
|
||||||
else
|
session:execute("speak",speak_mod.."|"..speak_voice.."|"..row.first_name);
|
||||||
session:execute("say", "en name_spelled iterated "..row.first_name);
|
else
|
||||||
|
session:execute("say", default_language.." name_spelled iterated "..row.first_name);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if (row.last_name ~= nil) then
|
if (row.last_name ~= nil and row.last_name ~= '') then
|
||||||
--session:execute("sleep", "500");
|
--session:execute("sleep", "500");
|
||||||
if (speak_mod ~= nil and speak_voice ~= nil) then
|
if (speak_mod ~= nil and speak_voice ~= nil) then
|
||||||
session:execute("speak",speak_mod.."|"..speak_voice.."|"..row.last_name);
|
session:execute("speak",speak_mod.."|"..speak_voice.."|"..row.last_name);
|
||||||
else
|
else
|
||||||
session:execute("say", "en name_spelled iterated "..row.last_name);
|
session:execute("say", default_language.." name_spelled iterated "..row.last_name);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--announce the extension number
|
--announce the extension number
|
||||||
if (row.directory_exten_visible == "false") then
|
--if (row.directory_exten_visible == "false") then
|
||||||
--invisible extension number
|
--invisible extension number
|
||||||
else
|
if (row.extension ~= nil and row.extension ~= '' and row.directory_exten_visible == "true") then
|
||||||
session:streamFile(sounds_dir.."/directory/dir-at_extension.wav");
|
session:streamFile(sounds_dir.."/directory/dir-at_extension.wav");
|
||||||
session:execute("say", "en number iterated "..row.extension);
|
session:execute("say", default_language.." NAME_SPELLED iterated "..row.extension);
|
||||||
end
|
end
|
||||||
|
|
||||||
--select this entry press 1
|
--select this entry press 1
|
||||||
|
|||||||
Reference in New Issue
Block a user