diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 823d911d..cbf1264b 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -778,6 +778,14 @@ OTHER CHANGES: 178. Added ability to update phone number on a lead when call is looked up through the cm_lookup.agi script from a Call Menu +179. Added Daily Max Stats used for measuring the total calls for the day for + in-groups and campaigns as well as the maximum number of concurrent + calls handled by each at any time during the day. Small graphs added to + the in-group and campaign screens as well as larger graphs with more + details on a new report screen. These stats are summary stats that are + generated from the logs in real-time on the back end, they are not + recalculated every time the screen loads as with most other reports. + diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi index 261710b2..37a523eb 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -171,6 +171,7 @@ # 111102-2014 - Added in-group max_calls_ feature # 111116-0157 - Added ALT and ADDR3 methods for CIDLOOKUP # 111201-1457 - Added grade-random next-agent-call option for inbound +# 111219-2124 - Added max stats updating # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -182,7 +183,7 @@ $wait_prompt_runs=0; $at='@'; $S='*'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=191; +$mysql_log_count=195; $one_mysql_log=0; @@ -202,6 +203,7 @@ $now_date_epoch = time(); $start_epoch = $now_date_epoch; $now_date = "$year-$mon-$mday $hour:$min:$sec"; $CLInow_date = "$year-$mon-$mday\\ $hour:$min:$sec"; +$YMD = "$year-$mon-$mday"; $start_time=$now_date; $CIDdate = "$mon$mday$hour$min$sec"; $tsSQLdate = "$year$mon$mday$hour$min$sec"; @@ -1130,10 +1132,9 @@ $MCcomments=''; if ( ($max_calls_method !~ /DISABLED/) && ($max_calls_count > 0) ) { $concurrent_calls=0; + $incalls_count=0; ### Get count of concurrent calls for this in-group - $stmtA = "SELECT count(*) FROM vicidial_auto_calls where campaign_id='$channel_group';"; - if (($max_calls_method =~ /IN_QUEUE/)) - {$stmtA = "SELECT count(*) FROM vicidial_auto_calls where campaign_id='$channel_group' and status IN('LIVE','IVR');";} + $stmtA = "SELECT count(*) FROM vicidial_auto_calls where campaign_id='$channel_group' and callerid!='$callerid';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -1142,9 +1143,58 @@ if ( ($max_calls_method !~ /DISABLED/) && ($max_calls_count > 0) ) { @aryA = $sthA->fetchrow_array; $concurrent_calls = $aryA[0]; + $incalls_count = $aryA[0]; + $incalls_count++; } $sthA->finish(); + $STATSmax_inbound=0; + $stmtA = "SELECT max_inbound from vicidial_daily_max_stats where campaign_id='$channel_group' and stats_type='INGROUP' and stats_flag='OPEN' order by update_time desc limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02192'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $STATSmax_inbound = $aryA[0]; + $sthA->finish(); + + $update_SQL=''; + if ($STATSmax_inbound < $incalls_count) + {$update_SQL .= ",max_inbound='$incalls_count'";} + + if (length($update_SQL) > 5) + { + $stmtA = "UPDATE vicidial_daily_max_stats SET update_time=NOW()$update_SQL where campaign_id='$channel_group' and stats_type='INGROUP' and stats_flag='OPEN';"; + $affected_rows = $dbhA->do($stmtA); + $dbhP=$dbhA; $mysql_count='02193'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($AGILOG) {$agi_string = "DAILY STATS UPDATE $channel_group|$affected_rows|$stmtA|\n"; &agi_output;} + } + } + else + { + $stmtA = "INSERT INTO vicidial_daily_max_stats SET stats_date='$YMD',update_time=NOW(),max_inbound='$incalls_count',campaign_id='$channel_group',stats_type='INGROUP',stats_flag='OPEN';"; + $affected_rows = $dbhA->do($stmtA); + $dbhP=$dbhA; $mysql_count='02195'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($AGILOG) {$agi_string = "DAILY STATS INSERT $channel_group|$affected_rows|$stmtA|\n"; &agi_output;} + } + + if (($max_calls_method =~ /IN_QUEUE/)) + { + $stmtA = "SELECT count(*) FROM vicidial_auto_calls where campaign_id='$channel_group' and status IN('LIVE','IVR') and callerid!='$callerid';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02194'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $concurrent_calls = $aryA[0]; + } + $sthA->finish(); + } + if ($concurrent_calls >= $max_calls_count) { if ($max_calls_action =~ /DROP/) @@ -1169,10 +1219,6 @@ if ( ($max_calls_method !~ /DISABLED/) && ($max_calls_count > 0) ) - - - - ##### BEGIN AFTER HOURS CHECK ##### $ct_stop_overflow=0; # allow for overflow time, past midnight if ($ct_default_stop > 2400) diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi index e8bd0328..444fb21c 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi @@ -92,12 +92,13 @@ # 110829-2324 - Added survey_recording option # 110926-1929 - Small fixes # 111201-1751 - Added grade-random next-agent-call option +# 111219-2256 - Added max stats updating # $script = 'agi-VDAD_ALL_outbound.agi'; $AGILOG = '0'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=92; +$mysql_log_count=96; $one_mysql_log=0; @@ -122,6 +123,7 @@ $now_date = "$year-$mon-$mday $hour:$min:$sec"; $CLInow_date = "$year-$mon-$mday\\ $hour:$min:$sec"; $start_time_epoch = $now_date_epoch; $start_time=$now_date; +$YMD = "$year-$mon-$mday"; $CIDdate = "$mon$mday$hour$min$sec"; $tsSQLdate = "$year$mon$mday$hour$min$sec"; $filedate = "$US$year-$mon-$mday$US$hour$min$sec"; @@ -420,14 +422,60 @@ if ($VDACaffected_rows < 1) $stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage,queue_priority) values('$VARserver_ip','$VDADcampaign','LIVE','$VDADlead_id','$uniqueid','$callerid','$channel','$VDADphone_code','$VDADphone','$VDADcall_time','$VDADorigin','LIVE-0','$VDADqueue_priority')"; $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='01071'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; - if ($AGILOG) {$agi_string = "$affected_rows|VDAC-reinsert|$stmtA|"; &agi_output;} - + if ($AGILOG) {$agi_string = "$affected_rows|VDAC-reinsert|$stmtA|"; &agi_output;} } else { if ($AGILOG) {$agi_string = "-- NO VDM FOUND!!!!!!!!!!: $callerid"; &agi_output;} } + ##### BEGIN - Max call stats + $outcalls_count=0; + ### Get count of concurrent calls for this campaign + $stmtA = "SELECT count(*) FROM vicidial_auto_calls where campaign_id='$VDADcampaign';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02093'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $outcalls_count = $aryA[0]; + } + $sthA->finish(); + + $STATSmax_outbound=0; + $stmtA = "SELECT max_outbound from vicidial_daily_max_stats where campaign_id='$VDADcampaign' and stats_type='CAMPAIGN' and stats_flag='OPEN' order by update_time desc limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02094'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $STATSmax_outbound = $aryA[0]; + $sthA->finish(); + + $update_SQL=''; + if ($STATSmax_outbound < $outcalls_count) + {$update_SQL .= ",max_outbound='$outcalls_count'";} + + if (length($update_SQL) > 5) + { + $stmtA = "UPDATE vicidial_daily_max_stats SET update_time=NOW()$update_SQL where campaign_id='$VDADcampaign' and stats_type='CAMPAIGN' and stats_flag='OPEN';"; + $affected_rows = $dbhA->do($stmtA); + $dbhP=$dbhA; $mysql_count='02095'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($AGILOG) {$agi_string = "DAILY STATS UPDATE $VDADcampaign|$affected_rows|$stmtA|\n"; &agi_output;} + } + } + else + { + $stmtA = "INSERT INTO vicidial_daily_max_stats SET stats_date='$YMD',update_time=NOW(),max_outbound='$outcalls_count',campaign_id='$VDADcampaign',stats_type='CAMPAIGN',stats_flag='OPEN';"; + $affected_rows = $dbhA->do($stmtA); + $dbhP=$dbhA; $mysql_count='02096'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($AGILOG) {$agi_string = "DAILY STATS INSERT $VDADcampaign|$affected_rows|$stmtA|\n"; &agi_output;} + } + ##### END - Max call stats } if ($VDACaffected_rows > 0) { diff --git a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl index 60a68c09..5e6c0116 100644 --- a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl +++ b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl @@ -67,6 +67,7 @@ # 110911-1452 - Added resets for extension groups and areacode cid tables # 110922-2148 - Added reset for vicidial_did_ra_extensions # 111004-2333 - Added Call Menu option for update of fields +# 111221-1454 - Added resetting of max stats records at timeclock end of day # $DB=0; # Debug flag @@ -573,7 +574,7 @@ if ($timeclock_auto_logout > 0) ################################################################################ ##### START clear out non-used vicidial_conferences sessions and reset daily -##### tally tables +##### tally tables at Timeclock end-of-day ################################################################################ # default path to astguiclient configuration file: @@ -623,17 +624,17 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA $timeclock_end_of_day_NOW=0; ### Grab system_settings values from the database - $stmtA = "SELECT count(*) from system_settings where timeclock_end_of_day LIKE \"%$reset_test%\";"; - if ($DB) {print "|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - if ($sthArows > 0) - { - @aryA = $sthA->fetchrow_array; - $timeclock_end_of_day_NOW = "$aryA[0]"; - } - $sthA->finish(); +$stmtA = "SELECT count(*) from system_settings where timeclock_end_of_day LIKE \"%$reset_test%\";"; +if ($DB) {print "|$stmtA|\n";} +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $timeclock_end_of_day_NOW = "$aryA[0]"; + } +$sthA->finish(); if ($timeclock_end_of_day_NOW > 0) { @@ -831,7 +832,6 @@ if ($timeclock_end_of_day_NOW > 0) if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} $sthA->finish(); - $stmtA = "update vicidial_campaign_agents SET calls_today=0;"; if($DBX){print STDERR "\n|$stmtA|\n";} $affected_rows = $dbhA->do($stmtA); @@ -897,6 +897,147 @@ if ($timeclock_end_of_day_NOW > 0) $sthA->finish(); + + + + + ##### BEGIN max stats end of day process ##### + $secX = time(); + $RMtarget = ($secX - 86400); # 24 hours ago + ($RMsec,$RMmin,$RMhour,$RMmday,$RMmon,$RMyear,$RMwday,$RMyday,$RMisdst) = localtime($RMtarget); + $RMyear = ($RMyear + 1900); + $RMmon++; + if ($RMmon < 10) {$RMmon = "0$RMmon";} + if ($RMmday < 10) {$RMmday = "0$RMmday";} + if ($RMhour < 10) {$RMhour = "0$RMhour";} + if ($RMmin < 10) {$RMmin = "0$RMmin";} + if ($RMsec < 10) {$RMsec = "0$RMsec";} + $RMSQLdate = "$RMyear-$RMmon-$RMmday $RMhour:$RMmin:$RMsec"; + + # set OPEN max stats records to CLOSING for processing + $stmtA = "UPDATE vicidial_daily_max_stats SET stats_flag='CLOSING' where stats_flag='OPEN';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); + if($DB){print STDERR "\n|$affected_rows Daily Max Stats Closing Process Started|\n";} + + # gather data from CLOSING max stats records + $stmtA = "SELECT stats_date,stats_flag,stats_type,campaign_id,update_time,closed_time,max_channels,max_calls,max_inbound,max_outbound,max_agents,max_remote_agents,total_calls from vicidial_daily_max_stats where stats_flag='CLOSING';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArowsDMS=$sthA->rows; + $i=0; + while ($sthArowsDMS > $i) + { + @aryA = $sthA->fetchrow_array; + $Astats_date[$i] = $aryA[0]; + $Astats_flag[$i] = $aryA[1]; + $Astats_type[$i] = $aryA[2]; + $Acampaign_id[$i] = $aryA[3]; + $Aupdate_time[$i] = $aryA[4]; + $Aclosed_time[$i] = $aryA[5]; + $Amax_channels[$i] = $aryA[6]; + $Amax_calls[$i] = $aryA[7]; + $Amax_inbound[$i] = $aryA[8]; + $Amax_outbound[$i] = $aryA[9]; + $Amax_agents[$i] = $aryA[10]; + $Amax_remote_agents[$i] = $aryA[11]; + $Atotal_calls[$i] = $aryA[12]; + + if($DBXXX){print STDERR "\nMAX STATS: |$i|$Astats_date[$i]|$Astats_flag[$i]|$Astats_type[$i]|$Acampaign_id[$i]|$Aupdate_time[$i]|$Aclosed_time[$i]|$Amax_channels[$i]|$Amax_calls[$i]|$Amax_inbound[$i]|$Amax_outbound[$i]|$Amax_agents[$i]|$Amax_remote_agents[$i]|$Atotal_calls[$i]|\n";} + $i++; + } + $sthA->finish(); + + ### loop through CLOSING max stats records and calculate end of day numbers, updating if necessary + $i=0; + while ($sthArowsDMS > $i) + { + $NEWtotal_calls=0; + $inbound_count=0; + $outbound_count=0; + ### calculate total calls for system, did inbound and vicidial outbound + if ($Astats_type[$i] =~ /TOTAL/) + { + $stmtA = "SELECT count(*) from vicidial_did_log where call_date > \"$RMSQLdate\";"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $inbound_count = $aryA[0]; + } + $sthA->finish(); + + $stmtA = "SELECT count(*) from vicidial_log where call_date > \"$RMSQLdate\";"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $outbound_count = $aryA[0]; + } + $sthA->finish(); + $NEWtotal_calls = ($inbound_count + $outbound_count); + + $stmtA = "UPDATE vicidial_daily_max_stats SET total_calls='$NEWtotal_calls',stats_flag='CLOSED' where stats_flag='CLOSING' and campaign_id='' and stats_type='TOTAL';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); + if($DB){print STDERR "\n|$affected_rows Daily Max Stats Closed for TOTAL: $NEWtotal_calls|$Atotal_calls[$i]\n";} + } + ### calculate total calls for ingroups + if ($Astats_type[$i] =~ /INGROUP/) + { + $stmtA = "SELECT count(*) from vicidial_closer_log where call_date > \"$RMSQLdate\" and campaign_id='$Acampaign_id[$i]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $inbound_count = $aryA[0]; + } + $sthA->finish(); + $NEWtotal_calls = ($inbound_count + $outbound_count); + + $stmtA = "UPDATE vicidial_daily_max_stats SET total_calls='$NEWtotal_calls',stats_flag='CLOSED' where stats_flag='CLOSING' and campaign_id='$Acampaign_id[$i]' and stats_type='INGROUP';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); + if($DB){print STDERR "\n|$affected_rows Daily Max Stats Closed for INGROUP $Acampaign_id[$i]: $NEWtotal_calls|$Atotal_calls[$i]|\n";} + } + ### calculate total calls for campaigns + if ($Astats_type[$i] =~ /CAMPAIGN/) + { + $stmtA = "SELECT count(*) from vicidial_log where call_date > \"$RMSQLdate\" and campaign_id='$Acampaign_id[$i]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $outbound_count = $aryA[0]; + } + $sthA->finish(); + $NEWtotal_calls = ($inbound_count + $outbound_count); + + $stmtA = "UPDATE vicidial_daily_max_stats SET total_calls='$NEWtotal_calls',stats_flag='CLOSED' where stats_flag='CLOSING' and campaign_id='$Acampaign_id[$i]' and stats_type='CAMPAIGN';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); + if($DB){print STDERR "\n|$affected_rows Daily Max Stats Closed for CAMPAIGN $Acampaign_id[$i]: $NEWtotal_calls|$Atotal_calls[$i]|\n";} + } + + if($DBXXX){print STDERR "\nMAX STATS: |$i|$Astats_date[$i]|$Astats_flag[$i]|$Astats_type[$i]|$Acampaign_id[$i]|$Aupdate_time[$i]|$Aclosed_time[$i]|$Amax_channels[$i]|$Amax_calls[$i]|$Amax_inbound[$i]|$Amax_outbound[$i]|$Amax_agents[$i]|$Amax_remote_agents[$i]|$Atotal_calls[$i]| |$NEWtotal_calls = ($inbound_count + $outbound_count)|\n";} + $i++; + } + + $stmtA = "UPDATE vicidial_daily_max_stats SET stats_flag='CLOSED' where stats_flag='CLOSING';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); + if($DB){print STDERR "\n|$affected_rows Daily Max Stats Closed Cleanup|\n";} + ##### END max stats end of day process ##### + + $dbhC = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_custom_user", "$VARDB_custom_pass") or die "Couldn't connect to database: " . DBI->errstr; diff --git a/agc_2-X/trunk/bin/AST_VDadapt.pl b/agc_2-X/trunk/bin/AST_VDadapt.pl index db711098..70776ace 100644 --- a/agc_2-X/trunk/bin/AST_VDadapt.pl +++ b/agc_2-X/trunk/bin/AST_VDadapt.pl @@ -36,6 +36,7 @@ # 100206-1453 - Fixed calculation of hold_sec stats (service level) for in-groups # 110513-0721 - Added debug DB table, dial level and available only tally threshold options # 111103-0626 - Added MAXCAL as a drop status +# 111219-1420 - Added daily stats updates to new table for total, in-group and campaign # # constants @@ -51,6 +52,7 @@ $MT[0]=''; $i=0; +$daily_stats=1; $drop_count_updater=0; $stat_it=15; $diff_ratio_updater=0; @@ -105,7 +107,17 @@ if (length($ARGV[0])>1) if ($args =~ /--help/i) { - print "allowed run time options(must stay in this order):\n [--debug] = debug\n [--debugX] = super debug\n [-t] = test\n [--loops=XXX] = force a number of loops of XXX\n [--delay=XXX] = force a loop delay of XXX seconds\n [--campaign=XXX] = run for campaign XXX only\n [-force] = force calculation of suggested predictive dial_level\n [-test] = test only, do not alter dial_level\n\n"; + print "allowed run time options(must stay in this order):\n"; + print " [--loops=XXX] = force a number of loops of XXX\n"; + print " [--delay=XXX] = force a loop delay of XXX seconds\n"; + print " [--campaign=XXX] = run for campaign XXX only\n"; + print " [--no-daily-stats] = will not daily stats for total, ingroup, campaign\n"; + print " [--force] = force calculation of suggested predictive dial_level\n"; + print " [--test] = test only, do not alter dial_level\n"; + print " [--debug] = debug\n"; + print " [--debugX] = super debug\n"; + print "\n"; + exit; } else { @@ -189,15 +201,20 @@ if (length($ARGV[0])>1) print "CLIdelay- $CLIdelay\n"; print "\n"; } - if ($args =~ /-force/i) + if ($args =~ /--force/i) { $force_test=1; print "\n----- FORCE TESTING -----\n\n"; } - if ($args =~ /-t/i) + if ($args =~ /--test/i) { $T=1; $TEST=1; - print "\n-----TESTING -----\n\n"; + print "\n----- TESTING -----\n\n"; + } + if ($args =~ /--no-daily-stats/i) + { + $daily_stats=0; + print "\n----- NO DAILY STATS -----\n\n"; } } } @@ -305,7 +322,6 @@ $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### - $master_loop=0; ### Start master loop ### @@ -424,7 +440,7 @@ while ($master_loop<$CLIloops) $five_min_ago = time(); $five_min_ago = ($five_min_ago - 300); - ##### LOOP THROUGH EACH CAMPAIGN AND PROCESS THE HOPPER ##### + ##### LOOP THROUGH EACH CAMPAIGN AND PROCESS THE DATA ##### $i=0; foreach(@campaign_id) { @@ -555,6 +571,11 @@ while ($master_loop<$CLIloops) &launch_inbound_gather; } + if ( ($daily_stats > 0) && (($stat_count =~ /0$|5$/) || ($stat_count==1)) ) + { + &launch_max_calls_gather; + } + if ($RESETdiff_ratio_updater>0) {$RESETdiff_ratio_updater=0; $diff_ratio_updater=0;} if ($RESETdrop_count_updater>0) {$RESETdrop_count_updater=0; $drop_count_updater=0;} $diff_ratio_updater = ($diff_ratio_updater + $CLIdelay); @@ -707,6 +728,7 @@ sub count_agents_lines ### Calculate campaign-wide agent waiting and calls waiting differential $stat_it=15; $total_agents[$i]=0; + $total_remote_agents[$i]=0; $ready_agents[$i]=0; $waiting_calls[$i]=0; $ready_diff_total[$i]=0; @@ -771,6 +793,21 @@ sub count_agents_lines $it++; } + # LIVE CAMPAIGN CALLS RIGHT NOW + if ($daily_stats > 0) + { + $stmtA = "SELECT count(*) from vicidial_live_agents where campaign_id='$campaign_id[$i]' and last_update_time > '$VDL_one' and extension LIKE \"R/%\";"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $total_remote_agents[$i] = $aryA[0]; + } + $sthA->finish(); + } + if ($ready_diff_total[$i] > 0) {$ready_diff_avg[$i] = ($ready_diff_total[$i] / $stat_it);} if ($waiting_diff_total[$i] > 0) @@ -856,6 +893,7 @@ sub calculate_drops $VCSagent_custtalk_today[$i]=0; $VCSagent_acw_today[$i]=0; $VCSagent_calls_today[$i]=0; + $VCSlive_calls[$i]=0; # LAST ONE MINUTE CALL AND DROP STATS $stmtA = "SELECT count(*) from $vicidial_log where campaign_id='$campaign_id[$i]' and call_date > '$VDL_one';"; @@ -1162,6 +1200,22 @@ sub calculate_drops } $sthA->finish(); + # LIVE CAMPAIGN CALLS RIGHT NOW + if ($daily_stats > 0) + { + $stmtA = "SELECT count(*) from vicidial_auto_calls where campaign_id='$campaign_id[$i]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $VCSlive_calls[$i] = $aryA[0]; + $debug_camp_output .= " LIVE CALLS: $aryA[0]|$stmtA\n"; + } + $sthA->finish(); + } + # If campaign is using a drop rate group, gather its stats if ($drop_rate_group[$i] !~ /DISABLED/) { @@ -1220,9 +1274,57 @@ sub calculate_drops $stmtA = "UPDATE vicidial_campaign_stats_debug SET entry_time='$now_date',debug_output='$debug_camp_output' where campaign_id='$campaign_id[$i]' and server_ip='ADAPT';"; $affected_rows = $dbhA->do($stmtA); $debug_camp_output=''; + + ##### BEGIN - DAILY STATS UPDATE CAMPAIGN + if ($daily_stats > 0) + { + $STATSmax_outbound=0; + $STATSmax_agents=0; + $STATSmax_remote_agents=0; + $STATStotal_calls=0; + $stmtA = "SELECT max_outbound,max_agents,max_remote_agents,total_calls from vicidial_daily_max_stats where campaign_id='$campaign_id[$i]' and stats_type='CAMPAIGN' and stats_flag='OPEN' order by update_time desc limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $STATSmax_outbound = $aryA[0]; + $STATSmax_agents = $aryA[1]; + $STATSmax_remote_agents = $aryA[2]; + $STATStotal_calls = $aryA[3]; + $sthA->finish(); + + $update_SQL=''; + if ($STATSmax_outbound < $VCSlive_calls[$i]) + {$update_SQL .= ",max_outbound='$VCSlive_calls[$i]'";} + if ($STATSmax_agents < $total_agents[$i]) + {$update_SQL .= ",max_agents='$total_agents[$i]'";} + if ($STATSmax_remote_agents < $total_remote_agents[$i]) + {$update_SQL .= ",max_remote_agents='$total_remote_agents[$i]'";} + if ($STATStotal_calls < $VCScalls_today[$i]) + {$update_SQL .= ",total_calls='$VCScalls_today[$i]'";} + if (length($update_SQL) > 5) + { + $stmtA = "UPDATE vicidial_daily_max_stats SET update_time=NOW()$update_SQL where campaign_id='$campaign_id[$i]' and stats_type='CAMPAIGN' and stats_flag='OPEN';"; + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "DAILY STATS UPDATE $campaign_id[$i]|$affected_rows|$stmtA|\n";} + } + } + else + { + $sthA->finish(); + + $stmtA = "INSERT INTO vicidial_daily_max_stats SET stats_date='$file_date',update_time=NOW(),max_outbound='$VCSlive_calls[$i]',max_agents='$total_agents[$i]',max_remote_agents='$total_remote_agents[$i]',total_calls='$VCScalls_today[$i]',campaign_id='$campaign_id[$i]',stats_type='CAMPAIGN',stats_flag='OPEN';"; + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "DAILY STATS INSERT $campaign_id[$i]|$affected_rows|$stmtA|\n";} + } + } + ##### END - DAILY STATS UPDATE CAMPAIGN } + sub drop_rate_group_gather { ################################################################################ @@ -1293,6 +1395,170 @@ sub drop_rate_group_gather } +sub launch_max_calls_gather + { + ################################################################################ + #### BEGIN gather stats for max channels and max calls + ################################################################################ + $serversSQL=''; + # Get list of active asterisk servers + $stmtA = "SELECT server_ip from servers where active_asterisk_server='Y';"; + $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; + $serversSQL .= "'$aryA[0]',"; + $rec_count++; + } + $sthA->finish(); + chop($serversSQL); + + if (length($serversSQL) > 5) + { + $stmtA = "SELECT count(*) from live_sip_channels where server_ip IN($serversSQL);"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $lsc_count=0; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $lsc_count = $aryA[0]; + } + $sthA->finish(); + + $stmtA = "SELECT count(*) from live_channels where server_ip IN($serversSQL);"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $lc_count=0; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $lc_count = $aryA[0]; + } + $sthA->finish(); + $tc_count = ($lsc_count + $lc_count); + + $stmtA = "SELECT count(*) from live_channels where channel NOT LIKE \"%pseudo%\" and server_ip IN($serversSQL);"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $tcalls_count=0; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $tcalls_count = $aryA[0]; + } + + $sthA->finish(); + + $stmtA = "SELECT count(*) from vicidial_auto_calls where call_type='IN' and server_ip IN($serversSQL);"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $incalls_count=0; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $incalls_count = $aryA[0]; + } + $sthA->finish(); + + $stmtA = "SELECT count(*) from vicidial_auto_calls where call_type IN('OUT','OUTBALANCE') and server_ip IN($serversSQL);"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $outcalls_count=0; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $outcalls_count = $aryA[0]; + } + $sthA->finish(); + + $stmtA = "SELECT count(*) from vicidial_live_agents where last_update_time > '$VDL_one' and server_ip IN($serversSQL);"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $live_agents=0; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $live_agents = $aryA[0]; + $sthA->finish(); + } + + $stmtA = "SELECT count(*) from vicidial_live_agents where last_update_time > '$VDL_one' and extension LIKE \"R/%\" and server_ip IN($serversSQL);"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $live_remote_agents=0; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $live_remote_agents = $aryA[0]; + $sthA->finish(); + } + + if ($DB) {print "$now_date MAX CHANNELS TOTALS: $tc_count($lsc_count+$lc_count)|$tcalls_count|$incalls_count|$outcalls_count|$live_agents|$live_remote_agents\n";} + + + $STATSmax_channels=0; + $STATSmax_calls=0; + $stmtA = "SELECT max_channels,max_calls,max_inbound,max_outbound,max_agents,max_remote_agents from vicidial_daily_max_stats where campaign_id='' and stats_type='TOTAL' and stats_flag='OPEN' order by update_time desc limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $STATSmax_channels = $aryA[0]; + $STATSmax_calls = $aryA[1]; + $STATSmax_inbound = $aryA[2]; + $STATSmax_outbound = $aryA[3]; + $STATSmax_agents = $aryA[4]; + $STATSmax_remote_agents = $aryA[5]; + $sthA->finish(); + + $update_SQL=''; + if ($STATSmax_channels < $tc_count) + {$update_SQL .= ",max_channels='$tc_count'";} + if ($STATSmax_calls < $tcalls_count) + {$update_SQL .= ",max_calls='$tcalls_count'";} + if ($STATSmax_inbound < $incalls_count) + {$update_SQL .= ",max_inbound='$incalls_count'";} + if ($STATSmax_outbound < $outcalls_count) + {$update_SQL .= ",max_outbound='$outcalls_count'";} + if ($STATSmax_agents < $live_agents) + {$update_SQL .= ",max_agents='$live_agents'";} + if ($STATSmax_remote_agents < $live_remote_agents) + {$update_SQL .= ",max_remote_agents='$live_remote_agents'";} + + if (length($update_SQL) > 5) + { + $stmtA = "UPDATE vicidial_daily_max_stats SET update_time=NOW()$update_SQL where campaign_id='' and stats_type='TOTAL' and stats_flag='OPEN';"; + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "DAILY STATS UPDATE $campaign_id[$i]|$affected_rows|$stmtA|\n";} + } + } + else + { + $sthA->finish(); + + $stmtA = "INSERT INTO vicidial_daily_max_stats SET stats_date='$file_date',update_time=NOW(),max_channels='$tc_count',max_calls='$tcalls_count',max_inbound='$incalls_count',max_outbound='$outcalls_count',max_agents='$live_agents',max_remote_agents='$live_remote_agents',campaign_id='',stats_type='TOTAL',stats_flag='OPEN';"; + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "DAILY STATS INSERT TOTAL|$affected_rows|$stmtA|\n";} + } + } + ################################################################################ + #### END gather stats for max channels and max calls + ################################################################################ + } + sub launch_inbound_gather { ################################################################################ @@ -1390,6 +1656,47 @@ sub calculate_drops_inbound $hold_sec_answer_calls[$p]=0; $hold_sec_drop_calls[$p]=0; $hold_sec_queue_calls[$p]=0; + $iVCSlive_calls[$p]=0; + $itotal_agents[$p]=0; + $itotal_remote_agents[$p]=0; + + # DAILY STATS UPDATE + if ($daily_stats > 0) + { + $stmtA = "SELECT count(*) from vicidial_auto_calls where campaign_id='$group_id[$p]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $iVCSlive_calls[$p] = $aryA[0]; + $sthA->finish(); + } + + $stmtA = "SELECT count(*) from vicidial_live_agents where closer_campaigns LIKE \"% $group_id[$p] %\" and last_update_time > '$VDL_one';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $itotal_agents[$p] = $aryA[0]; + $sthA->finish(); + } + + $stmtA = "SELECT count(*) from vicidial_live_agents where closer_campaigns LIKE \"% $group_id[$p] %\" and last_update_time > '$VDL_one' and extension LIKE \"R/%\";"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $itotal_remote_agents[$p] = $aryA[0]; + $sthA->finish(); + } + $debug_ingroup_output .= " DAILY STATS|$iVCSlive_calls[$p]|$itotal_agents[$p]|$itotal_remote_agents[$p]|"; + } # TODAY CALL AND DROP STATS $stmtA = "SELECT count(*) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date';"; @@ -1598,6 +1905,53 @@ sub calculate_drops_inbound $debug_ingroup_output =~ s/;|\\\\|\/|\'//gi; $stmtA="INSERT IGNORE INTO vicidial_campaign_stats_debug SET server_ip='INBOUND',campaign_id='$group_id[$p]',entry_time='$now_date',debug_output='$debug_ingroup_output' ON DUPLICATE KEY UPDATE entry_time='$now_date',debug_output='$debug_ingroup_output';"; $affected_rows = $dbhA->do($stmtA); + + ##### BEGIN - DAILY STATS UPDATE INGROUP + if ($daily_stats > 0) + { + $STATSmax_inbound=0; + $STATSmax_agents=0; + $STATSmax_remote_agents=0; + $STATStotal_calls=0; + $stmtA = "SELECT max_inbound,max_agents,max_remote_agents,total_calls from vicidial_daily_max_stats where campaign_id='$group_id[$p]' and stats_type='INGROUP' and stats_flag='OPEN' order by update_time desc limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $STATSmax_inbound = $aryA[0]; + $STATSmax_agents = $aryA[1]; + $STATSmax_remote_agents = $aryA[2]; + $STATStotal_calls = $aryA[3]; + $sthA->finish(); + + $update_SQL=''; + if ($STATSmax_inbound < $iVCSlive_calls[$p]) + {$update_SQL .= ",max_inbound='$iVCSlive_calls[$p]'";} + if ($STATSmax_agents < $itotal_agents[$p]) + {$update_SQL .= ",max_agents='$itotal_agents[$p]'";} + if ($STATSmax_remote_agents < $itotal_remote_agents[$p]) + {$update_SQL .= ",max_remote_agents='$itotal_remote_agents[$p]'";} + if ($STATStotal_calls < $iVCScalls_today[$p]) + {$update_SQL .= ",total_calls='$iVCScalls_today[$p]'";} + if (length($update_SQL) > 5) + { + $stmtA = "UPDATE vicidial_daily_max_stats SET update_time=NOW()$update_SQL where campaign_id='$group_id[$p]' and stats_type='INGROUP' and stats_flag='OPEN';"; + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "DAILY STATS UPDATE $campaign_id[$p]|$affected_rows|$stmtA|\n";} + } + } + else + { + $sthA->finish(); + + $stmtA = "INSERT INTO vicidial_daily_max_stats SET stats_date='$file_date',update_time=NOW(),max_inbound='$iVCSlive_calls[$p]',max_agents='$itotal_agents[$p]',max_remote_agents='$itotal_remote_agents[$p]',total_calls='$iVCScalls_today[$p]',campaign_id='$group_id[$p]',stats_type='INGROUP',stats_flag='OPEN';"; + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "DAILY STATS INSERT $group_id[$p]|$affected_rows|$stmtA|\n";} + } + } + ##### END - DAILY STATS UPDATE INGROUP } ##### END calculate_drops_inbound diff --git a/agc_2-X/trunk/bin/AST_manager_send.pl b/agc_2-X/trunk/bin/AST_manager_send.pl index f19e8392..43deb451 100644 --- a/agc_2-X/trunk/bin/AST_manager_send.pl +++ b/agc_2-X/trunk/bin/AST_manager_send.pl @@ -122,7 +122,7 @@ while ($one_day_interval > 0) if ($NEW_actions) { - my $stmtA = "UPDATE vicidial_manager set status='QUEUE' where server_ip = '" . $conf{VARserver_ip} . "' and status = 'NEW' order by entry_date limit 1"; + my $stmtA = "UPDATE vicidial_manager set status='QUEUE' where server_ip = '" . $conf{VARserver_ip} . "' and status = 'NEW' order by man_id limit 1"; $affected_rows = $dbhA->do($stmtA); print STDERR "rows updated to QUEUE: |$affected_rows|\n" if ($DB); } @@ -133,7 +133,7 @@ while ($one_day_interval > 0) if ($affected_rows) { - my $stmtA = "SELECT man_id,uniqueid,entry_date,status,response,server_ip,channel,action,callerid,cmd_line_b,cmd_line_c,cmd_line_d,cmd_line_e,cmd_line_f,cmd_line_g,cmd_line_h,cmd_line_i,cmd_line_j,cmd_line_k FROM vicidial_manager where server_ip = '" . $conf{VARserver_ip} . "' and status = 'QUEUE' order by entry_date desc limit 1"; + my $stmtA = "SELECT man_id,uniqueid,entry_date,status,response,server_ip,channel,action,callerid,cmd_line_b,cmd_line_c,cmd_line_d,cmd_line_e,cmd_line_f,cmd_line_g,cmd_line_h,cmd_line_i,cmd_line_j,cmd_line_k FROM vicidial_manager where server_ip = '" . $conf{VARserver_ip} . "' and status = 'QUEUE' order by man_id limit 1"; eventLogger($conf{'PATHlogs'}, 'process', "SQL_QUERY|" . $stmtA . "|"); my $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index fa7c97bb..5189ea8a 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -2606,6 +2606,25 @@ UNIQUE KEY snapshot_date_list_key KEY snapshot_date_key (snapshot_time) ); +CREATE TABLE vicidial_daily_max_stats ( +stats_date DATE NOT NULL, +stats_flag ENUM('OPEN','CLOSED','CLOSING') default 'CLOSED', +stats_type ENUM('TOTAL','INGROUP','CAMPAIGN','') default '', +campaign_id VARCHAR(20) default '', +update_time TIMESTAMP, +closed_time DATETIME, +max_channels MEDIUMINT(8) UNSIGNED default '0', +max_calls MEDIUMINT(8) UNSIGNED default '0', +max_inbound MEDIUMINT(8) UNSIGNED default '0', +max_outbound MEDIUMINT(8) UNSIGNED default '0', +max_agents MEDIUMINT(8) UNSIGNED default '0', +max_remote_agents MEDIUMINT(8) UNSIGNED default '0', +total_calls INT(9) UNSIGNED default '0', +index (stats_date), +index (stats_flag), +index (campaign_id) +); + ALTER TABLE vicidial_campaign_server_stats ENGINE=MEMORY; @@ -2758,7 +2777,7 @@ CREATE TABLE vicidial_log_noanswer_archive LIKE vicidial_log_noanswer; CREATE TABLE vicidial_did_agent_log_archive LIKE vicidial_did_agent_log; CREATE UNIQUE INDEX vdala on vicidial_did_agent_log_archive (uniqueid,call_date,did_route); -UPDATE system_settings SET db_schema_version='1310',db_schema_update_date=NOW(); +UPDATE system_settings SET db_schema_version='1311',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/agc_2-X/trunk/extras/upgrade_2.4.sql b/agc_2-X/trunk/extras/upgrade_2.4.sql index 02eb8575..8cde9404 100644 --- a/agc_2-X/trunk/extras/upgrade_2.4.sql +++ b/agc_2-X/trunk/extras/upgrade_2.4.sql @@ -1217,3 +1217,25 @@ ALTER TABLE vicidial_campaign_agents ADD campaign_grade TINYINT(2) UNSIGNED defa ALTER TABLE vicidial_campaigns MODIFY next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','campaign_rank','overall_user_level','fewest_calls','longest_wait_time','campaign_grade_random') default 'longest_wait_time'; UPDATE system_settings SET db_schema_version='1310',db_schema_update_date=NOW() where db_schema_version < 1310; + +CREATE TABLE vicidial_daily_max_stats ( +stats_date DATE NOT NULL, +stats_flag ENUM('OPEN','CLOSED','CLOSING') default 'CLOSED', +stats_type ENUM('TOTAL','INGROUP','CAMPAIGN','') default '', +campaign_id VARCHAR(20) default '', +update_time TIMESTAMP, +closed_time DATETIME, +max_channels MEDIUMINT(8) UNSIGNED default '0', +max_calls MEDIUMINT(8) UNSIGNED default '0', +max_inbound MEDIUMINT(8) UNSIGNED default '0', +max_outbound MEDIUMINT(8) UNSIGNED default '0', +max_agents MEDIUMINT(8) UNSIGNED default '0', +max_remote_agents MEDIUMINT(8) UNSIGNED default '0', +total_calls INT(9) UNSIGNED default '0', +index (stats_date), +index (stats_flag), +index (campaign_id) +); + +UPDATE system_settings SET db_schema_version='1311',db_schema_update_date=NOW() where db_schema_version < 1311; + diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index f48c9522..a6d23c6f 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -822,6 +822,11 @@ Another field in this section is GRADE, which allows for the campaign_grade_rand gives a higher probability of getting a call to the higher graded agents|| gives a higher probability of getting a call to the higher graded agents by in-group|| gives a higher probability of getting a call to the higher graded agents by campaign|| +Day call count for this in-group|| +Day call count for this campaign|| +SUMMARY STATS|| +Daily Maximum Stats|| +These are statistics that are generated by the system each day throughout the day until the timeclock end-of-day as it is set in the System Settings. These numbers are generated from the logs within the system to allow for much faster display. The stats are included are - Total Calls, Maximum Agents, Maximum inbound calls, Maximum outbound calls|| lead_report_export.php diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 18e08f10..624fd77f 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -5,6 +5,7 @@ # require("dbconnect.php"); +require("functions.php"); ###################################################################################################### ###################################################################################################### @@ -2442,7 +2443,7 @@ if ($non_latin < 1) ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); ### ALPHA-NUMERIC and spaces and dashes and underscores - $preset_name = ereg_replace("[^ -\_0-9a-zA-Z]","",$preset_name); + $preset_name = ereg_replace("[^- \_0-9a-zA-Z]","",$preset_name); ### ALPHA-NUMERIC and hash $group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); @@ -2460,88 +2461,88 @@ if ($non_latin < 1) ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores - $adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); - $adaptive_intensity = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_intensity); - $asterisk_version = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$asterisk_version); - $call_time_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_comments); - $call_time_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$call_time_name); - $campaign_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_name); + $adaptive_dl_diff_target = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_dl_diff_target); + $adaptive_intensity = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$adaptive_intensity); + $asterisk_version = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$asterisk_version); + $call_time_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_comments); + $call_time_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$call_time_name); + $campaign_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_name); $campaign_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$campaign_rec_filename); $ingroup_rec_filename = ereg_replace("[^\.-\_0-9a-zA-Z]","",$ingroup_rec_filename); - $company = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$company); - $full_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$full_name); - $fullname = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$fullname); - $group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_name); - $HKstatus = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$HKstatus); - $lead_filter_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_comments); - $lead_filter_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$lead_filter_name); - $list_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_name); - $local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$local_gmt); - $phone_type = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$phone_type); - $picture = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$picture); - $script_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_comments); - $script_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$script_name); - $server_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$server_description); - $status = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status); - $status_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$status_name); - $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); - $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); - $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); - $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); - $vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); - $vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); - $vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); - $code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$code_name); - $alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alias_name); - $shift_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$shift_name); - $did_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$did_description); - $alt_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alt_server_ip); - $template_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$template_name); - $carrier_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$carrier_name); - $group_alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_alias_name); - $caller_id_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$caller_id_name); - $user_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$user_code); - $territory = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$territory); - $tts_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$tts_name); - $moh_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$moh_name); - $timer_action_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$timer_action_message); - $external_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$external_server_ip); - $default_codecs = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$default_codecs); - $codecs_list = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$codecs_list); - $label_title = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_title); - $label_first_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_first_name); - $label_middle_initial = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_middle_initial); - $label_last_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_last_name); - $label_address1 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address1); - $label_address2 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address2); - $label_address3 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address3); - $label_city = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_city); - $label_state = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_state); - $label_province = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_province); - $label_postal_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_postal_code); - $label_vendor_lead_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_vendor_lead_code); - $label_gender = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_gender); - $label_phone_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_number); - $label_phone_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_code); - $label_alt_phone = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_alt_phone); - $label_security_phrase = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_security_phrase); - $label_email = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_email); - $label_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_comments); - $slave_db_server = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$slave_db_server); - $filter_phone_group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_name); - $filter_phone_group_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_description); - $filter_clean_cid_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_clean_cid_number); - $label_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_name); - $default_local_gmt = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$default_local_gmt); - $cid_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$cid_description); - $description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$description); - $first_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$first_name); - $last_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$last_name); - $bu_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$bu_name); - $department = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$department); - $group = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group); - $job_title = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$job_title); - $location = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$location); + $company = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$company); + $full_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$full_name); + $fullname = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$fullname); + $group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_name); + $HKstatus = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$HKstatus); + $lead_filter_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_comments); + $lead_filter_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$lead_filter_name); + $list_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_name); + $local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); + $phone_type = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$phone_type); + $picture = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$picture); + $script_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_comments); + $script_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$script_name); + $server_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$server_description); + $status = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status); + $status_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$status_name); + $wrapup_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$wrapup_message); + $pause_code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$pause_code_name); + $campaign_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$campaign_description); + $list_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$list_description); + $vcl_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vcl_name); + $vsc_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_name); + $vsc_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$vsc_description); + $code_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$code_name); + $alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alias_name); + $shift_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$shift_name); + $did_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$did_description); + $alt_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$alt_server_ip); + $template_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$template_name); + $carrier_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$carrier_name); + $group_alias_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group_alias_name); + $caller_id_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$caller_id_name); + $user_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$user_code); + $territory = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$territory); + $tts_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$tts_name); + $moh_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$moh_name); + $timer_action_message = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$timer_action_message); + $external_server_ip = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$external_server_ip); + $default_codecs = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_codecs); + $codecs_list = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$codecs_list); + $label_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_title); + $label_first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_first_name); + $label_middle_initial = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_middle_initial); + $label_last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_last_name); + $label_address1 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address1); + $label_address2 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address2); + $label_address3 = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_address3); + $label_city = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_city); + $label_state = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_state); + $label_province = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_province); + $label_postal_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_postal_code); + $label_vendor_lead_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_vendor_lead_code); + $label_gender = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_gender); + $label_phone_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_number); + $label_phone_code = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_phone_code); + $label_alt_phone = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_alt_phone); + $label_security_phrase = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_security_phrase); + $label_email = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_email); + $label_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_comments); + $slave_db_server = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$slave_db_server); + $filter_phone_group_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_name); + $filter_phone_group_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_phone_group_description); + $filter_clean_cid_number = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$filter_clean_cid_number); + $label_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$label_name); + $default_local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$default_local_gmt); + $cid_description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$cid_description); + $description = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$description); + $first_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$first_name); + $last_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$last_name); + $bu_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$bu_name); + $department = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$department); + $group = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group); + $job_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$job_title); + $location = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$location); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -2571,10 +2572,10 @@ if ($non_latin < 1) $filter_extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$filter_extension); ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma - $ivr_park_call_agi = ereg_replace("[^ -\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); + $ivr_park_call_agi = ereg_replace("[^- \*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma and equal - $voicemail_options = ereg_replace("[^ -\=\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$voicemail_options); + $voicemail_options = ereg_replace("[^- \=\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$voicemail_options); ### NUMERIC and comma and pipe $waitforsilence_options = ereg_replace("[^\|\,0-9a-zA-Z]","",$waitforsilence_options); @@ -3019,12 +3020,13 @@ else # 111116-0207 - Added ALT and ADDR3 in-group handle methods # 111122-1333 - Added Inbound Daily Report # 111201-0939 - Added graded-random next-agent-call option +# 111223-0043 - Added max stats displays for in-groups and , fixed several ereg issues # # 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.4-350a'; -$build = '111201-0939'; +$admin_version = '2.4-351a'; +$build = '111223-0043'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -3639,6 +3641,7 @@ if ($ADD==999997) {$hh='reports'; echo "CHANGE PASSWORD";} if ($ADD==999996) {$hh='reports'; echo "INITIAL INSTALL WELCOME";} if ($ADD==999995) {$hh='reports'; echo "COPYRIGHT TRADEMARK LICENSE";} if ($ADD==999994) {$hh='reports'; echo "ADMIN UTILITIES";} +if ($ADD==999993) {$hh='reports'; echo "SUMMARY STATS";} if ( ($ADD>9) and ($ADD < 99998) ) @@ -4632,6 +4635,11 @@ if ($ADD==99999)
Last Campaign Call Date - This is the last time that a call was handled by an agent logged into this campaign. +
+ +
+ Daily Maximum Stats - These are statistics that are generated by the system each day throughout the day until the timeclock end-of-day as it is set in the System Settings. These numbers are generated from the logs within the system to allow for much faster display. The stats are included are - Total Calls, Maximum Agents, Maximum inbound calls, Maximum outbound calls. +

