my $svc_phone = qsearchs('svc_phone', { 'phonenum' => $number } );
unless ( $svc_phone ) {
#XXX set freesideratestatus or something so we don't keep retrying?
+ warn "no phone number found for CDR ". $cdr->acctid. "\n";
next;
}
my $cust_pkg = $svc_phone{$number}->cust_svc->cust_pkg;
unless ( $cust_pkg ) {
#XXX unlinked svc_phone?
- # warn and also set freesideratestatus or somesuch?
+ # also set freesideratestatus or somesuch?
+ warn "no package found (unlinked phone number?) for CDR ". $cdr->acctid. "\n";
next;
}
#XXX no package for this CDR
# warn and also set freesideratestatus or somesuch?
# or at least warn
+ warn "no CDR rating package for CDR ". $cdr->acctid. "\n";
next;
} elsif ( scalar(@part_pkg) > 1 ) {
warn "multiple package could rate CDR ". $cdr->acctid. "\n";
#then we can't prerate this CDR
#some sort of warning?
# (sucks if you're depending on credit limit fraud warnings)
+ warn "package has min_included; can't prerate CDR ". $cdr->acctid. "\n";
next;
}
'svcnum' => $svc_phone{$number}->svcnum,
);
if ( $error ) {
- #XXX ???
- warn $error;
- sleep 30;
+ warn "Can't prerate CDR ". $cdr->acctid. ' to '. $cdr->dst. ": $error";
+ #could be an included minutes CDR, so don't sleep 30;
} else {
#this could get expensive on a per-call basis
}
sub usage {
- die "Usage:\n\n freeside-cdrrewrited user\n";
+ die "Usage:\n\n freeside-cdrrated user\n";
}
=head1 NAME