From 2c7cfbe44f66caf02c35087ea0f5a48b729b0c1d Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 29 Dec 2021 14:29:17 -0700 Subject: [PATCH] Account for bridge variables and more advanced agent contact string. If using the { and } with the contact string it would add an extra } bracket. The following changes remove the extra bracket and account for more of the bridge variables. --- .../scripts/configuration/callcenter.conf.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 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 3321d80186..5a10f01b86 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 @@ -206,24 +206,27 @@ if (string.find(agent_contact, 'call_timeout') == nil) then --add the call_timeout pos = string.find(agent_contact, "}"); - first = string.sub(agent_contact, 0, pos); + first = string.sub(agent_contact, 0, pos -1); + last = string.sub(agent_contact, pos); + agent_contact = first..[[,domain_name=]]..domain_name..[[,domain_uuid=]]..domain_uuid..[[,sip_h_caller_destination=${caller_destination},call_timeout=]]..agent_call_timeout..last; + else + --add the call_timeout + pos = string.find(agent_contact, "}"); + first = string.sub(agent_contact, 0, pos - 1); last = string.sub(agent_contact, pos); agent_contact = first..[[,sip_h_caller_destination=${caller_destination},call_timeout=]]..agent_call_timeout..last; - else - --the string has the call timeout - agent_contact = agent_contact; end - else + else --found pos = string.find(agent_contact, "}"); - first = string.sub(agent_contact, 0, pos); + first = string.sub(agent_contact, 0, pos - 1); last = string.sub(agent_contact, pos); if (string.find(agent_contact, 'call_timeout') == nil) then --add the call_timeout and confirm - agent_contact = first..','..confirm..',sip_h_caller_destination=${caller_destination},call_timeout='..agent_call_timeout..last; + agent_contact = first..','..confirm..',sip_h_caller_destination=${caller_destination},domain_name="..domain_name..",domain_uuid="..domain_uuid..",sip_h_caller_destination=${caller_destination},call_timeout='..agent_call_timeout..last; else --add confirm - agent_contact = tmp_first..',sip_h_caller_destination=${caller_destination},'..confirm..tmp_last; + agent_contact = tmp_first..',domain_name="..domain_name..",domain_uuid="..domain_uuid..",sip_h_caller_destination=${caller_destination},'..confirm..tmp_last; end end end