From 8053c478ad4bf0348a3642cd8173169fca30137a Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 3 Oct 2006 16:27:52 +0000 Subject: [PATCH] change to flush DB script to remove more vicidial_manager records if server logs are turned off git-svn-id: svn://192.168.202.10@324 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/bin/AST_flush_DBqueue.pl | 35 +++++++++++++++++-- .../TO_BE_TRANSLATED_2.0.2.txt | 19 ++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/agc_2-X/trunk/bin/AST_flush_DBqueue.pl b/agc_2-X/trunk/bin/AST_flush_DBqueue.pl index 188de63c..78571352 100644 --- a/agc_2-X/trunk/bin/AST_flush_DBqueue.pl +++ b/agc_2-X/trunk/bin/AST_flush_DBqueue.pl @@ -39,6 +39,17 @@ $SQLdate_NOW="$year-$mon-$mday $hour:$min:$sec"; if ($sec < 10) {$sec = "0$sec";} $SQLdate_NEG_1hour="$year-$mon-$mday $hour:$min:$sec"; +($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()-1800); + $year = ($year + 1900); + $yy = $year; $yy =~ s/^..//gi; + $mon++; + if ($mon < 10) {$mon = "0$mon";} + if ($mday < 10) {$mday = "0$mday";} + if ($hour < 10) {$hour = "0$hour";} + if ($min < 10) {$min = "0$min";} + if ($sec < 10) {$sec = "0$sec";} +$SQLdate_NEG_halfhour="$year-$mon-$mday $hour:$min:$sec"; + ### begin parsing run-time options ### if (length($ARGV[0])>1) { @@ -130,11 +141,31 @@ use DBI; $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") or die "Couldn't connect to database: " . DBI->errstr; +### Grab Server values from the database + $stmtA = "SELECT vd_server_logs FROM servers where server_ip = '$VARserver_ip';"; + $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; + $DBvd_server_logs = "$aryA[0]"; + if ($DBvd_server_logs =~ /Y/) {$SYSLOG = '1';} + else {$SYSLOG = '0';} + $rec_count++; + } + $sthA->finish(); - $stmtA = "delete from vicidial_manager where server_ip='$server_ip' and entry_date < '$SQLdate_NEG_1hour';"; +if ($SYSLOG) + {$flush_time = $SQLdate_NEG_1hour;} +else + {$flush_time = $SQLdate_NEG_halfhour;} + + $stmtA = "delete from vicidial_manager where server_ip='$server_ip' and entry_date < '$flush_time';"; if($DB){print STDERR "\n|$stmtA|\n";} if (!$T) { $affected_rows = $dbhA->do($stmtA);} - if (!$Q) {print " - vicidial_manager 1 hour flush\n";} + if (!$Q) {print " - vicidial_manager flush\n";} $stmtA = "optimize table vicidial_manager;"; if($DB){print STDERR "\n|$stmtA|\n";} diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.2.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.2.txt index dc69d42c..d2351bdd 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.2.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.2.txt @@ -1,9 +1,28 @@ ############################################################ ADMIN +VICIDIAL Server Trunks allows you to restrict the outgoing lines that are used on this server for campaign dialing on a per-campaign basis. You have the option to reserve a specific number of lines to be used by only one campaign as well as allowing that campaign to run over its reserved lines into whatever lines remain open, as long at the total lines used by vicidial on this server is less than the Max VICIDIAL Trunks setting. Not having any of these records will allow the campaign that dials the line first to have as many lines as it can get under the Max VICIDIAL Trunks setting VICIDIAL Balance Dialing -<\/B> Setting this field to Y will allow the server to place balance calls for campaigns in VICIDIAL so that the defined dial level can be met even if there are no agents logged into that campaign on this server. Default is N VICIDIAL Balance Offlimits -<\/B> This setting defines the number of trunks to not allow VICIDIAL balance dialing to use. For example if you have 40 max vicidial trunks and balance offlimits is set to 10 you will only be able to use 30 trunk lines for VICIDIAL balance dialing. Default is 0 +VICIDIAL SERVER TRUNK RECORD NOT ADDED +there is already a server-trunk record for this campaign +the number of vicidial trunks is too high +VICIDIAL SERVER TRUNK RECORD ADDED +VICIDIAL SERVER TRUNK RECORD NOT MODIFIED +VICIDIAL SERVER TRUNK RECORD MODIFIED +VICIDIAL SERVER TRUNK RECORD NOT DELETED +VICIDIAL SERVER TRUNK RECORD DELETED +campaign must be between 3 and 8 characters in length +server_ip delay must be at least 7 characters +trunks must be a digit from 0 to 9999 VICIDIAL Balance Dialing VICIDIAL Balance Offlimits +ADDING NEW SERVER VICIDIAL TRUNK RECORD +ADD NEW SERVER VICIDIAL TRUNK RECORD +MODIFY SERVER VICIDIAL TRUNK RECORD +DELETE SERVER VICIDIAL TRUNK RECORD +VICIDIAL TRUNKS FOR THIS SERVER +RESTRICTION +TRUNKS ############################################################ CLIENT