Index: apps/app_meetme.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v retrieving revision 1.58 diff -u -r1.58 app_meetme.c --- apps/app_meetme.c 27 Aug 2004 04:12:55 -0000 1.58 +++ apps/app_meetme.c 27 Aug 2004 15:13:59 -0000 @@ -71,6 +71,8 @@ " 'M' -- enable music on hold when the conference has a single caller\n" " 'x' -- close the conference when last marked user exits\n" " 'w' -- wait until the marked user enters the conference\n" +" 'W' -- wait until the marked user enters the conference,\n" +" and also if all marked users leave the conference\n" " 'b' -- run AGI script specified in ${MEETME_AGI_BACKGROUND}\n" " Default: conf-background.agi\n" " (Note: This does not work with non-Zap channels in the same conference)\n" @@ -154,6 +156,7 @@ #define CONFFLAG_WAITMARKED (1 << 11) /* If set, the MeetMe will wait until a marked user enters */ #define CONFFLAG_EXIT_CONTEXT (1 << 12) /* If set, the MeetMe will exit to the specified context */ #define CONFFLAG_MARKEDUSER (1 << 13) /* If set, the user will be marked */ +#define CONFFLAG_WAITMARKED2 (1 << 14) /* If set, the MeetMe will wait if all marked users leave */ static int careful_write(int fd, unsigned char *data, int len) @@ -746,18 +749,19 @@ /* Update the struct with the actual confflags */ user->userflags = confflags; - /* trying to add moh for single person conf */ - if (confflags & CONFFLAG_MOH) { - if (conf->users == 1) { - if (musiconhold == 0) { - ast_moh_start(chan, NULL); - musiconhold = 1; - } - } else { - if (musiconhold) { - ast_moh_stop(chan); - musiconhold = 0; - } + /* trying to add moh for single person conf, or unsupervised conf */ + if (((confflags & CONFFLAG_MOH) && conf->users == 1) || ((confflags & CONFFLAG_WAITMARKED2) && conf->markedusers == 0)) { + if (musiconhold == 0) { + if ((confflags & CONFFLAG_WAITMARKED2) && conf->markedusers == 0) + if (!ast_streamfile(chan, "pls-hold", chan->language)) + ast_waitstream(chan, ""); + ast_moh_start(chan, NULL); + musiconhold = 1; + } + } else { + if (musiconhold) { + ast_moh_stop(chan); + musiconhold = 0; } } @@ -1216,6 +1220,8 @@ confflags |= CONFFLAG_AGI; if (strchr(inflags, 'w')) confflags |= CONFFLAG_WAITMARKED; + if (strchr(inflags, 'W')) + confflags |= CONFFLAG_WAITMARKED | CONFFLAG_WAITMARKED2; if (strchr(inflags, 'd')) dynamic = 1; if (strchr(inflags, 'D')) {