diff --git a/agc_2-X/trunk/bin/AST_agent_daily_SPH.pl b/agc_2-X/trunk/bin/AST_agent_daily_SPH.pl index bb29cab1..a976e875 100644 --- a/agc_2-X/trunk/bin/AST_agent_daily_SPH.pl +++ b/agc_2-X/trunk/bin/AST_agent_daily_SPH.pl @@ -436,7 +436,7 @@ foreach (@Duser) $GMONTHhours = ($GMONTHhours + $MONTHhours); $TOTMONTHhours = ($TOTMONTHhours + $MONTHhours); - print Dout "$shipdate|$Dname[$i]|$Duser[$i]||$Dhours[0]|$Dsph[0]|$Dhours[1]|$Dsph[1]|$Dhours[2]|$Dsph[2]|$Dhours[3]|$Dsph[3]|$Dhours[4]|$Dsph[4]|$Dhours[5]|$Dsph[5]|$Dhours[6]|$Dsph[6]|$WEEKhours|$WEEKsph|$MONTHhours|$MONTHsph|$YEARpipe$Dgroup[$i]\n"; + print Dout "$shipdate|$Dname[$i]|$Duser[$i]|$Dhours[0]|$Dsph[0]|$Dhours[1]|$Dsph[1]|$Dhours[2]|$Dsph[2]|$Dhours[3]|$Dsph[3]|$Dhours[4]|$Dsph[4]|$Dhours[5]|$Dsph[5]|$Dhours[6]|$Dsph[6]|$WEEKhours|$WEEKsph|$MONTHhours|$MONTHsph|$YEARpipe$Dgroup[$i]\n"; ### only print to ASCII fixed-length file if week-to-date and month-to-date hours > 0 if ( ($WEEKhours > 0) || ($MONTHhours > 0) ) @@ -514,7 +514,7 @@ foreach (@Duser) $YEARgfixed=" $GYEARhours $GYEARsph"; } - print Dout "$shipdate|TOTAL $Dprevgroup|||$GDhours[0]|$GDsph[0]|$GDhours[1]|$GDsph[1]|$GDhours[2]|$GDsph[2]|$GDhours[3]|$GDsph[3]|$GDhours[4]|$GDsph[4]|$GDhours[5]|$GDsph[5]|$GDhours[6]|$GDsph[6]|$GWEEKhours|$GWEEKsph|$GMONTHhours|$GMONTHsph|$YEARgpipe\n"; + print Dout "$shipdate|TOTAL $Dprevgroup||$GDhours[0]|$GDsph[0]|$GDhours[1]|$GDsph[1]|$GDhours[2]|$GDsph[2]|$GDhours[3]|$GDsph[3]|$GDhours[4]|$GDsph[4]|$GDhours[5]|$GDsph[5]|$GDhours[6]|$GDsph[6]|$GWEEKhours|$GWEEKsph|$GMONTHhours|$GMONTHsph|$YEARgpipe\n"; $GWEEKhours = sprintf("%.0f", $GWEEKhours); $GWEEKhours = sprintf("%5s", $GWEEKhours); while(length($GWEEKhours)>5) {chop($GWEEKhours);} @@ -594,7 +594,7 @@ else $YEARtfixed=" $TOTYEARhours $TOTYEARsph"; } -print Dout "$shipdate|TOTAL|||$TOTDhours[0]|$TOTDsph[0]|$TOTDhours[1]|$TOTDsph[1]|$TOTDhours[2]|$TOTDsph[2]|$TOTDhours[3]|$TOTDsph[3]|$TOTDhours[4]|$TOTDsph[4]|$TOTDhours[5]|$TOTDsph[5]|$TOTDhours[6]|$TOTDsph[6]|$TOTWEEKhours|$TOTWEEKsph|$TOTMONTHhours|$TOTMONTHsph|$YEARtpipe\n"; +print Dout "$shipdate|TOTAL||$TOTDhours[0]|$TOTDsph[0]|$TOTDhours[1]|$TOTDsph[1]|$TOTDhours[2]|$TOTDsph[2]|$TOTDhours[3]|$TOTDsph[3]|$TOTDhours[4]|$TOTDsph[4]|$TOTDhours[5]|$TOTDsph[5]|$TOTDhours[6]|$TOTDsph[6]|$TOTWEEKhours|$TOTWEEKsph|$TOTMONTHhours|$TOTMONTHsph|$YEARtpipe\n"; $TOTWEEKhours = sprintf("%.0f", $TOTWEEKhours); $TOTWEEKhours = sprintf("%5s", $TOTWEEKhours); while(length($TOTWEEKhours)>5) {chop($TOTWEEKhours);} diff --git a/agc_2-X/trunk/bin/AST_agent_daily_SPHfront.pl b/agc_2-X/trunk/bin/AST_agent_daily_SPHfront.pl index cf9dfb0a..13d0c07b 100644 --- a/agc_2-X/trunk/bin/AST_agent_daily_SPHfront.pl +++ b/agc_2-X/trunk/bin/AST_agent_daily_SPHfront.pl @@ -379,7 +379,7 @@ foreach (@Duser) $GMONTHhours = ($GMONTHhours + $MONTHhours); $TOTMONTHhours = ($TOTMONTHhours + $MONTHhours); - print Dout "$shipdate|$Dname[$i]|$Duser[$i]||$Dhours[0]|$Dsph[0]|$Dhours[1]|$Dsph[1]|$Dhours[2]|$Dsph[2]|$Dhours[3]|$Dsph[3]|$Dhours[4]|$Dsph[4]|$Dhours[5]|$Dsph[5]|$Dhours[6]|$Dsph[6]|$WEEKhours|$WEEKsph|$MONTHhours|$MONTHsph|$Dgroup[$i]\n"; + print Dout "$shipdate|$Dname[$i]|$Duser[$i]|$Dhours[0]|$Dsph[0]|$Dhours[1]|$Dsph[1]|$Dhours[2]|$Dsph[2]|$Dhours[3]|$Dsph[3]|$Dhours[4]|$Dsph[4]|$Dhours[5]|$Dsph[5]|$Dhours[6]|$Dsph[6]|$WEEKhours|$WEEKsph|$MONTHhours|$MONTHsph|$Dgroup[$i]\n"; ### only print to ASCII fixed-length file if week-to-date and month-to-date hours > 0 if ( ($WEEKhours > 0) || ($MONTHhours > 0) ) @@ -441,7 +441,7 @@ foreach (@Duser) else {$GMONTHsph = 0;} - print Dout "$shipdate|TOTAL $Dprevgroup|||$GDhours[0]|$GDsph[0]|$GDhours[1]|$GDsph[1]|$GDhours[2]|$GDsph[2]|$GDhours[3]|$GDsph[3]|$GDhours[4]|$GDsph[4]|$GDhours[5]|$GDsph[5]|$GDhours[6]|$GDsph[6]|$GWEEKhours|$GWEEKsph|$GMONTHhours|$GMONTHsph|\n"; + print Dout "$shipdate|TOTAL $Dprevgroup||$GDhours[0]|$GDsph[0]|$GDhours[1]|$GDsph[1]|$GDhours[2]|$GDsph[2]|$GDhours[3]|$GDsph[3]|$GDhours[4]|$GDsph[4]|$GDhours[5]|$GDsph[5]|$GDhours[6]|$GDsph[6]|$GWEEKhours|$GWEEKsph|$GMONTHhours|$GMONTHsph|\n"; $GWEEKhours = sprintf("%.0f", $GWEEKhours); $GWEEKhours = sprintf("%5s", $GWEEKhours); while(length($GWEEKhours)>5) {chop($GWEEKhours);} @@ -505,7 +505,7 @@ else {$TOTMONTHsph = 0;} -print Dout "$shipdate|TOTAL|||$TOTDhours[0]|$TOTDsph[0]|$TOTDhours[1]|$TOTDsph[1]|$TOTDhours[2]|$TOTDsph[2]|$TOTDhours[3]|$TOTDsph[3]|$TOTDhours[4]|$TOTDsph[4]|$TOTDhours[5]|$TOTDsph[5]|$TOTDhours[6]|$TOTDsph[6]|$TOTWEEKhours|$TOTWEEKsph|$TOTMONTHhours|$TOTMONTHsph|\n"; +print Dout "$shipdate|TOTAL||$TOTDhours[0]|$TOTDsph[0]|$TOTDhours[1]|$TOTDsph[1]|$TOTDhours[2]|$TOTDsph[2]|$TOTDhours[3]|$TOTDsph[3]|$TOTDhours[4]|$TOTDsph[4]|$TOTDhours[5]|$TOTDsph[5]|$TOTDhours[6]|$TOTDsph[6]|$TOTWEEKhours|$TOTWEEKsph|$TOTMONTHhours|$TOTMONTHsph|\n"; $TOTWEEKhours = sprintf("%.0f", $TOTWEEKhours); $TOTWEEKhours = sprintf("%5s", $TOTWEEKhours); while(length($TOTWEEKhours)>5) {chop($TOTWEEKhours);} diff --git a/agc_2-X/trunk/docs/BASE_INSTALL.txt b/agc_2-X/trunk/docs/BASE_INSTALL.txt index 246b569a..4288acdb 100644 --- a/agc_2-X/trunk/docs/BASE_INSTALL.txt +++ b/agc_2-X/trunk/docs/BASE_INSTALL.txt @@ -648,9 +648,10 @@ PHASE 11: Security Hardening: You may want to reduce the exposure of some of the elements of VICIDIAL. Here are some examples: - ln -s /dev/null /usr/local/apache2/htdocs/vicidial/project_auth_entries.txt - ln -s /dev/null /usr/local/apache2/htdocs/agc/project_auth_entries.txt - ln -s /dev/null /usr/local/apache2/htdocs/vicidial/admin_changes_log.txt +ln -s /dev/null /usr/local/apache2/htdocs/vicidial/project_auth_entries.txt +ln -s /dev/null /usr/local/apache2/htdocs/agc/vicidial_auth_entries.txt +ln -s /dev/null /usr/local/apache2/htdocs/agc/astguiclient_auth_entries.txt +ln -s /dev/null /usr/local/apache2/htdocs/vicidial/admin_changes_log.txt - Change the WWW writable in the admin.php server settings to "0" - Change the default admin user "6666" or it's password from the default diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index ac1ea1b3..ad66ddaf 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -3,14 +3,6 @@ # # Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # -# make sure you have added a user to the vicidial_users MySQL table with at least -# user_level 1 or greater to access this page. Also, you need to have the login -# and pass of a phone listed in the asterisk.phones table. The page grabs the -# server info and other details from this login and pass. -# -# This script works best with Firefox or Mozilla, but will run for a couple -# hours on Internet Explorer before the memory leaks cause a crash. -# # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database # - manager_send.php: Sends manager actions to the DB for execution @@ -759,7 +751,7 @@ $VDloginDISPLAY=0; $HKstatuses = substr("$HKstatuses", 0, -1); $HKstatusnames = substr("$HKstatusnames", 0, -1); - ##### grab the statuses to be dialed for your campaign as well as other campaign settings + ##### grab the campaign settings $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDAD.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDAD.php index a85057e8..f569bfad 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDAD.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDAD.php @@ -10,6 +10,7 @@ # 60620-1037 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 61114-2004 - Changed to display CLOSER and DEFAULT, added trunk shortage +# 80422-0305 - Added phone login to display, lower font size to 2 # header ("Content-type: text/html; charset=utf-8"); @@ -111,7 +112,7 @@ if ($closer_display>0) echo "\n"; echo"\n"; echo "VICIDIAL: Time On VDAD\n"; -echo "
";
+echo "
";
 
 ###################################################################################
 ###### SERVER INFORMATION
