diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall_SIPmonitor.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall_SIPmonitor.php deleted file mode 100644 index ce1ba459..00000000 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall_SIPmonitor.php +++ /dev/null @@ -1,325 +0,0 @@ - LICENSE: GPLv2 -### Contributions by Magma Networks LLC -### -# live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# changes: -# 50406-0920 - Added Paused agents < 1 min (Chris Doyle) -# 51130-1218 - Modified layout and info to show all servers in a vicidial system -# 60504-2023 - Modified click-to-listen for SIP phones by Angelito Manansala -# 60619-1708 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# - Added 10 minutes on call (Magma Networks LLC) -# - Added extended pause (exceeding 60 seconds -> 20 minutes) (Magma Networks LLC) -# - Added Full Name Field to extract from Database (Magma Networks LLC) -# - Added Barge Link (Magma Networks LLC) -# 60731-1138 - fixed fullname formatting - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$reset_counter=$_GET["reset_counter"]; if (!$reset_counter) {$reset_counter=$_POST["reset_counter"];} -$RR=$_GET["RR"]; if (!$RR) {$RR=$_POST["RR"];} -$group=$_GET["group"]; if (!$group) {$group=$_POST["group"];} -$DB=$_GET["DB"]; if (!$DB) {$DB=$_POST["DB"];} -$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];} -$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$epochSIXhoursAGO = ($STARTtime - 21600); -$timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); - -$stmt="select campaign_id from vicidial_campaigns;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!$RR) {$RR=40;} - -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On VDAD Campaign: $group\n"; -echo "
\n"; -echo "VICIDIAL: Realtime Campaign: \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "         \n"; -echo "STOP | GO"; -echo "         MODIFY | REPORTS \n"; -echo "\n\n"; - -if (!$group) {echo "

please select a campaign from the pulldown above
\n"; exit;} -else -{ -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); - -echo "
"; -echo "DIAL LEVEL: $row[0]         "; -echo "STATUSES: $row[1], $row[2], $row[3], $row[4], $row[5]         "; -echo "ORDER: $row[6]"; -echo "\n\n"; -} -################################################################################### -###### OUTBOUND CALLS -################################################################################### -if (eregi("CLOSER",$group)) - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and (campaign_id='" . mysql_real_escape_string($group) . "' or campaign_id LIKE \"CL_%\");";} -else - {$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and campaign_id='" . mysql_real_escape_string($group) . "';";} -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - while ($i < $parked_to_print) - { - $row=mysql_fetch_row($rslt); - - if (eregi("LIVE",$row[0])) - {$out_live++;} - else - { - if (eregi("CLOSER",$row[0])) - {$nothing=1;} - else - {$out_ring++;} - } - $out_total++; - $i++; - } - - if ($out_live > 0) {$F=''; $FG='';} - if ($out_live > 4) {$F=''; $FG='';} - if ($out_live > 9) {$F=''; $FG='';} - if ($out_live > 14) {$F=''; $FG='';} - - if (eregi("CLOSER",$group)) - {echo "$NFB$out_total$NFE current active calls      \n";} - else - {echo "$NFB$out_total$NFE calls being placed       \n";} - - echo "$NFB$out_ring$NFE calls ringing         \n"; - echo "$NFB$F  $out_live $FG$NFE calls waiting for agents       \n"; - } - else - { - echo " NO LIVE CALLS WAITING \n"; - } - - -################################################################################### -###### TIME ON SYSTEM -################################################################################### - -$agent_incall=0; -$agent_ready=0; -$agent_paused=0; -$agent_total=0; - -$Aecho = ''; -$Aecho .= "VF DIALER: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; -$Aecho .= "+------------|--------+-----------------+----------------+-------+--------+-----------------+-----------------+---------+------------+\n"; -$Aecho .= "| STATION | USER | FULL NAME | SESSIONID | BARGE | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; -$Aecho .= "+------------|--------+-----------------+----------------+-------+--------+-----------------+-----------------+---------+------------+\n"; - - -$stmt=" - select - extension, - vicidial_live_agents.user, - conf_exten, - status, - server_ip, - UNIX_TIMESTAMP(last_call_time), - UNIX_TIMESTAMP(last_call_finish), - call_server_ip, - campaign_id, - vicidial_users.full_name as full_name - from vicidial_live_agents - left join vicidial_users on vicidial_live_agents.user = vicidial_users.user - where - campaign_id='" . mysql_real_escape_string($group) . "' - order by - status, - last_call_time; -"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[5]=$row[6]; - } - $extension = eregi_replace('Local/',"",$row[0]); - $extension = sprintf("%-10s", $extension); - while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} - $user = sprintf("%-6s", $row[1]); - $sessionid = sprintf("%-9s", $row[2]); - $status = sprintf("%-6s", $row[3]); - $server_ip = sprintf("%-15s", $row[4]); - $call_server_ip = sprintf("%-15s", $row[7]); - $campaign_id = sprintf("%-10s", $row[8]); - $full_name = sprintf("%-15s", $row[9]); - while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);} - $call_time_S = ($STARTtime - $row[5]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} -# if ($call_time_M_int >= 10) {$G=''; $EG='';} - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 20) - {$i++; continue;} - else - {$G=''; $EG=''; $agent_paused++; $agent_total++;} - } -# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) -# {$G=''; $EG='';} - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$G=''; $EG='';} - $sessionid = trim($sessionid); - - $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG | $G$full_name$EG | $G$sessionid$EG LISTEN | BARGE | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; - - $i++; - } - - $Aecho .= "+------------|--------+-----------------+----------------+--------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " NOTE: Click LISTEN to monitor agent call, you must have installed softphone on you machine.\n\n"; - - - $Aecho .= " - Paused agents\n"; - # $Aecho .= " - Balanced call\n"; - $Aecho .= " - Agent waiting for call\n"; - $Aecho .= " - Over 5 minutes on call\n"; - $Aecho .= " - Over 10 minutes on call\n"; - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-		echo "$Aecho";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS \n";
-	}
-
-?>
-
- -