[Asterisk-cvs] asterisk/apps app_meetme.c,1.5,1.6
markster at lists.digium.com
markster at lists.digium.com
Wed Oct 29 16:26:13 CST 2003
Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv30318/apps
Modified Files:
app_meetme.c
Log Message:
Add "dynamic" option to create conference rooms on demand
Index: app_meetme.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- app_meetme.c 28 Sep 2003 21:18:51 -0000 1.5
+++ app_meetme.c 29 Oct 2003 22:52:20 -0000 1.6
@@ -51,6 +51,7 @@
" 'p' -- allow user to exit the conference by pressing '#'\n"
" 's' -- send user to admin/user menu if '*' is received\n"
" 't' -- set talk only mode\n"
+" 'd' -- dynamically add conference\n"
" 'v' -- video mode\n"
" 'q' -- quiet mode (don't play enter/leave sounds)\n"
" 'b' -- run AGI script specified in ${MEETME_AGI_BACKGROUND} (Zap channels only)\n"
@@ -494,7 +495,7 @@
return ret;
}
-static struct conf *find_conf(char *confno, int make)
+static struct conf *find_conf(char *confno, int make, int dynamic)
{
struct ast_config *cfg;
struct ast_variable *var;
@@ -515,7 +516,11 @@
var = var->next;
}
if (!var) {
- ast_log(LOG_DEBUG, "%s isn't a valid conference\n", confno);
+ if (dynamic) {
+ ast_log(LOG_DEBUG, "Using dynamic conference '%s'\n", confno);
+ cnf = build_conf(confno, make);
+ } else
+ ast_log(LOG_DEBUG, "%s isn't a valid conference\n", confno);
}
ast_destroy(cfg);
return cnf;
@@ -539,7 +544,7 @@
LOCAL_USER_ADD(u);
strcpy(localdata,data);
confnum = strsep(&localdata,"|");
- conf = find_conf(confnum, 0);
+ conf = find_conf(confnum, 0, 1);
if (conf)
cnt = conf->users;
else
@@ -567,6 +572,7 @@
int retrycnt = 0;
struct conf *cnf;
int confflags = 0;
+ int dynamic = 0;
char info[256], *ptr, *inflags, *inpin;
@@ -600,6 +606,8 @@
confflags |= CONFFLAG_QUIET;
if (strchr(inflags, 'b'))
confflags |= CONFFLAG_AGI;
+ if (strchr(inflags, 'd'))
+ dynamic = 1;
inpin = strchr(inflags, '|');
@@ -622,7 +630,7 @@
}
if (strlen(confno)) {
/* Check the validity of the conference */
- cnf = find_conf(confno, 1);
+ cnf = find_conf(confno, 1, dynamic);
if (!cnf) {
res = ast_streamfile(chan, "conf-invalid", chan->language);
if (res < 0)
More information about the svn-commits
mailing list