diff --git a/bin/AST_VDauto_dial_FILL.pl b/bin/AST_VDauto_dial_FILL.pl index 0e2ebc9a..cee2aeda 100644 --- a/bin/AST_VDauto_dial_FILL.pl +++ b/bin/AST_VDauto_dial_FILL.pl @@ -843,7 +843,7 @@ while($one_day_interval > 0) if ( ($staggered > 0) && ($staggered_ct > 0) ) { $staggered_fill=0; - $stmtA = "SELECT count(*),vicidial_balance_rank FROM servers group by vicidial_balance_rank order by vicidial_balance_rank desc;"; + $stmtA = "SELECT count(*),vicidial_balance_rank FROM servers where vicidial_balance_active = 'Y' group by vicidial_balance_rank order by vicidial_balance_rank desc;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -862,7 +862,7 @@ while($one_day_interval > 0) while ( ($st_ct > $staggered_rank_ct) && ($staggered_ct > $staggered_fill) ) { $TOTAL_available=0; - $stmtA = "SELECT server_ip FROM servers where vicidial_balance_rank='$ST_rank[$staggered_rank_ct]' order by server_ip LIMIT $ST_count[$staggered_rank_ct];"; + $stmtA = "SELECT server_ip FROM servers where vicidial_balance_rank='$ST_rank[$staggered_rank_ct]' and vicidial_balance_active = 'Y' order by server_ip LIMIT $ST_count[$staggered_rank_ct];"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArowsSIPS=$sthA->rows;