diff -ur asterisk-trunk/apps/app_meetme.c asterisk-SVN-trunk-r172132/apps/app_meetme.c --- asterisk-trunk/apps/app_meetme.c 2009-01-28 22:05:15.000000000 -0200 +++ asterisk-SVN-trunk-r172132/apps/app_meetme.c 2009-01-29 12:50:09.000000000 -0200 @@ -107,6 +107,12 @@ + @@ -502,6 +508,8 @@ CONFFLAG_EMPTY = (1 << 18), CONFFLAG_EMPTYNOPIN = (1 << 19), CONFFLAG_ALWAYSPROMPT = (1 << 20), + /* !If set play an intro announcement at start of conference */ + CONFFLAG_INTROMSG = (1 << 21), /*! If set, won't speak the extra prompt when the first person * enters the conference */ CONFFLAG_NOONLYPERSON = (1 << 22), @@ -528,7 +536,8 @@ OPT_ARG_DURATION_STOP = 2, OPT_ARG_DURATION_LIMIT = 3, OPT_ARG_MOH_CLASS = 4, - OPT_ARG_ARRAY_SIZE = 5, + OPT_ARG_INTROMSG = 5, + OPT_ARG_ARRAY_SIZE = 6, }; AST_APP_OPTIONS(meetme_opts, BEGIN_OPTIONS @@ -542,6 +551,7 @@ AST_APP_OPTION('E', CONFFLAG_EMPTYNOPIN ), AST_APP_OPTION('e', CONFFLAG_EMPTY ), AST_APP_OPTION('F', CONFFLAG_PASS_DTMF ), + AST_APP_OPTION_ARG('G', CONFFLAG_INTROMSG, OPT_ARG_INTROMSG ), AST_APP_OPTION('i', CONFFLAG_INTROUSER ), AST_APP_OPTION('I', CONFFLAG_INTROUSERNOREVIEW ), AST_APP_OPTION_ARG('M', CONFFLAG_MOH, OPT_ARG_MOH_CLASS ), @@ -2263,6 +2273,13 @@ ast_channel_unlock(chan); } + /* Play an artbitrary intro message */ + if ((confflags & CONFFLAG_INTROMSG) && + !ast_strlen_zero(optargs[OPT_ARG_INTROMSG])) { + if (!ast_streamfile(chan, optargs[OPT_ARG_INTROMSG], chan->language)) + ast_waitstream(chan, ""); + } + if (!(confflags & (CONFFLAG_QUIET | CONFFLAG_NOONLYPERSON))) { if (conf->users == 1 && !(confflags & CONFFLAG_WAITMARKED)) if (!ast_streamfile(chan, "conf-onlyperson", chan->language)) diff -ur asterisk-trunk/apps/app_page.c asterisk-SVN-trunk-r172132/apps/app_page.c --- asterisk-trunk/apps/app_page.c 2009-01-28 22:05:15.000000000 -0200 +++ asterisk-SVN-trunk-r172132/apps/app_page.c 2009-01-29 12:42:33.000000000 -0200 @@ -80,6 +80,15 @@ + + @@ -107,21 +116,30 @@ PAGE_RECORD = (1 << 2), PAGE_SKIP = (1 << 3), PAGE_IGNORE_FORWARDS = (1 << 4), + PAGE_ANNOUNCE = (1 << 5), + PAGE_NOCALLERANNOUNCE = (1 << 6), } page_opt_flags; +enum { + OPT_ARG_ANNOUNCE = 0, + OPT_ARG_ARRAY_SIZE = 1, +}; + AST_APP_OPTIONS(page_opts, { AST_APP_OPTION('d', PAGE_DUPLEX), AST_APP_OPTION('q', PAGE_QUIET), AST_APP_OPTION('r', PAGE_RECORD), AST_APP_OPTION('s', PAGE_SKIP), AST_APP_OPTION('i', PAGE_IGNORE_FORWARDS), + AST_APP_OPTION_ARG('A', PAGE_ANNOUNCE, OPT_ARG_ANNOUNCE), + AST_APP_OPTION('n', PAGE_NOCALLERANNOUNCE), }); static int page_exec(struct ast_channel *chan, void *data) { char *tech, *resource, *tmp; - char meetmeopts[88], originator[AST_CHANNEL_NAME], *opts[0]; + char meetmeopts[128], originator[AST_CHANNEL_NAME], *opts[OPT_ARG_ARRAY_SIZE]; struct ast_flags flags = { 0 }; unsigned int confid = ast_random(); struct ast_app *app; @@ -164,8 +182,13 @@ timeout = atoi(args.timeout); } - snprintf(meetmeopts, sizeof(meetmeopts), "MeetMe,%ud,%s%sqxdw(5)", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"), + if (ast_test_flag(&flags, PAGE_ANNOUNCE) && !ast_strlen_zero(opts[OPT_ARG_ANNOUNCE])) { + snprintf(meetmeopts, sizeof(meetmeopts), "MeetMe,%ud,%s%sqxdw(5)G(%s)", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"), + (ast_test_flag(&flags, PAGE_RECORD) ? "r" : ""), opts[OPT_ARG_ANNOUNCE] ); + } else { + snprintf(meetmeopts, sizeof(meetmeopts), "MeetMe,%ud,%s%sqxdw(5)", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"), (ast_test_flag(&flags, PAGE_RECORD) ? "r" : "") ); + } /* Count number of extensions in list by number of ampersands + 1 */ num_dials = 1; @@ -247,8 +270,14 @@ } if (!res) { + /* Default behaviour */ snprintf(meetmeopts, sizeof(meetmeopts), "%ud,A%s%sqxd", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "t"), (ast_test_flag(&flags, PAGE_RECORD) ? "r" : "") ); + if (ast_test_flag(&flags, PAGE_ANNOUNCE) && !ast_strlen_zero(opts[OPT_ARG_ANNOUNCE]) && + !ast_test_flag(&flags, PAGE_NOCALLERANNOUNCE)) { + snprintf(meetmeopts, sizeof(meetmeopts), "%ud,A%s%sqxdG(%s)", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "t"), + (ast_test_flag(&flags, PAGE_RECORD) ? "r" : ""), opts[OPT_ARG_ANNOUNCE] ); + } pbx_exec(chan, app, meetmeopts); }