freeside/FS/FS/part_pkg voip_sqlradacct.pm,1.5,1.6

ivan ivan at pouncequick.420.am
Wed Jan 5 02:01:45 PST 2005


Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory pouncequick:/tmp/cvs-serv22433

Modified Files:
	voip_sqlradacct.pm 
Log Message:
add some debugging to voip_sqlradacct

Index: voip_sqlradacct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_sqlradacct.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- voip_sqlradacct.pm	31 Dec 2004 08:31:03 -0000	1.5
+++ voip_sqlradacct.pm	5 Jan 2005 10:01:41 -0000	1.6
@@ -9,7 +9,7 @@
 
 @ISA = qw(FS::part_pkg);
 
-$DEBUG = 0;
+$DEBUG = 1;
 
 %info = (
     'name' => 'VoIP rating by plan of CDR records in an SQL RADIUS radacct table',
@@ -90,6 +90,8 @@
         $countrycode = '1';
       }
 
+      warn "rating call to +$countrycode $dest" if $DEBUG;
+
       #find a rate prefix, first look at most specific (4 digits) then 3, etc.,
       # finally trying the country code only
       my $rate_prefix = '';
@@ -106,6 +108,7 @@
 
       unless ( $rate_prefix ) {
         if ( $self->option('ignore_unrateable') ) {
+          warn "  skipping unrateable call to +$countrycode $dest";
           next;
         } else {
           die "Can't find rate for call to +$countrycode $dest\n"
@@ -119,6 +122,10 @@
         'dest_regionnum' => $regionnum,
       } );
 
+      warn "  found rate for regionnum $regionnum ".
+           "and rate detail $rate_detail"
+        if $DEBUG;
+
       ###
       # find the price and add detail to the invoice
       ###
@@ -141,6 +148,15 @@
         $charge = sprintf('%.2f', $rate_detail->min_charge * $charge_min );
         $charges += $charge;
       }
+
+      warn "  adding details on charge to invoice: ".
+           join(' - ', 
+             "+$countrycode $dest",
+             $rate_prefix->rate_region->regionname,
+             $minutes.'m',
+             '$'.$charge,
+           )
+        if $DEBUG;
 
       push @$details, 
         #[




More information about the freeside-commits mailing list