[asterisk-commits] rmudgett: branch 1.8 r413991 - /branches/1.8/apps/app_meetme.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu May 15 16:28:05 CDT 2014
Author: rmudgett
Date: Thu May 15 16:27:58 2014
New Revision: 413991
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=413991
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.
Modified:
branches/1.8/apps/app_meetme.c
Modified: branches/1.8/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_meetme.c?view=diff&rev=413991&r1=413990&r2=413991
==============================================================================
--- branches/1.8/apps/app_meetme.c (original)
+++ branches/1.8/apps/app_meetme.c Thu May 15 16:27:58 2014
@@ -2545,9 +2545,10 @@
* \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)
+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)
{
int keepplaying;
int playednamerec;
@@ -2680,12 +2681,14 @@
ast_mutex_lock(&conf->recordthreadlock);
if ((conf->recordthread == AST_PTHREADT_NULL) && ast_test_flag64(confflags, CONFFLAG_RECORDCONF) && ((conf->lchan = ast_request("DAHDI", AST_FORMAT_SLINEAR, chan, "pseudo", NULL)))) {
+ struct dahdi_confinfo dahdic;
+
ast_set_read_format(conf->lchan, AST_FORMAT_SLINEAR);
ast_set_write_format(conf->lchan, AST_FORMAT_SLINEAR);
- dahdic->chan = 0;
- dahdic->confno = conf->dahdiconf;
- dahdic->confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
- if (ioctl(conf->lchan->fds[0], DAHDI_SETCONF, dahdic)) {
+ dahdic.chan = 0;
+ dahdic.confno = conf->dahdiconf;
+ dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
+ if (ioctl(conf->lchan->fds[0], DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error starting listen channel\n");
ast_hangup(conf->lchan);
conf->lchan = NULL;
@@ -2728,10 +2731,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)
+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)
{
switch (*menu_mode) {
case MENU_DISABLED:
@@ -2746,7 +2750,8 @@
break;
}
case MENU_ADMIN_EXTENDED:
- meetme_menu_admin_extended(menu_mode, dtmf, conf, confflags, chan, user, recordingtmp, recordingtmp_size, dahdic);
+ meetme_menu_admin_extended(menu_mode, dtmf, conf, confflags, chan, user,
+ recordingtmp, recordingtmp_size);
break;
}
}
@@ -2984,9 +2989,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", chan->language))
ast_waitstream(chan, "");
- ast_mutex_unlock(&conf->playlock);
goto outrun;
}
}
@@ -3754,6 +3759,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);
@@ -3791,13 +3797,15 @@
}
if (dtmf > 0) {
- meetme_menu(&menu_mode, &dtmf, conf, confflags, chan, user, recordingtmp, sizeof(recordingtmp), &dahdic);
+ meetme_menu(&menu_mode, &dtmf, conf, confflags,
+ chan, user, recordingtmp, sizeof(recordingtmp));
}
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 asterisk-commits
mailing list