Index: apps/app_meetme.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v retrieving revision 1.94 diff -u -r1.94 app_meetme.c --- apps/app_meetme.c 13 Apr 2005 23:33:47 -0000 1.94 +++ apps/app_meetme.c 17 Apr 2005 03:21:43 -0000 @@ -67,6 +67,7 @@ " 'X' -- allow user to exit the conference by entering a valid single\n" " digit extension ${MEETME_EXIT_CONTEXT} or the current context\n" " if that variable is not defined.\n" +" 't' -- honor DTMF ResponseTimeout and attempt to transfer to extension t\n" " 'd' -- dynamically add conference\n" " 'D' -- dynamically add conference, prompting for a PIN\n" " 'e' -- select an empty conference\n" @@ -191,6 +192,7 @@ #define CONFFLAG_EMPTYNOPIN (1 << 20) #define CONFFLAG_ALWAYSPROMPT (1 << 21) #define CONFFLAG_ANNOUNCEUSERCOUNT (1 << 22) /* If set, when user joins the conference, they will be told the number of users that are already in */ +#define CONFFLAG_TIMEOUT (1 << 23) /* If set, will transfer to timeout extension after responsetimeout seconds */ AST_DECLARE_OPTIONS(meetme_opts,{ @@ -215,6 +217,7 @@ ['e'] = { CONFFLAG_EMPTY }, ['E'] = { CONFFLAG_EMPTYNOPIN }, ['P'] = { CONFFLAG_ALWAYSPROMPT }, + ['t'] = { CONFFLAG_TIMEOUT }, }); static char *istalking(int x) @@ -577,7 +580,7 @@ struct ast_channel *c; struct ast_frame fr; int outfd; - int ms; + int ms = -1; int nfds; int res; int flags; @@ -887,9 +890,10 @@ ast_log(LOG_WARNING, "Unable to allocate DSP!\n"); res = -1; } + if (confflags & CONFFLAG_TIMEOUT) + ms = chan->pbx->rtimeout * 1000; for(;;) { outfd = -1; - ms = -1; currentmarked = conf->markedusers; if (!(confflags & CONFFLAG_QUIET) && (confflags & CONFFLAG_MARKEDUSER) && (confflags & CONFFLAG_WAITMARKED) && lastmarked == 0) { if (currentmarked == 1 && conf->users > 1) { @@ -912,6 +916,14 @@ /* Update the struct with the actual confflags */ user->userflags = confflags; + if (!ms) { + strncpy(chan->context, exitcontext, sizeof(chan->context) - 1); + strncpy(chan->exten, "t", sizeof(chan->exten) - 1); + chan->priority = 0; + ret = 0; + break; + } + if (confflags & CONFFLAG_WAITMARKED) { if(currentmarked == 0) { if (lastmarked != 0) { @@ -1068,6 +1080,8 @@ char tmp[2]; tmp[0] = f->subclass; tmp[1] = '\0'; + if (!ast_exists_extension(chan, exitcontext, tmp, 1, chan->cid.cid_num)) + tmp[0] = 'i'; if (ast_exists_extension(chan, exitcontext, tmp, 1, chan->cid.cid_num)) { strncpy(chan->context, exitcontext, sizeof(chan->context) - 1); strncpy(chan->exten, tmp, sizeof(chan->exten) - 1); @@ -1343,6 +1357,7 @@ snprintf(meetmesecs, sizeof(meetmesecs), "%i", (int) (time(NULL) - user->jointime)); pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs); } + if (musiconhold) ast_moh_stop(chan); free(user); ast_mutex_unlock(&conflock); return ret;