mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Add. Use params in vm/message_saved.lua (#2133)
This commit is contained in:
committed by
FusionPBX
parent
af88889983
commit
6ac04e29cd
@@ -30,21 +30,23 @@
|
|||||||
--flush dtmf digits from the input buffer
|
--flush dtmf digits from the input buffer
|
||||||
session:flushDigits();
|
session:flushDigits();
|
||||||
--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);
|
||||||
--delete from the database
|
--delete from the database
|
||||||
sql = [[UPDATE v_voicemail_messages SET message_status = 'saved'
|
sql = [[UPDATE v_voicemail_messages SET message_status = 'saved'
|
||||||
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][saved] id: " .. voicemail_id .. " message: "..uuid.."\n");
|
freeswitch.consoleLog("notice", "[voicemail][saved] id: " .. voicemail_id .. " message: "..uuid.."\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user