Commit 966ecb6a authored by jehan's avatar jehan
Browse files

disable sip keepalive in tcp

parent fd5e9b93
...@@ -336,13 +336,17 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i ...@@ -336,13 +336,17 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i
int err; int err;
bool_t ipv6; bool_t ipv6;
int proto=IPPROTO_UDP; int proto=IPPROTO_UDP;
int keepalive = ctx->keepalive_period;
switch (tr) { switch (tr) {
case SalTransportDatagram: case SalTransportDatagram:
proto=IPPROTO_UDP; proto=IPPROTO_UDP;
eXosip_set_option (EXOSIP_OPT_UDP_KEEP_ALIVE, &keepalive);
break; break;
case SalTransportStream: case SalTransportStream:
proto= IPPROTO_TCP; proto= IPPROTO_TCP;
keepalive=-1;
eXosip_set_option (EXOSIP_OPT_UDP_KEEP_ALIVE,&keepalive);
break; break;
default: default:
ms_warning("unexpected proto, using datagram"); ms_warning("unexpected proto, using datagram");
...@@ -363,7 +367,7 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i ...@@ -363,7 +367,7 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i
#ifdef HAVE_EXOSIP_GET_SOCKET #ifdef HAVE_EXOSIP_GET_SOCKET
ms_message("Exosip has socket number %i",eXosip_get_socket(proto)); ms_message("Exosip has socket number %i",eXosip_get_socket(proto));
#endif #endif
eXosip_set_option (EXOSIP_OPT_UDP_KEEP_ALIVE, &ctx->keepalive_period);
ctx->running=TRUE; ctx->running=TRUE;
return err; return err;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment