[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm,1.96,1.97

Ivan,,, ivan at wavetail.420.am
Fri Sep 17 10:28:49 PDT 2010


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

Modified Files:
	voip_cdr.pm 
Log Message:
when using src_dst_length_less, add option to charge for CDRs where accountcode is toll free anyway, RT#9683

Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -w -d -r1.96 -r1.97
--- voip_cdr.pm	26 Aug 2010 21:10:25 -0000	1.96
+++ voip_cdr.pm	17 Sep 2010 17:28:47 -0000	1.97
@@ -161,7 +161,7 @@
     'skip_src_length_more' => { 'name' => 'Do not charge for CDRs where the source is more than this many digits:',
                               },
 
-    'noskip_src_length_accountcode_tollfree' => { 'name' => 'Do charge for CDRs where source is equal or greater than the specified digits and accountcode is toll free',
+    'noskip_src_length_accountcode_tollfree' => { 'name' => 'Do charge for CDRs where source is equal or greater than the specified digits, when accountcode is toll free',
                                                   'type' => 'checkbox',
                                                 },
 
@@ -178,6 +178,10 @@
     'skip_dst_length_less' => { 'name' => 'Do not charge for CDRs where the destination is less than this many digits:',
                               },
 
+    'noskip_dst_length_accountcode_tollfree' => { 'name' => 'Do charge for CDRs where dst is less than the specified digits, when accountcode is toll free',
+                                                  'type' => 'checkbox',
+                                                },
+
     'skip_lastapp' => { 'name' => 'Do not charge for CDRs where the lastapp matches this value',
                       },
 
@@ -255,7 +259,9 @@
                        skip_dstchannel_prefix skip_src_length_more 
                        noskip_src_length_accountcode_tollfree
                        accountcode_tollfree_ratenum
-                       skip_dst_length_less skip_lastapp
+                       skip_dst_length_less
+                       noskip_dst_length_accountcode_tollfree
+                       skip_lastapp
                        use_duration
                        411_rewrite
                        output_format usage_mandate summarize_usage usage_section
@@ -827,7 +833,7 @@
     skip_dcontext
     skip_dstchannel_prefix
     skip_src_length_more noskip_src_length_accountcode_tollfree
-    skip_dst_length_less
+    skip_dst_length_less noskip_dst_length_accountcode_tollfree
     skip_lastapp
   );
   foreach my $opt (grep !exists($flags{option_cache}->{$_}), @opt ) {
@@ -869,7 +875,10 @@
 
   my $dst_length = $opt{'skip_dst_length_less'};
   return "destination less than $dst_length digits"
-    if $dst_length && length($cdr->dst) < $dst_length;
+    if $dst_length && length($cdr->dst) < $dst_length
+    && ! ( $opt{'noskip_dst_length_accountcode_tollfree'}
+            && $cdr->is_tollfree
+         );
 
   return "lastapp is $opt{'skip_lastapp'}"
     if length($opt{'skip_lastapp'}) && $cdr->lastapp eq $opt{'skip_lastapp'};



More information about the freeside-commits mailing list