[sr-dev] [kamailio/kamailio] presence: Always check if a record exists for this dialog before inserting (#724)

Phil Lavin notifications at github.com
Fri Jul 22 11:57:19 CEST 2016


- The presence implementation is a little dubious, to say the least.
  It probably wants re-writing at some stage. However, this fixes a
  race condition that could have a number of causes in which the PUA
  is unaware of the eTag at the point it sends the PUBLISH.

The mechanism is such that the PUA passes the eTag that should be updated in the database into a main Kamailio process via a header in the PUBLISH. It is made aware of the new eTag by the main Kamailio process in the 200 OK.

In the scenario when the PUA has not received the 200 OK for the `Trying` `PUBLISH` before it sends the `early` `PUBLISH`, it will send the `early` PUBLISH with no eTag. This results in both `Trying` and `early` being inserted into the database. Only the `early` is updated, as it is the most recent, meaning the `Trying` will stick around in the table until it expires.
You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/724

-- Commit Summary --

  * presence: Always check if a record exists for this dialog before inserting

-- File Changes --

    M modules/presence/presentity.c (134)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/724.patch
https://github.com/kamailio/kamailio/pull/724.diff

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/724
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160722/6d084908/attachment.html>


More information about the sr-dev mailing list