}
if (tech_pvt->hash_key) {
+ switch_mutex_lock(tech_pvt->profile->flag_mutex);
switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->hash_key);
+ switch_mutex_unlock(tech_pvt->profile->flag_mutex);
}
nua_handle_bind(nh, NULL);
tech_pvt->chat_from = tech_pvt->from_str;
tech_pvt->chat_to = tech_pvt->dest;
- tech_pvt->hash_key = switch_core_session_strdup(tech_pvt->session, hash_key);
- switch_core_hash_insert(tech_pvt->profile->chat_hash, tech_pvt->hash_key, tech_pvt);
+ if (tech_pvt->profile->pflags & PFLAG_PRESENCE) {
+ tech_pvt->hash_key = switch_core_session_strdup(tech_pvt->session, hash_key);
+ switch_mutex_lock(tech_pvt->profile->flag_mutex);
+ switch_core_hash_insert(tech_pvt->profile->chat_hash, tech_pvt->hash_key, tech_pvt);
+ switch_mutex_unlock(tech_pvt->profile->flag_mutex);
+ }
free(e_dest);
}
} else {
return;
}
-
+
+ switch_mutex_lock(tech_pvt->profile->flag_mutex);
tech_pvt->hash_key = switch_core_session_strdup(tech_pvt->session, hash_key);
switch_core_hash_insert(tech_pvt->profile->chat_hash, tech_pvt->hash_key, tech_pvt);
-
+ switch_mutex_unlock(tech_pvt->profile->flag_mutex);
}
/* For Emacs: