<h3>Description</h3>
<p>Kamailio fails to forward in-dialog request over TCP/TLS/WS/WSS connection.</p>
<h3>Troubleshooting</h3>
<p>kamailio 5.2 branch has a commit<br>
<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/kamailio/kamailio/commit/09ac3e47ef79dbd599b7dec5b84ae3b792f025ed/hovercard" href="https://github.com/kamailio/kamailio/commit/09ac3e47ef79dbd599b7dec5b84ae3b792f025ed"><tt>09ac3e4</tt></a> cherry picked from master branch.<br>
It makes sense for master because get_send_socket2() behavior has<br>
changed and function became smarter and also there were some patches to<br>
propagate connection it to the uac structure.</p>
<p>After applying this patch to 5.2.x kamailio searches for an outgoing socket, receives the first one due to limitations of get_send_socket2() and SND_F_FORCE_SOCKET flag. Then it fails to find an existing TCP connection by destination ip:port since it searches for a connection associated with a wrong socket.</p>
<h4>Log Messages</h4>

<pre><code>
Dec 11 21:33:49  kamailio[17999]: WARNING: <core> [core/msg_translator.c:2832]: via_builder(): TCP/TLS connection (id: 0) for WebSocket could not be found
Dec 11 21:33:49  kamailio[17999]: ERROR: tm [t_msgbuilder.c:1372]: assemble_via(): via building failed
Dec 11 21:33:49  kamailio[17999]: ERROR: tm [t_msgbuilder.c:1540]: build_uac_req(): error while assembling Via
Dec 11 21:33:49  kamailio[17999]: ERROR: tm [uac.c:517]: t_uac_prepare(): Error while building message
Dec 11 21:33:49  kamailio[17999]: ERROR: presence [notify.c:1798]: send_notify_request(): in function tmb.t_request_within
Dec 11 21:33:49  kamailio[17999]: ERROR: presence [notify.c:1897]: notify(): sending Notify not successful
Dec 11 21:33:49  kamailio[17999]: ERROR: presence [notify.c:1491]: publ_notify(): Could not send notify for message-summary
</code></pre>
<h3>Possible Solutions</h3>
<p>Delete mentioned commit from the 5.2 branch.</p>

<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>5.2.5
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>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/2181?email_source=notifications&email_token=ABO7UZNZGX3SJKEBQ7LPXNTQZNV5XA5CNFSM4J5FTSY2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IBUKACA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZLJMPHUPQZ6NW4D4CTQZNV5XANCNFSM4J5FTSYQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZN5PFUPTRIMIPDJDU3QZNV5XA5CNFSM4J5FTSY2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IBUKACA.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/2181?email_source=notifications\u0026email_token=ABO7UZNZGX3SJKEBQ7LPXNTQZNV5XA5CNFSM4J5FTSY2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IBUKACA",
"url": "https://github.com/kamailio/kamailio/issues/2181?email_source=notifications\u0026email_token=ABO7UZNZGX3SJKEBQ7LPXNTQZNV5XA5CNFSM4J5FTSY2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IBUKACA",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>