From f1397e4450d4ac11be7b4cb5a432e16c71fc90ae Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 31 Mar 2008 17:14:49 +0000 Subject: [PATCH] add a bunch of locking to mod_iax, if it deadlocks nobody will be suprised part 2 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7992 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_iax/mod_iax.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_iax/mod_iax.c b/src/mod/endpoints/mod_iax/mod_iax.c index 96da321ee0..b91d362163 100644 --- a/src/mod/endpoints/mod_iax/mod_iax.c +++ b/src/mod/endpoints/mod_iax/mod_iax.c @@ -1080,16 +1080,18 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_iax_runtime) case IAX_EVENT_BUSY: case IAX_EVENT_HANGUP: if (channel) { + switch_mutex_lock(globals.mutex); switch_mutex_lock(tech_pvt->flag_mutex); switch_clear_flag(tech_pvt, TFLAG_IO); switch_clear_flag(tech_pvt, TFLAG_VOICE); switch_mutex_unlock(tech_pvt->flag_mutex); - + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Hangup %s\n", switch_channel_get_name(channel)); switch_set_flag_locked(tech_pvt, TFLAG_HANGUP); switch_channel_hangup(channel, iaxevent->etype == IAX_EVENT_HANGUP ? SWITCH_CAUSE_NORMAL_CLEARING : SWITCH_CAUSE_FACILITY_REJECTED); iaxevent->session = NULL; + switch_mutex_unlock(globals.mutex); } break; case IAX_EVENT_CNG: