From 34c05dafbba6f5394b4324317ff82700d70b2ccd Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Fri, 22 May 2015 17:57:58 +0300 Subject: [PATCH] MT#12813 Dont set direction to in for empty destination_user_id Change-Id: I3ca6747bff2009c08bbfb5696e47d6597edb7b59 --- lib/NGCP/Panel/Role/API/CallLists.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/NGCP/Panel/Role/API/CallLists.pm b/lib/NGCP/Panel/Role/API/CallLists.pm index b51157aaef..190213c380 100644 --- a/lib/NGCP/Panel/Role/API/CallLists.pm +++ b/lib/NGCP/Panel/Role/API/CallLists.pm @@ -123,7 +123,8 @@ sub resource_from_item { # out by default if(defined $sub && $sub->uuid eq $item->destination_user_id) { $resource->{direction} = "in"; - } elsif (defined $cust && $item->destination_account_id == $cust->id) { + } elsif (defined $cust && $item->destination_account_id == $cust->id + && ( $item->source_account_id != $cust->id || $item->destination_user_id ) ) { $resource->{direction} = "in"; } else { $resource->{direction} = "out"; @@ -242,7 +243,7 @@ sub resource_from_item { number => $resource->{other_cli}, direction => "caller_out" ); } - if (($sub // $own_sub)->status eq "terminated") { + if ( (!($sub // $own_sub)) || (($sub // $own_sub)->status eq "terminated") ) { $resource->{own_cli} .= " (terminated)"; } $resource->{status} = $item->call_status;