@@ -11936,7 +11944,7 @@ if ($ADD==202) elseif (isset($_POST[$Factive])) {$Factive_value=$_POST[$Factive];} if (isset($_GET[$Fcid_description])) {$Fcid_description_value=$_GET[$Fcid_description];} elseif (isset($_POST[$Fcid_description])) {$Fcid_description_value=$_POST[$Fcid_description];} - $Fcid_description_value = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$Fcid_description_value); + $Fcid_description_value = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$Fcid_description_value); $Factive_value = ereg_replace("[^A-Z]","",$Factive_value); # echo "$campaign_id - $Xareacode[$o] - $Xoutbound_cid[$o] - $Factive($Factive_value|$Xactive[$o]) - $Fcid_description($Fcid_description_value|$Xcid_description[$o])
"; @@ -15790,7 +15798,7 @@ if ($ADD==4511) $option_description = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$option_description); $option_route = ereg_replace("[^-\_0-9a-zA-Z]","",$option_route); $option_route_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$option_route_value); - $option_route_value_context = ereg_replace("[^,-_0-9a-zA-Z]","",$option_route_value_context); + $option_route_value_context = ereg_replace("[^-\,\_0-9a-zA-Z]","",$option_route_value_context); } if (strlen($option_route) > 0) @@ -16039,7 +16047,7 @@ if ($ADD==411111) $group_shifts_ct = count($group_shifts); while ($p <= $group_shifts_ct) { - $group_shifts[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$group_shifts[$p]); + $group_shifts[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$group_shifts[$p]); $GROUP_shifts .= "$group_shifts[$p] "; $p++; } @@ -16048,7 +16056,7 @@ if ($ADD==411111) $vgroup_vgroups_ct = count($agent_status_viewable_groups); while ($p <= $vgroup_vgroups_ct) { - $agent_status_viewable_groups[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); + $agent_status_viewable_groups[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$agent_status_viewable_groups[$p]); $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; $p++; } @@ -16057,7 +16065,7 @@ if ($ADD==411111) $admin_viewable_groups_ct = count($admin_viewable_groups); while ($p <= $admin_viewable_groups_ct) { - $admin_viewable_groups[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$admin_viewable_groups[$p]); + $admin_viewable_groups[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$admin_viewable_groups[$p]); $Vadmin_viewable_groups .= "$admin_viewable_groups[$p] "; $p++; } @@ -16066,7 +16074,7 @@ if ($ADD==411111) $admin_viewable_call_times_ct = count($admin_viewable_call_times); while ($p <= $admin_viewable_call_times_ct) { - $admin_viewable_call_times[$p] = ereg_replace("[^ -_0-9a-zA-Z]","",$admin_viewable_call_times[$p]); + $admin_viewable_call_times[$p] = ereg_replace("[^- \_0-9a-zA-Z]","",$admin_viewable_call_times[$p]); $Vadmin_viewable_call_times .= "$admin_viewable_call_times[$p] "; $p++; } @@ -20661,6 +20669,11 @@ if ($ADD==31) echo "Campaign Change Date: $campaign_changedate   $NWB#vicidial_campaigns-campaign_changedate$NWE\n"; echo "Campaign Login Date: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE\n"; echo "Campaign Call Date: $campaign_calldate   $NWB#vicidial_campaigns-campaign_calldate$NWE\n"; + + echo "\n"; + horizontal_bar_chart($campaign_id,'8','campaign',$link,'total_calls','call count',1); + echo "\n"; + echo "Active: $NWB#vicidial_campaigns-active$NWE\n"; echo "Admin User Group: $NWB#vicidial_inbound_groups-group_color$NWE\n"; echo "Active: $NWB#vicidial_inbound_groups-active$NWE\n"; echo "In-Group Calldate: $group_calldate$NWB#vicidial_inbound_groups-group_calldate$NWE\n"; + + echo "\n"; + horizontal_bar_chart($group_id,'8','in-group',$link,'total_calls','call count',1); + echo "\n"; + echo "Admin User Group: $NWB#settings-use_non_latin$NWE\n"; echo "Webroot Writable: $NWB#settings-webroot_writable$NWE\n"; echo "VICIDIAL Agent Disable Display: