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);