aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_meetme.c
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-25 22:39:27 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-25 22:39:27 +0000
commit8ea8956f9bcb13b75c6f5fe69a2101b76e8b11f1 (patch)
tree65ef8bbf90667e0d6aa4810e828180e454ebb17d /apps/app_meetme.c
parente0d21aafb11300240ff9156bbee8ae03323661bf (diff)
This fix solves problem with intense squelch noise when someone joins conf in bug 9430; We repro'd the problem with meetme opts of 'CciMo'; Josh Colp supplied this patch, and I'm applying it. It looks like playing the recorded username will louse up the next thing played into the channel. Josh rearranged the code so as to start things over before playing data directly into the conference.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@77191 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_meetme.c')
-rw-r--r--apps/app_meetme.c48
1 files changed, 27 insertions, 21 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 8053196a2..7e05b917d 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -761,38 +761,44 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
ast_copy_string(cnf->confno, confno, sizeof(cnf->confno));
ast_copy_string(cnf->pin, pin, sizeof(cnf->pin));
ast_copy_string(cnf->pinadmin, pinadmin, sizeof(cnf->pinadmin));
+
+ /* Setup a new zap conference */
+ ztc.confno = -1;
+ ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
+ cnf->fd = open("/dev/zap/pseudo", O_RDWR);
+ if (cnf->fd < 0 || ioctl(cnf->fd, ZT_SETCONF, &ztc)) {
+ ast_log(LOG_WARNING, "Unable to open pseudo device\n");
+ if (cnf->fd >= 0)
+ close(cnf->fd);
+ free(cnf);
+ cnf = NULL;
+ goto cnfout;
+ }
+
+ cnf->zapconf = ztc.confno;
+
+ /* Setup a new channel for playback of audio files */
cnf->chan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL);
if (cnf->chan) {
ast_set_read_format(cnf->chan, AST_FORMAT_SLINEAR);
ast_set_write_format(cnf->chan, AST_FORMAT_SLINEAR);
- cnf->fd = cnf->chan->fds[0]; /* for use by conf_play() */
- } else {
- ast_log(LOG_WARNING, "Unable to open pseudo channel - trying device\n");
- cnf->fd = open("/dev/zap/pseudo", O_RDWR);
- if (cnf->fd < 0) {
- ast_log(LOG_WARNING, "Unable to open pseudo device\n");
+ ztc.chan = 0;
+ ztc.confno = cnf->zapconf;
+ ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
+ if (ioctl(cnf->chan->fds[0], ZT_SETCONF, &ztc)) {
+ ast_log(LOG_WARNING, "Error setting conference\n");
+ if (cnf->chan)
+ ast_hangup(cnf->chan);
+ else
+ close(cnf->fd);
free(cnf);
cnf = NULL;
goto cnfout;
}
}
-
- /* Setup a new zap conference */
- ztc.confno = -1;
- ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
- if (ioctl(cnf->fd, ZT_SETCONF, &ztc)) {
- ast_log(LOG_WARNING, "Error setting conference\n");
- if (cnf->chan)
- ast_hangup(cnf->chan);
- else
- close(cnf->fd);
- free(cnf);
- cnf = NULL;
- goto cnfout;
- }
+
/* Fill the conference struct */
cnf->start = time(NULL);
- cnf->zapconf = ztc.confno;
cnf->isdynamic = dynamic ? 1 : 0;
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);