'sub {
my( $call_ids, $call_id, $index ) = @_;
ceil(
( $call_ids->{$call_id}->{$index}->{duration_milliseconds} / 1000. ) / 6
) * 6 / 60;
}'
'sub {
my( $call_ids, $call_id, $index ) = @_;
if($call_ids->{$call_id}->{$index}->{ release_code } == 503 ){
1;
}
else{
0;
}
}'
'sub {
my( $call_ids, $call_id, $index ) = @_;
my $route = $call_ids->{$call_id}{$index}{ route };
my $src_state = $call_ids->{$call_id}{$index}{ o_state };
my $dest_state = $call_ids->{$call_id}{$index}{ t_state };
my $juris_indicator = 'f';
if( !$src_state ){
$juris_indicator = 'c';
}
elsif( $src_state eq $dest_state ){
$juris_indicator = 'a';
}else {
$juris_indicator = 'b';
};
$route =~ /^[a|b|c](1[2-9][0-9]{2}[2-9][0-9]{2})/;
$corrected_route = $juris_indicator . $1;
$corrected_route = $route if $route =~ /loop|none|lnp_error|no_juris_digits/;
$corrected_route = $route if !$corrected_route;
join ',',
$call_ids->{$call_id}{$index}{ day },
$call_ids->{$call_id}{$index}{ day_chunk },
$call_ids->{$call_id}{$index}{ o_trunk },
$call_ids->{$call_id}{$index}{ t_trunk },
$call_ids->{$call_id}{$index}{ route },
$corrected_route;
}'
####
$agg_snippets{ $_ }{snippet} = eval $agg_snippets{ $_ }{snippet} for keys %{ $agg_snippets };
####
for my $this_call_id ( sort keys %$call_ids ) {
$count++;
next if !$this_call_id;
my $route_attempts = 0;
for my $this_index ( sort keys %{ $call_ids->{ $this_call_id } } ) {
$route_attempts++;
foreach $aggregate_name ( keys %{ $agg_snippets } ){
my $this_group_data = eval $grouping_data_eval;
$summary_data->{$this_group_data}{$aggregate_name} = 0 if !$summary_data->{$this_group_data}->{$aggregate_name};
$summary_data->{$this_group_data}{$aggregate_name} +=
$agg_snippets->{$aggregate_name}{snippet}->( $call_ids, $this_call_id, $this_index );
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
}
}