[Asterisk-cvs] asterisk/apps app_meetme.c,1.79,1.80

markster at lists.digium.com markster at lists.digium.com
Tue Feb 15 21:51:19 CST 2005


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

Modified Files:
	app_meetme.c 
Log Message:
Begin autoservice while playing enter/leave sounds (bug #3599)


Index: app_meetme.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- app_meetme.c	2 Feb 2005 02:57:45 -0000	1.79
+++ app_meetme.c	16 Feb 2005 03:50:41 -0000	1.80
@@ -216,10 +216,13 @@
 	return 0;
 }
 
-static void conf_play(struct ast_conference *conf, int sound)
+static void conf_play(struct ast_channel *chan, struct ast_conference *conf, int sound)
 {
 	unsigned char *data;
 	int len;
+	int res=-1;
+	if (!chan->_softhangup)
+		res = ast_autoservice_start(chan);
 	ast_mutex_lock(&conflock);
 	switch(sound) {
 	case ENTER:
@@ -237,6 +240,8 @@
 	if (data) 
 		careful_write(conf->fd, data, len);
 	ast_mutex_unlock(&conflock);
+	if (!res) 
+		ast_autoservice_stop(chan);
 }
 
 static struct ast_conference *build_conf(char *confno, char *pin, int make, int dynamic)
@@ -789,7 +794,7 @@
 	if (!firstpass && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN)) {
 		firstpass = 1;
 		if (!(confflags & CONFFLAG_QUIET))
-			conf_play(conf, ENTER);
+			conf_play(chan, conf, ENTER);
 	}
 	ast_mutex_unlock(&conflock);
 	if (confflags & CONFFLAG_AGI) {
@@ -1105,7 +1110,7 @@
 
 	ast_mutex_lock(&conflock);
 	if (!(confflags & CONFFLAG_QUIET) && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN))
-		conf_play(conf, LEAVE);
+		conf_play(chan, conf, LEAVE);
 
 	if (!(confflags & CONFFLAG_QUIET) && (confflags & CONFFLAG_INTROUSER)) {
 		if (ast_fileexists(user->namerecloc, NULL, NULL)) {




More information about the svn-commits mailing list