Update agent state to waiting

This commit is contained in:
FusionPBX
2023-10-04 09:00:15 -06:00
committed by GitHub
parent 0e073230ce
commit ab0f5d3295

View File

@@ -207,18 +207,28 @@
if (!isset($row['queue_name'])) {
if ($agent_status == "Do Not Disturb") {
//set the default dnd action
$dnd_action = "add";
$dnd_action = "add";
//set the call center status to Logged Out
if (is_uuid($row['agent_uuid'])) {
$command = "api callcenter_config agent set status ".$row['agent_uuid']." 'Logged Out' ";
}
if (is_uuid($row['agent_uuid'])) {
$command = "api callcenter_config agent set status ".$row['agent_uuid']." 'Logged Out' ";
$response = event_socket_request($fp, $command);
}
}
else {
if (is_uuid($row['agent_uuid'])) {
//set the agent status
$command = "api callcenter_config agent set status ".$row['agent_uuid']." '".$agent_status."'";
$response = event_socket_request($fp, $command);
//set the agent state
if ($agent_status == 'Available' || $agent_status == 'Logged Out') {
$command = "api callcenter_config agent set state ".$row['agent_uuid']." 'Waiting'";
$response = event_socket_request($fp, $command);
}
}
}
$response = event_socket_request($fp, $command);
}
//echo $command."\n";