[OpenSIPS-Devel] Presence API & Clustering

Carsten Bock carsten at ng-voice.com
Wed Sep 20 10:56:00 UTC 2023


Hi there,
´
I have a quick question regarding presence & clustering:
I am working on extensions for handling "reg"-Events based on Usrloc. I
came across the following:

When OpenSIPS receives and handles a publish, it does the following:

/* query the database and update or insert */
if(update_presentity(msg, &presentity, &sent_reply) <0)
{
  LM_ERR("when updating presentity\n");
  reply_code = 500;
  reply_str = pu_500_rpl;
  goto error;
}

/* send event E_PRESENCE_PUBLISH */
presence_raise_event(presence_event_id, &presentity);

/* see if this PUBLISH needs to be replicated via cluster */
if (is_cluster_federation_enabled() &&
is_event_clustered(event->evp->parsed))
  replicate_publish_on_cluster(&presentity);

The API, however, only exposes "update_presentity()". I want to avoid
having to send me a PUBLISH locally, so I tried to use
"update_presentity()".
Do I understand this code correctly that the status set by my module using
"update_presentity()" is not replicated across the cluster and would not
raise any event?
Is that intended, or is there missing some functionality?
Should those functions be exposed so I can trigger a replication in the
cluster?

I am happy to make a PR for the changes once I have tested this, but I
wanted to know if this is on purpose.

Thanks,
Carsten
--
Carsten Bock I Chief Technology Innovation Officer & Founder

ng-voice GmbH

Trostbrücke 1 I 20457 Hamburg I Germany
T +49 1511 5942983 I www.ng-voice.com

Registry Office at Local Court Hamburg, HRB 120189
Managing Directors: Dr. David Bachmann, Carsten Bock, Quirin Maderspacher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20230920/a5f99f43/attachment.html>


More information about the Devel mailing list