<p></p>
<h3 dir="auto">Description</h3>
<p dir="auto">While debugging an issue in Kamailio 5.4, I compiled/installed master to see if the issue persists. However, I immediately ran into multiple issues with dialog in master:</p>
<h4 dir="auto">Using enable_dmq=1</h4>
<p dir="auto">With dmq enabled, I receive the following log lines which did not appear when running 5.4:</p>
<pre class="notranslate"><code class="notranslate">CRITICAL: dialog [dlg_timer.c:129]: insert_dlg_timer(): Trying to insert a bogus dlg tl=0x7fa0bc21fc80 tl->next=0x7fa0bbf46ba8 tl->prev=0x7fa0bbf46ba8
CRITICAL: dialog [dlg_dmq.c:314]: dlg_dmq_handle_msg(): Unable to insert dlg timer 0x7fa0bc21fc20 [2687:66928]
</code></pre>
<h4 dir="auto">Using database</h4>
<p dir="auto">When using database persistence (sqlite and db_mode=3 (SHUTDOWN)), dialogs are not persisted across restarts (which was working in 5.4). There are no obvious log lines, except when I end the call after restarting Kamailio I receive a "unable to find dialog for BYE" message which would be expected if the dialog did not persist.</p>
<h3 dir="auto">Troubleshooting</h3>
<ul dir="auto">
<li>I ran the same configuration using 5.4 and neither issue occurred.</li>
<li>I attempted to identify the troublesome commit by checking out/compiling older commits based on the commit history of the dialog module, but could only go so far back until builds started failing with <code class="notranslate">module not found: modules/siprepo</code>. As such I was not able to identify when the behavior changed.</li>
</ul>
<h4 dir="auto">Reproduction</h4>
<p dir="auto">DMQ issue: Use dialog module with dmq enabled and start a call that has <code class="notranslate">dlg_manage();</code> in the path. My configuration has the following settings:</p>
<pre class="notranslate"><code class="notranslate">modparam("dmq", "server_address", SERVER_ADDRESS_DMQ)
modparam("dmq", "notification_address", "redacted")
modparam("dmq", "notification_address", "redacted")
modparam("dmq", "num_workers", 6)
modparam("dialog", "default_timeout", 14520)
modparam("dialog", "profiles_with_value", "group")
modparam("dialog", "enable_dmq", 1)
modparam("dialog", "h_id_start", 0)
modparam("dialog", "h_id_step", 16)
</code></pre>
<p dir="auto">DB issue: Use dialog module with db enabled. Start a call that has <code class="notranslate">dlg_manage();</code> in the path and keep the call open. Observe <code class="notranslate">kamcmd dlg.list</code> shows the dialog. Restart kamailio. Observe <code class="notranslate">kamcmd dlg.list</code> no longer lists any dialogs. My configuration has the following additional settings:</p>
<pre class="notranslate"><code class="notranslate">modparam("dialog", "db_url", "sqlite:////kamailio/kamailio.sqlite")
modparam("dialog", "db_mode", 3)
</code></pre>
<h3 dir="auto">Additional Information</h3>
<p dir="auto"><strong>Kamailio Version</strong></p>
<pre class="notranslate"><code class="notranslate">version: kamailio 5.7.0-dev0 (x86_64/linux) f1dcb6
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, 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_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
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: f1dcb6
compiled on 23:18:23 Aug 15 2022 with gcc 8.3.0```
</code></pre>
<p dir="auto"><strong>Operating System</strong></p>
<pre class="notranslate"><code class="notranslate">Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/3218">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMT75KB5KUUNQ4POWLVZMCZPANCNFSM56UGJ3BA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZPAB3I26FAC4SNMZIDVZMCZPA5CNFSM56UGJ3BKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4T63CTHA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/issues/3218</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/3218",
"url": "https://github.com/kamailio/kamailio/issues/3218",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>