From ec2c977e024358d649f7d6a0f236081333f21672 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Fri, 15 Feb 2019 13:11:23 +0100 Subject: [PATCH] TT#52961 Use redis if enabled to fetch reg subsscribers Change-Id: Ib95b71515b1126bbfb7ba5405cb9ae11a0c21117 --- lib/NGCP/Panel/Controller/Customer.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/NGCP/Panel/Controller/Customer.pm b/lib/NGCP/Panel/Controller/Customer.pm index 20e6ec11df..cfe8673e37 100644 --- a/lib/NGCP/Panel/Controller/Customer.pm +++ b/lib/NGCP/Panel/Controller/Customer.pm @@ -1843,14 +1843,14 @@ sub pbx_device_sync :Chained('pbx_device_base') :PathPart('sync') :Args(0) { my $sub = $line->provisioning_voip_subscriber; next unless($sub); - my $reg_rs = $c->model('DB')->resultset('location')->search({ - username => $sub->username, - }); - if($c->config->{features}->{multidomain}) { - $reg_rs = $reg_rs->search({ - domain => $sub->domain->domain, - }); - } + + my $reg_rs = NGCP::Panel::Utils::Subscriber::get_subscriber_location_rs( + $c, + { + username => $sub->username, + $c->config->{features}->{multidomain} ? (domain => $sub->domain->domain) : (), + } + ); my $uri = $sub->username . '@' . $sub->domain->domain; if($reg_rs->count) { $c->log->debug("trigger device resync for $uri as it is registered");