<div dir="ltr">Hello,<div><br></div><div>Can you provide logs from the time it's rejecting/disconnecting abruptly?</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,</div><div><br></div>David Villasmil<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div><div>phone: +34669448337</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 18, 2019 at 6:24 PM Tom D <<a href="mailto:dworakowski.tom@gmail.com">dworakowski.tom@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>