<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<font face="monospace">Hi Volkan,<br>
<br>
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.<br>
<br>
For some active ways of keeping the conn up, see <br>
<a class="moz-txt-link-freetext" href="https://www.opensips.org/Documentation/Script-CoreParameters-3-4#tcp_keepalive">https://www.opensips.org/Documentation/Script-CoreParameters-3-4#tcp_keepalive</a><br>
<a class="moz-txt-link-freetext" href="https://opensips.org/html/docs/modules/3.4.x/proto_tcp.html#idp156272">https://opensips.org/html/docs/modules/3.4.x/proto_tcp.html#idp156272</a><br>
<br>
Otherwise try to lower the registration time (from OpenSIPS side)
for that device to shorter value, below the device TCP timeout.<br>
<br>
Regards,<br>
</font>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
<a class="moz-txt-link-freetext" href="https://www.siphub.com">https://www.siphub.com</a></pre>
<div class="moz-cite-prefix">On 24.08.2024 14:06, Volkan Oransoy
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAM_EGOGRgFHzWUH+3-+U3XGidSVaU3aLhmpKZZXYkpRL39-60A@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="auto">Hi all,<br>
<br>
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.<br>
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.</div>
<div dir="auto">Since this is not an issue with the old box, I
assume the issue is related to my new setup. <br>
<br>
When sniffing the traffic, I see that the UAC ends the
connection.<br>
</div>
<div dir="auto"><br>
<font face="monospace">11 9.378043 UAC_IP SERVER_IP TCP 60
22719 → 5060 [SYN] Seq=0 Win=1608 Len=0 MSS=536<br>
12 9.378148 SERVER_IP UAC_IP TCP 58 5060 → 22719 [SYN, ACK]
Seq=0 Ack=1 Win=64240 Len=0 MSS=1460<br>
13 9.401441 UAC_IP SERVER_IP TCP 60 22719 → 5060 [ACK] Seq=1
Ack=1 Win=1608 Len=0<br>
14 9.405625 UAC_IP SERVER_IP SIP 560 Request: REGISTER sip:<a
href="http://c384.bulutfon.net" moz-do-not-send="true">c384.bulutfon.net</a>
(1 binding) | <br>
15 9.405731 SERVER_IP UAC_IP TCP 54 5060 → 22719 [ACK] Seq=1
Ack=507 Win=63784 Len=0<br>
16 9.405863 SERVER_IP UAC_IP SIP 557 Status: 401
Unauthorized | <br>
17 9.434851 UAC_IP SERVER_IP TCP 60 22719 → 5060 [ACK]
Seq=507 Ack=504 Win=1608 Len=0<br>
18 9.464046 UAC_IP SERVER_IP SIP 756 Request: REGISTER sip:<a
href="http://c384.bulutfon.net" moz-do-not-send="true">c384.bulutfon.net</a>
(1 binding) | <br>
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]<br>
20 9.470337 SERVER_IP UAC_IP SIP 125 Status: 200 OK
(REGISTER) (2 bindings) | <br>
21 9.495625 UAC_IP SERVER_IP TCP 60 22719 → 5060 [ACK]
Seq=1209 Ack=1040 Win=1608 Len=0<br>
22 9.501248 UAC_IP SERVER_IP TCP 60 22719 → 5060 [ACK]
Seq=1209 Ack=1111 Win=1608 Len=0<br>
23 10.520457 UAC_IP SERVER_IP TCP 60 22719 → 5060 [FIN, ACK]
Seq=1209 Ack=1111 Win=1608 Len=0<br>
24 10.520701 SERVER_IP UAC_IP TCP 54 5060 → 22719 [FIN, ACK]
Seq=1111 Ack=1210 Win=63784 Len=0<br>
25 10.543913 UAC_IP SERVER_IP TCP 60 22719 → 5060 [ACK]
Seq=1210 Ack=1112 Win=1608 Len=0</font><br>
<br>
</div>
<div>I use tcp_persistent_flag to flag the TCP connections and I
can see the relevant flag on ul_dump output. </div>
<div><br>
</div>
<div><font face="monospace">modparam("mid_registrar",
"tcp_persistent_flag", "TCP_PERSISTENT")<br>
</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">if ($socket_in(proto) == "tcp" ||
$socket_in(proto) == "tls")<br>
setbflag("TCP_PERSISTENT");<br>
<br>
</font></div>
<div><font face="monospace">mid_registrar_save("location");</font><br>
</div>
<div><font face="monospace"><br>
</font></div>
<div>
<div dir="auto">I have tried disabling the config above and
giving a fixed TCP lifetime value to the OpenSIPS box, but
the issue remains the same.<br>
<br>
Do you have any hints that I can chase after?<br>
<br>
Best</div>
</div>
<div dir="auto"><br>
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">Volkan Oransoy</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>