diff --git a/UPGRADE b/UPGRADE index 62803c3a..cc264fd4 100644 --- a/UPGRADE +++ b/UPGRADE @@ -206,6 +206,10 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom exten => 2345,2,AGI(agi-AGENT_dial_in.agi) exten => 2345,3,Hangup +46. Added pause codes display to the Real-time report as well as pause code + statistics to the agent performance detail report. Also added an option to + force agents to enter a pause code(this is a campaign option) + diff --git a/bin/AST_cleanup_agent_log.pl b/bin/AST_cleanup_agent_log.pl index 96772143..9fc0d3c6 100644 --- a/bin/AST_cleanup_agent_log.pl +++ b/bin/AST_cleanup_agent_log.pl @@ -13,12 +13,12 @@ # Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 # # CHANGES -# 60711-0945 - changed to DBI by Marin Blu -# 60715-2301 - changed to use /etc/astguiclient.conf for configs +# 60711-0945 - Changed to DBI by Marin Blu +# 60715-2301 - Changed to use /etc/astguiclient.conf for configs +# 81029-0124 - Added portion to clean up queue_log entries if QM enabled # # constants -$COUNTER_OUTPUT=1; # set to 1 to display the counter as the script runs $US='__'; $MT[0]=''; @@ -27,34 +27,62 @@ if (length($ARGV[0])>1) { $i=0; while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - $i++; - } + { + $args = "$args $ARGV[$i]"; + $i++; + } if ($args =~ /--help/i) - { - print "allowed run time options:\n [-t] = test\n [-debug] = verbose debug messages\n[-debugX] = Extra-verbose debug messages\n\n"; - } + { + print "allowed run time options:\n"; + print " [-no-time-restriction] = will clean up all logs, without flag will only do last hour\n"; + print " (without time flag will do logs from 150-10 minutes ago)\n"; + print " [-last-24hours] = will clean up logs for the last 24 hours only\n"; + print " [-more-than-24hours] = will clean up logs older than 24 hours only\n"; + print " [-q] = quiet, no output\n"; + print " [-t] = test\n"; + print " [-debug] = verbose debug messages\n"; + print " [-debugX] = Extra-verbose debug messages\n\n"; + exit; + } else - { + { + if ($args =~ /-q/i) + { + $Q=1; # quiet + } if ($args =~ /-debug/i) - { - $DB=1; # Debug flag - print "\n----- DEBUGGING -----\n\n"; - } + { + $DB=1; # Debug flag + if ($Q < 1) {print "\n----- DEBUGGING -----\n\n";} + } if ($args =~ /--debugX/i) - { - $DBX=1; - print "\n----- SUPER-DUPER DEBUGGING -----\n\n"; - } + { + $DBX=1; + if ($Q < 1) {print "\n----- SUPER-DUPER DEBUGGING -----\n\n";} + } if ($args =~ /-t/i) - { - $TEST=1; - $T=1; - print "\n----- TEST RUN, NO UPDATES -----\n\n"; + { + $TEST=1; + $T=1; + if ($Q < 1) {print "\n----- TEST RUN, NO UPDATES -----\n\n";} + } + if ($args =~ /-no-time-restriction/i) + { + $ALL_TIME=1; + if ($Q < 1) {print "\n----- NO TIME RESTRICTIONS -----\n\n";} + } + if ($args =~ /-last-24hours/i) + { + $TWENTYFOUR_HOURS=1; + if ($Q < 1) {print "\n----- LAST 24 HOURS ONLY -----\n\n";} + } + if ($args =~ /-more-than-24hours/i) + { + $TWENTYFOUR_OLDER=1; + if ($Q < 1) {print "\n----- LAST 24 HOURS ONLY -----\n\n";} + } } - } } else { @@ -62,6 +90,71 @@ else } ### end parsing run-time options ### +# define time restrictions for queries in script +$secX = time(); +$FDtarget = ($secX - 600); # 10 minutes in the past +($Fsec,$Fmin,$Fhour,$Fmday,$Fmon,$Fyear,$Fwday,$Fyday,$Fisdst) = localtime($FDtarget); +$Fyear = ($Fyear + 1900); +$Fmon++; +if ($Fmon < 10) {$Fmon = "0$Fmon";} +if ($Fmday < 10) {$Fmday = "0$Fmday";} +if ($Fhour < 10) {$Fhour = "0$Fhour";} +if ($Fmin < 10) {$Fmin = "0$Fmin";} +if ($Fsec < 10) {$Fsec = "0$Fsec";} + $FDSQLdate = "$Fyear-$Fmon-$Fmday $Fhour:$Fmin:$Fsec"; + +$TDtarget = ($secX - 9000); # 150 minutes in the past +($Tsec,$Tmin,$Thour,$Tmday,$Tmon,$Tyear,$Twday,$Tyday,$Tisdst) = localtime($TDtarget); +$Tyear = ($Tyear + 1900); +$Tmon++; +if ($Tmon < 10) {$Tmon = "0$Tmon";} +if ($Tmday < 10) {$Tmday = "0$Tmday";} +if ($Thour < 10) {$Thour = "0$Thour";} +if ($Tmin < 10) {$Tmin = "0$Tmin";} +if ($Tsec < 10) {$Tsec = "0$Tsec";} + $TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec"; + +$VDAD_SQL_time = "and event_time > \"$TDSQLdate\" and event_time < \"$FDSQLdate\""; +$QM_SQL_time = "and time_id > $TDtarget and time_id < $FDtarget"; + +if ($ALL_TIME > 0) + { + $VDAD_SQL_time = ""; + $QM_SQL_time = ""; + } +if ($TWENTYFOUR_HOURS > 0) + { + $TDtarget = ($secX - 86400); # 24 hours in the past + ($Tsec,$Tmin,$Thour,$Tmday,$Tmon,$Tyear,$Twday,$Tyday,$Tisdst) = localtime($TDtarget); + $Tyear = ($Tyear + 1900); + $Tmon++; + if ($Tmon < 10) {$Tmon = "0$Tmon";} + if ($Tmday < 10) {$Tmday = "0$Tmday";} + if ($Thour < 10) {$Thour = "0$Thour";} + if ($Tmin < 10) {$Tmin = "0$Tmin";} + if ($Tsec < 10) {$Tsec = "0$Tsec";} + $TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec"; + + $VDAD_SQL_time = "and event_time > \"$TDSQLdate\" and event_time < \"$FDSQLdate\""; + $QM_SQL_time = "and time_id > $TDtarget and time_id < $FDtarget"; + } +if ($TWENTYFOUR_OLDER > 0) + { + $TDtarget = ($secX - 86400); # 24 hours in the past + ($Tsec,$Tmin,$Thour,$Tmday,$Tmon,$Tyear,$Twday,$Tyday,$Tisdst) = localtime($TDtarget); + $Tyear = ($Tyear + 1900); + $Tmon++; + if ($Tmon < 10) {$Tmon = "0$Tmon";} + if ($Tmday < 10) {$Tmday = "0$Tmday";} + if ($Thour < 10) {$Thour = "0$Thour";} + if ($Tmin < 10) {$Tmin = "0$Tmin";} + if ($Tsec < 10) {$Tsec = "0$Tsec";} + $TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec"; + + $VDAD_SQL_time = "and event_time < \"$TDSQLdate\""; + $QM_SQL_time = "and time_id < $TDtarget"; + } + # default path to astguiclient configuration file: $PATHconf = '/etc/astguiclient.conf'; @@ -114,7 +207,7 @@ if (!$VARDB_port) {$VARDB_port='3306';} if ($DB) {print " - cleaning up pause time\n";} ### Grab any pause time record greater than 43999 - $stmtA = "SELECT agent_log_id,pause_epoch,wait_epoch from vicidial_agent_log where pause_sec>43999;"; + $stmtA = "SELECT agent_log_id,pause_epoch,wait_epoch from vicidial_agent_log where pause_sec>43999 $VDAD_SQL_time;"; if ($DBX) {print "$stmtA\n";} #$dbhA->query("$stmtA"); $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; @@ -158,7 +251,7 @@ if (!$VARDB_port) {$VARDB_port='3306';} if ($DBX) {print "\n\n";} if ($DB) {print " - cleaning up wait time\n";} ### Grab any pause time record greater than 43999 - $stmtA = "SELECT agent_log_id,wait_epoch,talk_epoch from vicidial_agent_log where wait_sec>43999;"; + $stmtA = "SELECT agent_log_id,wait_epoch,talk_epoch from vicidial_agent_log where wait_sec>43999 $VDAD_SQL_time;"; if ($DBX) {print "$stmtA\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; @@ -201,7 +294,7 @@ if (!$VARDB_port) {$VARDB_port='3306';} if ($DBX) {print "\n\n";} if ($DB) {print " - cleaning up talk time\n";} ### Grab any pause time record greater than 43999 - $stmtA = "SELECT agent_log_id,talk_epoch,dispo_epoch from vicidial_agent_log where talk_sec>43999;"; + $stmtA = "SELECT agent_log_id,talk_epoch,dispo_epoch from vicidial_agent_log where talk_sec>43999 $VDAD_SQL_time;"; if ($DBX) {print "$stmtA\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; @@ -244,7 +337,7 @@ if (!$VARDB_port) {$VARDB_port='3306';} if ($DBX) {print "\n\n";} if ($DB) {print " - cleaning up dispo time\n";} - $stmtA = "UPDATE vicidial_agent_log set dispo_sec='0' where dispo_sec>43999;"; + $stmtA = "UPDATE vicidial_agent_log set dispo_sec='0' where dispo_sec>43999 $VDAD_SQL_time;"; if($DBX){print STDERR "|$stmtA|\n";} if (!$TEST) { @@ -253,6 +346,233 @@ if (!$VARDB_port) {$VARDB_port='3306';} if ($DB) {print STDERR " Bad Dispo times zeroed out: $affected_rows\n";} + + + + + + +############################################# +##### START QUEUEMETRICS LOGGING LOOKUP ##### +$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend FROM system_settings;"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$rec_count=0; +while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $enable_queuemetrics_logging = "$aryA[0]"; + $queuemetrics_server_ip = "$aryA[1]"; + $queuemetrics_dbname = "$aryA[2]"; + $queuemetrics_login= "$aryA[3]"; + $queuemetrics_pass = "$aryA[4]"; + $queuemetrics_log_id = "$aryA[5]"; + $queuemetrics_eq_prepend = "$aryA[6]"; + $rec_count++; + } +$sthA->finish(); +##### END QUEUEMETRICS LOGGING LOOKUP ##### +########################################### +if ($enable_queuemetrics_logging > 0) + { + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $COMPLETEinsert=0; + $COMPLETEupdate=0; + $CONNECTinsert=0; + $noCONNECT=0; + $noCALLSTATUS=0; + ##### grab all queue_log entries for ENTERQUEUE verb to validate + $stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid FROM queue_log where verb='ENTERQUEUE' $QM_SQL_time order by time_id;"; + $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; + $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; + $EQ_records=$sthB->rows; + if ($DB) {print "ENTERQUEUE Records: $EQ_records|$stmtB|\n\n";} + $h=0; + while ($EQ_records > $h) + { + @aryB = $sthB->fetchrow_array; + $time_id[$h] = "$aryB[0]"; + $call_id[$h] = "$aryB[1]"; + $queue[$h] = "$aryB[2]"; + $agent[$h] = "$aryB[3]"; + $verb[$h] = "$aryB[4]"; + $serverid[$h] = "$aryB[5]"; + $h++; + } + $sthB->finish(); + + $h=0; + while ($EQ_records > $h) + { + ##### find the CONNECT details for calls that were sent to agents + $stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid,data1 FROM queue_log where verb='CONNECT' and call_id='$call_id[$h]' $QM_SQL_time;"; + $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; + $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; + $CQ_records=$sthB->rows; + if ($CQ_records > 0) + { + @aryB = $sthB->fetchrow_array; + $Ctime_id[$h] = "$aryB[0]"; + $Ccall_id[$h] = "$aryB[1]"; + $Cqueue[$h] = "$aryB[2]"; + $Cagent[$h] = "$aryB[3]"; + $Cverb[$h] = "$aryB[4]"; + $Cserverid[$h] = "$aryB[5]"; + $Cdata1[$h] = "$aryB[6]"; + } + $sthB->finish(); + + if ( ($CQ_records > 0) && ($Ctime_id[$h] > 1000) ) + { + ##### find the CALLSTATUS details for calls that were dispositioned by an agent + $stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid FROM queue_log where verb='CALLSTATUS' and call_id='$call_id[$h]' and agent='$Cagent[$h]';"; + $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; + $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; + $SQ_records=$sthB->rows; + if ($SQ_records > 0) + { + @aryB = $sthB->fetchrow_array; + $Stime_id[$h] = "$aryB[0]"; + $Scall_id[$h] = "$aryB[1]"; + $Squeue[$h] = "$aryB[2]"; + $Sagent[$h] = "$aryB[3]"; + $Sverb[$h] = "$aryB[4]"; + $Sserverid[$h] = "$aryB[5]"; + } + $sthB->finish(); + + if ( ($SQ_records > 0) && ($Stime_id[$h] > 1000) ) + { + ##### check if there is a COMPLETEAGENT or COMPLETECALLER record for this call_id + $stmtB = "SELECT count(*) FROM queue_log where verb IN('COMPLETEAGENT','COMPLETECALLER') and call_id='$call_id[$h]' and agent='$Cagent[$h]';"; + $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; + $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; + $MQ_records=$sthB->rows; + if ($MQ_records > 0) + { + @aryB = $sthB->fetchrow_array; + $COMPLETEcount[$h] = "$aryB[0]"; + } + $sthB->finish(); + if ($COMPLETEcount[$h] > 0) + { + ##### check that the queue is set properly + $stmtB = "SELECT count(*) FROM queue_log where verb IN('COMPLETEAGENT','COMPLETECALLER') and call_id='$call_id[$h]' and agent='$Cagent[$h]' and queue='$queue[$h]';"; + $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; + $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; + $QQ_records=$sthB->rows; + if ($QQ_records > 0) + { + @aryB = $sthB->fetchrow_array; + $COMPLETEqueue[$h] = "$aryB[0]"; + } + $sthB->finish(); + if ($COMPLETEqueue[$h] < 1) + { + $stmtB = "UPDATE queue_log SET queue='$queue[$h]' where verb IN('COMPLETEAGENT','COMPLETECALLER') and call_id='$call_id[$h]' and agent='$Cagent[$h]';"; + if (!$TEST) + { + $Baffected_rows = $dbhB->do($stmtB); + } + if ($DB) {print "MCRI: $affected_rows|$stmtB|\n";} + $COMPLETEupdate++; + } + } + else + { + ##### insert a COMPLETEAGENT record for this call into the queue_log + $CALLtime[$h] = ($Stime_id[$h] - $time_id[$h]); + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$Stime_id[$h]',call_id='$Scall_id[$h]',queue='$Squeue[$h]',agent='$Sagent[$h]',verb='COMPLETEAGENT',data1='$Cdata1[$h]',data2='$CALLtime[$h]',data3='1',serverid='$Sserverid[$h]';"; + if (!$TEST) + { + $Baffected_rows = $dbhB->do($stmtB); + } + if ($DB) {print "MCRI: $affected_rows|$stmtB|\n";} + $COMPLETEinsert++; + } + } + else + { + if ($DB) {print "NO CALLSTATUS: $Ctime_id[$h]|$Ccall_id[$h]|$Cagent[$h] \n";} + $noCALLSTATUS++; + ##### find the COMPLETE details for calls that were connected to an agent + $stmtB = "SELECT time_id,call_id,queue,agent,verb,serverid FROM queue_log where verb IN('COMPLETEAGENT','COMPLETECALLER') and call_id='$call_id[$h]' and agent='$Cagent[$h]';"; + $sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr; + $sthB->execute or die "executing: $stmtB ", $dbhB->errstr; + $SQ_records=$sthB->rows; + if ($SQ_records > 0) + { + @aryB = $sthB->fetchrow_array; + $Stime_id[$h] = "$aryB[0]"; + $Scall_id[$h] = "$aryB[1]"; + $Squeue[$h] = "$aryB[2]"; + $Sagent[$h] = "$aryB[3]"; + $Sverb[$h] = "$aryB[4]"; + $Sserverid[$h] = "$aryB[5]"; + } + $sthB->finish(); + + if ( ($SQ_records > 0) && ($Stime_id[$h] > 1000) ) + { + ##### insert a CALLSTATUS record for this call into the queue_log + $CALLtime[$h] = ($Stime_id[$h] - $time_id[$h]); + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$Stime_id[$h]',call_id='$Scall_id[$h]',queue='$Cqueue[$h]',agent='$Sagent[$h]',verb='CALLSTATUS',data1='PU',serverid='$Sserverid[$h]';"; + if (!$TEST) + { + $Baffected_rows = $dbhB->do($stmtB); + } + if ($DB) {print "MCSI: $affected_rows|$stmtB|\n";} + $CONNECTinsert++; + } + } + } + else + { + if ($DBX) {print "NO CONNECT: $time_id[$h]|$call_id[$h]|$queue[$h] \n";} + $noCONNECT++; + } + if ($DB) + { + ($Dsec,$Dmin,$Dhour,$Dmday,$Dmon,$Dyear,$Dwday,$Dyday,$Disdst) = localtime($time_id[$h]); + $Dyear = ($Dyear + 1900); + $Dmon++; + if ($Dmon < 10) {$Dmon = "0$Dmon";} + if ($Dmday < 10) {$Dmday = "0$Dmday";} + if ($Dhour < 10) {$Dhour = "0$Dhour";} + if ($Dmin < 10) {$Dmin = "0$Dmin";} + if ($Dsec < 10) {$Dsec = "0$Dsec";} + $DBSQLdate = "$Dyear-$Dmon-$Dmday $Dhour:$Dmin:$Dsec"; + + if ($h =~ /0$/) {$k='+';} + if ($h =~ /1$/) {$k='|';} + if ($h =~ /2$/) {$k='/';} + if ($h =~ /3$/) {$k='-';} + if ($h =~ /4$/) {$k="\\";} + if ($h =~ /5$/) {$k='|';} + if ($h =~ /6$/) {$k='/';} + if ($h =~ /7$/) {$k='-';} + if ($h =~ /8$/) {$k="\\";} + if ($h =~ /9$/) {$k='0';} + print STDERR "$k $noCONNECT $noCALLSTATUS $COMPLETEinsert|$COMPLETEupdate $CONNECTinsert $h/$EQ_records $DBSQLdate|$time_id[$h] $Ctime_id[$h]|$CQ_records $Stime_id[$h]|$SQ_records $call_id[$h]|$COMPLETEcount[$h]\r"; + } + $h++; + } + + + $dbhB->disconnect(); + } + + + + + + + if ($DB) {print STDERR "\nDONE\n";} diff --git a/bin/FastAGI_log.pl b/bin/FastAGI_log.pl index 5fbd4333..e3b932a6 100644 --- a/bin/FastAGI_log.pl +++ b/bin/FastAGI_log.pl @@ -43,6 +43,7 @@ # 80909-0843 - Added support for campaign-speccific DNC lists # 81021-0306 - Added Local channel logging support and while-to-if changes # 81026-1247 - Changed to allow for better remote agent calling +# 81029-0522 - Changed to disallow queue_log logging of IVR calls # @@ -693,7 +694,7 @@ sub process_request { $sthA->finish(); ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### - if ($enable_queuemetrics_logging > 0) + if ( ($enable_queuemetrics_logging > 0) && ($VD_status !~ /IVR/) ) { $VD_agent='NONE'; $secX = time(); diff --git a/docs/Inbound_VDAC_IVR.txt b/docs/Inbound_VDAC_IVR.txt index 9958eb7b..4a79215a 100644 --- a/docs/Inbound_VDAC_IVR.txt +++ b/docs/Inbound_VDAC_IVR.txt @@ -8,6 +8,8 @@ A log of the calls going into this agi-VDAD_inbound_calltime_check.agi script is The agi-VDAD_inbound_calltime_check.agi script can also be used to log the progression of a call through an IVR if you place it at major points in your IVR dialplan. The third field that you can define allows you to set a note or comment that is placed into the database when the call goes through that step. +Now included in the vicidial web directory is the AST_IVRstats.php report whish can show you the statistics on the progression of customers through an Asterisk dialplan-based IVR using tracking with this script. + The example below shows how to do a very simple IVR before sending to a queue asking if the caller wants English, Spanish, French or German language service. diff --git a/docs/QUEUEMETRICS.txt b/docs/QUEUEMETRICS.txt index 2689ca8f..c4ca9bf2 100644 --- a/docs/QUEUEMETRICS.txt +++ b/docs/QUEUEMETRICS.txt @@ -10,6 +10,7 @@ This feature was added to the package at the request of several users of VICIDIA This feature is functional on outbound manual dialing, auto dialing and inbound call handling as of 2008-06-30(SVN trunk 2.0.5). +as of 2008-10-30, several validation and correction functions were added to the AST_cleanup_agent_log.pl script that is supposed to run every hour. These functions should clean up any queue_log errors that appear and cause QueueMetrics to display incorrect call totals. Here is a short summary of the needed steps to install QueueMetrics on your system: diff --git a/docs/REQUIRED_APPS_INSTALL.txt b/docs/REQUIRED_APPS_INSTALL.txt index fd52401b..95459b53 100644 --- a/docs/REQUIRED_APPS_INSTALL.txt +++ b/docs/REQUIRED_APPS_INSTALL.txt @@ -24,6 +24,8 @@ make make install PATH=$PATH:$HOME/bin:/usr/local/mysql/bin/ export PATH +PATH=$PATH:$HOME/bin:/usr/local/mysql/include/mysql/ +export PATH cp /usr/local/mysql-5.0.67/libmysql/.libs/libmysqlclient.so /usr/lib/ cp /usr/local/mysql-5.0.67/libmysql/.libs/libmysqlclient.so.15 /usr/lib/ cd /usr/local/mysql-5.0.67 @@ -55,8 +57,8 @@ install Switch install Mail::Sendmail install Unicode::Map install Jcode -install Spreadsheet::WriteExcel install OLE::Storage_Lite +install Spreadsheet::WriteExcel install Proc::ProcessTable install IO::Scalar install Spreadsheet::ParseExcel diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 9fff8288..f14c3880 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -554,7 +554,7 @@ adaptive_dl_diff_target SMALLINT(3) default '0', concurrent_transfers ENUM('AUTO','1','2','3','4','5','6','7','8','9','10') default 'AUTO', auto_alt_dial ENUM('NONE','ALT_ONLY','ADDR3_ONLY','ALT_AND_ADDR3','ALT_AND_EXTENDED','ALT_AND_ADDR3_AND_EXTENDED','EXTENDED_ONLY') default 'NONE', auto_alt_dial_statuses VARCHAR(255) default ' B N NA DC -', -agent_pause_codes_active ENUM('Y','N') default 'N', +agent_pause_codes_active ENUM('Y','N','FORCE') default 'N', campaign_description VARCHAR(255), campaign_changedate DATETIME, campaign_stats_refresh ENUM('Y','N') default 'N', @@ -801,7 +801,8 @@ user_group VARCHAR(20), comments VARCHAR(20), sub_status VARCHAR(6), index (lead_id), -index (user) +index (user), +index (event_time) ); CREATE TABLE vicidial_scripts ( @@ -1344,7 +1345,7 @@ CREATE INDEX phone_number on vicidial_xfer_log (phone_number); CREATE INDEX phone_number on vicidial_closer_log (phone_number); CREATE INDEX date_user on vicidial_closer_log (call_date,user); -UPDATE system_settings SET db_schema_version='1113'; +UPDATE system_settings SET db_schema_version='1115'; GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/extras/upgrade_2.0.5.sql b/extras/upgrade_2.0.5.sql index 6354d427..f257884e 100644 --- a/extras/upgrade_2.0.5.sql +++ b/extras/upgrade_2.0.5.sql @@ -514,3 +514,11 @@ CREATE INDEX phone_number on vicidial_closer_log (phone_number); CREATE INDEX date_user on vicidial_closer_log (call_date,user); UPDATE system_settings SET db_schema_version='1113'; + +CREATE INDEX event_time on vicidial_agent_log (event_time); + +UPDATE system_settings SET db_schema_version='1114'; + +ALTER TABLE vicidial_campaigns MODIFY agent_pause_codes_active ENUM('Y','N','FORCE') default 'N'; + +UPDATE system_settings SET db_schema_version='1115'; diff --git a/translations/br_language.txt b/translations/br_language.txt index 81e43523..416fe502 100644 --- a/translations/br_language.txt +++ b/translations/br_language.txt @@ -356,7 +356,7 @@ VOICEMAIL|CAIXA POSTAL| OLD| VELHO| STOP|BATENTE| START|INICIAR| -Pause|Pausa| + Pause | Pausa | Resume|Início| Faster|Mais rápido| Slower|Mais devagar| diff --git a/translations/de_language.txt b/translations/de_language.txt index b70fbaea..1b83c87d 100644 --- a/translations/de_language.txt +++ b/translations/de_language.txt @@ -331,7 +331,7 @@ VOICEMAIL|VOICEMAIL| OLD| ALT| STOP|STOP| START|START| -Pause|Pause| + Pause | Pause | Resume|WiederAufnehmen| Faster|Schneller| Slower|Langsamer| diff --git a/translations/el_language.txt b/translations/el_language.txt index dd14b42b..f64f5255 100644 --- a/translations/el_language.txt +++ b/translations/el_language.txt @@ -356,7 +356,7 @@ VOICEMAIL|ΦΩΝ.ΤΑΧ.| OLD| ΠΑΛΑΙΟ| STOP|ΣΤΑΣΗ| START|ΕΝΑΡΞΗ| -Pause|Παύση| + Pause | Παύση | Resume|Επανάληψη| Faster|Γρηγορότερα| Slower|Πιό αργά| diff --git a/translations/es_language.txt b/translations/es_language.txt index e96ce3cc..df493891 100644 --- a/translations/es_language.txt +++ b/translations/es_language.txt @@ -358,7 +358,7 @@ VOICEMAIL|BUZÓN DE VOZ| OLD| VIEJO| STOP|PARADA| START|COMIENZO| -Pause|Pausa| + Pause | Pausa | Resume|Comienzo| Faster|Más rápido| Slower|Más lento| diff --git a/translations/fr_language.txt b/translations/fr_language.txt index f298c264..ec5407c2 100644 --- a/translations/fr_language.txt +++ b/translations/fr_language.txt @@ -358,7 +358,7 @@ VOICEMAIL|Boite Vocale| OLD| ANCIEN| STOP|ARRÊT| START|DEBUT| -Pause|Pause| + Pause | Pause | Resume|Résumé| Faster|Plus rapidement| Slower|Plus lentement| diff --git a/translations/it_language.txt b/translations/it_language.txt index 1ccce77a..c4ffa18f 100644 --- a/translations/it_language.txt +++ b/translations/it_language.txt @@ -358,7 +358,7 @@ VOICEMAIL|VOICEMAIL| OLD| VECCHIO| STOP|ARRESTO| START|INIZIO| -Pause|Pausa| + Pause | Pausa | Resume|Riprendi| Faster|Piu` veloce| Slower|Piu` lento| diff --git a/translations/pl_language.txt b/translations/pl_language.txt index 429c867e..629bb89b 100644 --- a/translations/pl_language.txt +++ b/translations/pl_language.txt @@ -358,7 +358,7 @@ VOICEMAIL|POCZTAGŁOSOWA| OLD| STARY| STOP|BATENTE| START|START| -Pause|Przerwa| + Pause | Przerwa | Resume|Ponów| Faster|Szybciej| Slower|Wolniej| diff --git a/translations/pt_language.txt b/translations/pt_language.txt index ce24a44a..f7ee04fa 100644 --- a/translations/pt_language.txt +++ b/translations/pt_language.txt @@ -358,7 +358,7 @@ VOICEMAIL|VOICEMAIL| OLD| VELHO| STOP|BATENTE| START|COMEÇO| -Pause|Pausa| + Pause | Pausa | Resume|Resumo| Faster|Mais rapidamente| Slower|Mais lento| diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt index 8b951c74..faad4270 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt @@ -333,6 +333,7 @@ To disable the On Hold Prompt, set the interval to 0|| 3-Way Call Outbound CallerID -<\/B> This defines what is sent out as the outbound callerID number from 3-way calls placed by the agent, CAMPAIGN uses the custom campaign callerID, CUSTOMER uses the number of the customer that is active on the agents screen and AGENT_PHONE uses the callerID for the phone that the agent is logged into|| 3-Way Call Outbound CallerID:|| INBOUND_MAN allows the agent to place manual dial calls from a campaign list while being able to take inbound calls between manual dial calls|| +FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button|| ############################################################ CLIENT diff --git a/translations/sk_language.txt b/translations/sk_language.txt index e70c75fd..75a62975 100644 --- a/translations/sk_language.txt +++ b/translations/sk_language.txt @@ -358,7 +358,7 @@ VOICEMAIL|HLASOVÁ SCHRÁNKA| OLD| STARÁ| STOP|ZASTAVIŤ| START|SPUSTIŤ| -Pause|Pauza| + Pause | Pauza | Resume|Pokračovať| Faster|Rýchlejšie| Slower|Pomalšie| diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 006c65df..81d2a724 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -2370,7 +2370,7 @@ if ($ACTION == 'VDADcheckINCOMING') ### if web form is set then send on to vicidial.php for override of WEB_FORM address if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -3113,7 +3113,7 @@ if ($ACTION == 'PauseCodeSubmit') } } } -echo "Pause Code has been updated to $status for $agent_log_id\n"; +echo " Pause Code has been updated to $status for $agent_log_id\n"; } diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index e33b3f41..50636ec9 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -200,10 +200,11 @@ # 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available # 81020-1501 - Fixed bugs in queue_log logging # 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes +# 81030-0403 - Added option to force Pause Codes on PAUSE # -$version = '2.0.5-179'; -$build = '81023-0411'; +$version = '2.0.5-180'; +$build = '81030-0403'; require("dbconnect.php"); @@ -877,7 +878,7 @@ $VDloginDISPLAY=0; $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); $closer_campaigns = "'$closer_campaigns'"; - if ($agent_pause_codes_active=='Y') + if ( (ereg('Y',$agent_pause_codes_active)) or (ereg('FORCE',$agent_pause_codes_active)) ) { ##### grab the pause codes for this campaign $stmt="SELECT pause_code,pause_code_name FROM vicidial_pause_codes WHERE campaign_id='$VD_campaign' order by pause_code limit 50;"; @@ -2029,9 +2030,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var conf_dialed = 0; var leaving_threeway = 0; var dial_method = ''; - var DiaLControl_auto_HTML = "\"Pause\"\"Resume\""; - var DiaLControl_auto_HTML_ready = "\"Pause\"\"Resume\""; - var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Resume\""; + var DiaLControl_auto_HTML = "\"\"Resume\""; + var DiaLControl_auto_HTML_ready = "\"\"Resume\""; + var DiaLControl_auto_HTML_OFF = "\"\"Resume\""; var DiaLControl_manual_HTML = "\"Dial"; var image_blank = new Image(); image_blank.src="./images/blank.gif"; @@ -3628,7 +3629,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} AutoDial_ReSume_PauSe('VDADpause'); - document.getElementById("DiaLControl").innerHTML = "\"Pause\"\"Resume\"
\"Dial"; + document.getElementById("DiaLControl").innerHTML = "\"\"Resume\"
\"Dial"; } else { @@ -3714,7 +3715,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { auto_dial_level=starting_dial_level; - document.getElementById("DiaLControl").innerHTML = "\"Pause\"\"Resume\"
\"Dial"; + document.getElementById("DiaLControl").innerHTML = "\"\"Resume\"
\"Dial"; } else { @@ -3928,7 +3929,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { auto_dial_level=starting_dial_level; - document.getElementById("DiaLControl").innerHTML = "\"Pause\"\"Resume\"
\"Dial"; + document.getElementById("DiaLControl").innerHTML = "\"\"Resume\"
\"Dial"; } else { @@ -4017,7 +4018,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"Pause\"\"Resume\"
\"Dial"; + document.getElementById("DiaLControl").innerHTML = "\"\"Resume\"
\"Dial"; } else { @@ -4199,7 +4200,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { auto_dial_level=starting_dial_level; - document.getElementById("DiaLControl").innerHTML = "\"Pause\"\"Resume\"
\"Dial"; + document.getElementById("DiaLControl").innerHTML = "\"\"Resume\"
\"Dial"; } else { @@ -4215,12 +4216,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { auto_dial_level=starting_dial_level; - document.getElementById("DiaLControl").innerHTML = "\"Pause\"\"Resume\"
\"Dial"; + document.getElementById("DiaLControl").innerHTML = "\"\"Resume\"
\"Dial"; } else { document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } + + if (agent_pause_codes_active=='FORCE') + { + PauseCodeSelectContent_create(); + } } var xmlhttp=false; @@ -4601,7 +4607,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"Pause\"\"Resume\"
\"Dial"; + document.getElementById("DiaLControl").innerHTML = "\"\"Resume\"
\"Dial"; } else { @@ -5070,7 +5076,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").innerHTML = ''; if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"Pause\"\"Resume\"
\"Dial"; + document.getElementById("DiaLControl").innerHTML = "\"\"Resume\"
\"Dial"; } else { @@ -5086,7 +5092,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"Pause\"\"Resume\"
\"Dial"; + document.getElementById("DiaLControl").innerHTML = "\"\"Resume\"
\"Dial"; } else { @@ -5362,7 +5368,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (loop_ct == VD_pause_codes_ct_half) {PauseCode_HTML = PauseCode_HTML + "";} } - PauseCode_HTML = PauseCode_HTML + "

Go Back"; + + if (agent_pause_codes_active=='FORCE') + {var Go_BacK_LinK = '';} + else + {var Go_BacK_LinK = "Go Back";} + + PauseCode_HTML = PauseCode_HTML + "

" + Go_BacK_LinK; document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML; } } @@ -6590,7 +6602,7 @@ else document.vicidial_form.LeadLookuP.checked=true; - if (agent_pause_codes_active=='Y') + if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') ) { document.getElementById("PauseCodeLinkSpan").innerHTML = "ENTER A PAUSE CODE"; } @@ -7174,7 +7186,7 @@ else { if (dial_method == "INBOUND_MAN") { - document.getElementById("DiaLControl").innerHTML = "\"Pause\"\"Resume\"
\"Dial"; + document.getElementById("DiaLControl").innerHTML = "\"\"Resume\"
\"Dial"; if (manual_dial_preview == 1) {buildDiv('DiaLLeaDPrevieW');} } diff --git a/www/vicidial/AST_CLOSERstats.php b/www/vicidial/AST_CLOSERstats.php index e4bd1f95..1758ac65 100644 --- a/www/vicidial/AST_CLOSERstats.php +++ b/www/vicidial/AST_CLOSERstats.php @@ -104,6 +104,7 @@ while($i < $group_ct) { $group_string .= "$group[$i]|"; $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -177,7 +178,11 @@ echo "\n"; echo "\n"; -echo "           MODIFY | REPORTS \n"; +echo "           "; +echo "MODIFY | "; +echo "REPORTS | "; +echo "IVR REPORT \n"; +echo "\n"; echo "\n"; echo "\n"; @@ -301,6 +306,11 @@ $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE');"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$rowy=mysql_fetch_row($rslt); + $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -317,9 +327,21 @@ else $average_call_seconds = round($average_call_seconds, 0); $average_call_seconds = sprintf("%10s", $average_call_seconds); } +$ANSWEREDcalls = sprintf("%10s", $rowy[0]); +if ( ($rowy[0] < 1) or ($ANSWEREDcalls < 1) ) + {$average_answer_seconds = ' 0';} +else + { + $average_answer_seconds = ($rowy[1] / $rowy[0]); + $average_answer_seconds = round($average_answer_seconds, 2); + $average_answer_seconds = sprintf("%10s", $average_answer_seconds); + } + echo "Total calls taken in to this In-Group: $TOTALcalls\n"; echo "Average Call Length for all Calls: $average_call_seconds seconds\n"; +echo "Answered Calls: $ANSWEREDcalls\n"; +echo "Average queue time for Answered Calls: $average_answer_seconds seconds\n"; echo "Calls taken into the IVR for this In-Group: $IVRcalls\n"; echo "\n"; @@ -435,7 +457,7 @@ echo "Average QUEUE Length across all calls: $average_total_queue_seconds ############################## -######### CALL HOLD TIME BREAKDONW IN SECONDS +######### CALL HOLD TIME BREAKDOWN IN SECONDS $TOTALcalls = 0; @@ -497,6 +519,132 @@ echo "+------------------------------------------------------------------------- +############################## +######### CALL ANSWERED TIME BREAKDOWN IN SECONDS + +$BDansweredCALLS = 0; + +echo "\n"; +echo "---------- CALL ANSWERED TIME BREAKDOWN IN SECONDS\n"; +echo "+-------------------------------------------------------------------------------------------+------------+\n"; +echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +echo "+-------------------------------------------------------------------------------------------+------------+\n"; + +$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE') group by queue_seconds;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$reasons_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $reasons_to_print) + { + $row=mysql_fetch_row($rslt); + + $BDansweredCALLS = ($BDansweredCALLS + $row[0]); + + if ($row[1] == 0) {$ad_0 = ($ad_0 + $row[0]);} + if ( ($row[1] > 0) and ($row{1} <= 5) ) {$ad_5 = ($ad_5 + $row[0]);} + if ( ($row[1] > 5) and ($row{1} <= 10) ) {$ad10 = ($ad10 + $row[0]);} + if ( ($row[1] > 10) and ($row{1} <= 15) ) {$ad15 = ($ad15 + $row[0]);} + if ( ($row[1] > 15) and ($row{1} <= 20) ) {$ad20 = ($ad20 + $row[0]);} + if ( ($row[1] > 20) and ($row{1} <= 25) ) {$ad25 = ($ad25 + $row[0]);} + if ( ($row[1] > 25) and ($row{1} <= 30) ) {$ad30 = ($ad30 + $row[0]);} + if ( ($row[1] > 30) and ($row{1} <= 35) ) {$ad35 = ($ad35 + $row[0]);} + if ( ($row[1] > 35) and ($row{1} <= 40) ) {$ad40 = ($ad40 + $row[0]);} + if ( ($row[1] > 40) and ($row{1} <= 45) ) {$ad45 = ($ad45 + $row[0]);} + if ( ($row[1] > 45) and ($row{1} <= 50) ) {$ad50 = ($ad50 + $row[0]);} + if ( ($row[1] > 50) and ($row{1} <= 55) ) {$ad55 = ($ad55 + $row[0]);} + if ( ($row[1] > 55) and ($row{1} <= 60) ) {$ad60 = ($ad60 + $row[0]);} + if ( ($row[1] > 60) and ($row{1} <= 90) ) {$ad90 = ($ad90 + $row[0]);} + if ($row[1] > 90) {$ad99 = ($ad99 + $row[0]);} + $i++; + } + +$ad_0 = sprintf("%5s", $ad_0); +$ad_5 = sprintf("%5s", $ad_5); +$ad10 = sprintf("%5s", $ad10); +$ad15 = sprintf("%5s", $ad15); +$ad20 = sprintf("%5s", $ad20); +$ad25 = sprintf("%5s", $ad25); +$ad30 = sprintf("%5s", $ad30); +$ad35 = sprintf("%5s", $ad35); +$ad40 = sprintf("%5s", $ad40); +$ad45 = sprintf("%5s", $ad45); +$ad50 = sprintf("%5s", $ad50); +$ad55 = sprintf("%5s", $ad55); +$ad60 = sprintf("%5s", $ad60); +$ad90 = sprintf("%5s", $ad90); +$ad99 = sprintf("%5s", $ad99); + +$BDansweredCALLS = sprintf("%10s", $BDansweredCALLS); + +echo "| $ad_0 $ad_5 $ad10 $ad15 $ad20 $ad25 $ad30 $ad35 $ad40 $ad45 $ad50 $ad55 $ad60 $ad90 $ad99 | $BDansweredCALLS |\n"; +echo "+-------------------------------------------------------------------------------------------+------------+\n"; + + +############################## +######### CALL DROP TIME BREAKDOWN IN SECONDS + +$BDdropCALLS = 0; + +echo "\n"; +echo "---------- CALL DROP TIME BREAKDOWN IN SECONDS\n"; +echo "+-------------------------------------------------------------------------------------------+------------+\n"; +echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n"; +echo "+-------------------------------------------------------------------------------------------+------------+\n"; + +$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$reasons_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $reasons_to_print) + { + $row=mysql_fetch_row($rslt); + + $BDdropCALLS = ($BDdropCALLS + $row[0]); + + if ($row[1] == 0) {$dd_0 = ($dd_0 + $row[0]);} + if ( ($row[1] > 0) and ($row{1} <= 5) ) {$dd_5 = ($dd_5 + $row[0]);} + if ( ($row[1] > 5) and ($row{1} <= 10) ) {$dd10 = ($dd10 + $row[0]);} + if ( ($row[1] > 10) and ($row{1} <= 15) ) {$dd15 = ($dd15 + $row[0]);} + if ( ($row[1] > 15) and ($row{1} <= 20) ) {$dd20 = ($dd20 + $row[0]);} + if ( ($row[1] > 20) and ($row{1} <= 25) ) {$dd25 = ($dd25 + $row[0]);} + if ( ($row[1] > 25) and ($row{1} <= 30) ) {$dd30 = ($dd30 + $row[0]);} + if ( ($row[1] > 30) and ($row{1} <= 35) ) {$dd35 = ($dd35 + $row[0]);} + if ( ($row[1] > 35) and ($row{1} <= 40) ) {$dd40 = ($dd40 + $row[0]);} + if ( ($row[1] > 40) and ($row{1} <= 45) ) {$dd45 = ($dd45 + $row[0]);} + if ( ($row[1] > 45) and ($row{1} <= 50) ) {$dd50 = ($dd50 + $row[0]);} + if ( ($row[1] > 50) and ($row{1} <= 55) ) {$dd55 = ($dd55 + $row[0]);} + if ( ($row[1] > 55) and ($row{1} <= 60) ) {$dd60 = ($dd60 + $row[0]);} + if ( ($row[1] > 60) and ($row{1} <= 90) ) {$dd90 = ($dd90 + $row[0]);} + if ($row[1] > 90) {$dd99 = ($dd99 + $row[0]);} + $i++; + } + +$dd_0 = sprintf("%5s", $dd_0); +$dd_5 = sprintf("%5s", $dd_5); +$dd10 = sprintf("%5s", $dd10); +$dd15 = sprintf("%5s", $dd15); +$dd20 = sprintf("%5s", $dd20); +$dd25 = sprintf("%5s", $dd25); +$dd30 = sprintf("%5s", $dd30); +$dd35 = sprintf("%5s", $dd35); +$dd40 = sprintf("%5s", $dd40); +$dd45 = sprintf("%5s", $dd45); +$dd50 = sprintf("%5s", $dd50); +$dd55 = sprintf("%5s", $dd55); +$dd60 = sprintf("%5s", $dd60); +$dd90 = sprintf("%5s", $dd90); +$dd99 = sprintf("%5s", $dd99); + +$BDdropCALLS = sprintf("%10s", $BDdropCALLS); + +echo "| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n"; +echo "+-------------------------------------------------------------------------------------------+------------+\n"; + + + + ############################## ######### CALL HANGUP REASON STATS @@ -758,6 +906,7 @@ while ($i < $users_to_print) $USERtotTALK_S = round($USERtotTALK_S, 0); if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";} $USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S"; + $USERtotTALK_MS = eregi_replace('-','',$USERtotTALK_MS); $USERtotTALK_MS = sprintf("%8s", $USERtotTALK_MS); $USERavgTALK_M = ($USERavgTALK / 60); @@ -768,6 +917,7 @@ while ($i < $users_to_print) $USERavgTALK_S = round($USERavgTALK_S, 0); if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";} $USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S"; + $USERavgTALK_MS = eregi_replace('-','',$USERavgTALK_MS); $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; @@ -775,18 +925,21 @@ while ($i < $users_to_print) $i++; } -if (!$TOTcalls) {$TOTcalls = 1;} -$TOTavg = ($TOTtime / $TOTcalls); -$TOTavg = round($TOTavg, 0); -$TOTavg_M = ($TOTavg / 60); -$TOTavg_M_int = round($TOTavg_M, 2); -$TOTavg_M_int = intval("$TOTavg_M_int"); -$TOTavg_S = ($TOTavg_M - $TOTavg_M_int); -$TOTavg_S = ($TOTavg_S * 60); -$TOTavg_S = round($TOTavg_S, 0); -if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";} -$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S"; -$TOTavg = sprintf("%6s", $TOTavg_MS); +if ($TOTcalls < 1) {$TOTcalls = 0; $TOTavg=0;} +else + { + $TOTavg = ($TOTtime / $TOTcalls); + $TOTavg = round($TOTavg, 0); + $TOTavg_M = ($TOTavg / 60); + $TOTavg_M_int = round($TOTavg_M, 2); + $TOTavg_M_int = intval("$TOTavg_M_int"); + $TOTavg_S = ($TOTavg_M - $TOTavg_M_int); + $TOTavg_S = ($TOTavg_S * 60); + $TOTavg_S = round($TOTavg_S, 0); + if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";} + $TOTavg_MS = "$TOTavg_M_int:$TOTavg_S"; + $TOTavg = sprintf("%6s", $TOTavg_MS); + } $TOTtime_M = ($TOTtime / 60); $TOTtime_M_int = round($TOTtime_M, 2); diff --git a/www/vicidial/AST_IVRfilter.php b/www/vicidial/AST_IVRfilter.php new file mode 100644 index 00000000..867ea1a0 --- /dev/null +++ b/www/vicidial/AST_IVRfilter.php @@ -0,0 +1,239 @@ + LICENSE: AGPLv2 +# +# CHANGES +# +# 81030-0432 - First build +# + +require("dbconnect.php"); + +$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; +$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} + elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} + +$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$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_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$STARTtime = date("U"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($end_date)) {$end_date = $NOW_DATE;} + +$i=0; + +?> + + + + + +\n"; +echo "VICIDIAL: VDL IVR Filter Stats\n"; +echo "
\n"; +echo "\n"; +echo "
\n"; +echo "\n"; +echo "Date Range:
\n"; +echo "\n"; +echo " to \n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "           "; +echo "ADMIN | "; +echo "REPORTS\n"; +echo "\n"; + +echo "
\n"; + +echo "   \n"; +echo "
\n"; +echo "
\n\n"; + +echo "
\n\n";
+
+$shift = 'ALL';
+
+if ($shift == 'AM') 
+	{
+	$time_BEGIN=$AM_shift_BEGIN;
+	$time_END=$AM_shift_END;
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}   
+	if (strlen($time_END) < 6) {$time_END = "15:15:00";}
+	}
+if ($shift == 'PM') 
+	{
+	$time_BEGIN=$PM_shift_BEGIN;
+	$time_END=$PM_shift_END;
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
+	if (strlen($time_END) < 6) {$time_END = "23:15:00";}
+	}
+if ($shift == 'ALL') 
+	{
+	if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
+	if (strlen($time_END) < 6) {$time_END = "23:59:59";}
+	}
+$query_date_BEGIN = "$query_date $time_BEGIN";   
+$query_date_END = "$end_date $time_END";
+
+
+
+echo "VDL: IVR Filter Stats:           $NOW_TIME\n";
+
+
+echo "\n";
+echo "+----------------------+---------+---------+---------+\n";
+echo "| CATEGORY             | CALLS   | UNIQUE  |      %  |\n";
+echo "+----------------------+---------+---------+---------+\n";
+
+
+$stmtA="select count(*),count(distinct caller_id) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='CLEAN';";
+$rsltA=mysql_query($stmtA, $link);
+if ($DB) {echo "$stmtA\n";}
+$rowA=mysql_fetch_row($rsltA);
+
+$stmtB="select count(*),count(distinct caller_id) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='NOT_FOUND';";
+$rsltB=mysql_query($stmtB, $link);
+if ($DB) {echo "$stmtB\n";}
+$rowB=mysql_fetch_row($rsltB);
+
+$stmtC="select count(*),count(distinct caller_id) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='DNC';";
+$rsltC=mysql_query($stmtC, $link);
+if ($DB) {echo "$stmtC\n";}
+$rowC=mysql_fetch_row($rsltC);
+
+$stmtD="select count(*),count(distinct caller_id) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='SALE';";
+$rsltD=mysql_query($stmtD, $link);
+if ($DB) {echo "$stmtD\n";}
+$rowD=mysql_fetch_row($rsltD);
+
+$stmtE="select count(*),count(distinct caller_id) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='INBOUND_IVR_FILTER' and comment_b='EXISTING' and comment_c='ARCHIVE';";
+$rsltE=mysql_query($stmtE, $link);
+if ($DB) {echo "$stmtE\n";}
+$rowE=mysql_fetch_row($rsltE);
+
+
+$total = ($rowA[0] + $rowB[0] + $rowC[0] + $rowD[0] + $rowE[0]);
+$Utotal = ($rowA[1] + $rowB[1] + $rowC[1] + $rowD[1] + $rowE[1]);
+
+$agent =	sprintf("%7s", $rowA[0]);
+$Uagent =	sprintf("%7s", $rowA[1]);
+if ( ($Utotal < 1) or ($rowA[1] < 1) )
+	{$UagentPERCENT = '0';}
+else
+	{$UagentPERCENT = (($rowA[1] / $Utotal) * 100);   $UagentPERCENT = round($UagentPERCENT, 2);}
+$UagentPERCENT =	sprintf("%6s", $UagentPERCENT);
+
+$ntfnd =	sprintf("%7s", $rowB[0]);
+$Untfnd =	sprintf("%7s", $rowB[1]);
+if ( ($Utotal < 1) or ($rowB[1] < 1) )
+	{$UntfndPERCENT = '0';}
+else
+	{$UntfndPERCENT = (($rowB[1] / $Utotal) * 100);   $UntfndPERCENT = round($UntfndPERCENT, 2);}
+$UntfndPERCENT =	sprintf("%6s", $UntfndPERCENT);
+
+$prdnc =	sprintf("%7s", $rowC[0]);
+$Uprdnc =	sprintf("%7s", $rowC[1]);
+if ( ($Utotal < 1) or ($rowC[1] < 1) )
+	{$UprdncPERCENT = '0';}
+else
+	{$UprdncPERCENT = (($rowC[1] / $Utotal) * 100);   $UprdncPERCENT = round($UprdncPERCENT, 2);}
+$UprdncPERCENT =	sprintf("%6s", $UprdncPERCENT);
+
+$psale =	sprintf("%7s", $rowD[0]);
+$Upsale =	sprintf("%7s", $rowD[1]);
+if ( ($Utotal < 1) or ($rowD[1] < 1) )
+	{$UpsalePERCENT = '0';}
+else
+	{$UpsalePERCENT = (($rowD[1] / $Utotal) * 100);   $UpsalePERCENT = round($UpsalePERCENT, 2);}
+$UpsalePERCENT =	sprintf("%6s", $UpsalePERCENT);
+
+$archv =	sprintf("%7s", $rowD[0]);
+$Uarchv =	sprintf("%7s", $rowD[1]);
+if ( ($Utotal < 1) or ($rowD[1] < 1) )
+	{$UarchvPERCENT = '0';}
+else
+	{$UarchvPERCENT = (($rowD[1] / $Utotal) * 100);   $UarchvPERCENT = round($UarchvPERCENT, 2);}
+$UarchvPERCENT =	sprintf("%6s", $UarchvPERCENT);
+
+$total =	sprintf("%7s", $total);
+$Utotal =	sprintf("%7s", $Utotal);
+
+
+echo "| CALL SENT TO AGENT   | $agent | $Uagent | $UagentPERCENT% |\n";
+echo "| CALLERID NOT FOUND   | $ntfnd | $Untfnd | $UntfndPERCENT% |\n";
+echo "| PREVIOUS DNC         | $prdnc | $Uprdnc | $UprdncPERCENT% |\n";
+echo "| PREVIOUS SALE        | $psale | $Upsale | $UpsalePERCENT% |\n";
+echo "| ARCHIVE ONLY         | $archv | $Uarchv | $UarchvPERCENT% |\n";
+echo "+----------------------+---------+---------+---------+\n";
+echo "|               TOTALS:| $total | $Utotal |\n";
+echo "+----------------------+---------+---------+\n";
+
+
+
+
+$ENDtime = date("U");
+$RUNtime = ($ENDtime - $STARTtime);
+echo "\nRun Time: $RUNtime seconds\n";
+
+
+
+
+?>
+
+ + diff --git a/www/vicidial/AST_IVRstats.php b/www/vicidial/AST_IVRstats.php index 39a51cf3..f04b4449 100644 --- a/www/vicidial/AST_IVRstats.php +++ b/www/vicidial/AST_IVRstats.php @@ -94,6 +94,7 @@ while($i < $group_ct) { $group_string .= "$group[$i]|"; $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; $i++; } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) @@ -167,7 +168,11 @@ echo "\n"; echo "\n"; -echo "           MODIFY | REPORTS \n"; +echo "           "; +echo "MODIFY | "; +echo "REPORTS | "; +echo "CLOSER REPORT \n"; +echo "\n"; echo "\n"; echo "\n"; @@ -336,18 +341,56 @@ while ($s < $p) ### put call flows and counts together for sorting again $s=0; + +echo "+--------+--------+--------+--------+\n"; +echo "| IVR | QUEUE | QDROP | QDROP% | CALL PATH\n"; +echo "+--------+--------+--------+--------+------------\n"; + while ($s < $p) { + $vcl_statuses = $MT; + $FLOWdrop[$s]=0; + $FLOWtotal[$s]=0; + $FLOWdropPCT[$s]=0; $FLOWsummary = explode('__________',$FLOWunique_calls[$s]); $FLOWsummary[0] = ($FLOWsummary[0] + 0); $FLOWunique_calls_list[$s] = preg_replace("/,$/","",$FLOWunique_calls_list[$s]); - echo "$FLOWsummary[0]|$FLOWsummary[1]|$FLOWunique_calls_list[$s]\n"; + + ##### Grab all records for the IVR for the specified time period + $stmt="select status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vcl_statuses_to_print = mysql_num_rows($rslt); + $w=0; + while ($w < $vcl_statuses_to_print) + { + $row=mysql_fetch_row($rslt); + $vcl_statuses[$w] = $row[0]; + if (ereg("DROP",$vcl_statuses[$w])) + {$FLOWdrop[$s]++;} + $FLOWtotal[$s]++; + $w++; + } + if ( ($FLOWtotal[$s] > 0) and ($FLOWdrop[$s] > 0) ) + { + $FLOWdropPCT[$s] = ( ($FLOWdrop[$s] / $FLOWtotal[$s]) * 100); + $FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2); + } + $FLOWsummary[0] = sprintf("%6s", $FLOWsummary[0]); + $FLOWtotal[$s] = sprintf("%6s", $FLOWtotal[$s]); + $FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]); + $FLOWdropPCT[$s] = sprintf("%6s", $FLOWdropPCT[$s]); + $FLOWsummary[1] = ereg_replace('----------',' / ',$FLOWsummary[1]); + + echo "| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $FLOWsummary[1]\n"; $s++; } +echo "+--------+--------+--------+--------+\n"; + exit; @@ -356,6 +399,15 @@ exit; + + + + + + + + + if ($group_ct > 1) { echo "\n"; diff --git a/www/vicidial/AST_agent_performance_detail.php b/www/vicidial/AST_agent_performance_detail.php index c53d3f33..079187da 100644 --- a/www/vicidial/AST_agent_performance_detail.php +++ b/www/vicidial/AST_agent_performance_detail.php @@ -11,6 +11,8 @@ # 71218-1155 - added end_date for multi-day reports # 80428-0144 - UTF8 cleanup # 80712-1007 - tally bug fixes and time display change +# 81030-0346 - Added pause code stats +# 81030-1924 - Added total non-pause and total logged-in time to pause code section # require("dbconnect.php"); @@ -71,6 +73,7 @@ $auth=$row[0]; exit; } +$MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -207,7 +210,7 @@ $usersARY[0]=''; $user_namesARY[0]=''; $k=0; -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by full_name,status order by status desc,full_name limit 100000;"; +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by full_name,status order by full_name,status desc limit 500000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); @@ -245,7 +248,7 @@ while ($i < $rows_to_print) $i++; } - +echo "CALL STATS BREAKDOWN:\n"; echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG|$statusesHTML\n"; echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; @@ -316,20 +319,20 @@ while ($m < $k) $Scalls = sprintf("%6s", $Scalls); if ($non_latin < 1) - { - $Sfull_name= sprintf("%-15s", $Sfull_name); - while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);} - $Suser = sprintf("%-8s", $Suser); - while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);} - } + { + $Sfull_name= sprintf("%-15s", $Sfull_name); + while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);} + $Suser = sprintf("%-8s", $Suser); + while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);} + } else - { - $Sfull_name= sprintf("%-45s", $Sfull_name); - while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');} + { + $Sfull_name= sprintf("%-45s", $Sfull_name); + while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');} - $Suser = sprintf("%-24s", $Suser); - while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} - } + $Suser = sprintf("%-24s", $Suser); + while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} + } $USERtime_M = ($Stime / 60); $USERtime_M_int = round($USERtime_M, 2); @@ -370,6 +373,7 @@ while ($m < $k) if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";} $USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S"; $pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS); + $PAUSEtotal[$m] = $pfUSERtotPAUSE_MS; $USERavgPAUSE_M = ($Spause_avg / 60); $USERavgPAUSE_M_int = round($USERavgPAUSE_M, 2); @@ -570,7 +574,281 @@ echo "+-----------------+----------+--------+---------+--------+--------+------- echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$SUMstatusesHTML\n"; echo "+----------------------------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; -echo "\n"; +echo "\n\n"; + + + + + + + + + + + + + + + +$sub_statuses='-'; +$sub_statusesTXT=''; +$sub_statusesHEAD=''; +$sub_statusesHTML=''; +$sub_statusesARY=$MT; +$j=0; +$PCusers='-'; +$PCusersARY=$MT; +$PCuser_namesARY=$MT; +$k=0; +$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 $ugSQL group by full_name,sub_status order by full_name,sub_status desc limit 100000;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$subs_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $subs_to_print) + { + $row=mysql_fetch_row($rslt); + $PCfull_name[$i] = $row[0]; + $PCuser[$i] = $row[1]; + $PCpause_sec[$i] = $row[2]; + $sub_status[$i] = $row[3]; + $PCnon_pause_sec[$i] = $row[4]; +# if ( (!eregi("-$sub_status[$i]-", $sub_statuses)) and (strlen($sub_status[$i])>0) ) + if (!eregi("-$sub_status[$i]-", $sub_statuses)) + { + $sub_statusesTXT = sprintf("%8s", $sub_status[$i]); + $sub_statusesHEAD .= "----------+"; + $sub_statusesHTML .= " $sub_statusesTXT |"; + $sub_statuses .= "$sub_status[$i]-"; + $sub_statusesARY[$j] = $sub_status[$i]; + $j++; + } + if (!eregi("-$PCuser[$i]-", $PCusers)) + { + $PCusers .= "$PCuser[$i]-"; + $PCusersARY[$k] = $PCuser[$i]; + $PCuser_namesARY[$k] = $PCfull_name[$i]; + $k++; + } + + $i++; + } + +echo "PAUSE CODE BREAKDOWN:\n"; +echo "+-----------------+----------+--------+--------+--------+ +$sub_statusesHEAD\n"; +echo "| USER NAME | ID | TOTAL |NONPAUSE| PAUSE | |$sub_statusesHTML\n"; +echo "+-----------------+----------+--------+--------+--------+ +$sub_statusesHEAD\n"; + + +### BEGIN loop through each user ### +$m=0; +$Suser_ct = count($usersARY); +$TOTtotNONPAUSE = 0; +$TOTtotTOTAL = 0; + +while ($m < $k) + { + $d=0; + while ($d < $Suser_ct) + { + if ($usersARY[$d] === "$PCusersARY[$m]") + {$pcPAUSEtotal = $PAUSEtotal[$d];} + $d++; + } + $Suser=$PCusersARY[$m]; + $Sfull_name=$PCuser_namesARY[$m]; + $Spause_sec=0; + $Snon_pause_sec=0; + $Stotal_sec=0; + $SstatusesHTML=''; + + ### BEGIN loop through each status ### + $n=0; + while ($n < $j) + { + $Sstatus=$sub_statusesARY[$n]; + $SstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) + { + if ( ($Suser=="$PCuser[$i]") and ($Sstatus=="$sub_status[$i]") ) + { + $Spause_sec = ($Spause_sec + $PCpause_sec[$i]); + $Snon_pause_sec = ($Snon_pause_sec + $PCnon_pause_sec[$i]); + $Stotal_sec = ($Stotal_sec + $PCnon_pause_sec[$i] + $PCpause_sec[$i]); + + $USERcodePAUSE_M = ($PCpause_sec[$i] / 60); + $USERcodePAUSE_M_int = round($USERcodePAUSE_M, 2); + $USERcodePAUSE_M_int = intval("$USERcodePAUSE_M_int"); + $USERcodePAUSE_S = ($USERcodePAUSE_M - $USERcodePAUSE_M_int); + $USERcodePAUSE_S = ($USERcodePAUSE_S * 60); + $USERcodePAUSE_S = round($USERcodePAUSE_S, 0); + if ($USERcodePAUSE_S < 10) {$USERcodePAUSE_S = "0$USERcodePAUSE_S";} + $USERcodePAUSE_MS = "$USERcodePAUSE_M_int:$USERcodePAUSE_S"; + $pfUSERcodePAUSE_MS = sprintf("%6s", $USERcodePAUSE_MS); + + $SstatusTXT = sprintf("%8s", $pfUSERcodePAUSE_MS); + $SstatusesHTML .= " $SstatusTXT |"; + $status_found++; + } + $i++; + } + if ($status_found < 1) + { + $SstatusesHTML .= " 0 |"; + } + ### END loop through each stat line ### + $n++; + } + ### END loop through each status ### + $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + + if ($non_latin < 1) + { + $Sfull_name= sprintf("%-15s", $Sfull_name); + while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);} + $Suser = sprintf("%-8s", $Suser); + while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);} + } + else + { + $Sfull_name= sprintf("%-45s", $Sfull_name); + while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');} + + $Suser = sprintf("%-24s", $Suser); + while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} + } + + $TOTtotNONPAUSE = ($TOTtotNONPAUSE + $Snon_pause_sec); + $TOTtotTOTAL = ($TOTtotTOTAL + $Stotal_sec); + + $USERtotPAUSE_M = ($Spause_sec / 60); + $USERtotPAUSE_M_int = round($USERtotPAUSE_M, 2); + $USERtotPAUSE_M_int = intval("$USERtotPAUSE_M_int"); + $USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int); + $USERtotPAUSE_S = ($USERtotPAUSE_S * 60); + $USERtotPAUSE_S = round($USERtotPAUSE_S, 0); + if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";} + $USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S"; + $pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS); + + $USERtotNONPAUSE_M = ($Snon_pause_sec / 60); + $USERtotNONPAUSE_M_int = round($USERtotNONPAUSE_M, 2); + $USERtotNONPAUSE_M_int = intval("$USERtotNONPAUSE_M_int"); + $USERtotNONPAUSE_S = ($USERtotNONPAUSE_M - $USERtotNONPAUSE_M_int); + $USERtotNONPAUSE_S = ($USERtotNONPAUSE_S * 60); + $USERtotNONPAUSE_S = round($USERtotNONPAUSE_S, 0); + if ($USERtotNONPAUSE_S < 10) {$USERtotNONPAUSE_S = "0$USERtotNONPAUSE_S";} + $USERtotNONPAUSE_MS = "$USERtotNONPAUSE_M_int:$USERtotNONPAUSE_S"; + $pfUSERtotNONPAUSE_MS = sprintf("%6s", $USERtotNONPAUSE_MS); + + $USERtotTOTAL_M = ($Stotal_sec / 60); + $USERtotTOTAL_M_int = round($USERtotTOTAL_M, 2); + $USERtotTOTAL_M_int = intval("$USERtotTOTAL_M_int"); + $USERtotTOTAL_S = ($USERtotTOTAL_M - $USERtotTOTAL_M_int); + $USERtotTOTAL_S = ($USERtotTOTAL_S * 60); + $USERtotTOTAL_S = round($USERtotTOTAL_S, 0); + if ($USERtotTOTAL_S < 10) {$USERtotTOTAL_S = "0$USERtotTOTAL_S";} + $USERtotTOTAL_MS = "$USERtotTOTAL_M_int:$USERtotTOTAL_S"; + $pfUSERtotTOTAL_MS = sprintf("%6s", $USERtotTOTAL_MS); + + + echo "| $Sfull_name | $Suser | $pfUSERtotTOTAL_MS | $pfUSERtotNONPAUSE_MS | $pfUSERtotPAUSE_MS | |$SstatusesHTML\n"; + $m++; + } +### END loop through each user ### + + +###### LAST LINE FORMATTING ########## +### BEGIN loop through each status ### +$SUMstatusesHTML=''; +$TOTtotPAUSE=0; +$n=0; +while ($n < $j) + { + $Scalls=0; + $Sstatus=$sub_statusesARY[$n]; + $SUMstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) + { + if ($Sstatus=="$sub_status[$i]") + { + $Scalls = ($Scalls + $PCpause_sec[$i]); + $status_found++; + } + $i++; + } + ### END loop through each stat line ### + if ($status_found < 1) + { + $SUMstatusesHTML .= " 0 |"; + } + else + { + $TOTtotPAUSE = ($TOTtotPAUSE + $Scalls); + + $USERsumstatPAUSE_M = ($Scalls / 60); + $USERsumstatPAUSE_M_int = round($USERsumstatPAUSE_M, 2); + $USERsumstatPAUSE_M_int = intval("$USERsumstatPAUSE_M_int"); + $USERsumstatPAUSE_S = ($USERsumstatPAUSE_M - $USERsumstatPAUSE_M_int); + $USERsumstatPAUSE_S = ($USERsumstatPAUSE_S * 60); + $USERsumstatPAUSE_S = round($USERsumstatPAUSE_S, 0); + if ($USERsumstatPAUSE_S < 10) {$USERsumstatPAUSE_S = "0$USERsumstatPAUSE_S";} + $USERsumstatPAUSE_MS = "$USERsumstatPAUSE_M_int:$USERsumstatPAUSE_S"; + $pfUSERsumstatPAUSE_MS = sprintf("%6s", $USERsumstatPAUSE_MS); + + $SUMstatusTXT = sprintf("%8s", $pfUSERsumstatPAUSE_MS); + $SUMstatusesHTML .= " $SUMstatusTXT |"; + } + $n++; + } +### END loop through each status ### + + $TOT_AGENTS = sprintf("%-4s", $m); + + $TOTtotPAUSE_M = ($TOTtotPAUSE / 60); + $TOTtotPAUSE_M_int = round($TOTtotPAUSE_M, 2); + $TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M_int"); + $TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int); + $TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60); + $TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0); + if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";} + $TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S"; + $TOTtotPAUSE_MS = sprintf("%8s", $TOTtotPAUSE_MS); + while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} + + $TOTtotNONPAUSE_M = ($TOTtotNONPAUSE / 60); + $TOTtotNONPAUSE_M_int = round($TOTtotNONPAUSE_M, 2); + $TOTtotNONPAUSE_M_int = intval("$TOTtotNONPAUSE_M_int"); + $TOTtotNONPAUSE_S = ($TOTtotNONPAUSE_M - $TOTtotNONPAUSE_M_int); + $TOTtotNONPAUSE_S = ($TOTtotNONPAUSE_S * 60); + $TOTtotNONPAUSE_S = round($TOTtotNONPAUSE_S, 0); + if ($TOTtotNONPAUSE_S < 10) {$TOTtotNONPAUSE_S = "0$TOTtotNONPAUSE_S";} + $TOTtotNONPAUSE_MS = "$TOTtotNONPAUSE_M_int:$TOTtotNONPAUSE_S"; + $TOTtotNONPAUSE_MS = sprintf("%8s", $TOTtotNONPAUSE_MS); + while(strlen($TOTtotNONPAUSE_MS)>8) {$TOTtotNONPAUSE_MS = substr("$TOTtotNONPAUSE_MS", 0, -1);} + + $TOTtotTOTAL_M = ($TOTtotTOTAL / 60); + $TOTtotTOTAL_M_int = round($TOTtotTOTAL_M, 2); + $TOTtotTOTAL_M_int = intval("$TOTtotTOTAL_M_int"); + $TOTtotTOTAL_S = ($TOTtotTOTAL_M - $TOTtotTOTAL_M_int); + $TOTtotTOTAL_S = ($TOTtotTOTAL_S * 60); + $TOTtotTOTAL_S = round($TOTtotTOTAL_S, 0); + if ($TOTtotTOTAL_S < 10) {$TOTtotTOTAL_S = "0$TOTtotTOTAL_S";} + $TOTtotTOTAL_MS = "$TOTtotTOTAL_M_int:$TOTtotTOTAL_S"; + $TOTtotTOTAL_MS = sprintf("%8s", $TOTtotTOTAL_MS); + while(strlen($TOTtotTOTAL_MS)>8) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);} + + + +echo "+-----------------+----------+--------+--------+--------+ +$sub_statusesHEAD\n"; +echo "| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; +echo "+----------------------------+--------+--------+--------+ +$sub_statusesHEAD\n"; + +echo "\n\n"; } diff --git a/www/vicidial/AST_timeonVDADall.php b/www/vicidial/AST_timeonVDADall.php index d0875030..83b2786b 100644 --- a/www/vicidial/AST_timeonVDADall.php +++ b/www/vicidial/AST_timeonVDADall.php @@ -39,6 +39,8 @@ # 80822-1222 - Added option for display of customer phone number # 81011-0335 - Fixed remote agent display bug # 81022-1500 - Added inbound call stats display option +# 81029-1023 - Changed drop percent calculation for multi-stat reports +# 81029-1706 - Added pause code display if enabled per campaign # header ("Content-type: text/html; charset=utf-8"); @@ -103,8 +105,8 @@ while ($i < $qm_conf_ct) ##### END SETTINGS LOOKUP ##### ########################################### -if (!isset($RR)) {$gRRroup=4;} -if (!isset($group)) {$group='';} +if (!isset($RR)) {$RR=40;} +if (!isset($group)) {$group=''; $RR=40;} if (!isset($usergroup)) {$usergroup='';} if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes if (!isset($UidORname)) {$UidORname=0;} # 0=id, 1=name @@ -114,6 +116,8 @@ if (!isset($CALLSdisplay)) {$CALLSdisplay=1;} # 0=no, 1=yes if (!isset($PHONEdisplay)) {$PHONEdisplay=0;} # 0=no, 1=yes if (!isset($CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;} # 0=no, 1=yes if (!isset($with_inbound)) {$with_inbound='N';} # 0=no, 1=yes +if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes + function get_server_load($windows = false) { $os = strtolower(PHP_OS); @@ -334,9 +338,12 @@ echo "\n\n"; if (!$group) {echo "

