[Asterisk-cvs] asterisk/channels chan_h323.c,1.101,1.102

markster at lists.digium.com markster at lists.digium.com
Wed Feb 9 15:15:35 CST 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv27022/channels

Modified Files:
	chan_h323.c 
Log Message:
Fix H.323 locking (bug #3540)


Index: chan_h323.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- chan_h323.c	25 Jan 2005 06:10:19 -0000	1.101
+++ chan_h323.c	9 Feb 2005 21:15:44 -0000	1.102
@@ -832,7 +832,6 @@
 	} else  {
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
 	}
-	ast_mutex_unlock(&pvt->lock);
 	return ch;
 }
 
@@ -1389,8 +1388,14 @@
 		ast_log(LOG_ERROR, "Something is wrong: answer_call\n");
 		return 0;
 	}
+	/* Briefly lock call for oh323_new() */
+	ast_mutex_lock(&pvt->lock);
+
 	/* allocate a channel and tell asterisk about it */
 	c = oh323_new(pvt, AST_STATE_RINGING, pvt->cd.call_token);
+
+	/* And release when done */
+	ast_mutex_unlock(&pvt->lock);
 	if (!c) {
 		ast_log(LOG_ERROR, "Couldn't create channel. This is bad\n");
 		return 0;




More information about the svn-commits mailing list