[Asterisk-cvs] asterisk/apps app_meetme.c,1.83,1.84

markster at lists.digium.com markster at lists.digium.com
Thu Mar 3 17:35:59 CST 2005


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

Modified Files:
	app_meetme.c 
Log Message:
Flush MeetMe at appropriate times (bug #3599)


Index: app_meetme.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- app_meetme.c	26 Feb 2005 06:49:07 -0000	1.83
+++ app_meetme.c	3 Mar 2005 23:33:11 -0000	1.84
@@ -536,6 +536,16 @@
 	return res;
 }
 
+static void conf_flush(int fd)
+{
+	int x;
+	x = ZT_FLUSH_ALL;
+	if (ioctl(fd, ZT_FLUSH, x)) {
+		ast_log(LOG_WARNING, "Error flushing channel\n");
+		close(fd);
+	}
+}
+
 static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int confflags)
 {
 	struct ast_conference *prev=NULL, *cur;
@@ -785,6 +795,7 @@
 		ast_mutex_unlock(&conflock);
 		goto outrun;
 	}
+	conf_flush(fd);
 	ast_log(LOG_DEBUG, "Placed channel %s in ZAP conf %d\n", chan->name, conf->zapconf);
 
 	manager_event(EVENT_FLAG_CALL, "MeetmeJoin", 
@@ -960,6 +971,15 @@
 					ret = 0;
 					break;
 				} else if (((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*') && (confflags & CONFFLAG_STARMENU)) || ((f->frametype == AST_FRAME_DTMF) && menu_active)) {
+					int oldconfmode = 0;
+					oldconfmode = ztc.confmode;
+					ztc.confmode = 0;
+					if (ioctl(fd, ZT_SETCONF, &ztc)) {
+						ast_log(LOG_WARNING, "Error setting conference\n");
+						close(fd);
+						ast_mutex_unlock(&conflock);
+						goto outrun;
+					}
 					if (musiconhold) {
 			   			ast_moh_stop(chan);
 					}
@@ -1075,6 +1095,14 @@
 					if (musiconhold) {
 			   			ast_moh_start(chan, NULL);
 					}
+					ztc.confmode = oldconfmode;
+					if (ioctl(fd, ZT_SETCONF, &ztc)) {
+						ast_log(LOG_WARNING, "Error setting conference\n");
+						close(fd);
+						ast_mutex_unlock(&conflock);
+						goto outrun;
+					}
+					conf_flush(fd);
 				} else if (option_debug) {
 					ast_log(LOG_DEBUG, "Got unrecognized frame on channel %s, f->frametype=%d,f->subclass=%d\n",chan->name,f->frametype,f->subclass);
 				}




More information about the svn-commits mailing list