[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm,1.93,1.94

Mark Wells mark at wavetail.420.am
Thu Jul 15 13:34:48 PDT 2010


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

Modified Files:
	voip_cdr.pm 
Log Message:
add skip_dst_prefix option, RT#3288

Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -w -d -r1.93 -r1.94
--- voip_cdr.pm	14 Jul 2010 00:19:43 -0000	1.93
+++ voip_cdr.pm	15 Jul 2010 20:34:46 -0000	1.94
@@ -149,6 +149,9 @@
     'use_cdrtypenum' => { 'name' => 'Do not charge for CDRs where the CDR Type is not set to: ',
                          },
 
+    'skip_dst_prefix' => { 'name' => 'Do not charge for CDRs where the destination number starts with any of these values:',
+    },
+
     'skip_dcontext' => { 'name' => 'Do not charge for CDRs where the dcontext is set to any of these (comma-separated) values:',
                        },
 
@@ -248,8 +251,9 @@
                        disable_tollfree
                        use_amaflags use_disposition
                        use_disposition_taqua use_carrierid use_cdrtypenum
-                       skip_dcontext skip_dstchannel_prefix
-                       skip_src_length_more noskip_src_length_accountcode_tollfree
+                       skip_dcontext skip_dst_prefix 
+                       skip_dstchannel_prefix skip_src_length_more 
+                       noskip_src_length_accountcode_tollfree
                        accountcode_tollfree_ratenum
                        skip_dst_length_less skip_lastapp
                        use_duration
@@ -819,6 +823,7 @@
     use_disposition_taqua
     use_carrierid
     use_cdrtypenum
+    skip_dst_prefix
     skip_dcontext
     skip_dstchannel_prefix
     skip_src_length_more noskip_src_length_accountcode_tollfree
@@ -848,6 +853,11 @@
     if length($opt{'use_cdrtypenum'})
     && $cdr->cdrtypenum ne $opt{'use_cdrtypenum'}; #ne otherwise 0 matches ''
 
+  foreach(split(',',$opt{'skip_dst_prefix'})) {
+    return "dst starts with '$_'"
+    if length($_) && substr($cdr->dst,0,length($_)) eq $_;
+  }
+
   return "dcontext IN ( $opt{'skip_dcontext'} )"
     if $opt{'skip_dcontext'} =~ /\S/
     && grep { $cdr->dcontext eq $_ } split(/\s*,\s*/, $opt{'skip_dcontext'});



More information about the freeside-commits mailing list