Toll-allow into dialstring for external calls (#4495)

Insert toll-allow from the original extension into the dialstring for external calls.
This commit is contained in:
konradSC
2019-09-04 13:30:51 -04:00
committed by FusionPBX
parent 499ae9b33e
commit 9e301a0c97

View File

@@ -98,7 +98,7 @@
--forward_busy_destination = trim(api:executeString(cmd));
--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 .. "where domain_uuid = :domain_uuid ";
sql = sql .. "and ( ";
@@ -111,6 +111,7 @@
end
status = dbh:query(sql, params, function(row)
follow_me_uuid = row["follow_me_uuid"];
extension_toll_allow = row["toll_allow"];
end);
--dbh:query(sql, params, function(row);
@@ -287,6 +288,9 @@
else
--external 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
if (toll_allow == nil) then