<div style="font-family: Arial; font-size: 14px;">I am running latest kamailio 5.6.2 and attempting to detect tcp/tls connection being disconnected or closed using tcpops module. As suggested in tcpops documentation at <span><a target="_blank" rel="noreferrer nofollow noopener" href="https://www.kamailio.org/docs/modules/devel/modules/tcpops.html">https://www.kamailio.org/docs/modules/devel/modules/tcpops.html</a>, registered event routes as below.</span></div><div style="font-family: Arial; font-size: 14px;"><span><pre style="font-family:monospace;background-color:rgb(252, 255, 252);border:1px solid rgb(153, 204, 204);padding-left:15pt;overflow:auto;border-radius:2.5px;font-size:15px">event_route[tcp:closed] {
        xlog("L_INFO", "$proto connection closed ($conid)\n");
}

event_route[tcp:timeout] {
        xlog("L_INFO", "$proto connection timed out ($conid)\n");
}

event_route[tcp:reset] {
        xlog("L_INFO", "$proto connection reset by peer ($conid)\n");
}</pre>Now it is observed that the event route is being called but the $conid is not set. The logs show the below log statements and extra data is (nil).</span></div><div style="font-family: Arial; font-size: 14px;"><span><br></span></div><div style="font-family: Arial; font-size: 14px;"><span><span>24(4263) DEBUG: <core> [core/tcp_read.c:284]: tcp_read_data(): EOF on connection 0x7ffff2ff8b90 (state: 0, flags: 4018) - FD 7, bytes 0, rd-flags 10000 ([10.8.137.33]:51069 -> [10.8.137.33]:5060)24(4263) DEBUG: <core> [core/tcp_read.c:1500]: tcp_read_req(): EOF</span><div><span>24(4263) DEBUG: <core> [core/io_wait.h:600]: io_watch_del(): DBG: io_watch_del (0x555555ab6960, 7, -1, 0x10) fd_no=2 called</span></div><div><span>24(4263) DEBUG: <core> [core/tcp_read.c:1870]: handle_io(): removing from list 0x7ffff2ff8b90 id 1 fd 7, state 2, flags 4018, main fd 51, refcnt 2 ([10.8.137.33]:51069 -> [10.8.137.33]:5060)</span></div><div><span><b>24(4263) DEBUG: <core> [core/tcp_read.c:1653]: release_tcpconn(): releasing con 0x7ffff2ff8b90, state -1, fd=7, id=1 ([10.8.137.33]:51069 -> [10.8.137.33]:5060)</b></span></div><div><span><b>24(4263) DEBUG: <core> [core/tcp_read.c:1657]: release_tcpconn(): extra_data (nil)</b></span></div><div><span>32(4271) DEBUG: <core> [core/tcp_main.c:3651]: handle_tcp_child(): reader response= 7ffff2ff8b90, -1 from 0</span></div><div><span>32(4271) DEBUG: <core> [core/tcp_main.c:3576]: tcp_emit_closed_event(): TCP closed event creation triggered (reason: 0)</span></div><div><span><b>32(4271) DEBUG: tcpops [tcpops.c:295]: tcpops_handle_tcp_closed(): received TCP closed event</b></span></div><div><span><b>32(4271) DEBUG: tcpops [tcpops.c:249]: tcpops_tcp_closed_run_route(): event reason id: 0 rt: 1</b></span></div><div><span>32(4271) DEBUG: <core> [core/parser/parse_fline.c:249]: parse_first_line(): first line type 1 (request) flags 1</span></div><div><span>32(4271) DEBUG: <core> [core/parser/msg_parser.c:679]: parse_msg(): SIP Request:</span></div><div><span>32(4271) DEBUG: <core> [core/parser/msg_parser.c:681]: parse_msg():  method:  <OPTIONS></span></div><div><span>32(4271) DEBUG: <core> [core/parser/msg_parser.c:683]: parse_msg():  uri:     <<a target="_blank" rel="noreferrer nofollow noopener" href="mailto:sip:you@kamailio.org">sip:you@kamailio.org</a>></span></div><div><span>32(4271) DEBUG: <core> [core/parser/msg_parser.c:685]: parse_msg():  version: <SIP/2.0></span></div><div><span>32(4271) DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name(): parsed header name [Via] type 1</span></div><div><span>32(4271) DEBUG: <core> [core/parser/parse_via.c:2639]: parse_via(): end of header reached, state=2</span></div><div><span>32(4271) DEBUG: <core> [core/parser/msg_parser.c:555]: parse_headers(): Via found, flags=2</span></div><div><span>32(4271) DEBUG: <core> [core/parser/msg_parser.c:557]: parse_headers(): this is the first via</span></div><div><span>32(4271) exec: *** cfgtrace:dbg_cfg_trace(): unknown_route=[tcp:closed] c=[/usr/local/etc/kamailio/kamailio.cfg] l=976 a=26 n=xlog</span></div><span><b>32(4271) INFO: <script> tcp connection closed (<null>)</b></span><br></span></div><div style="font-family: Arial; font-size: 14px;"><span><span><b><br></b></span></span></div><div style="font-family: Arial; font-size: 14px;">Can anyone provide any pointers on what I am missing?</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">Thanks in advance.</div><div class="protonmail_signature_block" style="font-family: Arial; font-size: 14px;">
</div>