Add. Use params in vm/record_message.lua (#2129)

This commit is contained in:
Alexey Melnichuk
2016-11-22 21:11:55 +03:00
committed by FusionPBX
parent bf4922387b
commit 86bdf059e0

View File

@@ -133,12 +133,13 @@
session:hangup();
else
--get the voicemail options
sql = [[SELECT * FROM v_voicemail_options WHERE voicemail_uuid = ']] .. voicemail_uuid ..[[' ORDER BY voicemail_option_order asc ]];
local sql = [[SELECT * FROM v_voicemail_options WHERE voicemail_uuid = :voicemail_uuid ORDER BY voicemail_option_order asc ]];
local params = {voicemail_uuid = voicemail_uuid};
if (debug["sql"]) then
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
end
count = 0;
status = dbh:query(sql, function(row)
dbh:query(sql, params, function(row)
--check for matching options
if (tonumber(row.voicemail_option_digits) ~= nil) then
row.voicemail_option_digits = "^"..row.voicemail_option_digits.."$";