Index: apps/app_meetme.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v retrieving revision 1.70 diff -u -r1.70 app_meetme.c --- apps/app_meetme.c 14 Jan 2005 05:10:00 -0000 1.70 +++ apps/app_meetme.c 18 Jan 2005 10:19:36 -0000 @@ -71,6 +71,7 @@ " 'E' -- select an empty pinless conference\n" " 'v' -- video mode\n" " 'q' -- quiet mode (don't play enter/leave sounds)\n" +" 'c' -- announce user(s) count on joining a conference\n" " '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" @@ -162,6 +163,7 @@ #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_INTROUSER (1 << 14) /* If set, user will be ask record name on entry of conference */ +#define CONFFLAG_ANNOUNCEUSERCOUNT (1 << 15) /* If set, when user join the conference, they will be announce the number of user that is already in */ static int careful_write(int fd, unsigned char *data, int len) { @@ -626,6 +628,42 @@ goto outrun; } + if (!(confflags & CONFFLAG_QUIET) && (confflags & CONFFLAG_ANNOUNCEUSERCOUNT) && conf->users > 1) { + int keepplaying=1; + + if (conf->users == 2) { + if (!ast_streamfile(chan,"conf-onlyone",chan->language)) { + res = ast_waitstream(chan, AST_DIGIT_ANY); + if (res > 0) + keepplaying=0; + else if (res == -1) + goto outrun; + } + } else { + if (!ast_streamfile(chan, "conf-thereare", chan->language)) { + res = ast_waitstream(chan, AST_DIGIT_ANY); + if (res > 0) + keepplaying=0; + else if (res == -1) + goto outrun; + } + if (keepplaying) { + res = ast_say_number(chan, conf->users - 1, AST_DIGIT_ANY, chan->language, (char *) NULL); + if (res > 0) + keepplaying=0; + else if (res == -1) + goto outrun; + } + if (keepplaying && !ast_streamfile(chan, "conf-otherinparty", chan->language)) { + res = ast_waitstream(chan, AST_DIGIT_ANY); + if (res > 0) + keepplaying=0; + else if (res == -1) + goto outrun; + } + } + } + /* Set it into linear mode (write) */ if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) { ast_log(LOG_WARNING, "Unable to set '%s' to write linear mode\n", chan->name); @@ -1277,6 +1315,8 @@ confflags |= CONFFLAG_QUIET; if (strchr(inflags, 'M')) confflags |= CONFFLAG_MOH; + if (strchr(inflags, 'c')) + confflags |= CONFFLAG_ANNOUNCEUSERCOUNT; if (strchr(inflags, 'x')) confflags |= CONFFLAG_MARKEDEXIT; if (strchr(inflags, 'X'))