linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] SIP-TLS TCP keepalive


From: hrubi
Subject: Re: [Linphone-developers] SIP-TLS TCP keepalive
Date: Thu, 13 Oct 2011 00:37:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1

On 6.10.2011 21:38, hrubi wrote:
Hi, I'm trying to use the new SIP-TLS feature from the git head for Linux.

For the reference I'm connecting to Asterisk PBX on outside network.

As I'm behind NAT, I noticed that on long inactivity the TCP connection
gets eventually wiped from the NAT table. There's nothing I can do about
the NAT settings.

I finally resolved/workarounded this with this tiny library
http://libkeepalive.sourceforge.net/ which sets TCP keepalive on opened
TCP sockets.

Firstly I was trying to resolve this by various options in .linphonerc:
setting keepalive_period (that's only for UDP), setting small
reg_expires time, setting ping_with_options..

None of which did help.

It's possible that setting TCP keepalive is delegated to the sip
libraries and linphone has no control over it. But if it was possible it
would be nice option to have for specific scenarios.



For the record, here's how to use the libkeepalive:
1) Download and compile libkeepalive http://libkeepalive.sourceforge.net/
2) Create and run the startup script for linphone:
#!/bin/bash

LIBKEEPALIVE=/home/hrubi/linphone/lib/libkeepalive.so
LINPHONE=/home/hrubi/linphone/bin/linphone

LD_PRELOAD="$LIBKEEPALIVE" KEEPIDLE=60 KEEPINTVL=60 KEEPCNT=5
"$LINPHONE" $@



Regards,
hrubi



I found that linphone is intentionally disabling keepalives for TCP streams (both with and without TLS). Patch against git commit c3ce65e8021c38dc876617aa6cec2eecb226a93c to re-enable it is attached.

After applied, the linphonerc value in keepalive_period works fine for TCP too.

As a sidenote, http://www.linphone.org/eng/documentation/dev/tuning-linphone.html says that value of keepalive_period is in seconds, but it seems to be in miliseconds.

hrubi

Attachment: tcp_keepalive.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]