diff --git a/app/switch/resources/scripts/app/call_block/index.lua b/app/switch/resources/scripts/app/call_block/index.lua index 73f23201c0..e47ef4fd2d 100644 --- a/app/switch/resources/scripts/app/call_block/index.lua +++ b/app/switch/resources/scripts/app/call_block/index.lua @@ -243,7 +243,11 @@ --update the call block count if (call_block) then sql = "update v_call_block "; - sql = sql .. "set call_block_count = call_block_count + 1 "; + if (call_block_count == nil or call_block_count == '') then + sql = sql .. "set call_block_count = '1' "; + else + sql = sql .. "set call_block_count = call_block_count + 1 "; + end sql = sql .. "where call_block_uuid = :call_block_uuid "; local params = {call_block_uuid = call_block_uuid}; if (debug["sql"]) then