提交 1a66e8b2 authored 作者: Anthony Minessale's avatar Anthony Minessale

omit chat_hash code when presence is not enabled

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9574 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 b1e72c8b
...@@ -3782,7 +3782,9 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ ...@@ -3782,7 +3782,9 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
} }
if (tech_pvt->hash_key) { 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_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); nua_handle_bind(nh, NULL);
......
...@@ -1231,8 +1231,12 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) ...@@ -1231,8 +1231,12 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
tech_pvt->chat_from = tech_pvt->from_str; tech_pvt->chat_from = tech_pvt->from_str;
tech_pvt->chat_to = tech_pvt->dest; tech_pvt->chat_to = tech_pvt->dest;
tech_pvt->hash_key = switch_core_session_strdup(tech_pvt->session, hash_key); if (tech_pvt->profile->pflags & PFLAG_PRESENCE) {
switch_core_hash_insert(tech_pvt->profile->chat_hash, tech_pvt->hash_key, tech_pvt); 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); free(e_dest);
} }
......
...@@ -1724,10 +1724,11 @@ void sofia_presence_set_chat_hash(private_object_t *tech_pvt, sip_t const *sip) ...@@ -1724,10 +1724,11 @@ void sofia_presence_set_chat_hash(private_object_t *tech_pvt, sip_t const *sip)
} else { } else {
return; return;
} }
switch_mutex_lock(tech_pvt->profile->flag_mutex);
tech_pvt->hash_key = switch_core_session_strdup(tech_pvt->session, hash_key); 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_core_hash_insert(tech_pvt->profile->chat_hash, tech_pvt->hash_key, tech_pvt);
switch_mutex_unlock(tech_pvt->profile->flag_mutex);
} }
/* For Emacs: /* For Emacs:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论