<div dir="ltr">SO_KEEPALIVE is defined in the system headers. You shouldn&#39;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">&lt;<a href="mailto:a.daydreamer82@gmail.com" target="_blank">a.daydreamer82@gmail.com</a>&gt;</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 *)&amp;val, sizeof val);<br>
#endif<br>  val = 30;<br>#if defined(TCP_KEEPIDLE)<br>  setsockopt(socket, SOL_TCP, TCP_KEEPIDLE, (void *)&amp;val, sizeof val);<br>#endif<br>#if defined(TCP_KEEPINTVL)<br>  setsockopt(socket, SOL_TCP, TCP_KEEPINTVL, (void *)&amp;val, sizeof val);<br>


#endif<br><br></div>The 30 seconds are hardcoded...<br></div>Now to turn off keepalive, I&#39;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">&lt;<a href="mailto:a.daydreamer82@gmail.com" target="_blank">a.daydreamer82@gmail.com</a>&gt;</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&#39;ve downloaded the freeswitch source code, and did a search for &quot;tcp_keepalive&quot;. I found the variable of type &quot;int&quot; 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">&lt;<a href="mailto:a.daydreamer82@gmail.com" target="_blank">a.daydreamer82@gmail.com</a>&gt;</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&#39;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">&lt;<a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a>&gt;</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 &lt;<a href="mailto:a.daydreamer82@gmail.com" target="_blank">a.daydreamer82@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hello,<br>
&gt;<br>
&gt; I&#39;m running freeswitch 1.2.10, with tls-only.<br>
&gt; I&#39;ve tried 2 SIP Useragents now: PhonerLite and CSipSimple.<br>
&gt;<br>
&gt; My linux server shows me with netstat --timers that both useragents (both server sockets) use keepalive, with a value of 30 seconds.<br>
&gt;<br>
&gt; 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&#39;s not mobile friendly, it&#39;s eating up battery power if the useragents keep receiving keepalive every 30 seconds.<br>





&gt;<br>
&gt; I&#39;ve tried to set<br>
&gt; &lt;param name=&quot;tcp-keepalive&quot; value=&quot;disable&quot;/&gt;<br>
&gt; in internal.xml but to no avail. It didn&#39;t change a thing. Setting this to 60000 didn&#39;t change the output of netstat --timers either.<br>
&gt;<br>
&gt; Any advice?<br>
&gt;<br>
&gt; best regards,<br>
&gt; Can<br>
</div></div>&gt; _______<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>