+ 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
+ # trigger in a separate process with less frequency?
+
+ my $cust_main = $cust_pkg{ $pkgnum{$number} }->cust_main;
+
+ my $error = $cust_main->check_credit_limit;
+ if ( $error ) {
+ #"should never happen" normally, but as a daemon, better to survive
+ # e.g. database going away and coming back and resume doing our thing
+ warn $error;
+ sleep 30;
+ }
+