From 215b4d0df7884901ebfa15f33aa01e801c908c59 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 15 Jul 2024 23:06:23 -0600 Subject: [PATCH] Prevent empty caller id from blocking calls Improved the following - Prevent empty caller id name and number from blocking calls - Fixed the call block count so it would increment each time it has blocked a call --- app/switch/resources/scripts/app/call_block/index.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/switch/resources/scripts/app/call_block/index.lua b/app/switch/resources/scripts/app/call_block/index.lua index f274c2d1c2..73f23201c0 100644 --- a/app/switch/resources/scripts/app/call_block/index.lua +++ b/app/switch/resources/scripts/app/call_block/index.lua @@ -102,6 +102,7 @@ sql = sql .. "where (domain_uuid = :domain_uuid or domain_uuid is null) \n"; sql = sql .. "and call_block_enabled = 'true' \n"; sql = sql .. "and call_block_direction = :call_block_direction \n"; + sql = sql .. "and (call_block_name <> '' or call_block_number <> '') \n"; sql = sql .. "and ( \n"; sql = sql .. " (\n"; sql = sql .. " call_block_name = :call_block_name \n"; @@ -242,9 +243,9 @@ --update the call block count if (call_block) then sql = "update v_call_block "; - sql = sql .. "set call_block_count = :call_block_count "; + sql = sql .. "set call_block_count = call_block_count + 1 "; sql = sql .. "where call_block_uuid = :call_block_uuid "; - local params = {call_block_uuid = call_block_uuid, call_block_count = #call_block_count + 1}; + local params = {call_block_uuid = call_block_uuid}; if (debug["sql"]) then freeswitch.consoleLog("notice", "[dialplan] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n"); end