Update follow_me.lua (#4491)
This commit is contained in:
parent
37b5713c4b
commit
08cbbc86ba
|
|
@ -64,7 +64,7 @@
|
||||||
local dbh = Database.new('system');
|
local dbh = Database.new('system');
|
||||||
|
|
||||||
--determine whether to update the dial string
|
--determine whether to update the dial string
|
||||||
local sql = "select extension, number_alias, accountcode, follow_me_uuid ";
|
local sql = "select extension, number_alias, accountcode, follow_me_uuid, follow_me_enabled ";
|
||||||
sql = sql .. "from v_extensions ";
|
sql = sql .. "from v_extensions ";
|
||||||
sql = sql .. "where domain_uuid = :domain_uuid ";
|
sql = sql .. "where domain_uuid = :domain_uuid ";
|
||||||
sql = sql .. "and extension_uuid = :extension_uuid ";
|
sql = sql .. "and extension_uuid = :extension_uuid ";
|
||||||
|
|
@ -80,6 +80,7 @@
|
||||||
local number_alias = row.number_alias or '';
|
local number_alias = row.number_alias or '';
|
||||||
local accountcode = row.accountcode;
|
local accountcode = row.accountcode;
|
||||||
local follow_me_uuid = row.follow_me_uuid;
|
local follow_me_uuid = row.follow_me_uuid;
|
||||||
|
local enabled = row.follow_me_enabled;
|
||||||
|
|
||||||
--determine whether to update the dial string
|
--determine whether to update the dial string
|
||||||
sql = "select follow_me_enabled, cid_name_prefix, cid_number_prefix, dial_string "
|
sql = "select follow_me_enabled, cid_name_prefix, cid_number_prefix, dial_string "
|
||||||
|
|
@ -94,7 +95,7 @@
|
||||||
row = dbh:first_row(sql, params)
|
row = dbh:first_row(sql, params)
|
||||||
if not row then return end
|
if not row then return end
|
||||||
|
|
||||||
local enabled = row.follow_me_enabled;
|
--local enabled = row.follow_me_enabled;
|
||||||
local cid_name_prefix = row.cid_name_prefix;
|
local cid_name_prefix = row.cid_name_prefix;
|
||||||
local cid_number_prefix = row.cid_number_prefix;
|
local cid_number_prefix = row.cid_number_prefix;
|
||||||
local dial_string = row.dial_string;
|
local dial_string = row.dial_string;
|
||||||
|
|
@ -122,7 +123,7 @@
|
||||||
end
|
end
|
||||||
|
|
||||||
--enable or disable follow me
|
--enable or disable follow me
|
||||||
sql = "update v_follow_me set ";
|
sql = "update v_extensions set ";
|
||||||
if (enabled == "true") then
|
if (enabled == "true") then
|
||||||
sql = sql .. "follow_me_enabled = 'false' ";
|
sql = sql .. "follow_me_enabled = 'false' ";
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue