]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fix MEETMESECS (bug 2936)
authorRussell Bryant <russell@russellbryant.com>
Thu, 25 Nov 2004 18:27:22 +0000 (18:27 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 25 Nov 2004 18:27:22 +0000 (18:27 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4345 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_meetme.c

index ba63f554d049889d9e7f15b01f3f9b634c7a7b82..ae9846871b1331bf78524f9a7579531dab2478cc 100755 (executable)
@@ -524,7 +524,9 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
        memset(user, 0, sizeof(struct ast_conf_user));
 
        user->user_no = 0; /* User number 0 means starting up user! (dead - not in the list!) */
-       
+
+       time(&user->jointime);
+
        if (conf->locked) {
                /* Sorry, but this confernce is locked! */      
                if (!ast_streamfile(chan, "conf-locked", chan->language))
@@ -557,7 +559,6 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
                        conf->lastuser = user;
                }
        }
-       strncpy(user->usrvalue, "test", sizeof(user->usrvalue) - 1);
        user->chan = chan;
        user->userflags = confflags;
        user->adminflags = 0;
@@ -1043,10 +1044,10 @@ outrun:
                                else
                                        ast_log(LOG_ERROR, "Bad! Bad! Bad! user->prevuser is NULL but we're not the beginning!\n");
                        }
-                       /* Return the number of seconds the user was in the conf */
-                       snprintf(meetmesecs, sizeof(meetmesecs), "%i", (int) (user->jointime - time(NULL)));
-                       pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
                }
+               /* Return the number of seconds the user was in the conf */
+               snprintf(meetmesecs, sizeof(meetmesecs), "%i", (int) (time(NULL) - user->jointime));
+               pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
        }
        free(user);
        ast_mutex_unlock(&conflock);