From aeea3507061a3653e5babb856f69918e0686d7cf Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Tue, 24 Jun 2025 10:26:53 +0200 Subject: [PATCH] MT#60845 /api/calllists add filter by duration * new query params duration_ge and duration_le that enables filtering by the duration range. Change-Id: I2425bfc97aeed4c74d13420d3c50c92211ef5fd5 --- lib/NGCP/Panel/Controller/API/CallLists.pm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/NGCP/Panel/Controller/API/CallLists.pm b/lib/NGCP/Panel/Controller/API/CallLists.pm index 4d29c33555..325d14bb68 100644 --- a/lib/NGCP/Panel/Controller/API/CallLists.pm +++ b/lib/NGCP/Panel/Controller/API/CallLists.pm @@ -283,6 +283,28 @@ sub query_params { }, }, + { + param => 'duration_ge', + description => 'Filter for calls with duration being greater or equal the specified value.', + query => { + first => sub { + my $q = shift; + { 'me.duration' => { '>=' => $q } }; + }, + second => sub {}, + }, + }, + { + param => 'duration_le', + description => 'Filter for calls with duration lower or equal the specified value.', + query => { + first => sub { + my $q = shift; + { 'me.duration' => { '<=' => $q } }; + }, + second => sub {}, + }, + }, ]; }