<p>To test, create the following event_route in your script:</p>

<pre><code>event_route[tcp:closed] {
 xlogl("L_INFO", "TCP connection closed: si=$si sp=$sp conid=$conid proto=$proto\n");
}
</code></pre>

<p>Then connect to the server via TCP, TLS, WS, or WSS, and explicitly kill the connection between kamailio and the client using tcpkill or something similar, or alternatively, time out the TCP connection by unplugging a SIP phone or inserting IPtables rules to block traffic.  You should see event_route[tcp:closed] get executed.</p>

<p>Please let me know if you find issues with this approach.  Thanks!</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/commit/4cc9545b0056bcacf8a303259e629df6c754747d#commitcomment-15148606">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZS2YFXBgiXy5alKBk6AAVv7aYljHks5pS0b3gaJpZM4G64iS.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/commit/4cc9545b0056bcacf8a303259e629df6c754747d#commitcomment-15148606"></link>
  <meta itemprop="name" content="View Commit"></meta>
</div>
<meta itemprop="description" content="View this Commit on GitHub"></meta>
</div>