[svn-commits] rmudgett: trunk r413994 - in /trunk: ./ apps/app_meetme.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu May 15 17:02:36 CDT 2014


Author: rmudgett
Date: Thu May 15 17:02:32 2014
New Revision: 413994

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=413994
Log:
app_meetme: Fix overwrite of DAHDI conference data structure.

Starting a conference recording using the admin menu overwrites the DAHDI
conference data structure used to modify the admin user's conference mute
mode.

* Made no longer pass the user's DAHDI conference data structure into the
menu functions.  The menu now uses its own DAHDI conference data
structure to start the recording channel.

* Moved the unlock conf->playlock to before playing the conf-full message.
No sense keeping the lock while that prompt is playing.  The user is never
going to get into the conference at that point.
........

Merged revisions 413991 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413992 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413993 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/apps/app_meetme.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_meetme.c?view=diff&rev=413994&r1=413993&r2=413994
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Thu May 15 17:02:32 2014
@@ -2952,10 +2952,11 @@
  * \param chan ast_channel belonging to the user who called the menu
  * \param user which meetme conference user invoked the menu
  * \param recordingtmp character buffer which may hold the name of the conference recording file
- * \param dahdic dahdi configuration info used by the main conference loop
  */
-
-static void meetme_menu_admin_extended(enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user, char *recordingtmp, int recordingtmp_size, struct dahdi_confinfo *dahdic, struct ast_format_cap *cap_slin)
+static void meetme_menu_admin_extended(enum menu_modes *menu_mode, int *dtmf,
+	struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan,
+	struct ast_conf_user *user, char *recordingtmp, int recordingtmp_size,
+	struct ast_format_cap *cap_slin)
 {
 	int keepplaying;
 	int playednamerec;
@@ -3088,12 +3089,14 @@
 
 			ast_mutex_lock(&conf->recordthreadlock);
 			if ((conf->recordthread == AST_PTHREADT_NULL) && ast_test_flag64(confflags, CONFFLAG_RECORDCONF) && ((conf->lchan = ast_request("DAHDI", cap_slin, NULL, chan, "pseudo", NULL)))) {
+				struct dahdi_confinfo dahdic;
+
 				ast_set_read_format_by_id(conf->lchan, AST_FORMAT_SLINEAR);
 				ast_set_write_format_by_id(conf->lchan, AST_FORMAT_SLINEAR);
-				dahdic->chan = 0;
-				dahdic->confno = conf->dahdiconf;
-				dahdic->confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
-				if (ioctl(ast_channel_fd(conf->lchan, 0), DAHDI_SETCONF, dahdic)) {
+				dahdic.chan = 0;
+				dahdic.confno = conf->dahdiconf;
+				dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
+				if (ioctl(ast_channel_fd(conf->lchan, 0), DAHDI_SETCONF, &dahdic)) {
 					ast_log(LOG_WARNING, "Error starting listen channel\n");
 					ast_hangup(conf->lchan);
 					conf->lchan = NULL;
@@ -3136,10 +3139,11 @@
  * \param chan ast_channel belonging to the user who called the menu
  * \param user which meetme conference user invoked the menu
  * \param recordingtmp character buffer which may hold the name of the conference recording file
- * \param dahdic dahdi configuration info used by the main conference loop
  */
-
-static void meetme_menu(enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user, char *recordingtmp, int recordingtmp_size, struct dahdi_confinfo *dahdic, struct ast_format_cap *cap_slin)
+static void meetme_menu(enum menu_modes *menu_mode, int *dtmf,
+	struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan,
+	struct ast_conf_user *user, char *recordingtmp, int recordingtmp_size,
+	struct ast_format_cap *cap_slin)
 {
 	switch (*menu_mode) {
 	case MENU_DISABLED:
@@ -3154,7 +3158,8 @@
 			break;
 		}
 	case MENU_ADMIN_EXTENDED:
-		meetme_menu_admin_extended(menu_mode, dtmf, conf, confflags, chan, user, recordingtmp, recordingtmp_size, dahdic, cap_slin);
+		meetme_menu_admin_extended(menu_mode, dtmf, conf, confflags, chan, user,
+			recordingtmp, recordingtmp_size, cap_slin);
 		break;
 	}
 }
@@ -3400,9 +3405,9 @@
 	if (rt_schedule && conf->maxusers) {
 		if (conf->users >= conf->maxusers) {
 			/* Sorry, but this confernce has reached the participant limit! */	
+			ast_mutex_unlock(&conf->playlock);
 			if (!ast_streamfile(chan, "conf-full", ast_channel_language(chan)))
 				ast_waitstream(chan, "");
-			ast_mutex_unlock(&conf->playlock);
 			goto outrun;
 		}
 	}
@@ -4168,6 +4173,7 @@
 					if (ast_test_flag64(confflags, CONFFLAG_PASS_DTMF)) {
 						conf_queue_dtmf(conf, user, f);
 					}
+					/* Take out of conference */
 					if (ioctl(fd, DAHDI_SETCONF, &dahdic_empty)) {
 						ast_log(LOG_WARNING, "Error setting conference\n");
 						close(fd);
@@ -4205,13 +4211,15 @@
 					}
 
 					if (dtmf > 0) {
-						meetme_menu(&menu_mode, &dtmf, conf, confflags, chan, user, recordingtmp, sizeof(recordingtmp), &dahdic, cap_slin);
+						meetme_menu(&menu_mode, &dtmf, conf, confflags,
+							chan, user, recordingtmp, sizeof(recordingtmp), cap_slin);
 					}
 
 					if (musiconhold && !menu_mode) {
 						conf_start_moh(chan, optargs[OPT_ARG_MOH_CLASS]);
 					}
 
+					/* Put back into conference */
 					if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
 						ast_log(LOG_WARNING, "Error setting conference\n");
 						close(fd);




More information about the svn-commits mailing list