: '';
my $found = 0;
+ my %skip = ();
foreach my $cdr (
qsearch( {
'table' => 'cdr',
} )
) {
+ next if $skip{$cdr->acctid};
+
$found = 1;
my @status = ();
my $cantfind = "can't find primary CDR with session ". $cdr->sessionnum.
", src ". $cdr->subscriber;
if ( $cdr->calldate_unix + $accountcode_giveup < time ) {
- warn" ERROR: $cantfind; giving up\n";
+ warn "ERROR: $cantfind; giving up\n";
push @status, 'taqua-accountcode-NOTFOUND';
$cdr->status('done'); #so it doesn't try to rate
- delete $accountcode_unmatch($cdr->acctid}; #so it doesn't suck mem
+ delete $accountcode_unmatch{$cdr->acctid}; #so it doesn't suck mem
} else {
warn "WARNING: $cantfind; will keep trying\n";
$accountcode_unmatch{$cdr->acctid} = time;
warn "WARNING: error rewriting primary CDR (will retry): $error\n";
next;
}
+ $skip{$primary->acctid} = 1;
push @status, 'taqua-accountcode';
$cdr->status('done'); #so it doesn't try to rate