}
/* if in db_only mode, get the presentity information from database - skip htable search */
- if(publ_cache_enabled) {
+ if(publ_cache_mode == PS_PCACHE_HYBRID) {
/* search in hash table if any record exists */
hash_code = core_case_hash(&pres_uri, NULL, phtable_size);
if(search_phtable(&pres_uri, event->evp->type, hash_code) == NULL) {
int pres_sphere_enable = 0;
int pres_timeout_rm_subs = 1;
int pres_send_fast_notify = 1;
-int publ_cache_enabled = 1;
+int publ_cache_mode = PS_PCACHE_HYBRID;
int pres_waitn_time = 5;
int pres_notifier_poll_rate = 10;
int pres_notifier_processes = 1;
{ "subs_htable_size", INT_PARAM, &shtable_size},
{ "pres_htable_size", INT_PARAM, &phtable_size},
{ "subs_db_mode", INT_PARAM, &pres_subs_dbmode},
- { "publ_cache", INT_PARAM, &publ_cache_enabled},
+ { "publ_cache", INT_PARAM, &publ_cache_mode},
{ "enable_sphere_check", INT_PARAM, &pres_sphere_enable},
{ "timeout_rm_subs", INT_PARAM, &pres_timeout_rm_subs},
{ "send_fast_notify", INT_PARAM, &pres_send_fast_notify},
}
}
- if(publ_cache_enabled) {
+ if(publ_cache_mode==PS_PCACHE_HYBRID) {
if(phtable_size < 1)
phtable_size = 256;
else
#define NO_UPDATE_TYPE -1
#define UPDATED_TYPE 1
+#define PS_PCACHE_NONE 0
+#define PS_PCACHE_HYBRID 1
+#define PS_PCACHE_RECORD 1
+
/** TM bind */
extern struct tm_binds tmb;
extern int pres_min_expires_action;
extern uint32_t pres_max_expires;
extern int pres_subs_dbmode;
-extern int publ_cache_enabled;
+extern int publ_cache_mode;
extern int pres_sphere_enable;
extern int pres_timeout_rm_subs;
extern int pres_send_fast_notify;
/* insert new record in hash_table */
- if(publ_cache_enabled
+ if(publ_cache_mode==PS_PCACHE_HYBRID
&& insert_phtable(
&pres_uri, presentity->event->evp->type, sphere)
< 0) {
}
/* delete from hash table */
- if(publ_cache_enabled
+ if(publ_cache_mode == PS_PCACHE_HYBRID
&& delete_phtable(&pres_uri, presentity->event->evp->type)
< 0) {
LM_ERR("deleting record from hash table\n");
/* updated stored sphere */
if(pres_sphere_enable
&& presentity->event->evp->type == EVENT_PRESENCE) {
- if(publ_cache_enabled
+ if(publ_cache_mode == PS_PCACHE_HYBRID
&& update_phtable(presentity, &pres_uri, body) < 0) {
LM_ERR("failed to update sphere for presentity\n");
goto error;
return NULL;
}
- if(publ_cache_enabled) {
+ if(publ_cache_mode == PS_PCACHE_HYBRID) {
/* search in hash table*/
hash_code = core_case_hash(pres_uri, NULL, phtable_size);
}
/* delete from hash table */
- if(publ_cache_enabled
+ if(publ_cache_mode==PS_PCACHE_HYBRID
&& delete_phtable(&uri, pres.event->evp->type) < 0) {
LM_ERR("deleting from presentity hash table\n");
goto error;