<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:14pt"><div><span>Hi All,</span></div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>I am using Kamailio 4.1 as SIP proxy and registrar with websocket and msrp modules. As a client I am using the JsSIP stack. The client can open websocket for SIP messages by calling "new WebSocket('ws://1.2.3.4:8000','sip')" with sip as a subprotocol, this works fine. But when the client tries to open a websocket for MSRP sessions using
 new </span><span style="font-size: 14pt;">WebSocket('ws://1.2.3.4:8000','msrp') in the browser log I see  the error '</span><span style="box-sizing: border-box; color: rgb(255, 0, 0); font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; white-space: pre-wrap;">WebSocket connection to 'ws://1.2.3.4:8000/' failed: Unexpected response code: 400</span><span style="color: rgb(255, 0, 0); font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; white-space: pre-wrap;"> </span><span style="font-size: 14pt; background-color: transparent;">' . For MSRP file transfer I am using the crocodile msrp lib. </span></div><div style="color: rgb(0, 0, 0); font-size: 14pt; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size: 14pt; background-color: transparent;"><br></span></div><div style="color: rgb(0, 0, 0);
 font-size: 19px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size: 14pt; background-color: transparent;">The HTTP GET request of sent by the client is:</span></div><div style="color: rgb(0, 0, 0); font-size: 14pt; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size: 14pt; background-color: transparent;"><br></span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">GET / HTTP/1.1</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Via: SIP/2.0/TCP 10.147.66.197:54818</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Upgrade: websocket</span></div><div style="background-color: transparent;"><span
 style="color: rgb(205, 35, 44);">Connection: Upgrade</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Host: 192.168.144.48:8000</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Origin: http://localhost</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Sec-WebSocket-Protocol: msrp</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Pragma: no-cache</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Cache-Control: no-cache</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Sec-WebSocket-Key: gccXstTCf+egnPtufU2xng==</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Sec-WebSocket-Version: 13</span></div><div style="background-color:
 transparent;"><span style="color: rgb(205, 35, 44);">Sec-WebSocket-Extensions: x-webkit-deflate-frame</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36</span></div><div style="background-color: transparent;"><span style="background-color: transparent; color: rgb(205, 35, 44);"></span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Cookie: PHPSESSID=pdlbnc3h24i5r8rdg1979tino2</span></div><div style="background-color: transparent;"><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 19px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;"><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 19px; font-family: HelveticaNeue,
 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;">In the log of Kamailio I see these lines:</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 19px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;"><br></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">11(2114) WARNING: websocket [ws_handshake.c:318]: ws_handle_handshake(): required headers not present</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">11(2114) DEBUG: sl [sl.c:288]: send_reply(): reply in stateless mode (sl)</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">11(2114) DEBUG: <core> [msg_translator.c:204]: check_via_address(): check_via_address(10.147.66.197, 10.147.66.197, 0)</span></div><div style="background-color:
 transparent;"><span style="color: rgb(205, 35, 44);">11(2114) DEBUG: <core> [tcp_main.c:2320]: tcpconn_send_put(): tcp_send: send from reader (2114 (11)), reusing fd</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">11(2114) DEBUG: <core> [tcp_main.c:2556]: tcpconn_do_send(): tcp_send: sending...</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">11(2114) DEBUG: <core> [tcp_main.c:2590]: tcpconn_do_send(): tcp_send: after real write: c= 0x7f37ab162bd0 n=182 fd=8</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">11(2114) DEBUG: <core> [tcp_main.c:2591]: tcpconn_do_send(): tcp_send: buf=</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">HTTP/1.1 400 Bad Request</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35,
 44);">Via: SIP/2.0/TCP 10.147.66.197:54744</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Sec-WebSocket-Protocol: sip</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Sec-WebSocket-Version: 13</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Server: kamailio (4.1.1 (x86_64/linux))</span></div><div style="background-color: transparent;"><span style="color: rgb(205, 35, 44);">Content-Length: 0</span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 19px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;"><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 19px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;"><br></div><div
 style="color: rgb(0, 0, 0); font-size: 19px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size: 14pt; background-color: transparent;">So, anyone has an idea whats the problem is?</span></div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size: 14pt; background-color: transparent;"><br></span></div><div style="color: rgb(0, 0, 0); font-size: 19px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="font-size: 14pt; background-color: transparent;">Thanks,</span></div><div></div><div> </div><div style="color:rgb(17, 17, 17);font-weight:bold;"><font
 size="3">Medo</font></div></div></body></html>