[asterisk-commits] tilghman: trunk r42788 - in /trunk: ./ apps/app_meetme.c apps/app_page.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Sep 11 15:17:46 MST 2006


Author: tilghman
Date: Mon Sep 11 17:17:46 2006
New Revision: 42788

URL: http://svn.digium.com/view/asterisk?rev=42788&view=rev
Log:
Merged revisions 42783 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r42783 | tilghman | 2006-09-11 16:47:23 -0500 (Mon, 11 Sep 2006) | 4 lines

When paging, only wait 5 seconds for the marked user to enter the conference.
After that, assume the paging already completed by the time the channel entered
the conference and drop back out.  (Issue 7275)

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_meetme.c
    trunk/apps/app_page.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?rev=42788&r1=42787&r2=42788&view=diff
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Mon Sep 11 17:17:46 2006
@@ -156,6 +156,11 @@
 	CONFFLAG_HOLD = (1 << 27)
 };
 
+enum {
+	OPT_ARG_WAITMARKED = 0,
+	OPT_ARG_ARRAY_SIZE = 1,
+} meetme_option_args;
+
 AST_APP_OPTIONS(meetme_opts, {
 	AST_APP_OPTION('A', CONFFLAG_MARKEDUSER ),
 	AST_APP_OPTION('a', CONFFLAG_ADMIN ),
@@ -178,7 +183,7 @@
 	AST_APP_OPTION('T', CONFFLAG_MONITORTALKER ),
 	AST_APP_OPTION('l', CONFFLAG_MONITOR ),
 	AST_APP_OPTION('t', CONFFLAG_TALKER ),
-	AST_APP_OPTION('w', CONFFLAG_WAITMARKED ),
+	AST_APP_OPTION_ARG('w', CONFFLAG_WAITMARKED, OPT_ARG_WAITMARKED ),
 	AST_APP_OPTION('X', CONFFLAG_EXIT_CONTEXT ),
 	AST_APP_OPTION('x', CONFFLAG_MARKEDEXIT ),
 	AST_APP_OPTION('1', CONFFLAG_NOONLYPERSON ),
@@ -237,7 +242,8 @@
 "      's' -- Present menu (user or admin) when '*' is received ('send' to menu)\n"
 "      't' -- set talk only mode. (Talk only, no listening)\n"
 "      'T' -- set talker detection (sent to manager interface and meetme list)\n"
-"      'w' -- wait until the marked user enters the conference\n"
+"      'w[(<secs>)]'\n"
+"          -- wait until the marked user enters the conference\n"
 "      'x' -- close the conference when last marked user exits\n"
 "      'X' -- allow user to exit the conference by entering a valid single\n"
 "             digit extension ${MEETME_EXIT_CONTEXT} or the current context\n"
@@ -1002,7 +1008,7 @@
 }
 
 
-static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int confflags)
+static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int confflags, char *optargs[])
 {
 	struct ast_conf_user *user = NULL;
 	struct ast_conf_user *usr = NULL;
@@ -1038,7 +1044,8 @@
 	char exitcontext[AST_MAX_CONTEXT] = "";
 	char recordingtmp[AST_MAX_EXTENSION] = "";
 	char members[10] = "";
-	int dtmf;
+	int dtmf, opt_waitmarked_timeout = 0;
+	time_t timeout = 0;
 	ZT_BUFFERINFO bi;
 	char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
 	char *buf = __buf + AST_FRIENDLY_OFFSET;
@@ -1051,6 +1058,14 @@
 		}
 		AST_LIST_UNLOCK(&confs);
 		return ret;
+	}
+
+	/* Possible timeout waiting for marked user */
+	if ((confflags & CONFFLAG_WAITMARKED) &&
+		!ast_strlen_zero(optargs[OPT_ARG_WAITMARKED]) &&
+		(sscanf(optargs[OPT_ARG_WAITMARKED], "%d", &opt_waitmarked_timeout) == 1) &&
+		(opt_waitmarked_timeout > 0)) {
+		timeout = time(NULL) + opt_waitmarked_timeout;
 	}
 
 	if (confflags & CONFFLAG_RECORDCONF) {
@@ -1350,7 +1365,10 @@
 
 			outfd = -1;
 			ms = -1;
-			
+
+			if (timeout && time(NULL) >= timeout)
+				break;
+
 			/* if we have just exited from the menu, and the user had a channel-driver
 			   volume adjustment, restore it
 			*/
@@ -2160,6 +2178,7 @@
 		AST_APP_ARG(options);
 		AST_APP_ARG(pin);
 	);
+	char *optargs[OPT_ARG_ARRAY_SIZE] = { NULL, };
 
 	u = ast_module_user_add(chan);
 
@@ -2188,7 +2207,7 @@
 		ast_copy_string(the_pin, args.pin, sizeof(the_pin));
 
 	if (args.options) {
-		ast_app_parse_options(meetme_opts, &confflags, NULL, args.options);
+		ast_app_parse_options(meetme_opts, &confflags, optargs, args.options);
 		dynamic = ast_test_flag(&confflags, CONFFLAG_DYNAMIC | CONFFLAG_DYNAMICPIN);
 		if (ast_test_flag(&confflags, CONFFLAG_DYNAMICPIN) && !args.pin)
 			strcpy(the_pin, "q");
@@ -2344,7 +2363,7 @@
 								if (!ast_strlen_zero(cnf->pinadmin) && !strcasecmp(pin, cnf->pinadmin)) 
 									ast_set_flag(&confflags, CONFFLAG_ADMIN);
 								/* Run the conference */
-								res = conf_run(chan, cnf, confflags.flags);
+								res = conf_run(chan, cnf, confflags.flags, optargs);
 								break;
 							} else {
 								/* Pin invalid */
@@ -2393,7 +2412,7 @@
 					allowretry = 0;
 
 					/* Run the conference */
-					res = conf_run(chan, cnf, confflags.flags);
+					res = conf_run(chan, cnf, confflags.flags, optargs);
 				}
 			}
 		}
@@ -2503,6 +2522,7 @@
 	char *info;
 	struct ast_flags confflags = {0};
 	int dynamic = 1;
+	char *options[OPT_ARG_ARRAY_SIZE] = { NULL, };
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(confno);
 		AST_APP_ARG(options);
@@ -2549,7 +2569,7 @@
 				ast_answer(chan);
 
 			/* Run the conference */
-			res = conf_run(chan, cnf, confflags.flags);
+			res = conf_run(chan, cnf, confflags.flags, options);
 		} else
 			ast_log(LOG_WARNING, "SLA%c: Found SLA '%s' but unable to build conference!\n", trunk ? 'T' : 'S', args.confno);
 		ASTOBJ_UNREF(sla, sla_destroy);

Modified: trunk/apps/app_page.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_page.c?rev=42788&r1=42787&r2=42788&view=diff
==============================================================================
--- trunk/apps/app_page.c (original)
+++ trunk/apps/app_page.c Mon Sep 11 17:17:46 2006
@@ -176,7 +176,7 @@
 	if (options)
 		ast_app_parse_options(page_opts, &flags, NULL, options);
 
-	snprintf(meetmeopts, sizeof(meetmeopts), "%ud|%s%sqxdw", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"),
+	snprintf(meetmeopts, sizeof(meetmeopts), "%ud|%s%sqxdw(5)", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"),
 		(ast_test_flag(&flags, PAGE_RECORD) ? "r" : "") );
 
 	while ((tech = strsep(&tmp, "&"))) {



More information about the asterisk-commits mailing list