Add. Use params in vm/change_password.lua (#2156)

This commit is contained in:
Alexey Melnichuk 2016-11-23 12:01:51 +03:00 committed by FusionPBX
parent 9c687dc20c
commit c43f71c177
1 changed files with 8 additions and 6 deletions

View File

@ -32,15 +32,17 @@
dtmf_digits = ''; dtmf_digits = '';
password = macro(session, "password_new", 20, 5000, ''); password = macro(session, "password_new", 20, 5000, '');
--update the voicemail password --update the voicemail password
sql = [[UPDATE v_voicemails local sql = [[UPDATE v_voicemails
set voicemail_password = ']] .. password ..[[' set voicemail_password = :password
WHERE domain_uuid = ']] .. domain_uuid ..[[' WHERE domain_uuid = :domain_uuid
AND voicemail_id = ']] .. voicemail_id ..[[' AND voicemail_id = :voicemail_id
AND voicemail_enabled = 'true' ]]; AND voicemail_enabled = 'true' ]];
local params = {password = password, domain_uuid = domain_uuid,
voicemail_id = voicemail_id};
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);
--has been changed to --has been changed to
dtmf_digits = ''; dtmf_digits = '';
macro(session, "password_changed", 20, 3000, password); macro(session, "password_changed", 20, 3000, password);