Resolve app_meetme crash when member tries to mute/unmute (bug #3899)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2005-04-02 23:26:27 +00:00
parent 71f2c0c6ec
commit 66568b0f66

View File

@@ -572,7 +572,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
struct ast_conf_user *user = malloc(sizeof(struct ast_conf_user)); struct ast_conf_user *user = malloc(sizeof(struct ast_conf_user));
struct ast_conf_user *usr = NULL; struct ast_conf_user *usr = NULL;
int fd; int fd;
struct zt_confinfo ztc; struct zt_confinfo ztc, ztc_empty;
struct ast_frame *f; struct ast_frame *f;
struct ast_channel *c; struct ast_channel *c;
struct ast_frame fr; struct ast_frame fr;
@@ -790,6 +790,7 @@ zapretry:
nfds = 0; nfds = 0;
} }
memset(&ztc, 0, sizeof(ztc)); memset(&ztc, 0, sizeof(ztc));
memset(&ztc_empty, 0, sizeof(ztc_empty));
/* Check to see if we're in a conference... */ /* Check to see if we're in a conference... */
ztc.chan = 0; ztc.chan = 0;
if (ioctl(fd, ZT_GETCONF, &ztc)) { if (ioctl(fd, ZT_GETCONF, &ztc)) {
@@ -1078,10 +1079,7 @@ zapretry:
ret = 0; ret = 0;
break; break;
} else if (((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*') && (confflags & CONFFLAG_STARMENU)) || ((f->frametype == AST_FRAME_DTMF) && menu_active)) { } else if (((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*') && (confflags & CONFFLAG_STARMENU)) || ((f->frametype == AST_FRAME_DTMF) && menu_active)) {
int oldconfmode = 0; if (ioctl(fd, ZT_SETCONF, &ztc_empty)) {
oldconfmode = ztc.confmode;
ztc.confmode = 0;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n"); ast_log(LOG_WARNING, "Error setting conference\n");
close(fd); close(fd);
ast_mutex_unlock(&conflock); ast_mutex_unlock(&conflock);
@@ -1202,7 +1200,7 @@ zapretry:
if (musiconhold) { if (musiconhold) {
ast_moh_start(chan, NULL); ast_moh_start(chan, NULL);
} }
ztc.confmode = oldconfmode;
if (ioctl(fd, ZT_SETCONF, &ztc)) { if (ioctl(fd, ZT_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n"); ast_log(LOG_WARNING, "Error setting conference\n");
close(fd); close(fd);