Hi all,
I'm facing problems with active subscription restoration after sipproxy restart.
db_mode is 0 (DB_MEMORY_ONLY) and according to comments in the presence.h kamailio holds subscription in memory and periodically updates to db, but retrieves from db only at startup. And it's true, I see that kamailio tries to update the active_watchers table, but it never inserts new subscriptions there.
There are no problems with access to the database since when db_mode is 2 (DB_ONLY) kamailio inserts new records into the active_watchers without any problems.
Here are presence module settings: modparam("presence", "db_url", "sqlite:////var/db/presence.db") modparam("presence", "db_mode", 0) modparam("presence", "timeout_rm_subs", 1) modparam("presence", "pres_htable_size", 8) modparam("presence", "subs_htable_size", 8) modparam("presence", "max_expires", 3600) modparam("presence", "db_update_period", 60) modparam("presence", "clean_period", 60)
Does anybody have success with db_mode = DB_MEMORY_ONLY and active_watchers db table ?
Vitaliy Aleksandrov writes:
db_mode is 0 (DB_MEMORY_ONLY) and according to comments in the presence.h kamailio holds subscription in memory and periodically updates to db, but retrieves from db only at startup. And it's true, I see that kamailio tries to update the active_watchers table, but it never inserts new subscriptions there.
i suggest you upgrade to 3.3. according to its readme, subs_db_mode=0 means that db is disabled. perhaps it was the same with 3.2, which according to its readme does not have db_mode param.
-- juha
Readme at the link stated below said that db_mode is a valid parameter. http://kamailio.org/docs/modules/3.2.x/modules_k/presence.html#id2546358
This patch fixes subscription restoration after kamailio-3.2.4 restart in case when db_mode of presence module is 0 (MEMORY_ONLY).
vitalik@work:~/src$ diff modules_k/presence/hash.c modules_k/presence/hash.c 264c264 < if(dbmode == DB_FALLBACK || dbmode == DB_MEMORY_ONLY) { ---
if(dbmode == DB_FALLBACK) {
Now it saves subscriptions in memory and periodically(db_update_period parameter) dumps them to the active_watchers table. After restart kamailio fills subscription hash table from the active_watchers db table.
Upgrade is a good suggestion as presence module of 3.3.х branch differs much from the one in the previous release and I hope it doesn't have described problems.. I have to port a few custom modules to switch to the new branch.
Vitaliy Aleksandrov writes:
db_mode is 0 (DB_MEMORY_ONLY) and according to comments in the presence.h kamailio holds subscription in memory and periodically updates to db, but retrieves from db only at startup. And it's true, I see that kamailio tries to update the active_watchers table, but it never inserts new subscriptions there.
i suggest you upgrade to 3.3. according to its readme, subs_db_mode=0 means that db is disabled. perhaps it was the same with 3.2, which according to its readme does not have db_mode param.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users