Update route_to_bridge.lua

This commit is contained in:
FusionPBX 2018-06-18 17:43:25 -06:00 committed by GitHub
parent 0b07090460
commit 06af0ea61d
1 changed files with 6 additions and 0 deletions

View File

@ -573,6 +573,12 @@ local function outbound_route_to_bridge(dbh, domain_uuid, fields, actions)
local context = fields.context
if context == '' then context = nil end
--connect to the database
if (dbh == nil) then
local Database = require "resources.functions.database";
dbh = Database.new('system');
end
local current_dialplan_uuid, extension
dbh:query(select_outbound_dialplan_sql, {domain_uuid=domain_uuid, hostname=hostname}, function(route)
if (route.dialplan_context ~= '${domain_name}') and (context and context ~= route.dialplan_context) then