diff --git a/lib/NGCP/Panel/Controller/API/CallLists.pm b/lib/NGCP/Panel/Controller/API/CallLists.pm index bb7df4d65f..4ec1122492 100644 --- a/lib/NGCP/Panel/Controller/API/CallLists.pm +++ b/lib/NGCP/Panel/Controller/API/CallLists.pm @@ -205,6 +205,23 @@ sub query_params { second => sub {}, }, }, + { + param => 'call_id', + description => 'Filter for a particular call_id and sort by call leg depth.', + query => { + first => sub { + my $q = shift; + { + call_id => { like => $q.'%' }, + }; + }, + second => sub { + { + order_by => \"length(call_id) ASC, start_time ASC", + }; + }, + }, + }, ]; } diff --git a/lib/NGCP/Panel/Role/API/CallLists.pm b/lib/NGCP/Panel/Role/API/CallLists.pm index c1f9ae45ab..e19e1e6430 100644 --- a/lib/NGCP/Panel/Role/API/CallLists.pm +++ b/lib/NGCP/Panel/Role/API/CallLists.pm @@ -21,6 +21,7 @@ sub _item_rs { my ($self, $c) = @_; my $item_rs = $c->model('DB')->resultset('cdr'); + if($c->user->roles eq "admin") { } elsif($c->user->roles eq "reseller") { $item_rs = $item_rs->search({