<h3>Description</h3>
<p>In a setup with 2 kamailios in active/passive with a virtual IP that failovers between them:</p>
<p>sbc01 (active) is handling calls.<br>
sbc02 (passive) is started, and does an initial dialog sync via DMQ</p>
<pre><code>root@sbc01:~# kamctl rpc stats.get_statistics all | grep dialog
"dialog:active_dialogs = 39",
"dialog:early_dialogs = 2",
"dialog:expired_dialogs = 0",
"dialog:failed_dialogs = 583",
"dialog:processed_dialogs = 2527",
root@sbc01:~#
</code></pre>
<pre><code>root@sbc02:/etc/kamailio# kamctl rpc stats.get_statistics all | grep dialog
"dialog:active_dialogs = 39",
"dialog:early_dialogs = 0",
"dialog:expired_dialogs = 0",
"dialog:failed_dialogs = 0",
"dialog:processed_dialogs = 0",
root@sbc02:/etc/kamailio#
</code></pre>
<p>From that point onwards, as long as sbc01 stays as active, sbc02 stays as passive, and no restarts occur anywhere, the values for <code>dialog</code> metrics in sbc02 will not change and remain as they are, in the previous example, active_dialogs would remain as 39.</p>
<h3>Troubleshooting</h3>
<p>This was discovered during some tests from <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="340349355" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/1591" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/1591/hovercard" href="https://github.com/kamailio/kamailio/issues/1591">#1591</a></p>
<h4>Reproduction</h4>
<p>Setup 2 kamailio instances that replicate dialogs via DMQ.</p>
<p>1- On Kamailio1 put some traffic to have some active dialogs (must call <code>dlg_manage()</code> in routing script for these test calls)<br>
2- Start Kamailio2<br>
3- Compare output of: <code>kamcmd stats.get_statistics dialog:</code> on both nodes.<br>
4- Alter the amount of active dialogs on Kamailio1 (either end some or create new ones).<br>
5- Repeat step 3.</p>
<p>Kamailio1 --> Step5 will have different values from Step3.<br>
Kamailio2 --> Step5 will have exactly the same values from Step3.</p>
<h3>Possible Solutions</h3>
<p><code>dialog:active_dialogs</code> should remain as 0 on Kamailio2, as technically there are no dialogs being handled by that server, it only has information of replicated dialogs and those stats are available in the <code>dlg.stats_active</code> metric.</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code># kamailio -V
version: kamailio 5.2.0-pre1 (x86_64/linux) 2ecf60-dirty
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: 2ecf60 -dirty
compiled with gcc 6.3.0
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<pre><code>root@sbc02:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch
root@sbc02:~# uname -a
Linux sbc02 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux
root@sbc02:~#
</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/1692">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZWKGIEtVM8O4ep3Dt8VGU8kGp2tbks5uo0evgaJpZM4X8qh1">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZcqpIA0-wfsDTh56OK-oqyPndkIzks5uo0evgaJpZM4X8qh1.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://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Active dialog stats stays static on a passive kamailio node that replicates dialogs via DMQ (#1692)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1692"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1692",
"url": "https://github.com/kamailio/kamailio/issues/1692",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Active dialog stats stays static on a passive kamailio node that replicates dialogs via DMQ (#1692)",
"sections": [
{
"text": "",
"activityTitle": "**Joel Serrano**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@joelsdc",
"facts": [
{
"name": "Repository: ",
"value": "kamailio/kamailio"
},
{
"name": "Issue #: ",
"value": 1692
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1692,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1692\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1692"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 401778805\n}"
}
],
"themeColor": "26292E"
}
]</script>