[asterisk-commits] rmudgett: branch 12 r413993 - in /branches/12: ./ apps/app_meetme.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu May 15 16:54:10 CDT 2014
Author: rmudgett
Date: Thu May 15 16:54:06 2014
New Revision: 413993
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=413993
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
Modified:
branches/12/ (props changed)
branches/12/apps/app_meetme.c
Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Modified: branches/12/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_meetme.c?view=diff&rev=413993&r1=413992&r2=413993
==============================================================================
--- branches/12/apps/app_meetme.c (original)
+++ branches/12/apps/app_meetme.c Thu May 15 16:54:06 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 asterisk-commits
mailing list