<h3>Description</h3>
<p><code>topos-redis</code> does not clean entries for failed and canceled calls.</p>
<p>modules are loaded in this order:</p>
<pre><code>...
loadmodule "topos.so"
loadmodule "ndb_redis.so"
loadmodule "topos_redis.so"

# ----- ndb_redis params -----
modparam("ndb_redis", "server", "name=srvC;addr=REDIS_HOST;port=REDIS_PORT;db=REDIS_DB_TOPOS")

# ----- topos params -----
modparam("topos", "storage", "redis")
modparam("topos_redis", "serverid", "srvC")
modparam("topos", "mask_callid", 0)
modparam("topos", "sanity_checks", 0)

modparam("topos", "branch_expire", 30)
modparam("topos", "dialog_expire", 14400)
modparam("topos", "clean_interval", 10)
...
</code></pre>
<p>When a call is answered the timer are working fine and the records are cleaned after branch_expire timer.</p>
<ol>
<li>call established</li>
</ol>
<pre><code>10.0.1.11:6379[9]> KEYS *
1) "b:x:z9hG4bKe33b.1c2d440696a8e6d47f678fcf80962608.0"
2) "d:z:atpsh-5d305fc4-51c0-1"
3) "b:x:INVITE:6cbb3f3c-0470-474a-90e9-1d3f07d42a1a:as32b06c60"
</code></pre>
<ol start="2">
<li>after 30s</li>
</ol>
<pre><code>10.0.1.11:6379[9]> KEYS *
1) "d:z:atpsh-5d305fc4-51c0-1"
</code></pre>
<ol start="4">
<li>call ends</li>
</ol>
<pre><code>10.0.1.11:6379[9]> KEYS *
1) "b:x:z9hG4bKa4f4.d283ab69d26e3eadea338bb3cc28860e.0"
2) "d:z:atpsh-5d305fc4-51c0-1"
</code></pre>
<ol start="5">
<li>after 30s</li>
</ol>
<pre><code>10.0.1.11:6379[9]> KEYS *
(empty list or set)
</code></pre>
<h4>Issue description</h4>
<p>When the call fails or it's canceled</p>
<pre><code>10.0.1.11:6379[9]> KEYS *
1) "b:x:z9hG4bK6b04.0b594f71aba72f5f7f6f3ca8d7e57f04.0"
2) "d:z:atpsh-5d305fc4-51c3-1"
3) "b:x:INVITE:0319e114-c5b9-4dfc-91f0-392dc4239255:as018c9b6b"
</code></pre>
<p>after 30s</p>
<pre><code>10.0.1.11:6379[9]> KEYS *
1) "d:z:atpsh-5d305fc4-51c3-1"
10.0.1.11:6379[9]> TTL "d:z:atpsh-5d305fc4-51c3-1"
(integer) 14319
</code></pre>
<p>The record <code>d:z:atpsh-5d305fc4-51c3-1</code> is not cleaned by the cancel or busy...it will persist in the redis until it expires.</p>
<p>I upgraded my machine from 5.1.3 to 5.1.8 after finding this fix <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="346623244" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/1608" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/1608/hovercard" href="https://github.com/kamailio/kamailio/issues/1608">#1608</a> which I noticed in the beginning.</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.1.8 (x86_64/linux) c7a172
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: c7a172
compiled on 05:42:57 Jun 19 2019 with gcc 4.8.5
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<pre><code>3.10.0-693.17.1.el7.x86_64 #1 SMP Thu Jan 25 20:13:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Lin
</code></pre>
<pre><code>CentOS Linux release 7.4.1708 (Core)
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2012?email_source=notifications&email_token=ABO7UZOERZDSN2SYK6DKBRTQAB44HA5CNFSM4IE36QA2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAAUC7A">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZJHEVWRSECDAROTUATQAB44HANCNFSM4IE36QAQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZPARGY2GVM3NK3Y4KLQAB44HA5CNFSM4IE36QA2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAAUC7A.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2012?email_source=notifications\u0026email_token=ABO7UZOERZDSN2SYK6DKBRTQAB44HA5CNFSM4IE36QA2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAAUC7A",
"url": "https://github.com/kamailio/kamailio/issues/2012?email_source=notifications\u0026email_token=ABO7UZOERZDSN2SYK6DKBRTQAB44HA5CNFSM4IE36QA2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAAUC7A",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>