TT#70859 charge extrarate only if call duration exceeds

Change-Id: I26fc3f1f43e585426566b8ab067172c5e6bd09d7
changes/49/36149/1
Rene Krenn 5 years ago
parent 9e25252d36
commit 86968a7e02

@ -2356,6 +2356,7 @@ sub get_call_cost {
my $extra_second_time = int($cdr->{_start_time}) + $extra_second;
if ($extra_second_time >= $current_call_time
and $extra_second_time < ($current_call_time + $interval)
and ($current_call_time + int($duration)) >= $extra_second_time
and int($cdr->{start_time}) <= $extra_second_time) {
DEBUG "add extra second ($extra_second) cost $extra_rate to rate $rate";
$rate += $extra_rate;

@ -61,7 +61,7 @@ foreach my $extra_second (undef, 0, 60, $init_secs + $follow_secs - 1,$init_secs
if (ok((scalar @cdr_ids) > 0 && Utils::Rateomat::run_rateomat_threads(),'rate-o-mat executed')) {
my $caller_cdr_map = {};
my $label = 'extra_second ' . $extra_second . 'extra_rate ' . $extra_second . ': ';
my $label = 'extra_second ' . ($extra_second // '(none)') . 'extra_rate ' . $extra_second . ': ';
ok(Utils::Rateomat::check_cdrs($label,
map {
my $cdr = Utils::Rateomat::get_cdrs($_);

Loading…
Cancel
Save