Fix a problem with custom public context and XMl handler.

This commit is contained in:
markjcrane 2015-07-31 21:03:22 -06:00
parent 6f6a2fc8d0
commit 2a4621daaf
1 changed files with 3 additions and 15 deletions

View File

@ -1,6 +1,6 @@
-- xml_handler.lua
-- Part of FusionPBX
-- Copyright (C) 2013 Mark J Crane <markjcrane@fusionpbx.com>
-- Copyright (C) 2013-2015 Mark J Crane <markjcrane@fusionpbx.com>
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@ -61,17 +61,6 @@
end
end
--get the domain name
function get_domain_name(domains, domain_uuid)
for key,value in ipairs(domains) do
if (value.domain_uuid == domain_uuid) then
return value.domain_name;
end
end
return nil;
end
--set the xml array and then concatenate the array to a string
local xml = {}
table.insert(xml, [[<?xml version="1.0" encoding="UTF-8" standalone="no"?>]]);
@ -252,12 +241,11 @@
condition = ""; --prevents duplicate time conditions
end
end
if (call_context == "public") then
if (call_context == "public" or string.sub(call_context, 0, 7) == "public@" or string.sub(call_context, -7) == ".public") then
if (dialplan_detail_tag == "action") then
if (first_action) then
if (domain_uuid ~= nil and domain_uuid ~= '') then
--domain_name = get_domain_name(domains, domain_uuid);
domain_name = domains[domain_uuid];
table.insert(xml, [[ <action application="set" data="call_direction=inbound"/>]]);
table.insert(xml, [[ <action application="set" data="domain_uuid=]] .. domain_uuid .. [["/>]]);