<h4>Pre-Submission Checklist</h4>



<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Commit message has the format required by CONTRIBUTING guide</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Commits are split per component (core, individual modules, libs, utils, ...)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Each component has a single commit (if not, squash them into one commit)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> No commits to README files for modules (changes must be done to docbook files<br>
in <code>doc/</code> subfolder, the README file is autogenerated)</li>
</ul>
<h4>Type Of Change</h4>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Small bug fix (non-breaking change which fixes an issue)</li>
</ul>
<h4>Checklist:</h4>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> PR should be backported to stable branches</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Tested changes locally</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Related to issue #XXXX (replace XXXX with an open issue number)</li>
</ul>
<h4>Description</h4>
<p>Based on the email thread :</p>
<pre><code>[SR-Users] Dialog - timeout for dlg with CallIDInbox
</code></pre>
<p>Several users are facing unpexected dialog disconnection caused by no-ack timer.</p>
<p>Using a modified version of the dialog module to improve debug-ability<br>
ttps://github.com/<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="707566681" data-permission-text="Title is private" data-url="https://github.com/kamailio/kamailio/issues/2483" data-hovercard-type="pull_request" data-hovercard-url="/kamailio/kamailio/pull/2483/hovercard" href="https://github.com/kamailio/kamailio/pull/2483">/pull/2483</a></p>
<p>I was able to confirm at least one problem and after looking at the trace, it seems like dialog mismatch with a serial forking scenario :</p>
<ul>
<li>log line 3 is telling us that a NO-ACK disconnection should be triggered</li>
<li>log line 1-2 is telling us what happened when the ACK was received in dlg_onroute(), oddly enough state 5 was old and new, could it be a mismatch/confusio with the previous dialog, looking in this direction ...</li>
</ul>
<pre><code>1: 2020-09-25T16:30:16.896: dialog [dlg_handlers.c:1273]: extra_ack_debug_info(): [ACK][1] state not changed >>> call-id[562419_125824138_2072238224] to-tag[<sip:+14019991904@anon.com>;tag=gK02b68836]
2: 2020-09-25T16:30:16.896: dialog [dlg_handlers.c:1440]: dlg_onroute(): [ACK] state not changed old[5]new[5]
...
3: 2020-09-25T16:32:22.674: dialog [dlg_hash.c:247]: dlg_clean_run(): dialog disconnection no-ACK call-id[562419_125824138_2072238224][1601051416]<[1601051542 - 60]
</code></pre>
<p>After looking at the pcap trace, call-id 562419_125824138_2072238224 was involved in serial forking :</p>
<p>call attempt1</p>
<pre><code>X >> INVITE >> Y   // no to-tag  
X << 100
...
X << 408           // to-tag=594d50c3218065a60bb91fd47a70fbc1-59edef02 (locally generated)
X >> ACK           // to-tag=594d50c3218065a60bb91fd47a70fbc1-59edef02
</code></pre>
<p>call attempt2</p>
<pre><code>X >> INVITE >> Z   // no to-tag
X << 100
X << 200    << Z   // to-tag=gK02b68836
X >> ACK    >> Z   // to-tag=gK02b68836 (Should be state old[3]new[4], I wonder how it could possibly be state old[5]new[5])
</code></pre>
<p>I did look at several occurrences and there is always a locally generated 408/to-tag before, seems like I have a good lead to investigate further.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/kamailio/kamailio/pull/2484'>https://github.com/kamailio/kamailio/pull/2484</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>dialog: dlg_cell, always check for a to-tag match</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/2484/files#diff-ade768b78a2c15244cd867a7f071c0da">src/modules/dialog/dlg_hash.c</a>
    (13)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/kamailio/kamailio/pull/2484.patch'>https://github.com/kamailio/kamailio/pull/2484.patch</a></li>
  <li><a href='https://github.com/kamailio/kamailio/pull/2484.diff'>https://github.com/kamailio/kamailio/pull/2484.diff</a></li>
</ul>

<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/pull/2484">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZISALON67MWMVHABQTSIC3FNANCNFSM4R4XDCEA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZMMA6ECHTGSTFIANWDSIC3FNA5CNFSM4R4XDCEKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KSYB2GQ.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/pull/2484",
"url": "https://github.com/kamailio/kamailio/pull/2484",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>