Don't create a listen channel and record the conference unless the option is turned on. (issue #9204 reported by francesco_r)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Joshua Colp 18 years ago
parent 2feaf74cdd
commit a5b62f15c3

@ -772,18 +772,6 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
cnf = NULL; cnf = NULL;
goto cnfout; goto cnfout;
} }
cnf->lchan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL);
if (cnf->lchan) {
ast_set_read_format(cnf->lchan, AST_FORMAT_SLINEAR);
ast_set_write_format(cnf->lchan, AST_FORMAT_SLINEAR);
ztc.chan = 0;
ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
if (ioctl(cnf->lchan->fds[0], ZT_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
ast_hangup(cnf->lchan);
cnf->lchan = NULL;
}
}
/* Fill the conference struct */ /* Fill the conference struct */
cnf->start = time(NULL); cnf->start = time(NULL);
cnf->zapconf = ztc.confno; cnf->zapconf = ztc.confno;
@ -1404,12 +1392,23 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
} }
} }
if ((conf->recording == MEETME_RECORD_OFF) && ((confflags & CONFFLAG_RECORDCONF) || (conf->lchan))) { if ((conf->recording == MEETME_RECORD_OFF) && (confflags & CONFFLAG_RECORDCONF) && ((conf->lchan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL)))) {
ast_set_read_format(conf->lchan, AST_FORMAT_SLINEAR);
ast_set_write_format(conf->lchan, AST_FORMAT_SLINEAR);
ztc.chan = 0;
ztc.confno = conf->zapconf;
ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
if (ioctl(conf->lchan->fds[0], ZT_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error starting listen channel\n");
ast_hangup(conf->lchan);
conf->lchan = NULL;
} else {
pthread_attr_init(&conf->attr); pthread_attr_init(&conf->attr);
pthread_attr_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED); pthread_attr_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED);
ast_pthread_create_background(&conf->recordthread, &conf->attr, recordthread, conf); ast_pthread_create_background(&conf->recordthread, &conf->attr, recordthread, conf);
pthread_attr_destroy(&conf->attr); pthread_attr_destroy(&conf->attr);
} }
}
time(&user->jointime); time(&user->jointime);

Loading…
Cancel
Save