Replies: 4 comments
-
Can you try to add a debug msg to the keepalive handler: --- a/src/sip/transp.c
+++ b/src/sip/transp.c
@@ -316,6 +316,8 @@ static void conn_keepalive_handler(void *arg)
mb.pos = 0;
mb.end = 4;
+ DEBUG_WARNING("KEEPALIVE\n");
+
err = tcp_send(conn->tc, &mb);
if (err) {
conn_close(conn, err); You can do the same for |
Beta Was this translation helpful? Give feedback.
-
in general it is probably better to use the mailing list for questions like this. I think the sip outbound ping/pong feature is only enabled if supported by the SIP Server. You can also use a low registration interval to keep the TCP connection open:
please note that some networks (CGN) will kill random TCP connections at random times. |
Beta Was this translation helpful? Give feedback.
-
Agreed, thanks for the support; I'll let you know if we will detect anything meaningful. |
Beta Was this translation helpful? Give feedback.
-
we put the debug lines in place (conn_keepalive_handler, sip_keepalive_tcp and also keepalive_handler in src/sipreg/reg.c); apparently, the keepalive are never sent. Active timers:
We rebuilt both libre and baresip. Is there something else that is needed, in order to enable the keepalives? |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have some systems where, apparently randomly (after many hours, usually) and without other network failures, the connection is lost and is re-established only when a re-register happens after the configured regint time. This leaves some minutes when the the system is not reachable.
The account:
As you can see I'm using sipnat outbound.
In this case, looking at the code, I assument it should enable a TCP keepalive that if I've understood correctly, will publish a
\r\n
every 120 seconds (TCP_KEEPALIVE_INTVAL) and wait 10 seconds before closing a non-working connection:re/src/sip/transp.c
Line 1829 in c7599c1
However, from a tcpdump I do not see any '\r\n' lines sent at any interval.
Should I look for something else? Is this a feature that requires server-side support? (we are currently using FlexiSIP)
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions