<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>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.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 11.03.22 10:34, Igor Olhovskiy
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAJTkRNs8z-7T7rm3cGk7bTYnoJtx_8xf6U_pNO3zybSrvBea5w@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Xuo,</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Same for Kamailio, I also don't expect em to be saved there
for the same reason above.<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">пт, 11 мар. 2022 г. в 09:29,
Xuo Guoto <<a href="mailto:xuoguoto@protonmail.com"
moz-do-not-send="true" class="moz-txt-link-freetext">xuoguoto@protonmail.com</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="font-family:arial;font-size:14px">Hi,</div>
<div style="font-family:arial;font-size:14px"><br>
</div>
<div style="font-family:arial;font-size:14px">Yes, I
understand that the SIP OPTIONS and websocket pings are
different.</div>
<div style="font-family:arial;font-size:14px"><br>
</div>
<div style="font-family:arial;font-size:14px">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. <br>
</div>
<div style="font-family:arial;font-size:14px"><br>
</div>
<div style="font-family:arial;font-size:14px"><span>modparam("sipdump",
"enable", 1)</span>
<div><span>modparam("sipdump", "folder",
"/var/log/kamailio/sip/")</span></div>
<span></span></div>
<div style="font-family:arial;font-size:14px"><br>
</div>
<div style="font-family:arial;font-size:14px">With this
enabled, kamailio dumps all the traffic in a file for
analysis. For example:</div>
<div style="font-family:arial;font-size:14px"><br>
</div>
<div style="font-family:arial;font-size:14px"><span>tag: rcv</span>
<div><span>pid: 1553531</span></div>
<div><span>process: 16</span></div>
<div><span>time: 1646982958.357033</span></div>
<div><span>date: Fri Mar 11 12:45:58 2022</span></div>
<div><span>proto: tls ipv4</span></div>
<div><span>srcip: x9.xx.196.11</span></div>
<div><span>srcport: 54640</span></div>
<div><span>dstip: 1x8.xx.59.172</span></div>
<div><span>dstport: 443</span></div>
<div><span>~~~~~~~~~~~~~~~~~~~~</span></div>
<div><span>GET /ws HTTP/1.1</span></div>
<div><span>Host: <a rel="noreferrer nofollow noopener"
href="http://myhost-q01.mydomain.net" target="_blank"
moz-do-not-send="true">myhost-q01.mydomain.net</a></span></div>
<div><span>Connection: Upgrade</span></div>
<div><span>Pragma: no-cache</span></div>
<div><span>Cache-Control: no-cache</span></div>
<div><span>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</span></div>
<div><span>6 Edg/99.0.1150.36</span></div>
<div><span>Upgrade: websocket</span></div>
<div><span>Origin: <a rel="noreferrer nofollow noopener"
href="https://myhost-adm.mydomain.net" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">https://myhost-adm.mydomain.net</a></span></div>
<div><span>Sec-WebSocket-Version: 13</span></div>
<span></span><snip></div>
<div style="font-family:arial;font-size:14px"><br>
</div>
<div style="font-family:arial;font-size:14px">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. <br>
</div>
<div style="font-family:arial;font-size:14px"><br>
</div>
<div style="font-family:arial;font-size:14px">X.<br>
</div>
<div style="font-family:arial;font-size:14px"><br>
</div>
<div style="font-family:arial;font-size:14px"><br>
</div>
<div style="font-family:arial;font-size:14px">
<div> </div>
<div> Sent with <a href="https://protonmail.com/"
rel="noopener noreferrer" target="_blank"
moz-do-not-send="true">ProtonMail</a> secure email. </div>
</div>
<div style="font-family:arial;font-size:14px"><br>
</div>
<div> ------- Original Message -------<br>
On Friday, March 11th, 2022 at 2:19 PM, Igor Olhovskiy <<a
href="mailto:igorolhovskiy@gmail.com" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">igorolhovskiy@gmail.com</a>>
wrote:<br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>Xuo,</div>
<div><br>
</div>
<div>How do you capture this traffic? WebSocket pings is
not an ordinary "SIP-style OPTIONS" pings, It's
packets described in RFC6455 - <a
href="https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2"
rel="noreferrer nofollow noopener" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2</a></div>
</div>
<br>
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">чт, 10 мар. 2022 г. в
16:57, Xuo Guoto <<a
href="mailto:xuoguoto@protonmail.com"
rel="noreferrer nofollow noopener" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">xuoguoto@protonmail.com</a>>:<br>
</div>
<blockquote style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)">Hello
list,</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)"><br>
</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)">I
have kamailio <span>5.5.3 (x86_64/linux)</span>
configured as an SBC in front of asterisk to front
end webrtc clients. Browser clients running <span>JsSIP
3.7.0</span> connect to kamailio via webrtc and
kamailio sends the traffic back to asterisk using
SIP. rtpengine is configured to relay the RTP
packets.</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)"><br>
</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)">I
need to send websocket pings every 10 seconds to the
browser clients.<br>
</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)"><br>
</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)">I
have the following config in kamailio:</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)"><br>
</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)"><span></span><span></span><span>modparam("websocket",
"keepalive_mechanism", 1)</span>
<div><span>modparam("websocket",
"keepalive_timeout", 10)</span></div>
<div><span>modparam("websocket",
"keepalive_interval", 2)</span></div>
<div><span>modparam("websocket",
"keepalive_processes", 2)</span></div>
<div><span>modparam("websocket", "verbose_list", 1)</span></div>
<span></span></div>
<br>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)">If
my understanding of the documentation is correct, I
do not need to do any additional configuration. <br>
</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)"><br>
</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)">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.</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)"><br>
</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)">What
could be wrong here? Do I need to do any additional
config? <br>
</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)"><br>
</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)">Thanks
for every help!</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)"><br>
</div>
<div
style="font-family:arial;font-size:14px;color:rgb(34,34,34)">X.<br>
</div>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial
Discussions<br>
* <a href="mailto:sr-users@lists.kamailio.org"
rel="noreferrer nofollow noopener" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do
not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
* <a rel="noreferrer nofollow noopener"
href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote>
</div>
<br clear="all">
<br>
-- <br>
<div dir="ltr">
<div dir="ltr">Best regards,
<div>Igor</div>
</div>
</div>
</blockquote>
<br>
</div>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
 * <a href="mailto:sr-users@lists.kamailio.org"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not
reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
 * <a
href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
rel="noreferrer" target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote>
</div>
<br clear="all">
<br>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">Best regards,
<div>Igor</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
* <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
* <a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
March 28-31, 2022 (Europe Timezone)
* <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
</body>
</html>