Add. Use params in vm/play_greeting.lua (#2131)

This commit is contained in:
Alexey Melnichuk 2016-11-22 21:12:10 +03:00 committed by FusionPBX
parent 86bdf059e0
commit 09bdea108f
1 changed files with 8 additions and 6 deletions

View File

@ -51,15 +51,17 @@
if (storage_type == "base64") then
local dbh = Database.new('system', 'base64/read')
sql = [[SELECT * FROM v_voicemail_greetings
WHERE domain_uuid = ']] .. domain_uuid ..[['
AND voicemail_id = ']].. voicemail_id.. [['
AND greeting_id = ']].. greeting_id.. [[' ]];
local sql = [[SELECT * FROM v_voicemail_greetings
WHERE domain_uuid = :domain_uuid
AND voicemail_id = :voicemail_id
AND greeting_id = :greeting_id ]];
local params = {domain_uuid = domain_uuid, voicemail_id = voicemail_id,
greeting_id = greeting_id};
if (debug["sql"]) then
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
end
local saved
status = dbh:query(sql, function(row)
dbh:query(sql, params, function(row)
--set the voicemail message path
mkdir(voicemail_dir.."/"..voicemail_id);
greeting_location = voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"; --vm_message_ext;