Hi All,
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 WebSocket('ws://1.2.3.4:8000','msrp') in the browser
log I see the error 'WebSocket connection to 'ws://1.2.3.4:8000/' failed:
Unexpected response code: 400' . For MSRP file transfer I am using the crocodile msrp
lib.
The HTTP GET request of sent by the client is:
GET / HTTP/1.1
Via: SIP/2.0/TCP 10.147.66.197:54818
Upgrade: websocket
Connection: Upgrade
Host: 192.168.144.48:8000
Origin:
http://localhost
Sec-WebSocket-Protocol: msrp
Pragma: no-cache
Cache-Control: no-cache
Sec-WebSocket-Key: gccXstTCf+egnPtufU2xng==
Sec-WebSocket-Version: 13
Sec-WebSocket-Extensions: x-webkit-deflate-frame
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/31.0.1650.63 Safari/537.36
Cookie: PHPSESSID=pdlbnc3h24i5r8rdg1979tino2
In the log of Kamailio I see these lines:
11(2114) WARNING: websocket [ws_handshake.c:318]: ws_handle_handshake(): required headers
not present
11(2114) DEBUG: sl [sl.c:288]: send_reply(): reply in stateless mode (sl)
11(2114) DEBUG: <core> [msg_translator.c:204]: check_via_address():
check_via_address(10.147.66.197, 10.147.66.197, 0)
11(2114) DEBUG: <core> [tcp_main.c:2320]: tcpconn_send_put(): tcp_send: send from
reader (2114 (11)), reusing fd
11(2114) DEBUG: <core> [tcp_main.c:2556]: tcpconn_do_send(): tcp_send: sending...
11(2114) DEBUG: <core> [tcp_main.c:2590]: tcpconn_do_send(): tcp_send: after real
write: c= 0x7f37ab162bd0 n=182 fd=8
11(2114) DEBUG: <core> [tcp_main.c:2591]: tcpconn_do_send(): tcp_send: buf=
HTTP/1.1 400 Bad Request
Via: SIP/2.0/TCP 10.147.66.197:54744
Sec-WebSocket-Protocol: sip
Sec-WebSocket-Version: 13
Server: kamailio (4.1.1 (x86_64/linux))
Content-Length: 0
So, anyone has an idea whats the problem is?
Thanks,
Medo