From 2a4621daaf4bfbae38139829b4e4d4da194c26c1 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Fri, 31 Jul 2015 21:03:22 -0600 Subject: [PATCH] Fix a problem with custom public context and XMl handler. --- .../resources/scripts/dialplan/dialplan.lua | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/resources/install/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua b/resources/install/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua index c4eeeb0f63..077ebf77e0 100644 --- a/resources/install/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua +++ b/resources/install/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua @@ -1,6 +1,6 @@ -- xml_handler.lua -- Part of FusionPBX --- Copyright (C) 2013 Mark J Crane +-- Copyright (C) 2013-2015 Mark J Crane -- 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, [[]]); @@ -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, [[ ]]); table.insert(xml, [[ ]]);