[freeside-commits] branch master updated. 674cb2d9d7105f4cc2871539b2e9f7088cdaa750

Ivan ivan at 420.am
Wed Jun 29 14:29:45 PDT 2016


The branch, master has been updated
       via  674cb2d9d7105f4cc2871539b2e9f7088cdaa750 (commit)
       via  54eead497d6a8acea3ad8575d194fe027672dbf1 (commit)
      from  8f1500df332a86f1abe55a046778e42b21459430 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 674cb2d9d7105f4cc2871539b2e9f7088cdaa750
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jun 29 14:29:44 2016 -0700

    add skip_dcontext_suffix to skip CDRs with dcontext ending in a definable string, RT#71529

diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm
index 24c4cf0..0ff4e54 100644
--- a/FS/FS/part_pkg/voip_cdr.pm
+++ b/FS/FS/part_pkg/voip_cdr.pm
@@ -185,7 +185,10 @@ tie my %accountcode_tollfree_field, 'Tie::IxHash',
     '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: ',
+    'skip_dcontext' => { 'name' => 'Do not charge for CDRs where dcontext is set to any of these (comma-separated) values: ',
+                       },
+
+    'skip_dcontext_suffix' => { 'name' => 'Do not charge for CDRs where dcontext ends with: ',
                        },
 
     'skip_dstchannel_prefix' => { 'name' => 'Do not charge for CDRs where the dstchannel starts with:',
@@ -588,6 +591,11 @@ sub check_chargable {
     if $self->option_cacheable('skip_dcontext') =~ /\S/
     && grep { $cdr->dcontext eq $_ } split(/\s*,\s*/, $self->option_cacheable('skip_dcontext'));
 
+  my $len_suffix = length($self->option_cacheable('skip_dcontext_suffix'));
+  return "dcontext ends with ". $self->option_cacheable('skip_dcontext_suffix')
+    if $len_suffix
+    && substr($cdr->dcontext,-$len_suffix,$len_suffix) eq $self->option_cacheable('skip_dcontext_suffix');
+
   my $len_prefix = length($self->option_cacheable('skip_dstchannel_prefix'));
   return "dstchannel starts with ". $self->option_cacheable('skip_dstchannel_prefix')
     if $len_prefix

commit 54eead497d6a8acea3ad8575d194fe027672dbf1
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jun 29 14:10:22 2016 -0700

    use Tie::IxHash module explicitly, don't rely on load order

diff --git a/FS/FS/part_pkg/prorate_Mixin.pm b/FS/FS/part_pkg/prorate_Mixin.pm
index beae6d8..a89b54d 100644
--- a/FS/FS/part_pkg/prorate_Mixin.pm
+++ b/FS/FS/part_pkg/prorate_Mixin.pm
@@ -2,6 +2,7 @@ package FS::part_pkg::prorate_Mixin;
 
 use strict;
 use vars qw( %info );
+use Tie::IxHash;
 use Time::Local qw( timelocal timelocal_nocheck );
 use Date::Format qw( time2str );
 use List::Util qw( min );

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/part_pkg/prorate_Mixin.pm |    1 +
 FS/FS/part_pkg/voip_cdr.pm      |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list