mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-04 18:53:49 +00:00
Add. Use params in vm/delete_recording.lua (#2139)
This commit is contained in:
committed by
FusionPBX
parent
7758e7d810
commit
498ed9a3a8
@@ -32,11 +32,13 @@
|
||||
macro(session, "message_deleted", 1, 100, '');
|
||||
end
|
||||
end
|
||||
|
||||
--get the voicemail_uuid
|
||||
sql = [[SELECT * FROM v_voicemails
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND voicemail_id = ']] .. voicemail_id ..[[']];
|
||||
status = dbh:query(sql, function(row)
|
||||
local sql = [[SELECT * FROM v_voicemails
|
||||
WHERE domain_uuid = :domain_uuid
|
||||
AND voicemail_id = :voicemail_id]];
|
||||
local params = {domain_uuid = domain_uuid, voicemail_id = voicemail_id};
|
||||
dbh:query(sql, params, function(row)
|
||||
db_voicemail_uuid = row["voicemail_uuid"];
|
||||
end);
|
||||
--flush dtmf digits from the input buffer
|
||||
@@ -46,13 +48,14 @@
|
||||
os.remove(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext);
|
||||
--delete from the database
|
||||
sql = [[DELETE FROM v_voicemail_messages
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND voicemail_uuid = ']] .. db_voicemail_uuid ..[['
|
||||
AND voicemail_message_uuid = ']] .. uuid ..[[']];
|
||||
WHERE domain_uuid = :domain_uuid
|
||||
AND voicemail_uuid = :voicemail_uuid
|
||||
AND voicemail_message_uuid = :uuid]];
|
||||
params = {domain_uuid = domain_uuid, voicemail_uuid = db_voicemail_uuid, uuid = uuid};
|
||||
if (debug["sql"]) then
|
||||
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
|
||||
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
|
||||
end
|
||||
dbh:query(sql);
|
||||
dbh:query(sql, params);
|
||||
--log to console
|
||||
if (debug["info"]) then
|
||||
freeswitch.consoleLog("notice", "[voicemail][deleted] message: " .. uuid .. "\n");
|
||||
|
||||
Reference in New Issue
Block a user