diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-10-13 05:37:49 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-10-13 05:37:49 +0000 |
commit | 2e1e54a733196c08f36dc4c0cb08b238fa73fcb9 (patch) | |
tree | fbd72df8f25be514d137541dd9cc6b64b05c0b11 /apps/app_page.c | |
parent | 5985919ea4c296a005f49a3bf2f7306bfed9fdfa (diff) |
Make sure paging can be duplex if necessary
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6754 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_page.c')
-rwxr-xr-x | apps/app_page.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/apps/app_page.c b/apps/app_page.c index f84e0b346..9e8e30d06 100755 --- a/apps/app_page.c +++ b/apps/app_page.c @@ -36,6 +36,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/channel.h" #include "asterisk/pbx.h" #include "asterisk/module.h" +#include "asterisk/app.h" static char *tdesc = "Page Multiple Phones"; @@ -45,21 +46,30 @@ static char *app_page= "Page"; static char *page_synopsis = "Pages phones"; static char *page_descrip = -"Page(Technology/Resource&Technology2/Resource2)\n" +"Page(Technology/Resource&Technology2/Resource2[|options])\n" " Places outbound calls to the given technology / resource and dumps\n" "them into a conference bridge as muted participants. The original\n" "caller is dumped into the conference as a speaker and the room is\n" -"destroyed when the original caller leaves. Always returns -1.\n"; +"destroyed when the original caller leaves. Valid options are:\n" +" d - full duplex audio\n" +"Always returns -1.\n"; STANDARD_LOCAL_USER; LOCAL_USER_DECL; +#define PAGE_DUPLEX (1 << 0) + +AST_DECLARE_OPTIONS(page_opts,{ + ['d'] = { PAGE_DUPLEX }, +}); + static int page_exec(struct ast_channel *chan, void *data) { char *options; char *tech, *resource; char meetmeopts[80]; + struct ast_flags flags = { 0 }; unsigned int confid = rand(); struct ast_app *app; @@ -68,9 +78,9 @@ static int page_exec(struct ast_channel *chan, void *data) if (options) { char *tmp = strsep(&options, "|,"); if (options) { - /* XXX Parse options if we had any XXX */ + ast_parseoptions(page_opts, &flags, NULL, options); } - snprintf(meetmeopts, sizeof(meetmeopts), "%ud|mqxdw", confid); + snprintf(meetmeopts, sizeof(meetmeopts), "%ud|%sqxdw", confid, ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"); while(tmp && !ast_strlen_zero(tmp)) { tech = strsep(&tmp, "&"); if (tech) { @@ -82,7 +92,7 @@ static int page_exec(struct ast_channel *chan, void *data) } } } - snprintf(meetmeopts, sizeof(meetmeopts), "%ud|Atqxd", confid); + snprintf(meetmeopts, sizeof(meetmeopts), "%ud|A%sqxd", confid, ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "t"); app = pbx_findapp("Meetme"); if (app) { pbx_exec(chan, app, meetmeopts, 1); |