<h3>Description</h3>
<p>I have been checking the reason why the cnxcc module doesn't work and I have seen that the problem is in the dialog module. Cnxcc uses dialog callback functions to obtain the data of the new dialogs. However there is a check that always gives incorrect and the creation of the new dialog is never executed. The check is this:</p>
<pre><code>if((req->flags&dlg_flag_mask)!=dlg_flag_mask)
    return;

LM_DBG("dialog creation on config flag\n");
dlg_new_dialog(req, t, 1);
dlg = dlg_get_ctx_dialog();
</code></pre>

<p>I don't know is this check is important and I don't know if this is the best solution but removing this check the cnxcc module works fine for me.</p>
<pre><code>diff --git a/src/modules/dialog/dlg_handlers.c b/src/modules/dialog/dlg_handlers.c
index 96406bde3..ddfdffc27 100644
--- a/src/modules/dialog/dlg_handlers.c
+++ b/src/modules/dialog/dlg_handlers.c
@@ -761,8 +761,6 @@ void dlg_onreq(struct cell* t, int type, struct tmcb_params *param)
                }
        }
        if (dlg==NULL) {
-               if((req->flags&dlg_flag_mask)!=dlg_flag_mask)
-                       return;
                LM_DBG("dialog creation on config flag\n");
                dlg_new_dialog(req, t, 1);
                dlg = dlg_get_ctx_dialog();
</code></pre>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.3.0-dev1 (x86_64/linux) eb3fd4-dirty
flags: STATS: Off, 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_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: eb3fd4 -dirty
compiled on 14:06:31 Jan  2 2019 with gcc 6.3.0
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>Linux pepelux 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
</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/1783">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36Zbxk_0wqqoP-YK-vuezU04xCGgKXks5u_eeLgaJpZM4Zn7Rm">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZV9r_DjjqjWVVQUKZCtPl_Q4MW1iks5u_eeLgaJpZM4Zn7Rm.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"dialog: Error registering a dialog that causes the cnxcc module doesn't work correctly (#1783)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1783"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1783",
"url": "https://github.com/kamailio/kamailio/issues/1783",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>