From ebeb5d4ca0e59b031341184f06704056877b246e Mon Sep 17 00:00:00 2001 From: Andrew Pogrebennyk Date: Thu, 22 Mar 2018 11:22:39 +0100 Subject: [PATCH] TT#34600 Fix warnings about redis counters in Call Forwarding scenarios Change-Id: Ie01b24406ceca92b8eb378aac10a560b5eb28816 --- ngcp/dlgcnt.lua | 4 ++++ ngcp/dlglist.lua | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ngcp/dlgcnt.lua b/ngcp/dlgcnt.lua index 1be1988..cf93da5 100644 --- a/ngcp/dlgcnt.lua +++ b/ngcp/dlgcnt.lua @@ -132,6 +132,10 @@ end self.pair = self._connect(self.config.pair); end local num = self.pair:lrem(callid, 1, key); + if num == 0 then + sr.log("dbg", string.format("pair:lrem[%s]=>[%s] no such key found in list, skipping decrement", callid, key)); + return false; + end sr.log("dbg", string.format("pair:lrem[%s]=>[%s] %d\n", callid, key, num)); if not self._test_connection(self.central) then self.central = self._connect(self.config.central); diff --git a/ngcp/dlglist.lua b/ngcp/dlglist.lua index 6d36a1e..678cf37 100644 --- a/ngcp/dlglist.lua +++ b/ngcp/dlglist.lua @@ -129,6 +129,10 @@ end self.pair = _connect(self.config.pair); end local num = self.pair:lrem("list:"..callid, 0, key); + if num == 0 then + sr.log("dbg", string.format("pair:lrem[list:%s] no such key %s found in list", callid, key)); + return false; + end sr.log("dbg", string.format("pair:lrem[%s]=>[%s] %d\n", callid, key, num)); if not _test_connection(self.central) then self.central = _connect(self.config.central);