@@ -137,15 +138,15 @@ echo "VICIDIAL: Agents Time On Calls           $NOW_TIME    0)
 {
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+echo "| STATION    | PHONE      | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES | CAMPAIGN     | FRONT  |\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
 }
 else
 {
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
-echo "| STATION    | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES |\n";
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
+echo "| STATION    | PHONE      | USER   | SESSIONID | CHANNEL             | STATUS | CALLTIME | MINUTES |\n";
+echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
 }
 
 $stmt="select extension,user,conf_exten,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),uniqueid,lead_id from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by extension;";
@@ -158,18 +159,70 @@ $talking_to_print = mysql_num_rows($rslt);
 	while ($i < $talking_to_print)
 		{
 		$row=mysql_fetch_row($rslt);
-			if (eregi("READY|PAUSED|CLOSER",$row[4]))
+		$Sextension[$i] =		$row[0];
+		$Suser[$i] =			$row[1];
+		$Ssessionid[$i] =		$row[2];
+		$Schannel[$i] =			$row[3];
+		$Sstatus[$i] =			$row[4];
+		$Sstart_time[$i] =		$row[5];
+		$Scall_time[$i] =		$row[6];
+		$Sfinish_time[$i] =		$row[7];
+		$Suniqueid[$i] =		$row[8];
+		$Slead_id[$i] =			$row[9];
+		$i++;
+		}
+
+	$i=0;
+	while ($i < $talking_to_print)
+		{
+		$phone[$i]='          ';
+		if (eregi("Local/",$Sextension[$i])) 
 			{
-			$row[3]='';
-			$row[5]='- WAIT -';
-			$row[6]=$row[7];
+			$protocol = 'EXTERNAL';
+			$dialplan = eregi_replace('Local/',"",$Sextension[$i]);
+			$dialplan = eregi_replace("\@.*",'',$dialplan);
+			$exten = "dialplan_number='$dialplan'";
 			}
-		$extension[$i] = eregi_replace('Local/',"",$row[0]);
+		if (eregi('SIP/',$Sextension[$i])) 
+			{
+			$protocol = 'SIP';
+			$dialplan = eregi_replace('SIP/',"",$Sextension[$i]);
+			$dialplan = eregi_replace("-.*",'',$dialplan);
+			$exten = "extension='$dialplan'";
+			}
+		if (eregi('IAX2/',$Sextension[$i])) 
+			{
+			$protocol = 'IAX2';
+			$dialplan = eregi_replace('IAX2/',"",$Sextension[$i]);
+			$dialplan = eregi_replace("-.*",'',$dialplan);
+			$exten = "extension='$dialplan'";
+			}
+		if (eregi('Zap/',$Sextension[$i])) 
+			{
+			$protocol = 'Zap';
+			$dialplan = eregi_replace('Zap/',"",$Sextension[$i]);
+			$exten = "extension='$dialplan'";
+			}
+
+		$stmt="select login from phones where server_ip='" . mysql_real_escape_string($server_ip) . "' and $exten and protocol='$protocol';";
+		$rslt=mysql_query($stmt, $link);
+		$row=mysql_fetch_row($rslt);
+		$login = $row[0];
+
+		$phone[$i] =			sprintf("%-10s", $login);
+
+		if (eregi("READY|PAUSED|CLOSER",$Sstatus[$i]))
+			{
+			$Schannel[$i]='';
+			$Sstart_time[$i]='- WAIT -';
+			$Scall_time[$i]=$Sfinish_time[$i];
+			}
+		$extension[$i] = eregi_replace('Local/',"",$Sextension[$i]);
 		$extension[$i] =		sprintf("%-10s", $extension[$i]);
 			while(strlen($extension[$i])>10) {$extension[$i] = substr("$extension[$i]", 0, -1);}
-		$user[$i] =				sprintf("%-6s", $row[1]);
-		$sessionid[$i] =		sprintf("%-9s", $row[2]);
-		$channel[$i] =			sprintf("%-19s", $row[3]);
+		$user[$i] =				sprintf("%-6s", $Suser[$i]);
+		$sessionid[$i] =		sprintf("%-9s", $Ssessionid[$i]);
+		$channel[$i] =			sprintf("%-19s", $Schannel[$i]);
 			$cc[$i]=0;
 		while ( (strlen($channel[$i]) > 19) and ($cc[$i] < 100) )
 			{
@@ -177,8 +230,8 @@ $talking_to_print = mysql_num_rows($rslt);
 			$cc[$i]++;
 			if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
 			}
-		$status[$i] =			sprintf("%-6s", $row[4]);
-		$start_time[$i] =		sprintf("%-8s", $row[5]);
+		$status[$i] =			sprintf("%-6s", $Sstatus[$i]);
+		$start_time[$i] =		sprintf("%-8s", $Sstart_time[$i]);
 			$cd[$i]=0;
 		while ( (strlen($start_time[$i]) > 8) and ($cd[$i] < 100) )
 			{
@@ -186,10 +239,10 @@ $talking_to_print = mysql_num_rows($rslt);
 			$cd[$i]++;
 			if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
 			}
-		$uniqueid[$i] =			$row[8];
-		$lead_id[$i] =			$row[9];
-		$closer[$i] =			$row[1];
-		$call_time_S[$i] = ($STARTtime - $row[6]);
+		$uniqueid[$i] =			$Suniqueid[$i];
+		$lead_id[$i] =			$Slead_id[$i];
+		$closer[$i] =			$Suser[$i];
+		$call_time_S[$i] = ($STARTtime - $Scall_time[$i]);
 
 		$call_time_M[$i] = ($call_time_S[$i] / 60);
 		$call_time_M[$i] = round($call_time_M[$i], 2);
@@ -206,7 +259,7 @@ $talking_to_print = mysql_num_rows($rslt);
 			$G = '';		$EG = '';
 			if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
 			if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-			if (eregi("PAUSED",$row[4])) 
+			if (eregi("PAUSED",$Sstatus[$i])) 
 				{
 				if ($call_time_M_int >= 1) 
 					{$i++; continue;} 
@@ -214,7 +267,7 @@ $talking_to_print = mysql_num_rows($rslt);
 					{$G=''; $EG='';}
 				}
 			$agentcount++;
-			echo "| $G$extension[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG |\n";
+			echo "| $G$extension[$i]$EG | $G$phone[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG |\n";
 			}
 		$i++;
 		}
