diff --git a/ngcp/dlgcnt.lua b/ngcp/dlgcnt.lua index dee824d..1be1988 100644 --- a/ngcp/dlgcnt.lua +++ b/ngcp/dlgcnt.lua @@ -131,7 +131,7 @@ end if not self._test_connection(self.pair) then self.pair = self._connect(self.config.pair); end - local num = self.pair:lrem(callid, 0, key); + local num = self.pair:lrem(callid, 1, key); 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/tests/ngcp_dlgcnt.lua b/tests/ngcp_dlgcnt.lua index 611b52a..38cf581 100644 --- a/tests/ngcp_dlgcnt.lua +++ b/tests/ngcp_dlgcnt.lua @@ -230,5 +230,20 @@ TestNGCPDlgCnt = {} --class assertTrue(res) end + function TestNGCPDlgCnt:test_del_key() + self.pair:ping() ;mc :returns(true) + self.pair:lrem("callid0", 1, "key1") ;mc :returns(1) + + self.central:ping() ;mc :returns(true) + self.central:decr("key1") ;mc :returns(1) + + mc:replay() + self.dlg:del_key("callid0", "key1") + mc:verify() + + assertIs(self.dlg.central, self.central) + assertIs(self.dlg.pair, self.pair) + end + -- class TestNGCPDlgCnt --EOF