[Asterisk-cvs] asterisk/apps app_meetme.c,1.4,1.5
markster at lists.digium.com
markster at lists.digium.com
Sun Sep 28 16:17:40 CDT 2003
Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv30174/apps
Modified Files:
app_meetme.c
Log Message:
Merge Eagle's meetme/agi (Zap only) patch (with changes)
Index: app_meetme.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- app_meetme.c 20 Aug 2003 23:32:23 -0000 1.4
+++ app_meetme.c 28 Sep 2003 21:18:51 -0000 1.5
@@ -52,7 +52,9 @@
" 's' -- send user to admin/user menu if '*' is received\n"
" 't' -- set talk only mode\n"
" 'v' -- video mode\n"
-" 'q' -- quiet mode (don't play enter/leave sounds)\n";
+" 'q' -- quiet mode (don't play enter/leave sounds)\n"
+" 'b' -- run AGI script specified in ${MEETME_AGI_BACKGROUND} (Zap channels only)\n"
+" (does not work with non-Zap channels in the same conference)\n";
static char *descrip2 =
" MeetMeCount(confno[|var]): Plays back the number of users in the specifiedi\n"
@@ -90,6 +92,8 @@
#define CONFFLAG_TALKER (1 << 5) /* If set the use can only send audio to the conference */
#define CONFFLAG_QUIET (1 << 6) /* If set there will be no enter or leave sounds */
#define CONFFLAG_VIDEO (1 << 7) /* Set to enable video mode */
+#define CONFFLAG_AGI (1 << 8) /* Set to run AGI Script in Background */
+
static int careful_write(int fd, unsigned char *data, int len)
{
@@ -239,6 +243,10 @@
int ret = -1;
int x;
+ struct ast_app *app;
+ char *agifile;
+ char *agifiledefault = "conf-background.agi";
+
ZT_BUFFERINFO bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
char *buf = __buf + AST_FRIENDLY_OFFSET;
@@ -359,7 +367,34 @@
conf_play(conf, ENTER);
}
- for(;;) {
+ if (confflags & CONFFLAG_AGI) {
+
+ /* Get name of AGI file to run from $(MEETME_AGI_BACKGROUND)
+ or use default filename of conf-background.agi */
+
+ agifile = pbx_builtin_getvar_helper(chan,"MEETME_AGI_BACKGROUND");
+ if (!agifile)
+ agifile = agifiledefault;
+
+ if (!strcasecmp(chan->type,"Zap")) {
+ /* Set CONFMUTE mode on Zap channel to mute DTMF tones */
+ x = 1;
+ ast_channel_setoption(chan,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0);
+ }
+ /* Find a pointer to the agi app and execute the script */
+ app = pbx_findapp("agi");
+ if (app) {
+ ret = pbx_exec(chan, app, agifile, 1);
+ } else {
+ ast_log(LOG_WARNING, "Could not find application (agi)\n");
+ ret = -2;
+ }
+ if (!strcasecmp(chan->type,"Zap")) {
+ /* Remove CONFMUTE mode on Zap channel */
+ x = 0;
+ ast_channel_setoption(chan,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0);
+ }
+ } else for(;;) {
outfd = -1;
ms = -1;
c = ast_waitfor_nandfds(&chan, 1, &fd, nfds, NULL, &outfd, &ms);
@@ -414,6 +449,7 @@
ast_log(LOG_WARNING, "Failed to read frame: %s\n", strerror(errno));
}
}
+
if (fd != chan->fds[0])
close(fd);
else {
@@ -533,6 +569,7 @@
int confflags = 0;
char info[256], *ptr, *inflags, *inpin;
+
if (!data || !strlen(data)) {
allowretry = 1;
data = "";
@@ -561,6 +598,9 @@
confflags |= CONFFLAG_TALKER;
if (strchr(inflags, 'q'))
confflags |= CONFFLAG_QUIET;
+ if (strchr(inflags, 'b'))
+ confflags |= CONFFLAG_AGI;
+
inpin = strchr(inflags, '|');
if (inpin) {
More information about the svn-commits
mailing list