<div dir="ltr">Hi Everyone,<div><br></div><div>We're running Kamailio 5.2.5 with XHTTP, Websocket and TLS extensions - for the purpose of being able to provide WebRTC capability. The settings for the HTTP request are quite default as set out below.</div><div><br></div><div>The SIP client we're using is SIP5ML in different web browsers. After a successful start of Kamailio, it is possible to use SIP5ML and its features - i.e. it REGISTER's properly, calls can be made, etc. After about a few hours of running, Kamailio refuses to interact and abruptly closes the TCP connection. The only solution (discovered so far) is to restart Kamailio, which is not feasible on a server that is serving production needs. (On our development server, where the load is only a fraction - this problem does not occur).</div><div><br></div><div>When the problems does start to occur, in Wireshark I see:</div><div>1) Normal TLS negotiation and certificate exchange; followed by</div><div>2) SIP5ML initiating the initial HTTP GET</div><div>3) Kamailio responds to the upgrade with a 101/Switch Protocols.</div><div>(4- SIP5ML outputs a SIP REGISTER on a defunct socket as its was closed)</div><div><br></div><div>Immediately after the 101/Switching Protocol message is received, Kamailio closes down the TCP connection with a FIN message. Nothing in the message or Kamailio log files help to identify what module is responsible for this.</div><div><br></div><div>Would anyone have any advise where to look further? BTW, I don't see the TCP connection being Reset in the exchanges - so any advise will be appreciated.</div><div><br></div><div>Tom</div><div><br></div><div>event_route[xhttp:request] {<br></div><div><br> set_reply_close();<br> set_reply_no_connect();<br> <br> if ($Rp != 8089) {<br> xlogl("L_CRIT", "HTTP request received on $Rp\n");<br> xhttp_reply("403", "Forbidden - 0x24", "", "");<br> exit;<br> }<br><br> xlogl("L_CRIT", "HTTP Request Received\n");<br><br> if ($hdr(Upgrade)=~"websocket"<br> && $hdr(Connection)=~"Upgrade"<br> && $rm=~"GET") {<br><br> # Validate Host - make sure the client is using the correct<br> # alias for WebSockets<br> if ($hdr(Host) == $null || !is_myself("sip:" + $hdr(Host))) {<br> xlogl("L_CRIT", "Bad host $hdr(Host)\n");<br> xhttp_reply("403", "Forbidden - 0x25", "", "");<br> exit;<br> }<br><br> # ws_handle_handshake() exits (no further configuration file<br> # processing of the request) when complete.<br> if (ws_handle_handshake())<br> {<br> # Optional... cache some information about the<br> # successful connection<br> exit;<br> }<br> }<br><br> xhttp_reply("404", "Resource Not Found - 0x27", "", "");<br>}<br><br>event_route[websocket:closed] {<br> xlogl("L_CRIT", "WebSocket connection from $si:$sp has closed\n");<br>}<br></div></div>