<p></p>
<p>It seems that it is caused by an infinite loop of request to itself. That case normally is captured by using maxfwd module to handle Max-Forwards header and avoid looping. You should consider adding that in your config, you can see how it is done in the default kamailio.cfg.</p>
<p>In this case, somehow the length of the outgoing branch request buffer ended up negative (the invite_len), resulting in an inappropriate size of the buffer needed to build the correspinding CANCEL. I added safety checks can catch it with the commit:</p>
<ul>
<li><a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/kamailio/kamailio/commit/c45913497f222c67bcccdbc8724b25bb083c556f/hovercard" href="https://github.com/kamailio/kamailio/commit/c45913497f222c67bcccdbc8724b25bb083c556f"><tt>c459134</tt></a></li>
</ul>
<p>Now is only in the master branch, in a couple of days I will backport if no issue is reported.</p>
<p>Meanwhile you can test by cherry picking locally the commit in branch 5.2 and report if works ok or not.</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/2321#issuecomment-628824734">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZOUWEMZ4HLEFKHD3VDRRQ43BANCNFSM4M5UJWSQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZKZLAJNIXHYFZBJ7PDRRQ43BA5CNFSM4M5UJWS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEV5RVHQ.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/2321#issuecomment-628824734",
"url": "https://github.com/kamailio/kamailio/issues/2321#issuecomment-628824734",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>