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

@ -208,17 +208,27 @@
if ($agent_status == "Do Not Disturb") { if ($agent_status == "Do Not Disturb") {
//set the default dnd action //set the default dnd action
$dnd_action = "add"; $dnd_action = "add";
//set the call center status to Logged Out //set the call center status to Logged Out
if (is_uuid($row['agent_uuid'])) { if (is_uuid($row['agent_uuid'])) {
$command = "api callcenter_config agent set status ".$row['agent_uuid']." 'Logged Out' "; $command = "api callcenter_config agent set status ".$row['agent_uuid']." 'Logged Out' ";
$response = event_socket_request($fp, $command);
} }
} }
else { else {
if (is_uuid($row['agent_uuid'])) { if (is_uuid($row['agent_uuid'])) {
//set the agent status
$command = "api callcenter_config agent set status ".$row['agent_uuid']." '".$agent_status."'"; $command = "api callcenter_config agent set status ".$row['agent_uuid']." '".$agent_status."'";
}
}
$response = event_socket_request($fp, $command); $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);
}
}
}
} }
//echo $command."\n"; //echo $command."\n";