Revert "MT#63090 /api/calllists add phonebook entries support"

This reverts commit c5e6d15800.

Reason for revert: the logic is implemented in /api/conversations instead

Change-Id: I449f6793c754d6a968438de691147dcff2a33ba5
mr13.5
Kirill Solomko 4 months ago
parent 47da4251e8
commit 88a11e059e

@ -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,

@ -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 .

Loading…
Cancel
Save