[Asterisk-cvs] asterisk/apps app_page.c,1.1,1.2

markster markster
Thu Oct 13 01:43:08 CDT 2005


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv16529/apps

Modified Files:
	app_page.c 
Log Message:
Make sure paging can be duplex if necessary


Index: app_page.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_page.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- app_page.c	12 Oct 2005 22:56:53 -0000	1.1
+++ app_page.c	13 Oct 2005 05:37:49 -0000	1.2
@@ -36,6 +36,7 @@
 #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 *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 @@
 		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 @@
 					}
 				}
 			}
-			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);




More information about the svn-commits mailing list