please select a campaign from the pulldown above\n"; exit;} else { +$multi_drop=0; + if ($group=='XXXX-ALL-ACTIVE-XXXX') { - $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses) from vicidial_campaigns;"; + $multi_drop++; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active) from vicidial_campaigns;"; $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; } @@ -346,6 +353,7 @@ else if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) ) { + $multi_drop++; $stmt = "select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -355,13 +363,13 @@ else $closer_campaignsSQL = "'$closer_campaigns'"; if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} - $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);"; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active from vicidial_campaigns where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);"; $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);"; } else { - $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $stmtB="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; } @@ -391,6 +399,8 @@ $DIALtimeout = $row[17]; $DIALstatuses = $row[18]; $DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses)); $DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses)); +$agent_pause_codes_active = $row[19]; + $stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($group=='XXXX-ALL-ACTIVE-XXXX') @@ -411,6 +421,17 @@ $diffONEMIN = $row[4]; $agentsONEMIN = $row[5]; $balanceFILL = $row[6]; $answersTODAY = $row[7]; +if ($multi_drop > 0) + { + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + } $VSCcat1 = $row[8]; $VSCcat1tally = $row[9]; $VSCcat2 = $row[10]; @@ -779,7 +800,16 @@ $HDcampaign = "------------+"; $HTcampaign = " CAMPAIGN |"; $HDcalls = "-------+"; $HTcalls = " CALLS |"; +$HDpause = ''; +$HTpause = ''; +if (!ereg("N",$agent_pause_codes_active)) + { + $HDstatus = "----------"; + $HTstatus = " STATUS "; + $HDpause = "-------+"; + $HTpause = " PAUSE |"; + } if ($PHONEdisplay < 1) { $HDphone = ''; @@ -815,8 +845,8 @@ if ($SERVdisplay < 1) -$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls\n"; -$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\n"; +$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls\n"; +$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\n"; $Aecho .= "$Aline"; $Aecho .= "$Bline"; $Aecho .= "$Aline"; @@ -876,6 +906,7 @@ $talking_to_print = mysql_num_rows($rslt); } $callerids=''; +$pausecode=''; $stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -1013,6 +1044,11 @@ $calls_to_list = mysql_num_rows($rslt); $comments= $Acomments[$i]; $calls_today = sprintf("%-5s", $Acalls_today[$i]); + if (!ereg("N",$agent_pause_codes_active)) + {$pausecode=' ';} + else + {$pausecode='';} + if (eregi("INCALL",$Lstatus)) { ### temporarily deactivate DEAD calls display until bug is fixed @@ -1109,6 +1145,17 @@ $calls_to_list = mysql_num_rows($rslt); } if ($Lstatus=='PAUSED') { + if (!ereg("N",$agent_pause_codes_active)) + { + $stmtC="select sub_status from vicidial_agent_log where user='$Luser' order by agent_log_id desc limit 1;"; + $rsltC=mysql_query($stmtC,$link); + $rowC=mysql_fetch_row($rsltC); + $pausecode = sprintf("%-6s", $rowC[0]); + $pausecode = "$pausecode "; + } + else + {$pausecode='';} + if ($call_time_M_int >= 360) {$j++; continue;} else @@ -1173,7 +1220,7 @@ $calls_to_list = mysql_num_rows($rslt); $agentcount++; - $Aecho .= "| $G$extension$EG |$phoneD $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $CP$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 $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; $j++; } diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index c9c408b5..adabfe09 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -1047,7 +1047,6 @@ $available_only_ratio_tally = ereg_replace("[^NY]","",$available_only_ratio_tall $sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log); $vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active); $vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs); -$agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active); $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); @@ -1093,6 +1092,7 @@ $code = ereg_replace("[^0-9a-zA-Z]","",$code); $survey_no_response_action = ereg_replace("[^0-9a-zA-Z]","",$survey_no_response_action); $survey_ni_status = ereg_replace("[^0-9a-zA-Z]","",$survey_ni_status); $qc_get_record_launch = ereg_replace("[^0-9a-zA-Z]","",$qc_get_record_launch); +$agent_pause_codes_active = ereg_replace("[^0-9a-zA-Z]","",$agent_pause_codes_active); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -1459,11 +1459,13 @@ $survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir); # 81002-1101 - Added more in-group options and new DID section and user options # 81007-0936 - Added three_way_call_cid option to campaigns # 81012-1725 - Added INBOUND_MAN dial method allowing for manual list dialing with inbound calls +# 81030-0348 - Added campaign pause code force option +# 81030-2228 - Fixed DIDs creation issue # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.0.5-145'; -$build = '81012-1725'; +$admin_version = '2.0.5-147'; +$build = '81030-2228'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2867,7 +2869,7 @@ echo "\n"; - echo "\n"; + echo "\n"; echo "\n";

-Agent Pause Codes Active - Allows agents to select a pause code when they click on the PAUSE button in vicidial.php. Pause codes are definable per campaign at the bottom of the campaign view detail screen and they are stored in the vicidial_agent_log table. Default is N. +Agent Pause Codes Active - Allows agents to select a pause code when they click on the PAUSE button in vicidial.php. Pause codes are definable per campaign at the bottom of the campaign view detail screen and they are stored in the vicidial_agent_log table. Default is N. FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button.
@@ -6697,7 +6699,7 @@ $ADD=3111; if ($ADD==2311) { echo ""; - $stmt="SELECT count(*) from vicidial_inbound_dids where did_id='$did_id';"; + $stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$did_pattern';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) @@ -6711,7 +6713,7 @@ if ($ADD==2311) {echo "
DID NOT ADDED - there is already a DID in the system with this extension\n";} else { - if ( (strlen($source_did) < 1) or (strlen($did_pattern) < 1) or (eregi(' ',$source_did)) or (eregi(' ',$did_pattern)) or (eregi("\+",$source_did)) ) + if ( (strlen($did_pattern) < 2) or (eregi(' ',$did_pattern)) or (eregi('-',$did_pattern)) or (eregi("\+",$did_pattern)) ) { echo "
DID NOT ADDED - Please go back and look at the data you entered\n"; echo "
DID Extension must be between 2 and 20 characters in length and contain no ' -+'.\n"; @@ -6756,7 +6758,7 @@ if ($ADD==2411) {echo "
DID NOT ADDED - there is already a DID in the system with this extension\n";} else { - if ( (strlen($did_id) < 1) or (strlen($did_pattern) < 1) or (eregi(' ',$did_id)) or (eregi(' ',$did_pattern)) or (eregi("\+",$did_id)) ) + if ( (strlen($source_did) < 1) or (strlen($did_pattern) < 1) or (eregi(' ',$source_did)) or (eregi(' ',$did_pattern)) or (eregi("\+",$source_did)) ) { echo "
DID NOT ADDED - Please go back and look at the data you entered\n"; echo "
DID Extension must be between 2 and 20 characters in length and contain no ' -+'.\n"; @@ -11469,7 +11471,7 @@ if ($ADD==31) echo "
Use Campaign DNC List: $NWB#vicidial_campaigns-use_campaign_dnc$NWE
Agent Pause Codes Active: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Agent Pause Codes Active: $NWB#vicidial_campaigns-agent_pause_codes_active$NWE
Campaign Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE