[OpenSIPS-Users] how to delete contacts on dead TCP or TLS sessions?

Liviu Chircu liviu at opensips.org
Mon Jun 25 09:22:50 EDT 2018

Hi Alex,

You have to enable contact pinging for this to work.  After X unanswered 
pings, the contact will be deleted from the user location.  For this to 
work, you have to properly load and configure the nathelper module, as 
well as set the "sipping_bflag" [1], "remove_on_timeout_bflag" [2] 
branch flags before doing save() for each contact.  Also, don't forget 
to enable TCP pings [3] (the default is to only ping UDP contacts).

Best regards,


Liviu Chircu
OpenSIPS Developer

On 25.06.2018 16:16, vasilevalex wrote:
> Hello.
> Can anybody help, what to do with TCP and TLS contacts after restart
> OpenSIPS or switching from Active to Backup server?
> I'm using mid_registrar with AoR throttling mode. When Active server fails
> and Backup server starts, all TCP and TLS endpoints of course detect dead
> TCP connection and create new connection to Virtual IP (which is processed
> by Backup server). And everything work. But after switching each AoR has 2
> contacts, first - is old and dead, second is working (so it doubles userloc
> table). If there are several switching Active/Backup, so each AoR will have
> number of contacts equal to number of switchings.
> And in OpenSIPS logs I have a lot of messages because of dead TLS sessions:
> /usr/sbin/opensips[28570]: ERROR:core:tcp_connect_blocking_timeout: timeout
> 99600 ms elapsed from 100000 s
> /usr/sbin/opensips[28570]: ERROR:proto_tls:tls_sync_connect:
> tcp_blocking_connect failed
> /usr/sbin/opensips[28570]: ERROR:proto_tls:proto_tls_send: connect failed
> /usr/sbin/opensips[28570]: ERROR:tm:msg_send: send() to <IP>:4197 for proto
> tls/3 failed
> /usr/sbin/opensips[28570]: ERROR:tm:t_forward_nonack: sending request failed
> And OpenSIPS deletes these dead contacts only after expiring interval, which
> can be very long.
> NAT is processed with
> modparam("mid_registrar", "tcp_persistent_flag",
> So all TCP sessions have lifetime equal to register expiration.
> How to delete contacts when TCP or TLS sessions dead?
> Thanks.
> --
> Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

More information about the Users mailing list