[OpenSIPS-Users] TCP keepalive problem.
Bogdan-Andrei Iancu
bogdan at opensips.org
Tue Sep 24 07:54:04 UTC 2024
Hi Volkan,
The TCP persistent flag is a passive way to keep the connection open,
meaning OpenSIPS will not close it during the registration time. But
does not imply any kind of keep alive.
For some active ways of keeping the conn up, see
https://www.opensips.org/Documentation/Script-CoreParameters-3-4#tcp_keepalive
https://opensips.org/html/docs/modules/3.4.x/proto_tcp.html#idp156272
Otherwise try to lower the registration time (from OpenSIPS side) for
that device to shorter value, below the device TCP timeout.
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
https://www.opensips-solutions.com
https://www.siphub.com
On 24.08.2024 14:06, Volkan Oransoy wrote:
> Hi all,
>
> I have an interesting issue that I am trying to identify the cause of.
> I am trying to migrate a quite old Kamailio SIP proxy to OpenSIPS 3.4.
> The new OpenSIPS proxy uses mid_registrar and replicates registrations
> to the backend boxes.
> A specific type of UACs (Gigaset AS690) does not keep the TCP
> connection alive. So on every registration refresh, the traffic comes
> from another port and a new contact is created. Interestingly, there
> are UACs from the very same network that have a healthy connection to
> the OpenSIPS box.
> Since this is not an issue with the old box, I assume the issue is
> related to my new setup.
>
> When sniffing the traffic, I see that the UAC ends the connection.
>
> 11 9.378043 UAC_IP SERVER_IP TCP 60 22719 → 5060 [SYN] Seq=0 Win=1608
> Len=0 MSS=536
> 12 9.378148 SERVER_IP UAC_IP TCP 58 5060 → 22719 [SYN, ACK] Seq=0
> Ack=1 Win=64240 Len=0 MSS=1460
> 13 9.401441 UAC_IP SERVER_IP TCP 60 22719 → 5060 [ACK] Seq=1 Ack=1
> Win=1608 Len=0
> 14 9.405625 UAC_IP SERVER_IP SIP 560 Request: REGISTER
> sip:c384.bulutfon.net <http://c384.bulutfon.net> (1 binding) |
> 15 9.405731 SERVER_IP UAC_IP TCP 54 5060 → 22719 [ACK] Seq=1 Ack=507
> Win=63784 Len=0
> 16 9.405863 SERVER_IP UAC_IP SIP 557 Status: 401 Unauthorized |
> 17 9.434851 UAC_IP SERVER_IP TCP 60 22719 → 5060 [ACK] Seq=507 Ack=504
> Win=1608 Len=0
> 18 9.464046 UAC_IP SERVER_IP SIP 756 Request: REGISTER
> sip:c384.bulutfon.net <http://c384.bulutfon.net> (1 binding) |
> 19 9.470312 SERVER_IP UAC_IP TCP 590 5060 → 22719 [ACK] Seq=504
> Ack=1209 Win=63784 Len=536 [TCP segment of a reassembled PDU]
> 20 9.470337 SERVER_IP UAC_IP SIP 125 Status: 200 OK (REGISTER) (2
> bindings) |
> 21 9.495625 UAC_IP SERVER_IP TCP 60 22719 → 5060 [ACK] Seq=1209
> Ack=1040 Win=1608 Len=0
> 22 9.501248 UAC_IP SERVER_IP TCP 60 22719 → 5060 [ACK] Seq=1209
> Ack=1111 Win=1608 Len=0
> 23 10.520457 UAC_IP SERVER_IP TCP 60 22719 → 5060 [FIN, ACK] Seq=1209
> Ack=1111 Win=1608 Len=0
> 24 10.520701 SERVER_IP UAC_IP TCP 54 5060 → 22719 [FIN, ACK] Seq=1111
> Ack=1210 Win=63784 Len=0
> 25 10.543913 UAC_IP SERVER_IP TCP 60 22719 → 5060 [ACK] Seq=1210
> Ack=1112 Win=1608 Len=0
>
> I use tcp_persistent_flag to flag the TCP connections and I can see
> the relevant flag on ul_dump output.
>
> modparam("mid_registrar", "tcp_persistent_flag", "TCP_PERSISTENT")
>
> if ($socket_in(proto) == "tcp" || $socket_in(proto) == "tls")
> setbflag("TCP_PERSISTENT");
>
> mid_registrar_save("location");
>
> I have tried disabling the config above and giving a fixed TCP
> lifetime value to the OpenSIPS box, but the issue remains the same.
>
> Do you have any hints that I can chase after?
>
> Best
>
> --
> Volkan Oransoy
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20240924/14f711a8/attachment-0001.html>
More information about the Users
mailing list