Add. Use params in vm/send_email.lua (#2127)
This commit is contained in:
committed by
FusionPBX
parent
ae17af5fa5
commit
6c460641a4
@@ -34,13 +34,14 @@
|
|||||||
local settings = Settings.new(db, domain_name, domain_uuid)
|
local settings = Settings.new(db, domain_name, domain_uuid)
|
||||||
|
|
||||||
--get voicemail message details
|
--get voicemail message details
|
||||||
sql = [[SELECT * FROM v_voicemails
|
local sql = [[SELECT * FROM v_voicemails
|
||||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
WHERE domain_uuid = :domain_uuid
|
||||||
AND voicemail_id = ']] .. id ..[[']]
|
AND voicemail_id = :voicemail_id]]
|
||||||
|
local params = {domain_uuid = domain_uuid, voicemail_id = id};
|
||||||
if (debug["sql"]) then
|
if (debug["sql"]) then
|
||||||
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
|
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
|
||||||
end
|
end
|
||||||
status = dbh:query(sql, function(row)
|
dbh:query(sql, params, function(row)
|
||||||
db_voicemail_uuid = string.lower(row["voicemail_uuid"]);
|
db_voicemail_uuid = string.lower(row["voicemail_uuid"]);
|
||||||
--voicemail_password = row["voicemail_password"];
|
--voicemail_password = row["voicemail_password"];
|
||||||
--greeting_id = row["greeting_id"];
|
--greeting_id = row["greeting_id"];
|
||||||
@@ -71,13 +72,14 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
--get voicemail message details
|
--get voicemail message details
|
||||||
sql = [[SELECT * FROM v_voicemail_messages
|
local sql = [[SELECT * FROM v_voicemail_messages
|
||||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
WHERE domain_uuid = :domain_uuid
|
||||||
AND voicemail_message_uuid = ']] .. uuid ..[[']]
|
AND voicemail_message_uuid = :uuid]]
|
||||||
|
local params = {domain_uuid = domain_uuid, uuid = uuid};
|
||||||
if (debug["sql"]) then
|
if (debug["sql"]) then
|
||||||
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
|
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
|
||||||
end
|
end
|
||||||
status = dbh:query(sql, function(row)
|
dbh:query(sql, params, function(row)
|
||||||
--get the values from the database
|
--get the values from the database
|
||||||
--uuid = row["voicemail_message_uuid"];
|
--uuid = row["voicemail_message_uuid"];
|
||||||
created_epoch = row["created_epoch"];
|
created_epoch = row["created_epoch"];
|
||||||
@@ -211,14 +213,16 @@
|
|||||||
if (string.len(voicemail_mail_to) > 2) then
|
if (string.len(voicemail_mail_to) > 2) then
|
||||||
if (voicemail_local_after_email == "false") then
|
if (voicemail_local_after_email == "false") then
|
||||||
--delete the voicemail message details
|
--delete the voicemail message details
|
||||||
sql = [[DELETE FROM v_voicemail_messages
|
local sql = [[DELETE FROM v_voicemail_messages
|
||||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
WHERE domain_uuid = :domain_uuid
|
||||||
AND voicemail_uuid = ']] .. db_voicemail_uuid ..[['
|
AND voicemail_uuid = :voicemail_uuid
|
||||||
AND voicemail_message_uuid = ']] .. uuid ..[[']]
|
AND voicemail_message_uuid = :uuid]]
|
||||||
|
local params = {domain_uuid = domain_uuid,
|
||||||
|
voicemail_uuid = db_voicemail_uuid, uuid = uuid};
|
||||||
if (debug["sql"]) then
|
if (debug["sql"]) then
|
||||||
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
|
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
|
||||||
end
|
end
|
||||||
status = dbh:query(sql);
|
dbh:query(sql, params);
|
||||||
--delete voicemail recording file
|
--delete voicemail recording file
|
||||||
if (file_exists(file)) then
|
if (file_exists(file)) then
|
||||||
os.remove(file);
|
os.remove(file);
|
||||||
|
|||||||
Reference in New Issue
Block a user