From c2cb6e6896bf489269137974a2d284819e4becb6 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Fri, 2 Jan 2015 13:12:09 +0100 Subject: [PATCH] MT#10521 dlgcnt: add exists function Change-Id: Ibac4bacbe4af66b44901eeb2cd8b74211a719ff4 --- ngcp/dlgcnt.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ngcp/dlgcnt.lua b/ngcp/dlgcnt.lua index 7e59e18..159b10f 100644 --- a/ngcp/dlgcnt.lua +++ b/ngcp/dlgcnt.lua @@ -86,6 +86,18 @@ end return res; end + function NGCPDlgCounters:exists(callid) + if not self._test_connection(self.pair) then + self.pair = self._connect(self.config.pair); + end + local res = self.pair:llen(callid) + if res > 0 then + return true + else + return false + end + end + function NGCPDlgCounters:is_in_set(callid, key) if not self._test_connection(self.pair) then self.pair = self._connect(self.config.pair);