Add. Use params in vm/delete_recording.lua (#2139)
This commit is contained in:
parent
a7d54f03fe
commit
38dc420655
|
|
@ -32,11 +32,13 @@
|
||||||
macro(session, "message_deleted", 1, 100, '');
|
macro(session, "message_deleted", 1, 100, '');
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--get the voicemail_uuid
|
--get the voicemail_uuid
|
||||||
sql = [[SELECT * FROM v_voicemails
|
local sql = [[SELECT * FROM v_voicemails
|
||||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
WHERE domain_uuid = :domain_uuid
|
||||||
AND voicemail_id = ']] .. voicemail_id ..[[']];
|
AND voicemail_id = :voicemail_id]];
|
||||||
status = dbh:query(sql, function(row)
|
local params = {domain_uuid = domain_uuid, voicemail_id = voicemail_id};
|
||||||
|
dbh:query(sql, params, function(row)
|
||||||
db_voicemail_uuid = row["voicemail_uuid"];
|
db_voicemail_uuid = row["voicemail_uuid"];
|
||||||
end);
|
end);
|
||||||
--flush dtmf digits from the input buffer
|
--flush dtmf digits from the input buffer
|
||||||
|
|
@ -46,13 +48,14 @@
|
||||||
os.remove(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext);
|
os.remove(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext);
|
||||||
--delete from the database
|
--delete from the database
|
||||||
sql = [[DELETE FROM v_voicemail_messages
|
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]];
|
||||||
|
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
|
||||||
dbh:query(sql);
|
dbh:query(sql, params);
|
||||||
--log to console
|
--log to console
|
||||||
if (debug["info"]) then
|
if (debug["info"]) then
|
||||||
freeswitch.consoleLog("notice", "[voicemail][deleted] message: " .. uuid .. "\n");
|
freeswitch.consoleLog("notice", "[voicemail][deleted] message: " .. uuid .. "\n");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue