Hello Henning,
Thank you for your time.
Think I have not been able to explain my challenge, or I am so far off, I need to start at zero.
I would want to only request the value of the in memory content, cause when I a call is finished, the records in the presentity table stay valid till they expire and the action to remove the expired records has been executed.
So to my best knowledge that would mean that even if the dialog has been ended, the record could exist for x amount of time depending on the min_expires and the clean_period parameters of the presence module.
For now I have solved my routing requirement by using the dialog funtions set_dlg_profile and get_profile_size. So I am able to limit calls to an extension that has an active call, but still allow outgoing calls from that extension.
I guess I have to look into doing something with the publish messages, get the information in those before the handle_publish action, retrieve the information and put it in a database table. But I think then the dialog option is the same, so just keep using that.
Am I correct in saying that monitoring (realtime) if an extension is in a dialog can be checked by querying the presentity table, but that wont work to check if an extension is not in a call due to the expires value an dthe clean_period parameters. With extension I mean user..
Thank you.
Rgds, Gertjan
From: "Henning Westerholt" hw@skalatan.de To: "sr-users" sr-users@lists.kamailio.org Cc: "Gertjan Wolzak" g.wolzak@kazlow.nl Sent: Friday, July 12, 2019 10:17:20 PM Subject: RE: Reading presence state
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