[freeside-commits] branch FREESIDE_3_BRANCH updated. 146c2e9563b8afc05fe283791b998723ca585742
Ivan
ivan at 420.am
Wed Jun 29 14:29:49 PDT 2016
The branch, FREESIDE_3_BRANCH has been updated
via 146c2e9563b8afc05fe283791b998723ca585742 (commit)
from 21b66c72a2442c50461fe9b23e09677d42988596 (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 146c2e9563b8afc05fe283791b998723ca585742
Author: Ivan Kohler <ivan at freeside.biz>
Date: Wed Jun 29 14:29:48 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 2d53ace..98df561 100644
--- a/FS/FS/part_pkg/voip_cdr.pm
+++ b/FS/FS/part_pkg/voip_cdr.pm
@@ -188,7 +188,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:',
@@ -591,6 +594,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
-----------------------------------------------------------------------
Summary of changes:
FS/FS/part_pkg/voip_cdr.pm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
More information about the freeside-commits
mailing list