mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Populate toll-allow for Enterprise Ring Groups (#4496)
Add toll_allow to dialstring for external numbers
This commit is contained in:
@@ -504,7 +504,7 @@
|
|||||||
follow_me_uuid = nil;
|
follow_me_uuid = nil;
|
||||||
|
|
||||||
--select data from the database
|
--select data from the database
|
||||||
local sql = "select follow_me_uuid ";
|
local sql = "select follow_me_uuid, toll_allow ";
|
||||||
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 ( ";
|
sql = sql .. "and ( ";
|
||||||
@@ -517,6 +517,7 @@
|
|||||||
end
|
end
|
||||||
status = dbh:query(sql, params, function(field)
|
status = dbh:query(sql, params, function(field)
|
||||||
follow_me_uuid = field["follow_me_uuid"];
|
follow_me_uuid = field["follow_me_uuid"];
|
||||||
|
toll_allow = field["toll_allow"];
|
||||||
end);
|
end);
|
||||||
--dbh:query(sql, params, function(row);
|
--dbh:query(sql, params, function(row);
|
||||||
|
|
||||||
@@ -564,7 +565,7 @@
|
|||||||
destinations[new_key]['destination_prompt'] = field.destination_prompt;
|
destinations[new_key]['destination_prompt'] = field.destination_prompt;
|
||||||
destinations[new_key]['group_confirm_key'] = row.group_confirm_key;
|
destinations[new_key]['group_confirm_key'] = row.group_confirm_key;
|
||||||
destinations[new_key]['group_confirm_file'] = row.group_confirm_file;
|
destinations[new_key]['group_confirm_file'] = row.group_confirm_file;
|
||||||
destinations[new_key]['toll_allow'] = row.toll_allow;
|
destinations[new_key]['toll_allow'] = toll_allow;
|
||||||
destinations[new_key]['user_exists'] = user_exists;
|
destinations[new_key]['user_exists'] = user_exists;
|
||||||
|
|
||||||
--increment x
|
--increment x
|
||||||
@@ -753,7 +754,10 @@
|
|||||||
else
|
else
|
||||||
--external number
|
--external number
|
||||||
route_bridge = 'loopback/'..destination_number;
|
route_bridge = 'loopback/'..destination_number;
|
||||||
|
if (extension_toll_allow ~= nil) then
|
||||||
|
toll_allow = extension_toll_allow:gsub(",", ":");
|
||||||
|
end
|
||||||
|
|
||||||
--set the toll allow to an empty string
|
--set the toll allow to an empty string
|
||||||
if (toll_allow == nil) then
|
if (toll_allow == nil) then
|
||||||
toll_allow = '';
|
toll_allow = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user