<p></p>
<h3>Description</h3>
<p>I have a problem with publish/notify messages generated from Kamailio towards a monitoring device after multiple branches has been created.<br>
When the call is forked by kamailio, invites are generated towards each callee user agent depending on how many branches we have in the call.<br>
When one of the callee user agents sends back 200 ok to enter the conversation, kamailio automatically sends a CANCEL towards the user agents that lost the race condition and didnt take the call.<br>
When this happens, a notify is set to the monitoring user agent with the state "terminated" but this is wrong since the call is up and we are in conversation.</p>
<h4>Reproduction</h4>
<ol>
<li>set up a monitoring device that subscribes to B events.</li>
<li>Register more than one device to B to make kamailio behave like a forking proxy</li>
<li>Call B and observe the notify message sent to the monitoring device, in particular the <dialog id="xxx" value</li>
</ol>
<h3>Possible Solutions</h3>
<p>I think this can be solved just adding some random uuid inside the xml field sent inside the xml of the NOTIFY message:<br>
The random uuid must be different for each branch.</p>
<h3>Additional Information</h3>
<p>version: kamailio 5.5.1 (x86_64/linux)<br>
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, NO_SIG_DEBUG, 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<br>
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
id: unknown<br>
compiled with gcc 10.2.1</p>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<p>No LSB modules are available.<br>
Distributor ID: Debian<br>
Description:    Debian GNU/Linux 11 (bullseye)<br>
Release:        11<br>
Codename:       bullseye</p>
<p>Linux sp1 5.10.0-9-amd64 <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="31891578" data-permission-text="Title is private" data-url="https://github.com/kamailio/kamailio/issues/1" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/1/hovercard" href="https://github.com/kamailio/kamailio/issues/1">#1</a> SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux</p>

<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/2906">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMKPBJSQWUTC6YJUPTUJA6CLANCNFSM5G23PAHA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/ABO7UZMU6ZVWDWHUZQPKTDLUJA6CLA5CNFSM5G23PAHKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4POZPHQA.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/2906",
"url": "https://github.com/kamailio/kamailio/issues/2906",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>