[sr-dev] git:master: modules_k/pua, modules_k/rls: Updated rls_update_subs() to remove back-end SUBSCRIBE dialogs when a contact is removed from a resource list

Peter Dunkley peter.dunkley at crocodile-rcs.com
Wed Feb 29 16:19:02 CET 2012


Module: sip-router
Branch: master
Commit: 5c5e969961b7171319ff79e105ce36f660bd1b63
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5c5e969961b7171319ff79e105ce36f660bd1b63

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Wed Feb 29 14:52:23 2012 +0000

modules_k/pua, modules_k/rls: Updated rls_update_subs() to remove back-end SUBSCRIBE dialogs when a contact is removed from a resource list

- rls_update_subs() should be called in kamailio.cfg whenever a resource list
  changes. The initial version just created new back-end SUBSCRIBE dialogs for
  new contacts. This meant that dialogs for removed contacts would remain until
  the dialog expired by itself - which means that NOTIFYs for presence changes
  to contacts that have been removed will continue to be sent (and with some
  clients displayed) for a while after the contact was deleted.
- Working out when a contact has been deleted is a bit more tricky than working
  out which ones are new. The mechanism used is to build two insert-sorted
  lists. List one contains the contacts in the contact list, list two contains
  the active back-end dialogs. You can then pop the top item from list one and
  search and remove it from list two (it should be near the top of list two as
  they are both sorted). Once you have been through list one the remaining URIs
  in list two are those that have been deleted from the contact list.

---

 modules_k/pua/hash.c      |   48 ++++++++++++++++
 modules_k/pua/hash.h      |    4 ++
 modules_k/pua/pua_bind.c  |    1 +
 modules_k/pua/pua_bind.h  |    1 +
 modules_k/pua/pua_db.c    |   75 ++++++++++++++++++++++++++
 modules_k/pua/pua_db.h    |    2 +
 modules_k/rls/list.h      |  131 +++++++++++++++++++++++++++++++++++++++++++++
 modules_k/rls/rls.c       |    8 +++
 modules_k/rls/rls.h       |    1 +
 modules_k/rls/subscribe.c |   67 +++++++++++++++++++++++
 10 files changed, 338 insertions(+), 0 deletions(-)

Diff:   http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=5c5e969961b7171319ff79e105ce36f660bd1b63



More information about the sr-dev mailing list