[SR-Users] xhttp module and IPv6

Daniel-Constantin Mierla miconda at gmail.com
Fri Feb 20 21:49:53 CET 2015


Do you have event route for local replies generated via sl module?

The error log messages seems to come from a situation like that.

If yes, then perhaps is good to restrict the event route to sip replies
only, because the sip parser for http replies is not compatible always.

Otherwise, the websocket connection seems established, the http reply
goes to browser and sip register comes, so in this regard, the log
message shows a harmless situation.

Cheers,
Daniel

On 20/02/15 21:44, Sergey Okhapkin wrote:
> Here is web browser's log:
>
> Request URL:ws://sip1.callwithus.com:5060/
> Request Method:GET
> Status Code:101 Switching Protocols
>
> Request Headers
> Accept-Encoding:gzip, deflate, sdch
> Accept-Language:en-US,en;q=0.8
> Cache-Control:no-cache
> Connection:Upgrade
> Host:sip1.callwithus.com:5060
> Origin:http://www.callwithus.com
> Pragma:no-cache
> Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits
> Sec-WebSocket-Key:ITH30EL8eWOPvyaqbIIFsA==
> Sec-WebSocket-Protocol:sip
> Sec-WebSocket-Version:13
> Upgrade:websocket
> User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like 
> Gecko) Chrome/40.0.2214.93 Safari/537.36
>
> Response Headers
> Connection:upgrade
> Content-Length:0
> Sec-WebSocket-Accept:AnL9/ez1KsQtmMjyM2/b4FDqQPE=
> Sec-WebSocket-Protocol:sip
> Server:CWU SIP GW
> Sia:SIP/2.0/TCP [2601:3:8840:A:172E:9CAD:6BB2:3F69]:45464
> Upgrade:websocket
>
> On Friday 20 February 2015 15:24:09 Sergey Okhapkin wrote:
>> Works but something is still wrong:
>>
>> Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: INFO: <script>: HTTP
>> Request Received
>> Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: ERROR: <core>
>> [parser/parse_fline.c:257]: parse_first_line(): parse_fir
>> st_line: bad message (offset: 22)
>> Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: ERROR: <core>
>> [parser/msg_parser.c:688]: parse_msg(): ERROR: parse_msg:
>>  message=<HTTP/1.1 101 Switching Protocols
>> *Sia: SIP/2.0/TCP [2601:3:8840:A:172E:9CAD:6BB2:3F69]:45395*
>> Sec-WebSocket-Protocol: sip
>> Upgrade: websocket
>> Connection: upgrade
>> Sec-WebSocket-Accept: LDFXlUJtVZUIkU3Fr+yQE4cf32U=
>> Server: CWU SIP GW
>> Content-Length: 0
>>
>>
>> Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: ERROR: <core>
>> [msg_translator.c:3057]: build_sip_msg_from_buf(): parsin
>> g failed
>> Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: INFO: <script>: SIP
>> message from ws:2601:3:8840:A:172E:9CAD:6BB2:3F69:4
>> 5395
>> REGISTER sip:sip1.callwithus.com SIP/2.0
>> *Via: SIP/2.0/WS
>> df7jal23ls0d.invalid;branch=z9hG4bKRyhgyWxh96q86MCmDUoT1CJkKsAKhTw
>> F;rport*
>> From: <sip:659372106 at sip1.callwithus.com>;tag=U1x7c0lwCu7xmFUfEydT
>> To: <sip:659372106 at sip1.callwithus.com>
>> Contact: <sip:659372106 at df7jal23ls0d.invalid;rtcweb-
>> breaker=no;transport=ws>;expires=200;click2call=no;+g.oma.sip-im;
>> +audio;l
>> anguage="en,fr"
>> Call-ID: 96020df3-0561-fab3-5ef8-30ef748059d1
>> CSeq: 6919 REGISTER
>> Content-Length: 0
>> Max-Forwards: 69
>> User-Agent: IM-client/OMA1.0 sipML5-v1.2014.12.11
>> Supported: path
>>
>> On Friday 20 February 2015 20:44:59 Daniel-Constantin Mierla wrote:
>>> Can you try with the small patch from the commit?
>> https://github.com/kamailio/kamailio/commit/5c1a9df4fc8bd72f44066bcef1
>> 3f381f
>>
>>> 01cd9d07
>>>
>>> If ok, I will backport.
>>>
>>> Cheers,
>>> Daniel
>>>
>>> On 20/02/15 20:30, Sergey Okhapkin wrote:
>>>> It looks like when http request comes from ipv6 address, the module
>>>> inserts Via header without [] around the address:
>>>>
>>>>
>>>>
>>>> Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: <core>
>>>> [parser/parse_via.c:2193]: parse_via(): ERROR:parse_via: bad port
>>>>
>>>> Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: <core>
>>>> [parser/parse_via.c:2708]: parse_via(): ERROR: parse_via on:
>>>> <SIP/2.0/TCP 2601:3:8840:A:172E:9CAD:6BB2:3F69:45306
>>>>
>>>> Host: sip1.callwithus.com:5060
>>>>
>>>> Connection: Upgrade
>>>>
>>>> Pragma: no-cache
>>>>
>>>> Cache-Control: no-cache
>>>>
>>>> Upgrade: websocket
>>>>
>>>> Origin: http://www.callwithus.com
>>>>
>>>> Sec-WebSocket-Version: 13
>>>>
>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
>> (KHTML,
>>
>>>> like Gecko) Chrome/40.0.2214.93 Safari/537.36
>>>>
>>>> Accept-Encoding: gzip, deflate, sdch
>>>>
>>>> Accept-Language: en-US,en;q=0.8
>>>>
>>>> Sec-WebSocket-Key: nyAUyArASVRXTI+Nvx82/Q==
>>>>
>>>> Sec-WebSocket-Extensions: permessage-deflate;
>> client_max_window_bits
>>
>>>> Sec-WebSocket-Protocol: sip
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: <core>
>>>> [parser/parse_via.c:2712]: parse_via(): ERROR: parse_via parse error,
>>>> parsed so far:<SIP/2.0/TCP 2601:3>
>>>>
>>>> Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: <core>
>>>> [parser/msg_parser.c:125]: get_hdr_field(): ERROR: get_hdr_field: bad
>> via
>>
>>>> Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: INFO: <core>
>>>> [parser/msg_parser.c:338]: parse_headers(): ERROR: bad header field
>>>> [Via: SIP/2.0/TCP 260]
>>>>
>>>> Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: <core>
>>>> [parser/msg_parser.c:688]: parse_msg(): ERROR: parse_msg:
>> message=<GET
>>
>>>> / HTTP/1.1
>>>>
>>>> Via: SIP/2.0/TCP 2601:3:8840:A:172E:9CAD:6BB2:3F69:45306
>>>>
>>>> Host: sip1.callwithus.com:5060
>>>>
>>>> Connection: Upgrade
>>>>
>>>> Pragma: no-cache
>>>>
>>>> Cache-Control: no-cache
>>>>
>>>> Upgrade: websocket
>>>>
>>>> Origin: http://www.callwithus.com
>>>>
>>>> Sec-WebSocket-Version: 13
>>>>
>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
>> (KHTML,
>>
>>>> like Gecko) Chrome/40.0.2214.93 Safari/537.36
>>>>
>>>> Accept-Encoding: gzip, deflate, sdch
>>>>
>>>> Accept-Language: en-US,en;q=0.8

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com




More information about the sr-users mailing list