[SR-Users] WebSocket ping is not being sent

Xuo Guoto xuoguoto at protonmail.com
Mon Mar 14 03:37:04 CET 2022


Thanks for your inputs Daniel and Igor.

I have confirmed that Kamailio is indeed sending out WebSocket ping as configured. Chrome's network tab do not show the control packets, but it can be viewed using firefox.

X.

------- Original Message -------
On Friday, March 11th, 2022 at 3:25 PM, Daniel-Constantin Mierla <miconda at gmail.com> wrote:

> Indeed, the sipdump is not saving everything that comes in or goes out of kamailio, only the traffic that uses the functions for handling or sending sip traffic. http is mapped over sip internally, but ws pings are using directly lower api for tcp send.
>
> Cheers,
> Daniel
>
> On 11.03.22 10:34, Igor Olhovskiy wrote:
>
>> Xuo,
>>
>> Can't say for Chrome Web Tools, but they most likely will filter these packets out as they are not part of "real traffic". I'd suggest you to do a capture directly on the wire with Wireshark or so.
>>
>> Same for Kamailio, I also don't expect em to be saved there for the same reason above.
>>
>> пт, 11 мар. 2022 г. в 09:29, Xuo Guoto <xuoguoto at protonmail.com>:
>>
>>> Hi,
>>>
>>> Yes, I understand that the SIP OPTIONS and websocket pings are different.
>>>
>>> I check the ping using two methods. One at the client side using chrome developer tools. At the server side I use sipdump module to capture all traffic.
>>>
>>> modparam("sipdump", "enable", 1)
>>> modparam("sipdump", "folder", "/var/log/kamailio/sip/")
>>>
>>> With this enabled, kamailio dumps all the traffic in a file for analysis. For example:
>>>
>>> tag: rcv
>>> pid: 1553531
>>> process: 16
>>> time: 1646982958.357033
>>> date: Fri Mar 11 12:45:58 2022
>>> proto: tls ipv4
>>> srcip: x9.xx.196.11
>>> srcport: 54640
>>> dstip: 1x8.xx.59.172
>>> dstport: 443
>>> ~~~~~~~~~~~~~~~~~~~~
>>> GET /ws HTTP/1.1
>>> Host: myhost-q01.mydomain.net
>>> Connection: Upgrade
>>> Pragma: no-cache
>>> Cache-Control: no-cache
>>> User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.3
>>> 6 Edg/99.0.1150.36
>>> Upgrade: websocket
>>> Origin: https://myhost-adm.mydomain.net
>>> Sec-WebSocket-Version: 13 <snip>
>>>
>>> I expect the ping websockets to be printed here, but this is not the only place I am checking for. If pings are being sent, I should get to see it at chrome websocket also. In my case neither place shows any trace of websocket pings packets.
>>>
>>> X.
>>>
>>> Sent with [ProtonMail](https://protonmail.com/) secure email.
>>>
>>> ------- Original Message -------
>>> On Friday, March 11th, 2022 at 2:19 PM, Igor Olhovskiy <igorolhovskiy at gmail.com> wrote:
>>>
>>>> Xuo,
>>>>
>>>> How do you capture this traffic? WebSocket pings is not an ordinary "SIP-style OPTIONS" pings, It's packets described in RFC6455 - https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2
>>>>
>>>> чт, 10 мар. 2022 г. в 16:57, Xuo Guoto <xuoguoto at protonmail.com>:
>>>>
>>>>> Hello list,
>>>>>
>>>>> I have kamailio 5.5.3 (x86_64/linux) configured as an SBC in front of asterisk to front end webrtc clients. Browser clients running JsSIP 3.7.0 connect to kamailio via webrtc and kamailio sends the traffic back to asterisk using SIP. rtpengine is configured to relay the RTP packets.
>>>>>
>>>>> I need to send websocket pings every 10 seconds to the browser clients.
>>>>>
>>>>> I have the following config in kamailio:
>>>>>
>>>>> modparam("websocket", "keepalive_mechanism", 1)
>>>>> modparam("websocket", "keepalive_timeout", 10)
>>>>> modparam("websocket", "keepalive_interval", 2)
>>>>> modparam("websocket", "keepalive_processes", 2)
>>>>> modparam("websocket", "verbose_list", 1)
>>>>>
>>>>> If my understanding of the documentation is correct, I do not need to do any additional configuration.
>>>>>
>>>>> But looking at the websocket traffic, I do not see any ping packets in websocket. I am also using sipdump module to capture all packets sent and received by kamailio and the ping packets are not visible there either.
>>>>>
>>>>> What could be wrong here? Do I need to do any additional config?
>>>>>
>>>>> Thanks for every help!
>>>>>
>>>>> X.
>>>>> __________________________________________________________
>>>>> Kamailio - Users Mailing List - Non Commercial Discussions
>>>>> * sr-users at lists.kamailio.org
>>>>> Important: keep the mailing list in the recipients, do not reply only to the sender!
>>>>> Edit mailing list options or unsubscribe:
>>>>> * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>>
>>>> --
>>>>
>>>> Best regards,
>>>> Igor
>>>
>>> __________________________________________________________
>>> Kamailio - Users Mailing List - Non Commercial Discussions
>>> * sr-users at lists.kamailio.org
>>> Important: keep the mailing list in the recipients, do not reply only to the sender!
>>> Edit mailing list options or unsubscribe:
>>> * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>> --
>>
>> Best regards,
>> Igor
>>
>> __________________________________________________________
>> Kamailio - Users Mailing List - Non Commercial Discussions
>>   *
>> sr-users at lists.kamailio.org
>> Important: keep the mailing list in the recipients, do not reply only to the sender!
>> Edit mailing list options or unsubscribe:
>>   *
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla --
> www.asipto.com
>
> www.twitter.com/miconda
> --
> www.linkedin.com/in/miconda
> Kamailio Advanced Training - Online
>   March 28-31, 2022 (Europe Timezone)
>   *
> https://www.asipto.com/sw/kamailio-advanced-training-online/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220314/3b7cf48c/attachment.htm>


More information about the sr-users mailing list