Hello the list Let me exhume this old message :) I also encounter the same error message as Dimitry When a webrtc device is registering itself, here what's output in the logs (the registration being successful or not):
Apr 17 14:15:53 kamailio[11693]: 24(11720) ERROR: <core> [core/parser/parse_fline.c:257]: parse_first_line(): parse_first_line: bad message (offset: 22) Apr 17 14:15:53 kamailio[11693]: 24(11720) ERROR: <core> [core/parser/msg_parser.c:675]: parse_msg(): ERROR: parse_msg: message=<HTTP/1.1 101 Switching Protocols Apr 17 14:15:53 kamailio[11693]: Sia: SIP/2.0/TCP 10.2.10.16:10015 Apr 17 14:15:53 kamailio[11693]: Sec-WebSocket-Protocol: sip Apr 17 14:15:53 kamailio[11693]: Upgrade: websocket Apr 17 14:15:53 kamailio[11693]: Connection: upgrade Apr 17 14:15:53 kamailio[11693]: Sec-WebSocket-Accept: Z0nbYpr4fXFMpbkJKVBfyyb8qdU= Apr 17 14:15:53 kamailio[11693]: Server: kamailio (5.1.2 (x86_64/linux)) Apr 17 14:15:53 kamailio[11693]: Content-Length: 0 Apr 17 14:15:53 kamailio[11693]: #015 Apr 17 14:15:53 kamailio[11693]: > FYI, our kamailios are behind a HAProxy used for load-balancing Dimitry, did you succeed to fix it in your setup ? Kind Regards, Guillaume Bour. On Fri, Jun 03, 2016 at 11:11:58AM +0000, Nagorny, Dimitry wrote: > Hi all, > > > > Got INVITE resolved, but the Errors described below persist. > > > > > > Best Regards > > Dimitry Nagorny > > Trainee > > > > Von: sr-users [mailto:[email protected]] Im Auftrag > von Nagorny, Dimitry > Gesendet: Freitag, 3. Juni 2016 10:39 > An: Kamailio (SER) - Users Mailing List <[email protected]> > Betreff: Re: [SR-Users] Kamailio Websocket Questions > > > > Hello Daniel, > > > > Thank you very much for your response. Here the portions for my websocket > config. Of course all needed modules are loaded (one modparam for > websocket ping) and I took the config all from > http://kamailio.org/docs/modules/4.3.x/modules/websocket.html: > > onreply_route[WS_REPLY] { > > if (nat_uac_test(64)) { > > add_contact_alias(); > > } > > if (proto==WS) { > > xlog("L_INFO", "Hit Reply from Websocket"); > > rtpengine_answer("trust-address "); > > } > > } > > event_route[xhttp:request] { > > set_reply_close(); > > set_reply_no_connect(); > > > > if ($Rp != MY_INTERN_WSPORT){ > > xlog("L_WARN", "HTTP request received on > $Rp\n"); > > xhttp_reply("403", "Forbidden", "", ""); > > exit; > > } > > if ($hdr(Upgrade)=~"websocket" && > $hdr(Connection)=~"Upgrade" && $rm=~"GET") { > > if ($hdr(Host) == $null || > !is_myself("sip:" + $hdr(Host))) { > > xlog("L_WARN", "Bad host > $hdr(Host)\n"); > > xhttp_reply("403", > "Forbidden", "", ""); > > exit; > > } > > if (ws_handle_handshake()) { > > exit; > > } > > } > > xhttp_reply("404", "Not Found", "", ""); > > } > > event_route[websocket:closed] { > > xlog("L_INFO", "WebSocket connection from $si:$sp has > closed\n"); > > } > > > > I have attached a debug log for the registration process over websocket, > on line 49 you can see the error. > > > > As for the INVITE I use now this: > > if ($rU=~"^3$" && src_ip==$sel(cfg_get.pstn.gw_ip)) { > > $ru = "sip:[email protected]"; > > uac_replace_to("sip:[email protected]"); > > rtpengine_offer("external internal trust-address"); > > route(RELAY); > > } > > > > Unfortunately I can see now that Kamailio tries to send it out on > 10.250.5.74:5060, which I am not even listening on. For the route(RELAY) I > use this: > > route[RELAY] { > > if (is_method("INVITE")) { > > t_on_branch("MANAGE_BRANCH"); > > if (proto==WS) { > > t_on_reply("WS_REPLY"); > > } else { > > t_on_reply("MANAGE_REPLY"); > > } > > t_on_failure("MANAGE_FAILURE"); > > } > > if (is_method("CANCEL|BYE")) { > > rtpengine_delete(); > > } > > > > if (!t_relay()) { > > sl_reply_error(); > > } > > exit; > > } > > > > Is t_relay for Websocket the right choice? I somehow have my doubts but > couldn’t find any suggestion in the documentation. Additional Info: > Outgoing calls from Websocket registered Users are working. > > Thanks for your time helping me out. > > > > > > Best Regards > > Dimitry Nagorny > > Trainee > > > > Von: sr-users [mailto:[email protected]] Im Auftrag > von Daniel-Constantin Mierla > Gesendet: Freitag, 3. Juni 2016 08:36 > An: Kamailio (SER) - Users Mailing List <[email protected]> > Betreff: Re: [SR-Users] Kamailio Websocket Questions > > > > Hello, > > 1. for websocket the connection has to be reused, the server cannot open a > connection towards the browser. So you don't have to force any socket, if > kamailio doesn't find the address matching the target ws address, then > will throw an error, otherwise will use it. > > 2. have you enabled xhttp and websocket modules properly? > > Cheers, > Daniel > > > > On 02/06/16 17:13, Nagorny, Dimitry wrote: > > Hi List, > > > > two questions regarding Kamailio Websockets: > > > > 1. How do I send INVITE request TO the listening Websocket? > I usually used for UDP/TCP/TLS these format, but somehow this is not > working for Websocket because it gets in an endless loop: > if ($rU=~"^(\+|00|0)?[1-9][0-9]{4,20}$") { > > $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + > ";user=phone;transport=udp"; > > force_send_socket(udp:MY_EXTERN_IP:MY_EXTERN_PORT); > > rtpengine_offer("internal trust-address RTP AVP"); > > route(RELAY); > > exit; > > } > > 2. Why do I get these errors every time my Websocket Client is > registering, but it still works and DB is inserted with registered > location: > > ERROR: <core> [parser/parse_fline.c:257]: parse_first_line(): > parse_first_line: bad message (offset: 22) > > ERROR: <core> [parser/msg_parser.c:690]: parse_msg(): ERROR: parse_msg: > message=<HTTP/1.1 101 Switching Protocols#015#012Sia: SIP/2.0/TCP > 10.250.5.17:51283#015#012Sec-WebSocket-Protocol: sip#015#012Upgrade: > websocket#015#012Connection: upgrade#015#012Sec-WebSocket-Accept: > 6uLXlD/aBrzu/j3PYP3DWO7rvLE=#015#012Server: kamailio (4.3.5 > (x86_64/linux))#015#012Content-Length: 0#015#012#015#012> > > > > I am using Kamailio 4.3.5 + CentOS 7.2. I appreciate every help I can > get. > > > > > > Best Regards > > Dimitry Nagorny > > Trainee > > > > _______________________________________________ > > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list > > [email protected] > > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users > > > > -- > > Daniel-Constantin Mierla > > http://www.asipto.com - http://www.kamailio.org > > http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda > _______________________________________________ > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list > [email protected] > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ Kamailio (SER) - Users Mailing List [email protected] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
