Added phone login to timeonVDAD reports

Added toggled sorting columns for timeonVDADall report
updated BASE INSTALL doc and vicidial.php comments

git-svn-id: svn://192.168.202.10@843 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2008-04-22 07:07:48 +00:00
parent b5374b63e4
commit 62d400adeb
6 changed files with 200 additions and 69 deletions
+3 -3
View File
@@ -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);}
@@ -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);}
+4 -3
View File
@@ -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
+1 -9
View File
@@ -3,14 +3,6 @@
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> 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);
+79 -26
View File
@@ -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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo"<META HTTP-EQUIV=Refresh CONTENT=\"4; URL=$PHP_SELF?server_ip=$server_ip&DB=$DB&reset_counter=$reset_counter&closer_display=$closer_display\">\n";
echo "<TITLE>VICIDIAL: Time On VDAD</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
echo "<PRE><FONT SIZE=3>";
echo "<PRE><FONT SIZE=2>";
###################################################################################
###### SERVER INFORMATION
@@ -137,15 +138,15 @@ echo "VICIDIAL: Agents Time On Calls $NOW_TIME <a href=\"$PHP_SELF?
if ($closer_display>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='<SPAN class="blue"><B>'; $EG='</B></SPAN>';}
if ($call_time_M_int[$i] >= 10) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
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='<SPAN class="yellow"><B>'; $EG='</B></SPAN>';}
}
$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='<SPAN class="blue"><B>'; $EG='</B></SPAN>';}
# if ($call_time_M_int[$i] >= 10) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
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 " <SPAN class=\"blue\"><B> </SPAN> - 5 minutes or more on call</B>\n";
# echo " <SPAN class=\"purple\"><B> </SPAN> - Over 10 minutes on call</B>\n";
}
else
{
echo "+------------|--------+-----------+---------------------+--------+----------+---------+\n";
echo "+------------+------------+--------+-----------+---------------------+--------+----------+---------+\n";
echo " $agentcount agents logged in on server $server_ip\n\n";
echo " <SPAN class=\"yellow\"><B> </SPAN> - Paused agents</B>\n";
+110 -25
View File
@@ -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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo"<META HTTP-EQUIV=Refresh CONTENT=\"$RR; URL=$PHP_SELF?RR=$RR&DB=$DB&group=$group&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\">\n";
echo"<META HTTP-EQUIV=Refresh CONTENT=\"$RR; URL=$PHP_SELF?RR=$RR&DB=$DB&group=$group&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\">\n";
echo "<TITLE>VICIDIAL: Time On VDAD Campaign: $group</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
echo "VICIDIAL Campaign: \n";
@@ -260,6 +262,7 @@ echo "<INPUT TYPE=HIDDEN NAME=UidORname VALUE=\"$UidORname\">\n";
echo "<INPUT TYPE=HIDDEN NAME=orderby VALUE=\"$orderby\">\n";
echo "<INPUT TYPE=HIDDEN NAME=SERVdisplay VALUE=\"$SERVdisplay\">\n";
echo "<INPUT TYPE=HIDDEN NAME=CALLSdisplay VALUE=\"$CALLSdisplay\">\n";
echo "<INPUT TYPE=HIDDEN NAME=PHONEdisplay VALUE=\"$PHONEdisplay\">\n";
echo "<SELECT SIZE=1 NAME=group>\n";
echo "<option value=\"XXXX-ALL-ACTIVE-XXXX\">ALL ACTIVE</option>\n";
$o=0;
@@ -284,10 +287,17 @@ if ($UGdisplay > 0)
echo "</SELECT>\n";
}
echo "<INPUT type=submit NAME=SUBMIT VALUE=SUBMIT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; \n";
echo "<a href=\"$PHP_SELF?group=$group&RR=4000&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\">STOP</a> | ";
echo "<a href=\"$PHP_SELF?group=$group&RR=40&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\">SLOW</a> | ";
echo "<a href=\"$PHP_SELF?group=$group&RR=4&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\">GO</a>";
echo " &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | \n";
echo "<a href=\"$PHP_SELF?group=$group&RR=4000&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\">STOP</a> | ";
echo "<a href=\"$PHP_SELF?group=$group&RR=40&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\">SLOW</a> | ";
echo "<a href=\"$PHP_SELF?group=$group&RR=4&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\">GO</a>";
if ($group == 'XXXX-ALL-ACTIVE-XXXX')
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=10\">MODIFY</a> | \n";
}
else
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | \n";
}
echo "<a href=\"./AST_timeonVDADallSUMMARY.php?group=$group&RR=$RR&DB=$DB&adastats=$adastats\">SUMMARY</a> | \n";
echo "<a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
echo "\n\n";
@@ -461,39 +471,47 @@ echo "<TD ALIGN=LEFT COLSPAN=8>";
if ($adastats<2)
{
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\"><font size=1>+ VIEW MORE SETTINGS</font></a>";
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\"><font size=1>+ VIEW MORE SETTINGS</font></a>";
}
if ($UGdisplay>0)
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=0&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\"><font size=1>HIDE USER GROUP</font></a>";
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=0&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\"><font size=1>HIDE USER GROUP</font></a>";
}
else
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=1&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\"><font size=1>VIEW USER GROUP</font></a>";
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=1&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\"><font size=1>VIEW USER GROUP</font></a>";
}
if ($UidORname>0)
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=0&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\"><font size=1>SHOW AGENT ID</font></a>";
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=0&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\"><font size=1>SHOW AGENT ID</font></a>";
}
else
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=1&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\"><font size=1>SHOW AGENT NAME</font></a>";
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=1&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\"><font size=1>SHOW AGENT NAME</font></a>";
}
if ($SERVdisplay>0)
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=0&CALLSdisplay=$CALLSdisplay\"><font size=1>HIDE SERVER INFO</font></a>";
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=0&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\"><font size=1>HIDE SERVER INFO</font></a>";
}
else
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=1&CALLSdisplay=$CALLSdisplay\"><font size=1>SHOW SERVER INFO</font></a>";
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=1&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\"><font size=1>SHOW SERVER INFO</font></a>";
}
if ($CALLSdisplay>0)
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0\"><font size=1>HIDE WAITING CALLS DETAIL</font></a>";
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0&PHONEdisplay=$PHONEdisplay\"><font size=1>HIDE WAITING CALLS</font></a>";
}
else
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1\"><font size=1>SHOW WAITING CALLS DETAIL</font></a>";
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1&PHONEdisplay=$PHONEdisplay\"><font size=1>SHOW WAITING CALLS</font></a>";
}
if ($PHONEdisplay>0)
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0&PHONEdisplay=0\"><font size=1>HIDE PHONES</font></a>";
}
else
{
echo " &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1&PHONEdisplay=1\"><font size=1>SHOW PHONES</font></a>";
}
echo "</TD>";
echo "</TR>";
@@ -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 = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$phoneord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\">PHONE</a> |";
$HDuser = "--------------------+";
$HTuser = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=userup&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\">USER</a> |";
$HTuser = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$userord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\">USER</a> |";
$HDusergroup = "--------------+";
$HTusergroup = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=groupup&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\">USER GROUP</a> |";
$HTusergroup = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$groupord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\">USER GROUP</a> |";
$HDsessionid = "------------------+";
$HTsessionid = " SESSIONID |";
$HDbarge = "-------+";
@@ -680,12 +717,17 @@ $HTserver_ip = " SERVER IP |";
$HDcall_server_ip = "-----------------+";
$HTcall_server_ip = " CALL SERVER IP |";
$HDtime = "---------+";
$HTtime = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=timeup&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\">MM:SS</a> |";
$HTtime = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$timeord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\">MM:SS</a> |";
$HDcampaign = "------------+";
$HTcampaign = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=campaignup&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay\">CAMPAIGN</a> |";
$HTcampaign = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$campaignord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay\">CAMPAIGN</a> |";
$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 | <a href=\"./user_status.php?user=$Luser\" target=\"_blank\">$G$user$EG</a> |$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 <a href=\"./user_status.php?user=$Luser\" target=\"_blank\">$G$user$EG</a> |$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++;
}