[Asterisk-cvs] asterisk/apps app_meetme.c,1.44,1.45

markster at lists.digium.com markster at lists.digium.com
Sun Jun 20 22:51:38 CDT 2004


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

Modified Files:
	app_meetme.c 
Log Message:
Make 'x' option behave as advertised (bug #1878)


Index: app_meetme.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- app_meetme.c	17 Jun 2004 05:21:54 -0000	1.44
+++ app_meetme.c	21 Jun 2004 02:37:34 -0000	1.45
@@ -212,6 +212,7 @@
 			memset(cnf, 0, sizeof(struct ast_conference));
 			strncpy(cnf->confno, confno, sizeof(cnf->confno) - 1);
 			strncpy(cnf->pin, pin, sizeof(cnf->pin) - 1);
+			cnf->markedusers = -1;
 			cnf->chan = ast_request("zap", AST_FORMAT_ULAW, "pseudo");
 			if (cnf->chan) {
 				cnf->fd = cnf->chan->fds[0];	/* for use by conf_play() */
@@ -279,8 +280,8 @@
 	int hr, min, sec;
 	int i = 0, total = 0;
 	time_t now;
-	char *header_format = "%-14s %-14s %-8s  %-8s\n";
-	char *data_format = "%-12.12s   %4.4d	   %02d:%02d:%02d  %-8s\n";
+	char *header_format = "%-14s %-14s %-10s %-8s  %-8s\n";
+	char *data_format = "%-12.12s   %4.4d	      %4.4s       %02d:%02d:%02d  %-8s\n";
 	char cmdline[1024] = "";
 
 	if (argc > 8)
@@ -298,16 +299,17 @@
 		ast_cli(fd, "No active MeetMe conferences.\n");
 		return RESULT_SUCCESS;
 	}
-	ast_cli(fd, header_format, "Conf Num", "Parties", "Activity", "Creation");
+	ast_cli(fd, header_format, "Conf Num", "Parties", "Marked", "Activity", "Creation");
 		while(cnf) {
+			if (cnf->markedusers < 0)
+				strcpy(cmdline, "N/A ");
+			else 
+				snprintf(cmdline, sizeof(cmdline), "%4.4d", cnf->markedusers);
 			hr = (now - cnf->start) / 3600;
 			min = ((now - cnf->start) % 3600) / 60;
 			sec = (now - cnf->start) % 60;
 
-			if (cnf->isdynamic)
-				ast_cli(fd, data_format, cnf->confno, cnf->users, hr, min, sec, "Dynamic");
-			else
-				ast_cli(fd, data_format, cnf->confno, cnf->users, hr, min, sec, "Static");
+			ast_cli(fd, data_format, cnf->confno, cnf->users, cmdline, hr, min, sec, cnf->isdynamic ? "Dynamic" : "Static");
 
 			total += cnf->users; 	
 			cnf = cnf->next;
@@ -705,8 +707,8 @@
 			}
 			
 			/* Leave if the last marked user left */
-			if ((confflags & CONFFLAG_ADMINEXIT) && (conf->markedusers == 0)) {
-				ret = 0;
+			if (conf->markedusers == 0) {
+				ret = -1;
 				break;
 			}
 	
@@ -915,6 +917,8 @@
 			chan->name, chan->uniqueid, conf->confno);
 		prev = NULL;
 		conf->users--;
+		if (confflags & CONFFLAG_ADMINEXIT) 
+			conf->markedusers--;
 		cur = confs;
 		if (!conf->users) {
 			/* No more users -- close this one out */




More information about the svn-commits mailing list