MT#7935 Show callid, cost and link to callmap.

In call history of a subscriber, link to callmap, and show the
call-id and source customer cost in case of admin/reseller.
gjungwirth/voicemail_number
Andreas Granig 11 years ago
parent 5409d3834b
commit 0d577b3490

@ -5,6 +5,7 @@ BEGIN { extends 'Catalyst::Controller'; }
use NGCP::Panel::Utils::Callflow;
use NGCP::Panel::Utils::Navigation;
use NGCP::Panel::Utils::Message;
use HTML::Entities;
@ -111,6 +112,7 @@ sub get_png :Chained('callflow_base') :PathPart('png') :Args(0) {
sub get_callmap :Chained('callflow_base') :PathPart('callmap') :Args(0) {
my ($self, $c) = @_;
my $cid = $c->stash->{callid};
$c->stash->{template} = 'callflow/callmap.tt';
my $calls_rs = $c->model('DB')->resultset('messages')->search({
'me.call_id' => { -in => [ $cid, $cid.'_b2b-1', $cid.'_pbx-1' ] },
@ -119,12 +121,13 @@ sub get_callmap :Chained('callflow_base') :PathPart('callmap') :Args(0) {
});
my $calls = [ $calls_rs->all ];
my $map = NGCP::Panel::Utils::Callflow::generate_callmap($c, $calls);
$c->stash(
canvas => $map,
template => 'callflow/callmap.tt',
);
unless(@{ $calls }) {
$c->log->error("No packets for call-id $cid found");
$c->stash(messages => [{type => 'error', text => $c->loc('No packets for this Call-ID found.')}])
} else {
my $map = NGCP::Panel::Utils::Callflow::generate_callmap($c, $calls);
$c->stash->{canvas} = $map;
}
}
sub get_packet :Chained('callflow_base') :PathPart('packet') :Args() {

@ -1858,13 +1858,19 @@ sub load_preference_list :Private {
sub master :Chained('base') :PathPart('details') :CaptureArgs(0) {
my ($self, $c) = @_;
$c->stash->{calls_dt_columns} = NGCP::Panel::Utils::Datatables::set_columns($c, [
my $call_cols = [
{ name => "source_user", search => 1, title => $c->loc('Caller') },
{ name => "destination_user", search => 1, title => $c->loc('Callee') },
{ name => "call_status", search => 1, title => $c->loc('Status') },
{ name => "start_time", search_from_epoch => 1, search_to_epoch => 1, title => $c->loc('Start Time') },
{ name => "duration", search => 1, title => $c->loc('Duration') },
]);
];
push @{ $call_cols }, (
{ name => "call_id", search => 1, title => $c->loc('Call-ID') },
{ name => "source_customer_cost", search => 1, title => $c->loc('Source Cust Cost (cents)') },
) if($c->user->roles eq "admin" || $c->user->roles eq "reseller");
$c->stash->{calls_dt_columns} = NGCP::Panel::Utils::Datatables::set_columns($c, $call_cols);
$c->stash->{vm_dt_columns} = NGCP::Panel::Utils::Datatables::set_columns($c, [
{ name => "id", search => 1, title => $c->loc('#') },
{ name => "callerid", search => 1, title => $c->loc('Caller') },

@ -178,7 +178,7 @@ sub AUTOLOAD {
my($pack,$func_name) = $AUTOLOAD=~/(.+)::([^:]+)$/;
return if $func_name eq 'DESTROY';
if (ref $self && exists $self->{gd}) {
if (ref $self && defined $self->{gd}) {
$self->{gd}->$func_name(@_);
} else {
my @result = $IMAGECLASS->$func_name(@_);

@ -19,6 +19,7 @@ log4perl.appender.Default.layout.ConversionPattern=%d{ISO8601} [%p] [%F +%L] %m{
</contact>
<features>
callflow 1
multidomain 1
faxserver 1
@ -93,6 +94,7 @@ log4perl.appender.Default.layout.ConversionPattern=%d{ISO8601} [%p] [%F +%L] %m{
proxy 127.0.0.1:5062
sbc 127.0.0.1:5080
app 127.0.0.1:5070
pbx 127.0.0.1:5085
</callflow>
<ssl>

@ -13,7 +13,9 @@
<div class="row">
<span class="pull-left" style="margin:0 5px 0 5px;">
<a class="btn btn-primary btn-large" href="[% c.uri_for('/back') %]"><i class="icon-arrow-left"></i> [% c.loc('Back') %]</a>
[% IF canvas -%]
<a class="btn btn-primary btn-large" href="[% c.uri_for_action('/callflow/get_pcap', c.req.captures) %]"><i class="icon-file"></i> [% c.loc('Download PCAP') %]</a>
[% END -%]
</span>
</div>
[% back_created = 1 -%]
@ -25,7 +27,7 @@
</div>
<div class="ngcp-separator"></div>
[% IF canvas -%]
<img src="[% c.uri_for_action('/callflow/get_png', c.req.captures) %]"
width="[% canvas.width %]" height="[% canvas.height %]" usemap="#diamap" style="min-width:[% canvas.width %]px !important" />
<map name="diamap">
@ -33,5 +35,6 @@
<area shape="rect" coords="[% area.coords %]" href="javascript:pkgPopup([% area.id %])" />
[% END -%]
</map>
[% END -%]
[% # vim: set tabstop=4 syntax=html expandtab: -%]

@ -178,6 +178,12 @@
helper.form_object = form;
helper.ajax_uri = c.uri_for_action('/subscriber/ajax_calls', [c.req.captures.0]);
IF (c.user.roles == "admin" || c.user.roles == "reseller") && c.config.features.callflow;
helper.dt_buttons = [
{ name = c.loc('Call Flow'), uri = "/callflow/'+encodeURIComponent(full.call_id)+'/callmap", class = 'btn-small btn-primary', icon = 'icon-random' },
];
END;
PROCESS 'helpers/datatables.tt';
%]
</div>

Loading…
Cancel
Save