From 8dbd85484e8efd38d1d5965de0d909b7b08a95a0 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 20 Apr 2023 14:20:14 -0600 Subject: [PATCH] xml.santize allow required variables --- .../scripts/configuration/callcenter.conf.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua index 158ecc2c32..e3da36175f 100644 --- a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua +++ b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua @@ -105,6 +105,12 @@ --replace the space with a dash queue_name = queue_name:gsub(" ", "-"); + --sanitize the queue_record_template and allow specific variables + queue_record_template = xml.sanitize(queue_record_template); + queue_record_template = string.gsub(queue_record_template, "{strftime", "${strftime"); + queue_record_template = string.gsub(queue_record_template, "{uuid}", "${uuid}"); + queue_record_template = string.gsub(queue_record_template, "{record_ext}", "${record_ext}"); + --start the xml xml:append([[ ]]); xml:append([[ ]]); @@ -112,7 +118,7 @@ queue_ringback = format_ringback(queue_moh_sound); xml:append([[ ]]); if (queue_record_template ~= nil) then - xml:append([[ ]]); + xml:append([[ ]]); end if (queue_time_base_score ~= nil) then xml:append([[ ]]); @@ -238,12 +244,16 @@ end end + --sanitize the agent_contact and allow specific variables + agent_contact = xml.sanitize(agent_contact); + agent_contact = string.gsub(agent_contact, "{caller_destination}", "${caller_destination"); + --build the xml string xml:append([[