mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-01 09:43:50 +00:00
Update route_to_bridge.lua
This commit is contained in:
@@ -36,6 +36,7 @@ local select_routes_sql = [[
|
||||
select *
|
||||
from v_dialplans
|
||||
where (domain_uuid = :domain_uuid or domain_uuid is null)
|
||||
and (hostname = :hostname or hostname is null)
|
||||
and app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3'
|
||||
and dialplan_enabled = 'true'
|
||||
order by dialplan_order asc
|
||||
@@ -238,9 +239,11 @@ end
|
||||
|
||||
local function outbound_route_to_bridge(dbh, domain_uuid, fields)
|
||||
local actions, dial_string = {}
|
||||
require "resources.functions.trim";
|
||||
hostname = trim(api:execute("switchname", ""));
|
||||
|
||||
local params = {}
|
||||
dbh:query(select_routes_sql, {domain_uuid=domain_uuid}, function(route)
|
||||
dbh:query(select_routes_sql, {domain_uuid=domain_uuid,hostname=hostname}, function(route)
|
||||
local extension = {}
|
||||
params.dialplan_uuid = route.dialplan_uuid
|
||||
dbh:query(select_extensions_sql, params, function(ext)
|
||||
@@ -281,4 +284,4 @@ return setmetatable({
|
||||
__self_test = self_test;
|
||||
}, {__call = function(_, ...)
|
||||
return outbound_route_to_bridge(...)
|
||||
end})
|
||||
end})
|
||||
|
||||
Reference in New Issue
Block a user