mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Merged revisions 92617 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 (closes issue #11048) ........ r92617 | qwell | 2007-12-12 15:15:45 -0600 (Wed, 12 Dec 2007) | 4 lines Don't increment user count until after name has been recorded (if enabled). Issue 11048, tested by pep. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1531,6 +1531,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
long time_left_ms = 0;
|
long time_left_ms = 0;
|
||||||
struct timeval nexteventts = { 0, };
|
struct timeval nexteventts = { 0, };
|
||||||
int to;
|
int to;
|
||||||
|
int setusercount = 0;
|
||||||
|
|
||||||
if (!(user = ast_calloc(1, sizeof(*user))))
|
if (!(user = ast_calloc(1, sizeof(*user))))
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1671,9 +1672,6 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
goto outrun;
|
goto outrun;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (confflags & CONFFLAG_MARKEDUSER)
|
|
||||||
conf->markedusers++;
|
|
||||||
|
|
||||||
ast_mutex_lock(&conf->playlock);
|
ast_mutex_lock(&conf->playlock);
|
||||||
|
|
||||||
if (AST_LIST_EMPTY(&conf->userlist))
|
if (AST_LIST_EMPTY(&conf->userlist))
|
||||||
@@ -1695,12 +1693,33 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
user->userflags = confflags;
|
user->userflags = confflags;
|
||||||
user->adminflags = (confflags & CONFFLAG_STARTMUTED) ? ADMINFLAG_SELFMUTED : 0;
|
user->adminflags = (confflags & CONFFLAG_STARTMUTED) ? ADMINFLAG_SELFMUTED : 0;
|
||||||
user->talking = -1;
|
user->talking = -1;
|
||||||
|
|
||||||
|
ast_mutex_unlock(&conf->playlock);
|
||||||
|
|
||||||
|
if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW))) {
|
||||||
|
snprintf(user->namerecloc, sizeof(user->namerecloc),
|
||||||
|
"%s/meetme/meetme-username-%s-%d", ast_config_AST_SPOOL_DIR,
|
||||||
|
conf->confno, user->user_no);
|
||||||
|
if (confflags & CONFFLAG_INTROUSERNOREVIEW)
|
||||||
|
res = ast_play_and_record(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, 128, 0, NULL);
|
||||||
|
else
|
||||||
|
res = ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL);
|
||||||
|
if (res == -1)
|
||||||
|
goto outrun;
|
||||||
|
}
|
||||||
|
|
||||||
|
ast_mutex_lock(&conf->playlock);
|
||||||
|
|
||||||
|
if (confflags & CONFFLAG_MARKEDUSER)
|
||||||
|
conf->markedusers++;
|
||||||
conf->users++;
|
conf->users++;
|
||||||
if (rt_log_members) {
|
if (rt_log_members) {
|
||||||
/* Update table */
|
/* Update table */
|
||||||
snprintf(members, sizeof(members), "%d", conf->users);
|
snprintf(members, sizeof(members), "%d", conf->users);
|
||||||
ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
|
ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
|
||||||
}
|
}
|
||||||
|
setusercount = 1;
|
||||||
|
|
||||||
/* This device changed state now - if this is the first user */
|
/* This device changed state now - if this is the first user */
|
||||||
if (conf->users == 1)
|
if (conf->users == 1)
|
||||||
ast_devstate_changed(AST_DEVICE_INUSE, "meetme:%s", conf->confno);
|
ast_devstate_changed(AST_DEVICE_INUSE, "meetme:%s", conf->confno);
|
||||||
@@ -1719,18 +1738,6 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
ast_copy_string(exitcontext, chan->context, sizeof(exitcontext));
|
ast_copy_string(exitcontext, chan->context, sizeof(exitcontext));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW))) {
|
|
||||||
snprintf(user->namerecloc, sizeof(user->namerecloc),
|
|
||||||
"%s/meetme/meetme-username-%s-%d", ast_config_AST_SPOOL_DIR,
|
|
||||||
conf->confno, user->user_no);
|
|
||||||
if (confflags & CONFFLAG_INTROUSERNOREVIEW)
|
|
||||||
res = ast_play_and_record(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, 128, 0, NULL);
|
|
||||||
else
|
|
||||||
res = ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL);
|
|
||||||
if (res == -1)
|
|
||||||
goto outrun;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !(confflags & (CONFFLAG_QUIET | CONFFLAG_NOONLYPERSON)) ) {
|
if ( !(confflags & (CONFFLAG_QUIET | CONFFLAG_NOONLYPERSON)) ) {
|
||||||
if (conf->users == 1 && !(confflags & CONFFLAG_WAITMARKED))
|
if (conf->users == 1 && !(confflags & CONFFLAG_WAITMARKED))
|
||||||
if (!ast_streamfile(chan, "conf-onlyperson", chan->language))
|
if (!ast_streamfile(chan, "conf-onlyperson", chan->language))
|
||||||
@@ -2647,14 +2654,16 @@ bailoutandtrynormal:
|
|||||||
(long)(now.tv_sec - user->jointime));
|
(long)(now.tv_sec - user->jointime));
|
||||||
}
|
}
|
||||||
|
|
||||||
conf->users--;
|
if (setusercount) {
|
||||||
if (rt_log_members){
|
conf->users--;
|
||||||
/* Update table */
|
if (rt_log_members){
|
||||||
snprintf(members, sizeof(members), "%d", conf->users);
|
/* Update table */
|
||||||
ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
|
snprintf(members, sizeof(members), "%d", conf->users);
|
||||||
|
ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
|
||||||
|
}
|
||||||
|
if (confflags & CONFFLAG_MARKEDUSER)
|
||||||
|
conf->markedusers--;
|
||||||
}
|
}
|
||||||
if (confflags & CONFFLAG_MARKEDUSER)
|
|
||||||
conf->markedusers--;
|
|
||||||
/* Remove ourselves from the list */
|
/* Remove ourselves from the list */
|
||||||
AST_LIST_REMOVE(&conf->userlist, user, list);
|
AST_LIST_REMOVE(&conf->userlist, user, list);
|
||||||
|
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
/* ringtone.h: Generated from frequencies 440 and 480
|
/* ringtone.h: Generated from frequencies 440 and 480
|
||||||
by gentone. 200 samples */
|
by gentone. 200 samples */
|
||||||
/*! \file
|
|
||||||
\brief
|
|
||||||
Generated from frequencies 440 and 480 by gentone. 200 samples
|
|
||||||
*/
|
|
||||||
static short ringtone[200] = {
|
static short ringtone[200] = {
|
||||||
0, 11581, 21659, 28927, 32445, 31764, 26981, 18727,
|
0, 11581, 21659, 28927, 32445, 31764, 26981, 18727,
|
||||||
8084, -3559, -14693, -23875, -29927, -32083, -30088, -24228,
|
8084, -3559, -14693, -23875, -29927, -32083, -30088, -24228,
|
||||||
|
Reference in New Issue
Block a user