From 88a11e059ef0a7c370c112ce68f13dfd63d8e76d Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Mon, 1 Sep 2025 16:07:47 +0200 Subject: [PATCH] Revert "MT#63090 /api/calllists add phonebook entries support" This reverts commit c5e6d158007f3d23be3ec476d477b5fb12f18fa3. Reason for revert: the logic is implemented in /api/conversations instead Change-Id: I449f6793c754d6a968438de691147dcff2a33ba5 --- lib/NGCP/Panel/Form/CallList/Subscriber.pm | 37 ----------- lib/NGCP/Panel/Utils/CallList.pm | 77 ---------------------- 2 files changed, 114 deletions(-) diff --git a/lib/NGCP/Panel/Form/CallList/Subscriber.pm b/lib/NGCP/Panel/Form/CallList/Subscriber.pm index 01a8956a87..3922d05282 100644 --- a/lib/NGCP/Panel/Form/CallList/Subscriber.pm +++ b/lib/NGCP/Panel/Form/CallList/Subscriber.pm @@ -67,43 +67,6 @@ has_field 'status' => ( title => ['The status of the call, one of ok, busy, noanswer, cancel, offline, timeout, other.'] }, ); - -has_field 'own_phonebook_name' => ( - type => 'Text', - required => 0, - element_attr => { - rel => ['tooltip'], - title => ['Phonebook name associated to the own number'], - }, -); - -has_field 'own_phonebook_id' => ( - type => 'PosInteger', - required => 0, - element_attr => { - rel => ['tooltip'], - title => ['Phonebook entry id associated to the own number'], - }, -); - -has_field 'other_phonebook_name' => ( - type => 'Text', - required => 0, - element_attr => { - rel => ['tooltip'], - title => ['Phonebook name associated to the other number'], - }, -); - -has_field 'other_phonebook_id' => ( - type => 'PosInteger', - required => 0, - element_attr => { - rel => ['tooltip'], - title => ['Phonebook entry id associated to the other number'], - }, -); - has_field 'rating_status' => ( type => 'Select', required => 1, diff --git a/lib/NGCP/Panel/Utils/CallList.pm b/lib/NGCP/Panel/Utils/CallList.pm index ed007eccfe..c535c712fd 100644 --- a/lib/NGCP/Panel/Utils/CallList.pm +++ b/lib/NGCP/Panel/Utils/CallList.pm @@ -40,10 +40,6 @@ use constant ENABLE_SUPPRESSIONS => 1; #setting to 0 totally disables call list # * status # * rating_status # * type -# * own_phonebook_name -# * own_phonebook_id -# * other_phonebook_name -# * other_phonebook_id sub process_cdr_item { my ($c, $item, $owner, $params) = @_; @@ -291,79 +287,6 @@ sub process_cdr_item { } } - $resource->{own_phonebook_id} = undef; - $resource->{own_phonebook_name} = undef; - - my ($own_phonebook_entries, $other_phonebook_entries); - if ($resource->{direction} eq "out") { - $own_phonebook_entries = - $c->model('DB')->resultset('v_subscriber_phonebook')->search({ - number => { - '-in' => [ - $resource->{own_cli}, - $item->source_user, - $item->source_cli, - ], - }, - subscriber_id => $billing_src_sub->id, - },{ - rows => 1, - }); - - $other_phonebook_entries = - $c->model('DB')->resultset('v_subscriber_phonebook')->search({ - number => { - '-in' => [ - $resource->{other_cli}, - $item->destination_user, - $item->destination_user_in, - $item->destination_user_dialed, - ], - }, - subscriber_id => $billing_src_sub->id, - },{ - rows => 1 - }); - } else { - $own_phonebook_entries = - $c->model('DB')->resultset('v_subscriber_phonebook')->search({ - number => { - '-in' => [ - $resource->{own_cli}, - $item->destination_user, - $item->destination_user_in, - $item->destination_user_dialed, - ], - }, - subscriber_id => $billing_dst_sub->id, - },{ - rows => 1 - }); - - $other_phonebook_entries = - $c->model('DB')->resultset('v_subscriber_phonebook')->search({ - number => { - '-in' => [ - $resource->{other_cli}, - $item->source_user, - $item->source_cli, - ], - }, - subscriber_id => $billing_dst_sub->id, - },{ - rows => 1 - }); - } - - if ($own_phonebook_entries->first) { - $resource->{own_phonebook_id} = $own_phonebook_entries->first->id; - $resource->{own_phonebook_name} = $own_phonebook_entries->first->name; - } - if ($other_phonebook_entries->first) { - $resource->{other_phonebook_id} = $other_phonebook_entries->first->id; - $resource->{other_phonebook_name} = $other_phonebook_entries->first->name; - } - my @own_details = (); if ($own_suppression) { $c->log->debug('own suppression: id = ' . $own_suppression->id . ' direction = ' . $own_suppression->direction .