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)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2006-09-11 22:17:46 +00:00
parent da55c166dc
commit 979ef8d2ed
2 changed files with 30 additions and 10 deletions

View File

@@ -156,6 +156,11 @@ enum {
CONFFLAG_HOLD = (1 << 27) CONFFLAG_HOLD = (1 << 27)
}; };
enum {
OPT_ARG_WAITMARKED = 0,
OPT_ARG_ARRAY_SIZE = 1,
} meetme_option_args;
AST_APP_OPTIONS(meetme_opts, { AST_APP_OPTIONS(meetme_opts, {
AST_APP_OPTION('A', CONFFLAG_MARKEDUSER ), AST_APP_OPTION('A', CONFFLAG_MARKEDUSER ),
AST_APP_OPTION('a', CONFFLAG_ADMIN ), AST_APP_OPTION('a', CONFFLAG_ADMIN ),
@@ -178,7 +183,7 @@ AST_APP_OPTIONS(meetme_opts, {
AST_APP_OPTION('T', CONFFLAG_MONITORTALKER ), AST_APP_OPTION('T', CONFFLAG_MONITORTALKER ),
AST_APP_OPTION('l', CONFFLAG_MONITOR ), AST_APP_OPTION('l', CONFFLAG_MONITOR ),
AST_APP_OPTION('t', CONFFLAG_TALKER ), 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_EXIT_CONTEXT ),
AST_APP_OPTION('x', CONFFLAG_MARKEDEXIT ), AST_APP_OPTION('x', CONFFLAG_MARKEDEXIT ),
AST_APP_OPTION('1', CONFFLAG_NOONLYPERSON ), AST_APP_OPTION('1', CONFFLAG_NOONLYPERSON ),
@@ -237,7 +242,8 @@ static const char *descrip =
" 's' -- Present menu (user or admin) when '*' is received ('send' to menu)\n" " '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 talk only mode. (Talk only, no listening)\n"
" 'T' -- set talker detection (sent to manager interface and meetme list)\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' -- close the conference when last marked user exits\n"
" 'X' -- allow user to exit the conference by entering a valid single\n" " 'X' -- allow user to exit the conference by entering a valid single\n"
" digit extension ${MEETME_EXIT_CONTEXT} or the current context\n" " digit extension ${MEETME_EXIT_CONTEXT} or the current context\n"
@@ -1002,7 +1008,7 @@ static void conf_queue_control(struct ast_conference *conf, int control)
} }
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 *user = NULL;
struct ast_conf_user *usr = NULL; struct ast_conf_user *usr = NULL;
@@ -1038,7 +1044,8 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
char exitcontext[AST_MAX_CONTEXT] = ""; char exitcontext[AST_MAX_CONTEXT] = "";
char recordingtmp[AST_MAX_EXTENSION] = ""; char recordingtmp[AST_MAX_EXTENSION] = "";
char members[10] = ""; char members[10] = "";
int dtmf; int dtmf, opt_waitmarked_timeout = 0;
time_t timeout = 0;
ZT_BUFFERINFO bi; ZT_BUFFERINFO bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET]; char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
char *buf = __buf + AST_FRIENDLY_OFFSET; char *buf = __buf + AST_FRIENDLY_OFFSET;
@@ -1053,6 +1060,14 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
return ret; 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) { if (confflags & CONFFLAG_RECORDCONF) {
if (!conf->recordingfilename) { if (!conf->recordingfilename) {
conf->recordingfilename = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFILE"); conf->recordingfilename = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFILE");
@@ -1351,6 +1366,9 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
outfd = -1; outfd = -1;
ms = -1; ms = -1;
if (timeout && time(NULL) >= timeout)
break;
/* if we have just exited from the menu, and the user had a channel-driver /* if we have just exited from the menu, and the user had a channel-driver
volume adjustment, restore it volume adjustment, restore it
*/ */
@@ -2160,6 +2178,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
AST_APP_ARG(options); AST_APP_ARG(options);
AST_APP_ARG(pin); AST_APP_ARG(pin);
); );
char *optargs[OPT_ARG_ARRAY_SIZE] = { NULL, };
u = ast_module_user_add(chan); u = ast_module_user_add(chan);
@@ -2188,7 +2207,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
ast_copy_string(the_pin, args.pin, sizeof(the_pin)); ast_copy_string(the_pin, args.pin, sizeof(the_pin));
if (args.options) { 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); dynamic = ast_test_flag(&confflags, CONFFLAG_DYNAMIC | CONFFLAG_DYNAMICPIN);
if (ast_test_flag(&confflags, CONFFLAG_DYNAMICPIN) && !args.pin) if (ast_test_flag(&confflags, CONFFLAG_DYNAMICPIN) && !args.pin)
strcpy(the_pin, "q"); strcpy(the_pin, "q");
@@ -2344,7 +2363,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
if (!ast_strlen_zero(cnf->pinadmin) && !strcasecmp(pin, cnf->pinadmin)) if (!ast_strlen_zero(cnf->pinadmin) && !strcasecmp(pin, cnf->pinadmin))
ast_set_flag(&confflags, CONFFLAG_ADMIN); ast_set_flag(&confflags, CONFFLAG_ADMIN);
/* Run the conference */ /* Run the conference */
res = conf_run(chan, cnf, confflags.flags); res = conf_run(chan, cnf, confflags.flags, optargs);
break; break;
} else { } else {
/* Pin invalid */ /* Pin invalid */
@@ -2393,7 +2412,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
allowretry = 0; allowretry = 0;
/* Run the conference */ /* Run the conference */
res = conf_run(chan, cnf, confflags.flags); res = conf_run(chan, cnf, confflags.flags, optargs);
} }
} }
} }
@@ -2503,6 +2522,7 @@ static int sla_exec(struct ast_channel *chan, void *data, int trunk)
char *info; char *info;
struct ast_flags confflags = {0}; struct ast_flags confflags = {0};
int dynamic = 1; int dynamic = 1;
char *options[OPT_ARG_ARRAY_SIZE] = { NULL, };
AST_DECLARE_APP_ARGS(args, AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(confno); AST_APP_ARG(confno);
AST_APP_ARG(options); AST_APP_ARG(options);
@@ -2549,7 +2569,7 @@ static int sla_exec(struct ast_channel *chan, void *data, int trunk)
ast_answer(chan); ast_answer(chan);
/* Run the conference */ /* Run the conference */
res = conf_run(chan, cnf, confflags.flags); res = conf_run(chan, cnf, confflags.flags, options);
} else } else
ast_log(LOG_WARNING, "SLA%c: Found SLA '%s' but unable to build conference!\n", trunk ? 'T' : 'S', args.confno); 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); ASTOBJ_UNREF(sla, sla_destroy);

View File

@@ -176,7 +176,7 @@ static int page_exec(struct ast_channel *chan, void *data)
if (options) if (options)
ast_app_parse_options(page_opts, &flags, NULL, 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" : "") ); (ast_test_flag(&flags, PAGE_RECORD) ? "r" : "") );
while ((tech = strsep(&tmp, "&"))) { while ((tech = strsep(&tmp, "&"))) {