[asterisk-commits] qwell: trunk r92618 - in /trunk: ./ apps/app_meetme.c channels/ringtone.h
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Dec 12 15:22:58 CST 2007
Author: qwell
Date: Wed Dec 12 15:22:58 2007
New Revision: 92618
URL: http://svn.digium.com/view/asterisk?view=rev&rev=92618
Log:
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.
........
Modified:
trunk/ (props changed)
trunk/apps/app_meetme.c
trunk/channels/ringtone.h
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?view=diff&rev=92618&r1=92617&r2=92618
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Wed Dec 12 15:22:58 2007
@@ -1531,7 +1531,8 @@
long time_left_ms = 0;
struct timeval nexteventts = { 0, };
int to;
-
+ int setusercount = 0;
+
if (!(user = ast_calloc(1, sizeof(*user))))
return ret;
@@ -1671,9 +1672,6 @@
goto outrun;
}
- if (confflags & CONFFLAG_MARKEDUSER)
- conf->markedusers++;
-
ast_mutex_lock(&conf->playlock);
if (AST_LIST_EMPTY(&conf->userlist))
@@ -1695,29 +1693,8 @@
user->userflags = confflags;
user->adminflags = (confflags & CONFFLAG_STARTMUTED) ? ADMINFLAG_SELFMUTED : 0;
user->talking = -1;
- conf->users++;
- if (rt_log_members) {
- /* Update table */
- snprintf(members, sizeof(members), "%d", conf->users);
- ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
- }
- /* This device changed state now - if this is the first user */
- if (conf->users == 1)
- ast_devstate_changed(AST_DEVICE_INUSE, "meetme:%s", conf->confno);
ast_mutex_unlock(&conf->playlock);
-
- /* return the unique ID of the conference */
- pbx_builtin_setvar_helper(chan, "MEETMEUNIQUEID", conf->uniqueid);
-
- if (confflags & CONFFLAG_EXIT_CONTEXT) {
- if ((agifile = pbx_builtin_getvar_helper(chan, "MEETME_EXIT_CONTEXT")))
- ast_copy_string(exitcontext, agifile, sizeof(exitcontext));
- else if (!ast_strlen_zero(chan->macrocontext))
- ast_copy_string(exitcontext, chan->macrocontext, sizeof(exitcontext));
- else
- ast_copy_string(exitcontext, chan->context, sizeof(exitcontext));
- }
if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW))) {
snprintf(user->namerecloc, sizeof(user->namerecloc),
@@ -1729,6 +1706,36 @@
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++;
+ if (rt_log_members) {
+ /* Update table */
+ snprintf(members, sizeof(members), "%d", conf->users);
+ ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
+ }
+ setusercount = 1;
+
+ /* This device changed state now - if this is the first user */
+ if (conf->users == 1)
+ ast_devstate_changed(AST_DEVICE_INUSE, "meetme:%s", conf->confno);
+
+ ast_mutex_unlock(&conf->playlock);
+
+ /* return the unique ID of the conference */
+ pbx_builtin_setvar_helper(chan, "MEETMEUNIQUEID", conf->uniqueid);
+
+ if (confflags & CONFFLAG_EXIT_CONTEXT) {
+ if ((agifile = pbx_builtin_getvar_helper(chan, "MEETME_EXIT_CONTEXT")))
+ ast_copy_string(exitcontext, agifile, sizeof(exitcontext));
+ else if (!ast_strlen_zero(chan->macrocontext))
+ ast_copy_string(exitcontext, chan->macrocontext, sizeof(exitcontext));
+ else
+ ast_copy_string(exitcontext, chan->context, sizeof(exitcontext));
}
if ( !(confflags & (CONFFLAG_QUIET | CONFFLAG_NOONLYPERSON)) ) {
@@ -2647,14 +2654,16 @@
(long)(now.tv_sec - user->jointime));
}
- conf->users--;
- if (rt_log_members){
- /* Update table */
- snprintf(members, sizeof(members), "%d", conf->users);
- ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
- }
- if (confflags & CONFFLAG_MARKEDUSER)
- conf->markedusers--;
+ if (setusercount) {
+ conf->users--;
+ if (rt_log_members){
+ /* Update table */
+ snprintf(members, sizeof(members), "%d", conf->users);
+ ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
+ }
+ if (confflags & CONFFLAG_MARKEDUSER)
+ conf->markedusers--;
+ }
/* Remove ourselves from the list */
AST_LIST_REMOVE(&conf->userlist, user, list);
Modified: trunk/channels/ringtone.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/ringtone.h?view=diff&rev=92618&r1=92617&r2=92618
==============================================================================
--- trunk/channels/ringtone.h (original)
+++ trunk/channels/ringtone.h Wed Dec 12 15:22:58 2007
@@ -1,9 +1,5 @@
/* ringtone.h: Generated from frequencies 440 and 480
by gentone. 200 samples */
-/*! \file
- \brief
- Generated from frequencies 440 and 480 by gentone. 200 samples
-*/
static short ringtone[200] = {
0, 11581, 21659, 28927, 32445, 31764, 26981, 18727,
8084, -3559, -14693, -23875, -29927, -32083, -30088, -24228,
More information about the asterisk-commits
mailing list