Add. Use params in call_block/index.lua (#2161)

This commit is contained in:
Alexey Melnichuk 2016-11-23 12:18:36 +03:00 committed by FusionPBX
parent 559a16b461
commit 928b1afb72
1 changed files with 4 additions and 2 deletions

View File

@ -176,7 +176,9 @@ This method causes the script to get its manadatory arguments directly from the
k = k + 1
end
if (source == "database") then
dbh:query("UPDATE v_call_block SET call_block_count = " .. found_count + 1 .. " WHERE call_block_uuid = '" .. found_uuid .. "'")
dbh:query("UPDATE v_call_block SET call_block_count = :call_block_count WHERE call_block_uuid = :call_block_uuid",{
call_block_count = found_count + 1, call_block_uuid = found_uuid
})
end
session:execute("set", "call_blocked=true");
logger("W", "NOTICE", "number " .. params["cid_num"] .. " blocked with " .. found_count .. " previous hits, domain_name: " .. params["domain_name"])