[SR-Users] Reading presence state

Henning Westerholt hw at skalatan.de
Fri Jul 12 22:17:20 CEST 2019


Hello Gertjan,

so you want to not only query the database, but also the in-memory content of the presence module?

The PV $subs does not work for you? Another idea – have you looked to the parameter subs_db_mode? From the docs:

“1 - Write-Through scheme. Subscriptions are updated synchronously in database and in memory(used for read operations). Use this scheme if speed is not top priority, but it's important that no subscriptions will be lost during crash or reboot or if you have an external application that reads the state of the subscriptions from database and they need to be updated synchronously.”

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services

From: sr-users <sr-users-bounces at lists.kamailio.org> On Behalf Of Gertjan Wolzak
Sent: Monday, July 8, 2019 2:23 PM
To: sr-users <sr-users at lists.kamailio.org>
Subject: [SR-Users] Reading presence state


Hello Kamailions,

I have been able to get the presence configured, subscribers see the status of their subscriptions, this is working fine, for internal, incoming external and external calls. This was solved by enabling use_pubruri_avps in the pua_dialoginfo module.

Now I want to be able to route calls based on the presence state.

Using the presentity table could be used by doing a query based on the userpart of the ruri, which works fine when the call is still active, but it can take a while for the record to be removed from the presentity table, as that is dependend on the expires value. So when a query is made after a call is finished, a record would still be present in the presentity table till clean_period timer has hit again and the expires value is expired.

So I should get the status from memory, but I have not been able to find the information on how to do that.

Can someone enlighten me on where to find that information?

Rgds,

Gertjan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190712/f6e924f4/attachment.html>


More information about the sr-users mailing list