[Asterisk-Dev] meetme dynamic conf creation problem

Jared Mauch jared at puck.nether.net
Fri Apr 1 09:32:57 MST 2005


On Thu, Mar 31, 2005 at 06:05:21PM -0500, Jared Mauch wrote:
> 	(running CVS HEAD "today" 2005/03/31)
> 
> 	So today I had an interesting case happen:
> 
> 	Two users (one of them being me, the * admin) joined a conf
> at the same time.  I was user #1 and the other user was #2:
> 
> "<1005>","SIP/1005-1e72","","MeetMe","4059|cdpMs","2005-03-31 20:56:21"
> "<1058>","SIP/1058-11b4","","MeetMe","4059|cdpMs","2005-03-31 20:56:21"
> 
> 	When I joined the conf, I received the message
> "you are the only person in this conference" then "there is
> one other user in the confernece".
> 
> 	The resulting impact is that (based on the code path i see
> in app_meetme.c) I was placed in a essentially 'null' conference due to
> the timing.  It would appear (to me) that the ast_mutex_lock(&conflock)
> (line 812) needs to be moved up in the code to cover this case.  Other
> users continued to join the conf and I was unable to tx to them
> or hear them.  (using ztdummy, not sure if that matters).
> 
> 	it may be possible to just ast_mutex_lock/unlock around
> the conf->users/marked users writes/updates.
> 
> 	recommendations?

	Ok, so i was hoping for some feedback, but instead what about
this attached (minor) patch.

	- jared

-- 
Jared Mauch  | pgp key available via finger from jared at puck.nether.net
clue++;      | http://puck.nether.net/~jared/  My statements are only mine.
-------------- next part --------------
? app_meetme.diff
Index: app_meetme.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v
retrieving revision 1.92
diff -u -r1.92 app_meetme.c
--- app_meetme.c	29 Mar 2005 06:34:50 -0000	1.92
+++ app_meetme.c	1 Apr 2005 16:30:38 -0000
@@ -640,12 +640,14 @@
 			ast_waitstream(chan, "");
 		goto outrun;
 	}
+
+	ast_mutex_lock(&conflock); /* Always lock around writes */
+
 	conf->users++;
 
 	if (confflags & CONFFLAG_MARKEDUSER)
 		conf->markedusers++;
       
-   	ast_mutex_lock(&conflock);
 	if (conf->firstuser == NULL) {
 		/* Fill the first new User struct */
 		user->user_no = 1;
@@ -671,7 +673,9 @@
 	user->userflags = confflags;
 	user->adminflags = 0;
 	user->talking = -1;
+
 	ast_mutex_unlock(&conflock);
+
 	origquiet = confflags & CONFFLAG_QUIET;
 	if (confflags & CONFFLAG_EXIT_CONTEXT) {
 		if ((agifile = pbx_builtin_getvar_helper(chan, "MEETME_EXIT_CONTEXT"))) 


More information about the asterisk-dev mailing list