[Freeswitch-svn] [commit] r7992 - freeswitch/trunk/src/mod/endpoints/mod_iax

Freeswitch SVN anthm at freeswitch.org
Mon Mar 31 13:14:49 EDT 2008


Author: anthm
Date: Mon Mar 31 13:14:49 2008
New Revision: 7992

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c

Log:
add a bunch of locking to mod_iax, if it deadlocks nobody will be suprised part 2

Modified: freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c	Mon Mar 31 13:14:49 2008
@@ -1080,16 +1080,18 @@
 			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:



More information about the Freeswitch-svn mailing list