From 7ecfe963813d1a94d072ef94cd0503569b417dbc Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 7 Oct 2024 11:39:28 -0600 Subject: [PATCH] Add agent state to indicate wrap up time --- .../call_center_active_inc.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/app/call_center_active/call_center_active_inc.php b/app/call_center_active/call_center_active_inc.php index c3e276c028..5091dac96d 100644 --- a/app/call_center_active/call_center_active_inc.php +++ b/app/call_center_active/call_center_active_inc.php @@ -221,9 +221,18 @@ $talk_time = $agent_row['talk_time']; $ready_time = $agent_row['ready_time']; + //calcudate the length since status change and bridge end + $last_status_change_length = time() - $last_status_change; + $last_bridge_end_length = time() - $last_bridge_end; + + //set the state to wrap up time + if ($last_bridge_end_length < $wrap_up_time) { + $state = 'Wrap Up Time'; + } + //format the seconds to hh:mm:ss - $last_status_change_length = format_seconds(time() - $last_status_change); - $last_bridge_end_length = format_seconds(time() - $last_bridge_end); + $last_status_change_length_formatted = format_seconds($last_status_change_length); + $last_bridge_end_length_formatted = format_seconds($last_bridge_end_length); if (permission_exists('call_center_agent_edit')) { $list_row_url = "../call_centers/call_center_agent_edit.php?id=".$agent_uuid; @@ -241,8 +250,8 @@ echo "".escape($agent_extension)."\n"; echo "".escape($status)."\n"; echo "".escape($state)."\n"; - echo "".escape($last_status_change_length)."\n"; - echo "".escape($last_bridge_end_length)."\n"; + echo "".escape($last_status_change_length_formatted)."\n"; + echo "".escape($last_bridge_end_length_formatted)."\n"; echo "".escape($no_answer_count)."\n"; echo "".escape($calls_answered)."\n"; echo "".escape($tier_state)."\n"; @@ -389,4 +398,4 @@ } -?> \ No newline at end of file +?>