TCP keep alive

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

 



Klaus Darilion wrote:
> Hi Benny!
> 
> from documentation:
> ..
>> unsigned pjsua_acc_config::ka_interval
>> ...
>> Even if this setting is enabled, keep-alive transmission is only
>> done when STUN is enabled in the global pjsua_config, and the
>> transport used for registration is UDP. For TCP and TLS transports,
>> keep-alive is done by the transport themselves.
> ...
> 
> Are you sure that TCP keep alive will work? AFAIK TCP keep-alives vary 
> strong between different OS and the timeout is hardly to configure.

Yes it will. The TCP/TLS transports meant by the doc are pjsip's 
TCP/TLS transport, and not the keep-alive feature of the underlying 
socket. The data to be sent and the duration of the keep-alive are 
controlled by some config macros, and the default are to send CRLF 
once every 90 seconds (sip_config.h):

#ifndef PJSIP_TCP_KEEP_ALIVE_INTERVAL
#   define PJSIP_TCP_KEEP_ALIVE_INTERVAL    90
#endif

#ifndef PJSIP_TCP_KEEP_ALIVE_DATA
#   define PJSIP_TCP_KEEP_ALIVE_DATA	    { "\r\n", 2 }
#endif

#ifndef PJSIP_TLS_KEEP_ALIVE_INTERVAL
#   define PJSIP_TLS_KEEP_ALIVE_INTERVAL    90
#endif

#ifndef PJSIP_TLS_KEEP_ALIVE_DATA
#   define PJSIP_TLS_KEEP_ALIVE_DATA	    { "\r\n", 2 }
#endif



> Thus, also the SIP outbound draft specify to use CRLF as keep alive when 
> using TCP/TLS. (actually it uses CRLFCRLF "ping" and CRLF "pong")
> 
> http://www.ietf.org/internet-drafts/draft-ietf-sip-outbound-11.txt
> 

Outbound is in my desired features list for the next release 
(http://www.pjsip.org/trac/roadmap), hopefully it'll be able to make it.

thanks,
  -benny

> regards
> klaus





[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux