mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-27 19:19:17 +00:00
Add. Support bridge mode to call forward from Lua. (#1631)
This commit is contained in:
committed by
FusionPBX
parent
96d576fc7a
commit
add8222cff
@@ -45,6 +45,7 @@
|
||||
local log = require "resources.functions.log".call_forward
|
||||
local cache = require "resources.functions.cache"
|
||||
local Database = require "resources.functions.database"
|
||||
local route_to_bridge = require "resources.functions.route_to_bridge"
|
||||
|
||||
local function opt(t, ...)
|
||||
if select('#', ...) == 0 then
|
||||
@@ -265,7 +266,20 @@
|
||||
dial_string = dial_string .. "user/"..forward_all_destination.."@"..domain_name;
|
||||
end
|
||||
else
|
||||
dial_string = dial_string .. "loopback/"..forward_all_destination;
|
||||
local mode = opt(settings(domain_uuid), 'domain', 'bridge', 'text')
|
||||
if mode == "outbound" or mode == "bridge" then
|
||||
local bridge = route_to_bridge(dbh, domain_uuid, {
|
||||
destination_number = forward_all_destination;
|
||||
['${toll_allow}'] = toll_allow;
|
||||
})
|
||||
if bridge and bridge.bridge then
|
||||
dial_string = dial_string .. bridge.bridge
|
||||
else
|
||||
log.warning('Can not build dialstring for call forward number.')
|
||||
end
|
||||
else
|
||||
dial_string = dial_string .. "loopback/"..forward_all_destination;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user