diff --git a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua index 06b78d48fb..84a410afd0 100644 --- a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua +++ b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua @@ -110,7 +110,11 @@ if (call_context == "public" or string.sub(call_context, 0, 7) == "public@" or string.sub(call_context, -7) == ".public") then context_name = 'public'; end - --freeswitch.consoleLog("notice", "[xml_handler] ".. dialplan_mode .. " key:" .. dialplan_cache_key .. "\n"); + +--use alternative sip_to_user instead of the default + if (dialplan_destination == '${sip_to_user}' or dialplan_destination == 'sip_to_user') then + destination_number = api:execute("url_decode", sip_to_user); + end --set the dialplan cache key local dialplan_cache_key = "dialplan:" .. call_context; @@ -118,10 +122,8 @@ dialplan_cache_key = "dialplan:" .. call_context .. ":" .. destination_number; end ---use alternative sip_to_user instead of the default - if (dialplan_destination == '${sip_to_user}') then - destination_number = api:execute("url_decode", sip_to_user); - end +--log the dialplan mode and dialplan cache key + freeswitch.consoleLog("notice", "[xml_handler] ".. dialplan_mode .. " key:" .. dialplan_cache_key .. "\n"); --get the cache XML_STRING, err = cache.get(dialplan_cache_key); @@ -153,7 +155,7 @@ table.insert(xml, [[]]); table.insert(xml, [[]]); table.insert(xml, [[
]]); - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); --get the dialplan xml if (context_name == 'public' and dialplan_mode == 'single') then