[SR-Users] unregister user when kamailio looses TCP connection.
Vitaliy Aleksandrov
vitalik.voip at gmail.com
Thu Aug 29 12:47:51 CEST 2013
Thanks community for all replies.
I did the second try. Result is in the attachment.
This time a did it in the way proposed by Daniel-Constantin Mierla.
All job is done in timer process when it iterates through all
registrations looking for expired ones.
It works for all database modes except DB_ONLY.
I'm not sure about tcpconn_get() / tcpconn_put() functions.
tcpconn_get() increments ref counter, but there are several function to
decrement it: tcpconn_put(), tcpconn_chld_put() and
atomic_dec_and_test(). When I was looking for examples in other modules
I saw that tcp_read.c uses tcpconn_chld_put(), but forward.h and
msg_translator.c uses only tcpconn_get() without decrementing ref
counter at all.
It would be great if somebody more experienced shed some light on this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unregister_tcp_lost.patch
Type: text/x-patch
Size: 7588 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130829/ff55ef7a/attachment.bin>
More information about the sr-users
mailing list