Update call_center_active_inc.php

This commit is contained in:
FusionPBX 2019-06-16 18:22:17 -06:00 committed by GitHub
parent 030794be4a
commit e5a48bb5c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 72 additions and 77 deletions

View File

@ -121,8 +121,8 @@
//send the event socket command and get the response
//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));
$switch_command = 'callcenter_config queue list tiers '.$queue_uuid;
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_command));
$result = str_to_named_array($event_socket_str, '|');
//prepare the result for array_multisort
@ -143,8 +143,8 @@
//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_uuid;
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
$switch_command = 'callcenter_config queue list agents '.$queue_uuid;
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_command));
$agent_result = str_to_named_array($event_socket_str, '|');
//get the agents from the database
@ -252,19 +252,14 @@
//need to check state to so only waiting gets call, and trying/answer gets eavesdrop
if ($tier_state == "Offering" || $tier_state == "Active Inbound") {
$orig_command="{origination_caller_id_name=eavesdrop,origination_caller_id_number=".escape($agent_extension)."}user/".$_SESSION['user']['extension'][0]['user']."@".$_SESSION['domain_name']." %26eavesdrop(".escape($agent_uuid).")";
//debug
//echo $orig_command;
//echo " <a href='javascript:void(0);' style='color: #444444;' onclick=\"confirm_response = confirm('".$text['message-confirm']."');if (confirm_response){send_cmd('call_center_exec.php?cmd=log+".$orig_command.")');}\">log_cmd</a>&nbsp;\n";
echo " <a href='javascript:void(0);' style='color: #444444;' onclick=\"confirm_response = confirm('".$text['message-confirm']."');if (confirm_response){send_cmd('call_center_exec.php?cmd=originate+".$orig_command.")');}\">".$text['label-eavesdrop']."</a>&nbsp;\n";
echo " <a href='javascript:void(0);' style='color: #444444;' onclick=\"confirm_response = confirm('".$text['message-confirm']."');if (confirm_response){send_command('call_center_exec.php?command=eavesdrop&uuid=".escape($agent_uuid)."&extension=".escape($agent_extension)."');}\">".$text['label-eavesdrop']."</a>&nbsp;\n";
$xfer_command = escape($agent_uuid)." -bleg ".escape($_SESSION['user']['extension'][0]['user'])." XML ".escape($_SESSION['domain_name']);
//$xfer_command = $agent_uuid." ".$_SESSION['user']['extension'][0]['user']." XML default";
echo " <a href='javascript:void(0);' style='color: #444444;' onclick=\"confirm_response = confirm('".$text['message-confirm']."');if (confirm_response){send_cmd('call_center_exec.php?cmd=uuid_transfer+".urlencode($xfer_command)."');}\">".$text['label-transfer']."</a>&nbsp;\n";
echo " <a href='javascript:void(0);' style='color: #444444;' onclick=\"confirm_response = confirm('".$text['message-confirm']."');if (confirm_response){send_command('call_center_exec.php?command=uuid_transfer&uuid=".escape($agent_uuid)." -');}\">".$text['label-transfer']."</a>&nbsp;\n";
}
else {
$orig_call="{origination_caller_id_name=c2c-".urlencode(escape($name)).",origination_caller_id_number=".escape($agent_extension)."}user/".$_SESSION['user']['extension'][0]['user']."@".$_SESSION['domain_name']." %26bridge(user/".escape($agent_extension)."@".$_SESSION['domain_name'].")";
echo " <a href='javascript:void(0);' style='color: #444444;' onclick=\"confirm_response = confirm('".$text['message-confirm']."');if (confirm_response){send_cmd('call_center_exec.php?cmd=originate+".escape($orig_call).")');}\">".$text['label-call']."</a>&nbsp;\n";
echo " <a href='javascript:void(0);' style='color: #444444;' onclick=\"confirm_response = confirm('".$text['message-confirm']."');if (confirm_response){send_command('call_center_exec.php?command=bridge&extension=".escape($agent_extension)."&caller_id_name=".urlencode(escape($name))."');}\">".$text['label-call']."</a>&nbsp;\n";
}
echo "</td>";
}
@ -285,10 +280,12 @@
//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_uuid;
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
if (is_uuid($queue_uuid)) {
$switch_command = 'callcenter_config queue list members '.$queue_uuid;
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_command));
$result = str_to_named_array($event_socket_str, '|');
if (!is_array($result)) { unset($result); }
}
//show the title
$q_waiting=0;
@ -301,12 +298,14 @@
echo " ".$text['description-queue']."<br />\n";
echo " </td>\n";
echo " <td align='right' valign='top'>";
if (isset($result)) foreach ($result as $row) {
if (isset($result)) {
foreach ($result as $row) {
$state = $row['state'];
$q_trying += ($state == "Trying") ? 1 : 0;
$q_waiting += ($state == "Waiting") ? 1 : 0;
$q_answered += ($state == "Answered") ? 1 : 0;
}
}
echo " <strong>".$text['label-waiting'].":</strong> <b>".$q_waiting."</b>&nbsp;&nbsp;&nbsp;";
echo " <strong>".$text['label-trying'].":</strong> <b>".$q_trying."</b>&nbsp;&nbsp;&nbsp; ";
echo " <strong>".$text['label-answered'].":</strong> <b>".$q_answered."</b>";
@ -328,7 +327,8 @@
echo "<th>".$text['label-agent']."</th>\n";
echo "</tr>\n";
if (isset($result)) foreach ($result as $row) {
if (is_array($result)) {
foreach ($result as $row) {
$queue = $row['queue'];
$system = $row['system'];
$uuid = $row['uuid'];
@ -370,14 +370,8 @@
if (if_group("admin") || if_group("superadmin")) {
echo "<td valign='top' class='".$row_style[$c]."'>";
if ($state != "Abandoned") {
$q_caller_number = urlencode($caller_number);
$orig_command="{origination_caller_id_name=eavesdrop,origination_caller_id_number=".escape($q_caller_number)."}user/".escape($_SESSION['user']['extension'][0]['user'])."@".escape($_SESSION['domain_name'])." %26eavesdrop(".escape($session_uuid).")";
//debug
//echo $orig_command;
//echo " <a href='javascript:void(0);' style='color: #444444;' onclick=\"confirm_response = confirm('".$text['message-confirm']."');if (confirm_response){send_cmd('call_center_exec.php?cmd=log+".$orig_command.")');}\">log_cmd</a>&nbsp;\n";
echo " <a href='javascript:void(0);' style='color: #444444;' onclick=\"confirm_response = confirm('".$text['message-confirm']."');if (confirm_response){send_cmd('call_center_exec.php?cmd=originate+".$orig_command.")');}\">".$text['label-eavesdrop']."</a>&nbsp;\n";
echo " <a href='javascript:void(0);' style='color: #444444;' onclick=\"confirm_response = confirm('".$text['message-confirm']."');if (confirm_response){send_command('call_center_exec.php?command=eavesdrop&caller_id_number=".escape(urlencode($caller_number))."&uuid=".escape($session_uuid)."');}\">".$text['label-eavesdrop']."</a>&nbsp;\n";
}
else {
echo "&nbsp;";
@ -388,6 +382,7 @@
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
}
}
echo "</table>\n";
//add vertical spacing