From 901c2505f93aeaa0ea7bdb91a4143bfacdb043f6 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 21 Mar 2026 01:37:35 +0000 Subject: [PATCH] Fix call center queue sound_prefix --- app/call_centers/call_center_queue_edit.php | 18 +++++++++++++----- .../scripts/configuration/callcenter.conf.lua | 12 +----------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php index 89dceebcdf..4954fd3153 100644 --- a/app/call_centers/call_center_queue_edit.php +++ b/app/call_centers/call_center_queue_edit.php @@ -216,7 +216,7 @@ } //if the user doesn't have the correct permission then - //override domain_uuid and queue_context values + //override domain_uuid and queue_context values if ($action == 'update' && is_uuid($call_center_queue_uuid)) { $sql = "select * from v_call_center_queues "; $sql .= "where call_center_queue_uuid = :call_center_queue_uuid "; @@ -335,11 +335,11 @@ $array['call_center_queues'][0]['queue_extension'] = $queue_extension; $array['call_center_queues'][0]['queue_greeting'] = $queue_greeting; $array['call_center_queues'][0]['queue_language'] = $queue_language; + $array['call_center_queues'][0]['queue_dialect'] = $queue_dialect; + $array['call_center_queues'][0]['queue_voice'] = $queue_voice; $array['call_center_queues'][0]['queue_strategy'] = $queue_strategy; $array['call_center_queues'][0]['queue_moh_sound'] = $queue_moh_sound; $array['call_center_queues'][0]['queue_record_template'] = $record_template; - $array['call_center_queues'][0]['queue_dialect'] = $queue_dialect; - $array['call_center_queues'][0]['queue_voice'] = $queue_voice; $array['call_center_queues'][0]['queue_limit'] = $queue_limit; $array['call_center_queues'][0]['queue_time_base_score'] = $queue_time_base_score; $array['call_center_queues'][0]['queue_time_base_score_sec'] = $queue_time_base_score_sec; @@ -400,13 +400,20 @@ } //add definable export variables can be set in default settings - $export_variables = 'call_center_queue_uuid,sip_h_Alert-Info'; + $export_variables = 'call_center_queue_uuid,sip_h_Alert-Info,sound_prefix'; if (!empty($settings->get('call_center','export_vars', []))) { foreach ($settings->get('call_center','export_vars', []) as $export_variable) { $export_variables .= ','.$export_variable; } } + //set the default language, dialect and voice + if (empty($queue_language) && empty($queue_dialect) && empty($queue_voice)) { + $queue_language = 'en'; + $queue_dialect = 'us'; + $queue_voice = 'callie'; + } + //build the xml dialplan $dialplan_xml = "\n"; if (!empty($queue_limit)) { @@ -419,6 +426,7 @@ $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; + $dialplan_xml .= " get('switch','sounds', '').'/'.xml::sanitize($queue_language)."/".xml::sanitize($queue_dialect)."/".xml::sanitize($queue_voice)."\"/>\n"; if (!empty($call_center_queue_uuid) && is_uuid($call_center_queue_uuid)) { $dialplan_xml .= " \n"; } @@ -1082,7 +1090,7 @@ echo " "; if (permission_exists('call_center_tier_delete')) { echo " $v_link_label_delete"; - } + } echo " \n"; echo " \n"; $assigned_agents[] = $field['agent_name']; diff --git a/app/switch/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua b/app/switch/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua index 8a0ef025e2..4a2a9ab7ad 100644 --- a/app/switch/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua +++ b/app/switch/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua @@ -124,9 +124,6 @@ domain_name = row.domain_name; queue_name = row.queue_name; queue_extension = row.queue_extension; - queue_language = row.queue_language; - queue_dialect = row.queue_dialect; - queue_voice = row.queue_voice; queue_strategy = row.queue_strategy; queue_moh_sound = row.queue_moh_sound; queue_record_template = row.queue_record_template; @@ -246,17 +243,10 @@ agent_busy_delay_time = row.agent_busy_delay_time; agent_record = row.agent_record; - --set the language, voice and dialect - if (queue_language ~= nil and queue_dialect ~= nil and queue_voice ~= nil) then - sound_prefix = "sound_prefix="..sounds_dir.."/"..queue_language.."/"..queue_dialect .."/"..queue_voice; - else - sound_prefix = sounds_dir.."/en/us/callie"; - end - --get and then set the complete agent_contact with the call_timeout and when necessary confirm --confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1"; --if you change this variable also change app/call_center/call_center_agent_edit.php - confirm = ""..sound_prefix..",group_confirm_file=ivr/ivr-accept_reject_voicemail.wav,group_confirm_key=1,group_confirm_read_timeout=2000,leg_timeout="..agent_call_timeout; + confirm = "group_confirm_file=ivr/ivr-accept_reject_voicemail.wav,group_confirm_key=1,group_confirm_read_timeout=2000,leg_timeout="..agent_call_timeout; local record = ""; if (agent_record == "true") then record = string.format(",execute_on_pre_bridge='record_session %s/%s/archive/${strftime(%%Y)}/${strftime(%%b)}/${strftime(%%d)}/${uuid}.${record_ext}'", recordings_dir, domain_name)