Use SQL to cast to boolean

This commit is contained in:
FusionPBX
2025-09-21 14:43:17 -06:00
committed by GitHub
parent 6df7fdd616
commit 573903147a
6 changed files with 98 additions and 55 deletions

View File

@@ -89,7 +89,19 @@
end
--determine whether to update the dial string
local sql = "select * from v_extensions ";
local sql = "select ";
sql = sql .. " extension_uuid, ";
sql = sql .. " extension, ";
sql = sql .. " number_alias, ";
sql = sql .. " accountcode, ";
sql = sql .. " cast(do_not_disturb as text), ";
sql = sql .. " cast(forward_all_enabled as text), ";
sql = sql .. " forward_all_destination, ";
sql = sql .. " toll_allow, ";
sql = sql .. " context, ";
sql = sql .. " outbound_caller_id_name, ";
sql = sql .. " outbound_caller_id_number ";
sql = sql .. "from v_extensions ";
sql = sql .. "where domain_uuid = :domain_uuid ";
sql = sql .. "and extension_uuid = :extension_uuid ";
local params = {domain_uuid = domain_uuid, extension_uuid = extension_uuid};
@@ -106,9 +118,6 @@
context = row.user_context;
end);
forward_all_enabled = forward_all_enabled and "true" or "false";
do_not_disturb = do_not_disturb and "true" or "false";
--send information to the console
if (session:ready()) then
freeswitch.consoleLog("NOTICE", "[do_not_disturb] do_not_disturb "..do_not_disturb.."\n");