WhitespaceClean-resources/install/scripts
whitespace pass over files for reference regex that was used s/[ \t]+(\r?\n)/\1/
This commit is contained in:
@@ -183,7 +183,7 @@
|
||||
if (voicemail_attach_file == nil) then
|
||||
voicemail_attach_file = "true";
|
||||
end
|
||||
|
||||
|
||||
--valid voicemail
|
||||
if (voicemail_uuid ~= nil) then
|
||||
--answer the session
|
||||
@@ -340,7 +340,7 @@
|
||||
end
|
||||
|
||||
--get the voicemail destinations
|
||||
sql = [[select * from v_voicemail_destinations
|
||||
sql = [[select * from v_voicemail_destinations
|
||||
where voicemail_uuid = ']]..voicemail_uuid..[[']]
|
||||
--freeswitch.consoleLog("notice", "[voicemail][destinations] SQL:" .. sql .. "\n");
|
||||
destinations = {};
|
||||
@@ -361,7 +361,7 @@
|
||||
--determine uuid
|
||||
if (y == 1) then
|
||||
voicemail_message_uuid = uuid;
|
||||
else
|
||||
else
|
||||
voicemail_message_uuid = api:execute("create_uuid");
|
||||
end
|
||||
y = y + 1;
|
||||
@@ -506,7 +506,7 @@
|
||||
--callback (works with DTMF)
|
||||
--http://wiki.freeswitch.org/wiki/Mod_fsv
|
||||
--mkdir(voicemail_dir.."/"..voicemail_id);
|
||||
--session:recordFile(file_name, max_len_secs, silence_threshold, silence_secs)
|
||||
--session:recordFile(file_name, max_len_secs, silence_threshold, silence_secs)
|
||||
--session:sayPhrase(macro_name [,macro_data] [,language]);
|
||||
--session:sayPhrase("voicemail_menu", "1:2:3:#", default_language);
|
||||
--session:streamFile("directory/dir-to_select_entry.wav"); --works with setInputCallback
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
--check to see if the greeting file exists
|
||||
if (storage_type == "base64" or storage_type == "http_cache") then
|
||||
greeting_invalid = true;
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND voicemail_id = ']].. voicemail_id.. [['
|
||||
AND greeting_id = ']].. greeting_id.. [[' ]];
|
||||
@@ -59,20 +59,20 @@
|
||||
end
|
||||
|
||||
--validate the greeting_id
|
||||
if (greeting_id == "0"
|
||||
or greeting_id == "1"
|
||||
or greeting_id == "2"
|
||||
or greeting_id == "3"
|
||||
or greeting_id == "4"
|
||||
or greeting_id == "5"
|
||||
or greeting_id == "6"
|
||||
or greeting_id == "7"
|
||||
or greeting_id == "8"
|
||||
if (greeting_id == "0"
|
||||
or greeting_id == "1"
|
||||
or greeting_id == "2"
|
||||
or greeting_id == "3"
|
||||
or greeting_id == "4"
|
||||
or greeting_id == "5"
|
||||
or greeting_id == "6"
|
||||
or greeting_id == "7"
|
||||
or greeting_id == "8"
|
||||
or greeting_id == "9") then
|
||||
|
||||
--valid greeting_id update the database
|
||||
if (session:ready()) then
|
||||
if (greeting_id == "0") then
|
||||
if (greeting_id == "0") then
|
||||
sql = [[UPDATE v_voicemails SET greeting_id = null ]];
|
||||
else
|
||||
sql = [[UPDATE v_voicemails SET greeting_id = ']]..greeting_id..[[' ]];
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
--get the greeting from the database
|
||||
if (storage_type == "base64") then
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND voicemail_id = ']].. voicemail_id.. [['
|
||||
AND greeting_id = ']].. greeting_id.. [[' ]];
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
end
|
||||
--say the message number
|
||||
if (session:ready()) then
|
||||
if (string.len(dtmf_digits) == 0) then
|
||||
if (string.len(dtmf_digits) == 0) then
|
||||
dtmf_digits = macro(session, "message_number", 1, 100, '');
|
||||
end
|
||||
end
|
||||
@@ -72,7 +72,7 @@
|
||||
end
|
||||
--get the recordings from the database
|
||||
if (storage_type == "base64") then
|
||||
sql = [[SELECT * FROM v_voicemail_messages
|
||||
sql = [[SELECT * FROM v_voicemail_messages
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND voicemail_message_uuid = ']].. uuid.. [[' ]];
|
||||
if (debug["sql"]) then
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
table.insert(actions, {app="streamFile",data="voicemail/vm-press.wav"});
|
||||
table.insert(actions, {app="streamFile",data="digits/3.wav"});
|
||||
end
|
||||
--At the tone please record your name press any key or stop talking to end the recording
|
||||
--At the tone please record your name press any key or stop talking to end the recording
|
||||
if (name == "record_name") then
|
||||
table.insert(actions, {app="streamFile",data="voicemail/vm-record_name1.wav"});
|
||||
table.insert(actions, {app="tone_stream",data="L=1;%(1000, 0, 640)"});
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
local accounts = {}
|
||||
table.insert(accounts, voicemail_id);
|
||||
--get the voicemail id and all related mwi accounts
|
||||
sql = [[SELECT extension, number_alias from v_extensions
|
||||
sql = [[SELECT extension, number_alias from v_extensions
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND (mwi_account = ']]..voicemail_id..[[' or mwi_account = ']]..voicemail_id..[[@]]..domain_name..[[')]];
|
||||
if (debug["sql"]) then
|
||||
@@ -47,7 +47,7 @@
|
||||
sql = [[SELECT count(*) as message_count FROM v_voicemail_messages as m, v_voicemails as v
|
||||
WHERE v.domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND v.voicemail_uuid = m.voicemail_uuid
|
||||
AND v.voicemail_id = ']] .. voicemail_id ..[['
|
||||
AND v.voicemail_id = ']] .. voicemail_id ..[['
|
||||
AND (m.message_status is null or m.message_status = '') ]];
|
||||
if (debug["sql"]) then
|
||||
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
|
||||
@@ -57,7 +57,7 @@
|
||||
end);
|
||||
|
||||
--send the message waiting event
|
||||
for key,value in pairs(accounts) do
|
||||
for key,value in pairs(accounts) do
|
||||
local event = freeswitch.Event("message_waiting");
|
||||
if (message_count == "0") then
|
||||
if (debug["info"]) then
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
--define on_dtmf call back function
|
||||
function on_dtmf(s, type, obj, arg)
|
||||
if (type == "dtmf") then
|
||||
freeswitch.console_log("info", "[voicemail] dtmf digit: " .. obj['digit'] .. ", duration: " .. obj['duration'] .. "\n");
|
||||
freeswitch.console_log("info", "[voicemail] dtmf digit: " .. obj['digit'] .. ", duration: " .. obj['duration'] .. "\n");
|
||||
if (obj['digit'] == "#") then
|
||||
return 0;
|
||||
else
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
--get the greeting from the database
|
||||
if (storage_type == "base64") then
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND voicemail_id = ']].. voicemail_id.. [['
|
||||
AND greeting_id = ']].. greeting_id.. [[' ]];
|
||||
|
||||
@@ -39,14 +39,14 @@
|
||||
end
|
||||
|
||||
--validate the greeting_id
|
||||
if (greeting_id == "1"
|
||||
or greeting_id == "2"
|
||||
or greeting_id == "3"
|
||||
or greeting_id == "4"
|
||||
or greeting_id == "5"
|
||||
or greeting_id == "6"
|
||||
or greeting_id == "7"
|
||||
or greeting_id == "8"
|
||||
if (greeting_id == "1"
|
||||
or greeting_id == "2"
|
||||
or greeting_id == "3"
|
||||
or greeting_id == "4"
|
||||
or greeting_id == "5"
|
||||
or greeting_id == "6"
|
||||
or greeting_id == "7"
|
||||
or greeting_id == "8"
|
||||
or greeting_id == "9") then
|
||||
--record your greeting at the tone press any key or stop talking to end the recording
|
||||
if (session:ready()) then
|
||||
@@ -59,7 +59,7 @@
|
||||
freeswitch.consoleLog("notice", "[voicemail] ".. storage_type .. " ".. storage_path .."\n");
|
||||
storage_path = storage_path:gsub("${domain_name}", domain_name);
|
||||
session:execute("record", storage_path .."/"..recording_name);
|
||||
else
|
||||
else
|
||||
--prepare to record the greeting
|
||||
if (session:ready()) then
|
||||
max_len_seconds = 30;
|
||||
@@ -101,12 +101,12 @@
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--clean up any tmp greeting files
|
||||
for gid = 1, 9, 1 do
|
||||
if (file_exists(voicemail_dir.."/"..voicemail_id.."/greeting_"..gid..".tmp.wav")) then
|
||||
os.remove(voicemail_dir.."/"..voicemail_id.."/greeting_"..gid..".tmp.wav");
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -170,7 +170,7 @@
|
||||
--remove temporary greeting file, if any
|
||||
if (file_exists(tmp_file)) then
|
||||
os.remove(tmp_file);
|
||||
end
|
||||
end
|
||||
record_greeting(greeting_id);
|
||||
end
|
||||
if (type == "name") then
|
||||
@@ -181,8 +181,8 @@
|
||||
--remove temporary greeting file, if any
|
||||
if (file_exists(tmp_file)) then
|
||||
os.remove(tmp_file);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
--hangup
|
||||
if (session:ready()) then
|
||||
dtmf_digits = '';
|
||||
@@ -205,7 +205,7 @@
|
||||
--remove temporary greeting file, if any
|
||||
if (file_exists(tmp_file)) then
|
||||
os.remove(tmp_file);
|
||||
end
|
||||
end
|
||||
advanced();
|
||||
end
|
||||
if (type == "name") then
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
if (dtmf_digits == nil) then
|
||||
dtmf_digits = session:getDigits(max_digits, "#", 1000);
|
||||
else
|
||||
dtmf_digits = dtmf_digits .. session:getDigits(max_digits, "#", 1000);
|
||||
dtmf_digits = dtmf_digits .. session:getDigits(max_digits, "#", 1000);
|
||||
end
|
||||
end
|
||||
if (dtmf_digits) then
|
||||
@@ -166,10 +166,10 @@
|
||||
--delete the wav file, if mp3 exists
|
||||
if (file_exists(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid..".mp3")) then
|
||||
os.remove(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid..".wav");
|
||||
else
|
||||
else
|
||||
vm_message_ext = "wav";
|
||||
end
|
||||
else
|
||||
else
|
||||
freeswitch.consoleLog("notice", "neither mod_shout or lame found, defaulting to wav\n");
|
||||
vm_message_ext = "wav";
|
||||
end
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
os.remove(file);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -36,7 +36,7 @@
|
||||
debug["sql"] = false;
|
||||
debug["info"] = false;
|
||||
|
||||
--only run the script a single time
|
||||
--only run the script a single time
|
||||
runonce = true
|
||||
--connect to the database
|
||||
require "resources.functions.database_handle";
|
||||
@@ -65,10 +65,10 @@
|
||||
end
|
||||
|
||||
--Send MWI events for voicemail boxes with messages
|
||||
sql = [[SELECT v.voicemail_id, v.voicemail_uuid, v.domain_uuid, d.domain_name, COUNT(*) AS message_count
|
||||
FROM v_voicemail_messages as m, v_voicemails as v, v_domains as d
|
||||
WHERE v.voicemail_uuid = m.voicemail_uuid
|
||||
AND v.domain_uuid = d.domain_uuid
|
||||
sql = [[SELECT v.voicemail_id, v.voicemail_uuid, v.domain_uuid, d.domain_name, COUNT(*) AS message_count
|
||||
FROM v_voicemail_messages as m, v_voicemails as v, v_domains as d
|
||||
WHERE v.voicemail_uuid = m.voicemail_uuid
|
||||
AND v.domain_uuid = d.domain_uuid
|
||||
GROUP BY v.voicemail_id, v.voicemail_uuid, v.domain_uuid, d.domain_name;]];
|
||||
if (debug["sql"]) then
|
||||
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
|
||||
@@ -120,5 +120,5 @@
|
||||
--slow the loop down
|
||||
os.execute("sleep "..sleep);
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user