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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 5 deletions

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";