X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2Fbin%2Ffreeside-cdrrewrited;h=846b0b976cc485f9c2e1a2f882d5d3bcac103b95;hb=8688a1fe1b157c1061e928823d81ba1b7f34cde8;hp=ac0a1ce4f18099ac6928d29955a52071ce535668;hpb=7fb4524a6efd3aeffe137b1bb42141f38d7be988;p=freeside.git diff --git a/FS/bin/freeside-cdrrewrited b/FS/bin/freeside-cdrrewrited index ac0a1ce4f..846b0b976 100644 --- a/FS/bin/freeside-cdrrewrited +++ b/FS/bin/freeside-cdrrewrited @@ -49,6 +49,7 @@ while (1) { : ''; my $found = 0; + my %skip = (); foreach my $cdr ( qsearch( { 'table' => 'cdr', @@ -61,6 +62,8 @@ while (1) { } ) ) { + next if $skip{$cdr->acctid}; + $found = 1; my @status = (); @@ -106,10 +109,10 @@ while (1) { 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; @@ -125,6 +128,7 @@ while (1) { 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