diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-05 18:39:28 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-05 18:39:28 +0000 |
commit | ca26b3e865df58417d426dcde6fcf3b17006d3e5 (patch) | |
tree | 06295ea445ffba65db4bedfac47a6d72d9e760cd /apps | |
parent | c47e0ff5a2549ea5733042e71687dd34a71e6c6d (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.4@57872 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_meetme.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c index 99c2636eb..aee0eb9a6 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -772,18 +772,6 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin cnf = NULL; 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 */ cnf->start = time(NULL); 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))) { - 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); + 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_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED); + ast_pthread_create_background(&conf->recordthread, &conf->attr, recordthread, conf); + pthread_attr_destroy(&conf->attr); + } } time(&user->jointime); |