From ba7434aace795242db68a4fafd14d1f8aa63bdd8 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Mon, 3 Sep 2012 23:13:43 +0000 Subject: [PATCH] Apply latest call center change to the dev branch. --- .../v_call_center_active_inc.php | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/app/call_center_active/v_call_center_active_inc.php b/app/call_center_active/v_call_center_active_inc.php index 4d19b3e2d6..dc67e78dc9 100644 --- a/app/call_center_active/v_call_center_active_inc.php +++ b/app/call_center_active/v_call_center_active_inc.php @@ -113,8 +113,13 @@ else { if (if_group("admin") || if_group("superadmin")) { echo "Options\n"; } + echo "Agent\n"; echo "\n"; + $q_waiting=0; + $q_trying=0; + $q_answered=0; + foreach ($result as $row) { $switch_cmd = 'uuid_exists '.$row['session_uuid']; if (trim(event_socket_request($fp, 'api '.$switch_cmd)) == "true") { @@ -122,8 +127,8 @@ else { $system = $row['system']; $uuid = $row['uuid']; $session_uuid = $row['session_uuid']; - $caller_number = $row['caller_number']; - $caller_name = $row['caller_name']; + $caller_number = $row['cid_number']; + $caller_name = $row['cid_name']; $system_epoch = $row['system_epoch']; $joined_epoch = $row['joined_epoch']; $rejoined_epoch = $row['rejoined_epoch']; @@ -134,6 +139,9 @@ else { $serving_agent = $row['serving_agent']; $serving_system = $row['serving_system']; $state = $row['state']; + if ($state=="Trying") {$q_trying = $q_trying + 1;} + if ($state=="Waiting") {$q_waiting = $q_waiting + 1;} + if ($state=="Answered") {$q_answered = $q_answered + 1;} $joined_seconds = time() - $joined_epoch; $joined_length_hour = floor($joined_seconds/3600); @@ -159,9 +167,22 @@ else { echo "".$state."\n"; if (if_group("admin") || if_group("superadmin")) { echo ""; - echo " eavesdrop \n"; + + $orig_command="{origination_caller_id_name=eavesdrop,origination_caller_id_number=".$caller_number."}user/".$_SESSION['user']['extension'][0]['user']."@".$_SESSION['domain_name']." %26eavesdrop(".$session_uuid.")"; + + //url encode any plus signs in caller id + $orig_command = str_replace("+", "%2B", $orig_command); + + //debug + //echo $orig_command; + //echo " log_cmd \n"; + + echo " eavesdrop \n"; + + echo ""; } + echo "".$serving_agent." \n"; echo "\n"; if ($c==0) { $c=1; } else { $c=0; } } //end if uuid_exists @@ -292,7 +313,9 @@ else { if ($c==0) { $c=1; } else { $c=0; } } - echo "\n"; + echo "\n\n"; + echo "
"; + echo "Total Waiting is {$q_waiting}. Total Trying is {$q_trying}. Total Answered is {$q_answered}.\n"; //add vertical spacing echo "
\n";