--- apps/app_meetme.c.orig 2003-09-03 00:09:03.000000000 -0500 +++ apps/app_meetme.c 2003-09-03 00:08:34.000000000 -0500 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -52,7 +53,8 @@ " 's' -- send user to admin/user menu if '*' is received\n" " 't' -- set talk only mode\n" " 'v' -- video mode\n" -" 'q' -- quiet mode (don't play enter/leave sounds)\n"; +" 'q' -- quiet mode (don't play enter/leave sounds)\n" +" 'M' -- enable music on hold when the conference has a single caller\n"; static char *descrip2 = " MeetMeCount(confno[|var]): Plays back the number of users in the specifiedi\n" @@ -90,6 +92,7 @@ #define CONFFLAG_TALKER (1 << 5) /* If set the use can only send audio to the conference */ #define CONFFLAG_QUIET (1 << 6) /* If set there will be no enter or leave sounds */ #define CONFFLAG_VIDEO (1 << 7) /* Set to enable video mode */ +#define CONFFLAG_MOH (1 << 8) /* If set there will be MOH when there's only one caller */ static int careful_write(int fd, unsigned char *data, int len) { @@ -235,6 +238,7 @@ int flags; int retryzap; int origfd; + int musiconhold = 0; int firstpass = 0; int ret = -1; int x; @@ -242,7 +246,7 @@ ZT_BUFFERINFO bi; char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET]; char *buf = __buf + AST_FRIENDLY_OFFSET; - + if (!(confflags & CONFFLAG_QUIET) && conf->users == 1) { if (!ast_streamfile(chan, "conf-onlyperson", chan->language)) ast_waitstream(chan, ""); @@ -363,6 +367,20 @@ outfd = -1; ms = -1; c = ast_waitfor_nandfds(&chan, 1, &fd, nfds, NULL, &outfd, &ms); + /* 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 { + ast_moh_stop(chan); + musiconhold = 0; + } + } + /* end modifications */ + if (c) { if (c->fds[0] != origfd) { if (retryzap) { @@ -561,6 +579,8 @@ confflags |= CONFFLAG_TALKER; if (strchr(inflags, 'q')) confflags |= CONFFLAG_QUIET; + if (strchr(inflags, 'M')) + confflags |= CONFFLAG_MOH; inpin = strchr(inflags, '|'); if (inpin) {