[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm,1.37,1.38

Ivan,,, ivan at wavetail.420.am
Thu Oct 16 15:45:21 PDT 2008


Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv29679

Modified Files:
	voip_cdr.pm 
Log Message:
add an option to use duration instead of billsec to calculate billable time, RT#4147

Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- voip_cdr.pm	4 Oct 2008 20:43:51 -0000	1.37
+++ voip_cdr.pm	16 Oct 2008 22:45:19 -0000	1.38
@@ -106,6 +106,10 @@
     'use_cdrtypenum' => { 'name' => 'Do not charge for CDRs where the CDR Type is not set to: ',
                          },
 
+    'use_duration'   => { 'name' => 'Calculate usage based on the duration field instead of the billsec field',
+                          'type' => 'checkbox',
+                        },
+
     '411_rewrite' => { 'name' => 'Rewrite these (comma-separated) destination numbers to 411 for rating purposes: ',
                       },
 
@@ -154,6 +158,7 @@
                        disable_tollfree
                        use_amaflags use_disposition
                        use_disposition_taqua use_carrierid use_cdrtypenum
+                       use_duration
                        411_rewrite
                        output_format summarize_usage usage_section
                      )
@@ -415,7 +420,12 @@
             unless exists $included_min{$regionnum};
 
           my $granularity = $rate_detail->sec_granularity;
-          my $seconds = $cdr->billsec; # length($cdr->billsec) ? $cdr->billsec : $cdr->duration;
+
+                      # length($cdr->billsec) ? $cdr->billsec : $cdr->duration;
+          my $seconds = $self->option('use_duration')
+                          ? $cdr->duration
+                          : $cdr->billsec;
+
           $seconds += $granularity - ( $seconds % $granularity )
             if $seconds      # don't granular-ize 0 billsec calls (bills them)
             && $granularity; # 0 is per call



More information about the freeside-commits mailing list