From 56d5094cb36d84bfe1c60ce2320215ab4b1c2b1c Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Tue, 3 Dec 2024 11:28:13 +0100 Subject: [PATCH] MT#61673 /api/calllists fix missing type response field * The 'type' field is now present in the reponse as it's described in the form and also the search params but was not rendered correctly because in the database it is as 'call_type' Change-Id: If7b69a33ed9578be6873462dbab79c9a2079b076 (cherry picked from commit 18731938145edae8fcc5680218467d8944731978) --- lib/NGCP/Panel/Utils/CallList.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/NGCP/Panel/Utils/CallList.pm b/lib/NGCP/Panel/Utils/CallList.pm index 4a05433798..c535c712fd 100644 --- a/lib/NGCP/Panel/Utils/CallList.pm +++ b/lib/NGCP/Panel/Utils/CallList.pm @@ -51,6 +51,10 @@ sub process_cdr_item { $params //= $c->req->params; map { $resource->{$_} = $item->get_column($_); } qw/id call_id call_type/; + + # it's call_type in the DB but type in the form + $resource->{type} = delete $resource->{call_type}; + if ($item->can('cdr_mos_data') and (my $mos_data = $item->cdr_mos_data)) { my %mos_data_res = $mos_data->get_inflated_columns; map { $resource->{$_} = $mos_data_res{$_}; } qw/mos_average mos_average_packetloss mos_average_jitter mos_average_roundtrip/;