From 0590142f4b74a02e8d0f8d38be9f01f4226b1838 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 1 Sep 2012 11:46:45 -0500 Subject: [PATCH] FS-4582 --resolve --- src/mod/endpoints/mod_sofia/mod_sofia.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 92353e2ab4..d0180bfa30 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -381,14 +381,15 @@ switch_status_t sofia_on_destroy(switch_core_session_t *session) switch_yield(100000); } - switch_mutex_lock(tech_pvt->profile->flag_mutex); - if ((uuid = switch_core_hash_find(tech_pvt->profile->chat_hash, tech_pvt->call_id))) { - free(uuid); - uuid = NULL; - switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->call_id); + if (!zstr(tech_pvt->call_id)) { + switch_mutex_lock(tech_pvt->profile->flag_mutex); + if ((uuid = switch_core_hash_find(tech_pvt->profile->chat_hash, tech_pvt->call_id))) { + free(uuid); + uuid = NULL; + switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->call_id); + } + switch_mutex_unlock(tech_pvt->profile->flag_mutex); } - switch_mutex_unlock(tech_pvt->profile->flag_mutex); - if (switch_core_codec_ready(&tech_pvt->read_codec)) { switch_core_codec_destroy(&tech_pvt->read_codec);