@@ -259,18 +312,18 @@ $talking_to_print = mysql_num_rows($rslt);
 		#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
 		#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
 
-			echo "| $G$extension[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG | $G$campaign$EG | $G$fronter$EG |\n";
+			echo "| $G$extension[$i]$EG | $G$phone[$i]$EG | $G$user[$i]$EG | $G$sessionid[$i]$EG | $G$channel[$i]$EG | $G$status[$i]$EG | $G$start_time[$i]$EG | $G$call_time_MS[$i]$EG | $G$campaign$EG | $G$fronter$EG |\n";
 
 			$i++;
 			}
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
+		echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
 		echo "  $i agents logged in on server $server_ip\n\n";
 	#	echo "             - 5 minutes or more on call\n";
 	#	echo "             - Over 10 minutes on call\n";
 		}
 	else
 		{
-		echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
+		echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
 		echo "  $agentcount agents logged in on server $server_ip\n\n";
 
 		echo "             - Paused agents\n";
diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php
index a773a47b..1fa03c97 100644
--- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php
+++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php
@@ -30,6 +30,7 @@
 # 71029-1900 - Changed CLOSER-type to not require campaign_id restriction
 # 80227-0418 - Added priority to waiting calls display
 # 80311-1550 - Added calls_today on all agents and wait time/in-group for inbound calls
+# 80422-0033 - Added phonediaplay option, allow for toggle-sorting on sortable fields
 #
 
 header ("Content-type: text/html; charset=utf-8");
@@ -71,7 +72,8 @@ if (isset($_GET["SERVdisplay"]))			{$SERVdisplay=$_GET["SERVdisplay"];}
 	elseif (isset($_POST["SERVdisplay"]))	{$SERVdisplay=$_POST["SERVdisplay"];}
 if (isset($_GET["CALLSdisplay"]))			{$CALLSdisplay=$_GET["CALLSdisplay"];}
 	elseif (isset($_POST["CALLSdisplay"]))	{$CALLSdisplay=$_POST["CALLSdisplay"];}
-
+if (isset($_GET["PHONEdisplay"]))			{$PHONEdisplay=$_GET["PHONEdisplay"];}
+	elseif (isset($_POST["PHONEdisplay"]))	{$PHONEdisplay=$_POST["PHONEdisplay"];}
 
 if (!isset($RR))			{$gRRroup=4;}
 if (!isset($group))			{$group='';}
@@ -81,7 +83,7 @@ if (!isset($UidORname))		{$UidORname=0;}	# 0=id, 1=name
 if (!isset($orderby))		{$orderby='timeup';}
 if (!isset($SERVdisplay))	{$SERVdisplay=1;}	# 0=no, 1=yes
 if (!isset($CALLSdisplay))	{$CALLSdisplay=1;}	# 0=no, 1=yes
-
+if (!isset($PHONEdisplay))	{$PHONEdisplay=0;}	# 0=no, 1=yes
 
 function get_server_load($windows = false) {
 $os = strtolower(PHP_OS);
@@ -245,7 +247,7 @@ $rslt=mysql_query($stmt, $link);
 	$campaign_allow_inbound = $row[0];
 
 echo "\n";
-echo"\n";
+echo"\n";
 echo "VICIDIAL: Time On VDAD Campaign: $group\n";
 echo "
\n"; echo "VICIDIAL Campaign: \n"; @@ -260,6 +262,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; echo "\n"; } echo "         \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; -echo "       MODIFY | \n"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; +if ($group == 'XXXX-ALL-ACTIVE-XXXX') + { + echo "       MODIFY | \n"; + } +else + { + echo "       MODIFY | \n"; + } echo "SUMMARY | \n"; echo "REPORTS \n"; echo "\n\n"; @@ -461,39 +471,47 @@ echo ""; if ($adastats<2) { - echo "+ VIEW MORE SETTINGS"; + echo "+ VIEW MORE SETTINGS"; } if ($UGdisplay>0) { - echo "       HIDE USER GROUP"; + echo "       HIDE USER GROUP"; } else { - echo "       VIEW USER GROUP"; + echo "       VIEW USER GROUP"; } if ($UidORname>0) { - echo "       SHOW AGENT ID"; + echo "       SHOW AGENT ID"; } else { - echo "       SHOW AGENT NAME"; + echo "       SHOW AGENT NAME"; } if ($SERVdisplay>0) { - echo "       HIDE SERVER INFO"; + echo "       HIDE SERVER INFO"; } else { - echo "       SHOW SERVER INFO"; + echo "       SHOW SERVER INFO"; } if ($CALLSdisplay>0) { - echo "       HIDE WAITING CALLS DETAIL"; + echo "       HIDE WAITING CALLS"; } else { - echo "       SHOW WAITING CALLS DETAIL"; + echo "       SHOW WAITING CALLS"; + } +if ($PHONEdisplay>0) + { + echo "       HIDE PHONES"; + } +else + { + echo "       SHOW PHONES"; } echo ""; echo ""; @@ -649,7 +667,7 @@ if ($p<1) {$Cecho='';} ################################################################################### -###### TIME ON SYSTEM +###### AGENT TIME ON SYSTEM ################################################################################### $agent_incall=0; @@ -657,6 +675,23 @@ $agent_ready=0; $agent_paused=0; $agent_total=0; +$phoneord=$orderby; +$userord=$orderby; +$groupord=$orderby; +$timeord=$orderby; +$campaignord=$orderby; + +if ($phoneord=='phoneup') {$phoneord='phonedown';} + else {$phoneord='phoneup';} +if ($userord=='userup') {$userord='userdown';} + else {$userord='userup';} +if ($groupord=='groupup') {$groupord='groupdown';} + else {$groupord='groupup';} +if ($timeord=='timeup') {$timeord='timedown';} + else {$timeord='timeup';} +if ($campaignord=='campaignup') {$campaignord='campaigndown';} + else {$campaignord='campaignup';} + $Aecho = ''; $Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group $NOW_TIME\n"; @@ -665,10 +700,12 @@ $HDbegin = "+"; $HTbegin = "|"; $HDstation = "------------+"; $HTstation = " STATION |"; +$HDphone = "------------+"; +$HTphone = " PHONE |"; $HDuser = "--------------------+"; -$HTuser = " USER |"; +$HTuser = " USER |"; $HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; +$HTusergroup = " USER GROUP |"; $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -680,12 +717,17 @@ $HTserver_ip = " SERVER IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVER IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; $HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; +$HTcampaign = " CAMPAIGN |"; $HDcalls = "-------+"; $HTcalls = " CALLS |"; +if ($PHONEdisplay < 1) + { + $HDphone = ''; + $HTphone = ''; + } if ($UGdisplay < 1) { $HDusergroup = ''; @@ -711,8 +753,8 @@ if ($SERVdisplay < 1) -$Aline = "$HDbegin$HDstation$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls\n"; -$Bline = "$HTbegin$HTstation$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\n"; +$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls\n"; +$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\n"; $Aecho .= "$Aline"; $Aecho .= "$Bline"; $Aecho .= "$Aline"; @@ -723,6 +765,8 @@ if ($orderby=='campaignup') {$orderSQL='vicidial_live_agents.campaign_id,vicidia if ($orderby=='campaigndown') {$orderSQL='vicidial_live_agents.campaign_id desc,vicidial_live_agents.status desc,last_call_time desc';} if ($orderby=='groupup') {$orderSQL='user_group,vicidial_live_agents.status,last_call_time';} if ($orderby=='groupdown') {$orderSQL='user_group desc,vicidial_live_agents.status desc,last_call_time desc';} +if ($orderby=='phoneup') {$orderSQL='extension,server_ip';} +if ($orderby=='phonedown') {$orderSQL='extension desc,server_ip desc';} if ($UidORname > 0) { if ($orderby=='userup') {$orderSQL='full_name,status,last_call_time';} @@ -740,7 +784,6 @@ if (strlen($usergroup)<1) {$usergroupSQL = '';} else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} $stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;"; - if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'"); @@ -793,6 +836,45 @@ $talking_to_print = mysql_num_rows($rslt); $extension = sprintf("%-40s", $extension); while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');} } + + if (eregi("Local/",$Aextension[$i])) + { + $protocol = 'EXTERNAL'; + $dialplan = eregi_replace('Local/',"",$Aextension[$i]); + $dialplan = eregi_replace("\@.*",'',$dialplan); + $exten = "dialplan_number='$dialplan'"; + } + if (eregi('SIP/',$Aextension[$i])) + { + $protocol = 'SIP'; + $dialplan = eregi_replace('SIP/',"",$Aextension[$i]); + $dialplan = eregi_replace("-.*",'',$dialplan); + $exten = "extension='$dialplan'"; + } + if (eregi('IAX2/',$Aextension[$i])) + { + $protocol = 'IAX2'; + $dialplan = eregi_replace('IAX2/',"",$Aextension[$i]); + $dialplan = eregi_replace("-.*",'',$dialplan); + $exten = "extension='$dialplan'"; + } + if (eregi('Zap/',$Aextension[$i])) + { + $protocol = 'Zap'; + $dialplan = eregi_replace('Zap/',"",$Aextension[$i]); + $exten = "extension='$dialplan'"; + } + + $stmt="select login from phones where server_ip='$Aserver_ip[$i]' and $exten and protocol='$protocol';"; + if ($non_latin > 0) + { + $rslt=mysql_query("SET NAMES 'UTF8'"); + } + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $login = $row[0]; + + $phone = sprintf("%-10s", $login); $Luser = $Auser[$i]; $user = sprintf("%-18s", $Auser[$i]); $Lsessionid = $Asessionid[$i]; @@ -905,6 +987,9 @@ $talking_to_print = mysql_num_rows($rslt); if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} else {$SVD = "";} + if ($PHONEdisplay > 0) {$phoneD = "$G$phone$EG | ";} + else {$phoneD = "";} + $vac_stage=''; $vac_campaign=''; $INGRP=''; @@ -931,7 +1016,7 @@ $talking_to_print = mysql_num_rows($rslt); $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + $Aecho .= "| $G$extension$EG |$phoneD $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; $i++; }