diff --git a/app/call_center_active/call_center_active_inc.php b/app/call_center_active/call_center_active_inc.php index a2112cf869..2c3adabbba 100644 --- a/app/call_center_active/call_center_active_inc.php +++ b/app/call_center_active/call_center_active_inc.php @@ -1,4 +1,4 @@ -get(); -//get the queue_name and set it as a variable - $queue_name = $_GET['queue_name']; +//get the queue uuid and set it as a variable + $queue_uuid = $_GET['queue_name']; + +//get the queues from the database + if (!is_array($_SESSION['queues'])) { + $sql = "select * from v_call_center_queues "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "order by queue_name ASC "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $_SESSION['queues'] = $prep_statement->fetchAll(PDO::FETCH_NAMED); + } + +//get the queue name + foreach ($_SESSION['queues'] as $row) { + if ($row['call_center_queue_uuid'] == $queue_uuid) { + $queue_name = $row['queue_name']; + } + } //convert the string to a named array function str_to_named_array($tmp_str, $tmp_delimiter) { @@ -104,7 +121,7 @@ //send the event socket command and get the response //callcenter_config queue list tiers [queue_name] | - $switch_cmd = 'callcenter_config queue list tiers '.$queue_name; + $switch_cmd = 'callcenter_config queue list tiers '.$queue_uuid; $event_socket_str = trim(event_socket_request($fp, 'api '.$switch_cmd)); $result = str_to_named_array($event_socket_str, '|'); @@ -126,7 +143,7 @@ //send the event socket command and get the response //callcenter_config queue list agents [queue_name] [status] | - $switch_cmd = 'callcenter_config queue list agents '.$queue_name; + $switch_cmd = 'callcenter_config queue list agents '.$queue_uuid; $event_socket_str = trim(event_socket_request($fp, 'api '.$switch_cmd)); $agent_result = str_to_named_array($event_socket_str, '|'); @@ -269,7 +286,7 @@ //get the queue list //send the event socket command and get the response //callcenter_config queue list members [queue_name] - $switch_cmd = 'callcenter_config queue list members '.$queue_name; + $switch_cmd = 'callcenter_config queue list members '.$queue_uuid; $event_socket_str = trim(event_socket_request($fp, 'api '.$switch_cmd)); $result = str_to_named_array($event_socket_str, '|'); if (!is_array($result)) { unset($result); } @@ -281,7 +298,7 @@ echo "\n"; echo " \n"; - echo " \n"; echo "
".$text['label-queue'].": ".ucfirst($_GET['name'])."
\n"; + echo "
".$text['label-queue'].": ".ucfirst($queue_name)."
\n"; echo " ".$text['description-queue']."
\n"; echo "
";