<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">nginx has nothing at all to do with the media stream, just the signaling path.<div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 10, 2017, at 8:48 PM, Mundkowsky, Robert <<a href="mailto:rmundkowsky@ets.org" class="">rmundkowsky@ets.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><a name="_MailEndCompose" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">I am surprised given microphones usually pick up low levels of noise and that Nginx would inspect data packets for data. Are you explicitly stopping data being sent based on push to talk events or VAD?<span class="Apple-converted-space"> </span><o:p class=""></o:p></span></a></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Robert<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><b class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span>FreeSWITCH-users [<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" style="color: purple; text-decoration: underline;" class="">mailto:freeswitch-users-bounces@lists.freeswitch.org</a>]<span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>Chad Phillips<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Tuesday, October 10, 2017 7:52 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>FreeSWITCH Users Help <<a href="mailto:freeswitch-users@lists.freeswitch.org" style="color: purple; text-decoration: underline;" class="">freeswitch-users@lists.freeswitch.org</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [Freeswitch-users] Sending keepalives on Verto websocket<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9.5pt;" class="">I’ve seen this issue when everyone is audio muted and/or doesn’t trigger a talking event for more than 60 seconds, which in my use case does happen. I would agree under normal videoconferencing circumstances it would be rare to go 60 seconds without a single event being sent along the websocket.</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">On Mon, Oct 9, 2017 at 7:38 AM, Mundkowsky, Robert <<a href="mailto:rmundkowsky@ets.org" target="_blank" style="color: purple; text-decoration: underline;" class="">rmundkowsky@ets.org</a>> wrote:<o:p class=""></o:p></div><blockquote style="border-style: none none none solid; border-left-width: 1pt; border-left-color: rgb(204, 204, 204); padding: 0in 0in 0in 6pt; margin-left: 4.8pt; margin-right: 0in;" class=""><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><a name="m_5443940142988388462__MailEndCompose" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">I am curious, what type of situation causes this problem? I mean, we use Verto for a conference, granted without Nginx, and seems like there are always packets being sent back and forth even when there is no audio or video.</span></a><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Robert</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><b class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span>FreeSWITCH-users [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank" style="color: purple; text-decoration: underline;" class="">freeswitch-users-bounces@lists.freeswitch.org</a>]<span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>Chad Phillips<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Friday, October 6, 2017 4:53 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>FreeSWITCH Users Help <<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank" style="color: purple; text-decoration: underline;" class="">freeswitch-users@lists.freeswitch.org</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [Freeswitch-users] Sending keepalives on Verto websocket</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">There are various suggested solutions out there. On the Nginx config side, easiest is to increase the <code style="font-family: 'Courier New';" class=""><span style="font-size: 10pt;" class="">proxy_read_timeout </span></code>setting to something high, but that seems like it could result in connections getting hung open if the server process goes away.<o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">Then there’s this module which looks pretty fancy and claims to solve the problem: <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fyaoweibin%2Fnginx_tcp_proxy_module&data=02%7C01%7Crmundkowsky%40ets.org%7C8340e5ebbbbe4d94bb6b08d50cfcf688%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C636429202964109077&sdata=lFoJ8DsDuceYjteVcZ72fMtgH%2BgmSWHj5g1MvTe%2FKzs%3D&reserved=0" target="_blank" style="color: purple; text-decoration: underline;" class="">https://github.com/yaoweibin/nginx_tcp_proxy_module</a><span class="Apple-converted-space"> </span>— it requires custom compiling nginx though…<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">I think I’ll stick with my current solution, which basically follows the other suggestion of having the server send periodic keepalives, except that I’m initiating from the client. Steps for others interested:<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">1. Add ‘echo’ to the list of jsonrpc-allowed-methods in any relevant domains in your user directory<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">2. Do something like this after a successful websocket connection:<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> MODULE.keepAliveTimer = setInterval(function() {<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> verto.rpcClient.call("echo", {keepalive: true});<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> }, VERTO_KEEPALIVE_INTERVAL)<o:p class=""></o:p></div></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">3. Add some cleanup on websocket close:<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> if (MODULE.keepAliveTimer) {<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> clearInterval(MODULE.keepAliveTimer);<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> MODULE.keepAliveTimer = null;<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> }<o:p class=""></o:p></div></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">Request and response lengths are both under 150 characters, so pretty short, and I set the intervals at 50 seconds, since Nginx’s default timeout is 60 seconds.<o:p class=""></o:p></div></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">On Fri, Oct 6, 2017 at 6:39 AM, Mundkowsky, Robert <<a href="mailto:rmundkowsky@ets.org" target="_blank" style="color: purple; text-decoration: underline;" class="">rmundkowsky@ets.org</a>> wrote:<o:p class=""></o:p></div><blockquote style="border-style: none none none solid; border-left-width: 1pt; border-left-color: rgb(204, 204, 204); padding: 0in 0in 0in 6pt; margin: 5pt 0in 5pt 4.8pt;" class=""><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><a name="m_5443940142988388462_m_-835003064064081" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Have you checked if Nginx has timeout settings and/or keep alive settings?</span></a><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F10550558%2Fnginx-tcp-websockets-timeout-keepalive-config&data=02%7C01%7Crmundkowsky%40ets.org%7C8340e5ebbbbe4d94bb6b08d50cfcf688%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C636429202964109077&sdata=5Ds%2BMnxK3AzpWTZ0JEfO3taJPp16uIK2UdKWfTLcvJg%3D&reserved=0" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">https://stackoverflow.com/questions/10550558/nginx-tcp-websockets-timeout-keepalive-config</span></a><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Robert</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><b class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span>FreeSWITCH-users [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank" style="color: purple; text-decoration: underline;" class="">freeswitch-users-bounces@lists.freeswitch.org</a>]<span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>Chad Phillips<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Thursday, October 5, 2017 11:07 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>FreeSWITCH Users Help <<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank" style="color: purple; text-decoration: underline;" class="">freeswitch-users@lists.freeswitch.org</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[Freeswitch-users] Sending keepalives on Verto websocket</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">I've switched to using Nginx to proxy Verto websockets, and have run into a small snag: by default, if Nginx doesn't read any data from a proxy backend within 60 seconds, it closes the connection, even for websockets.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">It appears the recommended solution is to have the server send some kind of regular keepalive. I poked around in mod_verto.c and found a 'request.keepalive' variable, but I'm unclear how to set that in the request, and/or if it even accomplishes what I'm wanting.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">I've solved the issue for now by periodically sending a JSON RPC 'echo' request along the websocket every 50 seconds, and the reply from the server is enough to keep the connection open. This is fine, but I am curious if there's a way to do it just from the server side, and if not, if it's worth it to add a setting to enable that functionality?<o:p class=""></o:p></div></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> <o:p class=""></o:p></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div><br class=""></div></body></html>