<div dir="ltr">SO_KEEPALIVE is defined in the system headers. You shouldn't undefine it.<br><div><br></div><div>Rather if you want to tune that code you should patch sofia and mod_sofia to allow you to do so.</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On 23 August 2013 10:35, Master Can <span dir="ltr"><<a href="mailto:a.daydreamer82@gmail.com" target="_blank">a.daydreamer82@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>When digging further into the source code, I found in libs\sofia-sip\libsofia-sip-ua\tport\tport_type_tcp.c:<br>
<br>#if defined(SO_KEEPALIVE)<br> setsockopt(socket, SOL_SOCKET, SO_KEEPALIVE, (void *)&val, sizeof val);<br>
#endif<br> val = 30;<br>#if defined(TCP_KEEPIDLE)<br> setsockopt(socket, SOL_TCP, TCP_KEEPIDLE, (void *)&val, sizeof val);<br>#endif<br>#if defined(TCP_KEEPINTVL)<br> setsockopt(socket, SOL_TCP, TCP_KEEPINTVL, (void *)&val, sizeof val);<br>
#endif<br><br></div>The 30 seconds are hardcoded...<br></div>Now to turn off keepalive, I'd have to change the header file where SO_KEEPALIVE is set and to compile freeswitch?<br><br></div>Is there a more straightforward way?<br>
<br></div>br,<br></div>Can<br><div><div><div><div><div><br><br></div></div></div></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/23 Master Can <span dir="ltr"><<a href="mailto:a.daydreamer82@gmail.com" target="_blank">a.daydreamer82@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am not a C/C++ programmer, but I've downloaded the freeswitch source code, and did a search for "tcp_keepalive". I found the variable of type "int" and it is populated with the value tcp-keepalive from the XML file (in sofia.c). But apart from that the variable is not used at all?? Am I overseeing something?<br>
</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/22 Master Can <span dir="ltr"><<a href="mailto:a.daydreamer82@gmail.com" target="_blank">a.daydreamer82@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Originally the option was not there - so I tried running Freeswitch without the option already. That didn't influence tcp keepalives though...<br><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/8/21 Brian West <span dir="ltr"><<a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>
Remove the option.<br>
<div><div><br>
On Aug 21, 2013, at 12:44 PM, Master Can <<a href="mailto:a.daydreamer82@gmail.com" target="_blank">a.daydreamer82@gmail.com</a>> wrote:<br>
<br>
> Hello,<br>
><br>
> I'm running freeswitch 1.2.10, with tls-only.<br>
> I've tried 2 SIP Useragents now: PhonerLite and CSipSimple.<br>
><br>
> My linux server shows me with netstat --timers that both useragents (both server sockets) use keepalive, with a value of 30 seconds.<br>
><br>
> How can I disable keepalive on the TCP layer completely? My useragents take care of sending keepalive packets anyway, so Freeswitch does not need to do that. It's not mobile friendly, it's eating up battery power if the useragents keep receiving keepalive every 30 seconds.<br>
><br>
> I've tried to set<br>
> <param name="tcp-keepalive" value="disable"/><br>
> in internal.xml but to no avail. It didn't change a thing. Setting this to 60000 didn't change the output of netstat --timers either.<br>
><br>
> Any advice?<br>
><br>
> best regards,<br>
> Can<br>
</div></div>> _______<br>
<br>
<br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>