diff --git a/app/call_centers/app_config.php b/app/call_centers/app_config.php index f1a46d8a58..4afafe6e4f 100644 --- a/app/call_centers/app_config.php +++ b/app/call_centers/app_config.php @@ -421,6 +421,18 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_language"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_dialect"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_voice"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_time_base_score"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php index 475346a7b5..182bc0f3ff 100644 --- a/app/call_centers/call_center_queue_edit.php +++ b/app/call_centers/call_center_queue_edit.php @@ -72,6 +72,20 @@ //initialize the destination object $destination = new destinations; +//get installed languages + $language_paths = glob($settings->get('switch', 'sounds')."/*/*/*"); + foreach ($language_paths as $key => $path) { + $path = str_replace($settings->get('switch', 'sounds').'/', "", $path); + $path_array = explode('/', $path); + if (count($path_array) <> 3 || strlen($path_array[0]) <> 2 || strlen($path_array[1]) <> 2) { + unset($language_paths[$key]); + } + $language_paths[$key] = str_replace($settings->get('switch', 'sounds')."/","",$language_paths[$key] ?? ''); + if (empty($language_paths[$key])) { + unset($language_paths[$key]); + } + } + //get total call center queues count from the database, check limit, if defined if ($action == 'add') { if (!empty($settings->get('limit','call_center_queues', ''))) { @@ -97,6 +111,7 @@ $queue_name = $_POST["queue_name"]; $queue_extension = $_POST["queue_extension"]; $queue_greeting = $_POST["queue_greeting"]; + $queue_language = $_POST["queue_language"]; $queue_strategy = $_POST["queue_strategy"]; $call_center_tiers = $_POST["call_center_tiers"]; $queue_moh_sound = $_POST["queue_moh_sound"]; @@ -131,6 +146,12 @@ $queue_context = $domain_name; } + //seperate the language components into language, dialect and voice + $language_array = explode("/",$queue_language); + $queue_language = $language_array[0] ?? ''; + $queue_dialect = $language_array[1] ?? ''; + $queue_voice = $language_array[2] ?? ''; + //remove invalid characters $queue_cid_prefix = str_replace(":", "-", $queue_cid_prefix); $queue_cid_prefix = str_replace("\"", "", $queue_cid_prefix); @@ -311,9 +332,12 @@ $array['call_center_queues'][0]['queue_name'] = $queue_name; $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_strategy'] = $queue_strategy; $array['call_center_queues'][0]['queue_moh_sound'] = $queue_moh_sound; $array['call_center_queues'][0]['queue_record_template'] = $queue_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_time_base_score'] = $queue_time_base_score; $array['call_center_queues'][0]['queue_time_base_score_sec'] = $queue_time_base_score_sec; $array['call_center_queues'][0]['queue_max_wait_time'] = $queue_max_wait_time; @@ -548,6 +572,9 @@ $database_queue_name = $row["queue_name"]; $queue_extension = $row["queue_extension"]; $queue_greeting = $row["queue_greeting"]; + $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"]; @@ -864,6 +891,34 @@ echo "\n"; echo "\n"; + echo "