mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 22:45:39 +00:00
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
This commit is contained in:
@@ -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,11 +1392,22 @@ 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)))) {
|
||||||
pthread_attr_init(&conf->attr);
|
ast_set_read_format(conf->lchan, AST_FORMAT_SLINEAR);
|
||||||
pthread_attr_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED);
|
ast_set_write_format(conf->lchan, AST_FORMAT_SLINEAR);
|
||||||
ast_pthread_create_background(&conf->recordthread, &conf->attr, recordthread, conf);
|
ztc.chan = 0;
|
||||||
pthread_attr_destroy(&conf->attr);
|
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_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED);
|
||||||
|
ast_pthread_create_background(&conf->recordthread, &conf->attr, recordthread, conf);
|
||||||
|
pthread_attr_destroy(&conf->attr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
time(&user->jointime);
|
time(&user->jointime);
|
||||||
|
Reference in New Issue
Block a user