X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fvoip_cdr.pm;h=81de0bda089b76443067d3bfcdbd0788d2eda1d8;hb=fe8914c3b55d747fc4c3559b17d8d0ef6ed1a0b3;hp=836387325698b2d032176053140a308afdb8a4b1;hpb=90dfd05877a331fb13ba50389e3d8a3105465bc7;p=freeside.git diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm index 836387325..81de0bda0 100644 --- a/FS/FS/part_pkg/voip_cdr.pm +++ b/FS/FS/part_pkg/voip_cdr.pm @@ -133,14 +133,14 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities(); 'type' => 'checkbox', }, - 'use_amaflags' => { 'name' => 'Do not charge for CDRs where the amaflags field is not set to "2" ("BILL"/"BILLING").', + 'use_amaflags' => { 'name' => 'Only charge for CDRs where the amaflags field is set to "2" ("BILL"/"BILLING").', 'type' => 'checkbox', }, - 'use_carrierid' => { 'name' => 'Do not charge for CDRs where the Carrier ID is not set to: ', + 'use_carrierid' => { 'name' => 'Only charge for CDRs where the Carrier ID is set to: ', }, - 'use_cdrtypenum' => { 'name' => 'Do not charge for CDRs where the CDR Type is not set to: ', + 'use_cdrtypenum' => { 'name' => 'Only charge for CDRs where the CDR Type is set to: ', }, 'ignore_cdrtypenum' => { 'name' => 'Do not charge for CDRs where the CDR Type is set to: ', @@ -149,7 +149,7 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities(); 'ignore_disposition' => { 'name' => 'Do not charge for CDRs where the Disposition is set to any of these (comma-separated) values: ', }, - 'disposition_in' => { 'name' => 'Do not charge for CDRs where the Disposition is not set to any of these (comma-separated) values: ', + 'disposition_in' => { 'name' => 'Only charge for CDRs where the Disposition is set to any of these (comma-separated) values: ', }, 'skip_dst_prefix' => { 'name' => 'Do not charge for CDRs where the destination number starts with any of these values: ', @@ -774,6 +774,7 @@ sub calc_usage { $classnum, $phonenum, $cdr->accountcode, + $cdr->startdate, $seconds, $regionname, ]; @@ -786,6 +787,7 @@ sub calc_usage { $classnum, $phonenum, $cdr->accountcode, + $cdr->startdate, $seconds, $regionname, ]; @@ -897,6 +899,11 @@ sub check_chargable { if $opt{'ignore_disposition'} =~ /\S/ && grep { $cdr->disposition eq $_ } split(/\s*,\s*/, $opt{'ignore_disposition'}); + foreach(split(/\s*,\s*/, $opt{'skip_dst_prefix'})) { + return "dst starts with '$_'" + if length($_) && substr($cdr->dst,0,length($_)) eq $_; + } + return "carrierid != $opt{'use_carrierid'}" if length($opt{'use_carrierid'}) && $cdr->carrierid ne $opt{'use_carrierid'} #ne otherwise 0 matches '' @@ -910,11 +917,6 @@ sub check_chargable { if length($opt{'ignore_cdrtypenum'}) && $cdr->cdrtypenum eq $opt{'ignore_cdrtypenum'}; #eq 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'});