Fix. Find call_group with NULL in intercept.lua (#2169)

This commit is contained in:
Alexey Melnichuk 2016-11-24 13:04:52 +03:00 committed by FusionPBX
parent 679169e8e0
commit 4ba9e89765
1 changed files with 7 additions and 3 deletions

View File

@ -188,9 +188,13 @@
sql = sql .. "AND (";
for key,call_group in ipairs(call_groups) do
if key > 1 then sql = sql .. " OR " end
local param_name = "call_group_" .. tostring(key)
sql = sql .. "call_group = :" .. param_name;
params[param_name] = (#call_group == 0) and '' or ('%' .. call_group .. '%');
if #call_group == 0 then
sql = sql .. "call_group = '' or call_group is NULL";
else
local param_name = "call_group_" .. tostring(key)
sql = sql .. "call_group = :" .. param_name;
params[param_name] = '%' .. call_group .. '%';
end
end
sql = sql .. ") ";
if (debug["sql"]) then