The problem we experienced was that the kamailio would sometimes send empty NOTIFYs after start. This problem was persistent until the kamailio was restarted again.

We found out that this would occur in case the presentity table contained more or equal expired entries than valid ones.
Lets assume we have only one presentity entry on startup and it is expired. This entry is ignored when filling the hash table. A PUBLISH generates a new valid entry in the DB and the hash table before the first cleanup run resulting in an expired and a valid entry in the DB and a publ_count of 1 for the URI in the hash table. On first run of the cleaner it removes the expired entry from the DB and reduces the publ_count to 0 which means removing it from the hash table despite the fact that there is still a valid DB entry.
Since the following PUBLISHes are subsequent ones only the DB is updated but not the hash table. The effect are hash table misses resulting in the omission of fetching the XML body from the presentity table for every following lookup.

This patch primarily tries to make the usage of publ_count consistently represent the number of presentity entries in the DB. And to make up for the short times an expired entry is in the hash table (after startup and for recently expired ones during runtime) the entry's expires time is checked on fetching the body for a NOTIFY.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.