'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_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 the dcontext is set to any of these (comma-separated) values: ',
},
'skip_dstchannel_prefix' => { 'name' => 'Do not charge for CDRs where the dstchannel starts with:',
'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',
},
'accountcode_tollfree_ratenum' => {
- 'name' => 'Optional alternate rate plan when accountcode is toll free',
+ 'name' => 'Optional alternate rate plan when accountcode is toll free: ',
'type' => 'select',
'select_table' => 'rate',
'select_key' => 'ratenum',
'skip_dst_length_less' => { 'name' => 'Do not charge for CDRs where the destination is less than this many digits:',
},
- 'skip_lastapp' => { 'name' => 'Do not charge for CDRs where the lastapp matches this value',
+ '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: ',
},
+ 'skip_max_callers' => { 'name' => 'Do not charge for CDRs where max_callers is greater than this value: ',
+ },
+
'use_duration' => { 'name' => 'Calculate usage based on the duration field instead of the billsec field',
'type' => 'checkbox',
},
'default' => 'default', #XXX test
},
- 'usage_section' => { 'name' => 'Section in which to place usage charges (whether separated or not)',
+ 'usage_section' => { 'name' => 'Section in which to place usage charges (whether separated or not): ',
},
'summarize_usage' => { 'name' => 'Include usage summary with recurring charges when usage is in separate section',
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
+ skip_max_callers
use_duration
411_rewrite
output_format usage_mandate summarize_usage usage_section
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
+ skip_max_callers
);
foreach my $opt (grep !exists($flags{option_cache}->{$_}), @opt ) {
$flags{option_cache}->{$opt} = $self->option($opt, 1);
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'};
}
+ return "max_callers > $opt{skip_max_callers}"
+ if length($opt{'skip_max_callers'})
+ and length($cdr->max_callers)
+ and $cdr->max_callers > $opt{'skip_max_callers'};
+
#all right then, rate it
'';
}