From 50ef0504c6936b0f29459f87ac216531208969fd Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Thu, 3 Mar 2005 23:33:11 +0000 Subject: [PATCH] Flush MeetMe at appropriate times (bug #3599) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5131 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_meetme.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/apps/app_meetme.c b/apps/app_meetme.c index c1b1a21..269e6c5 100755 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -536,6 +536,16 @@ static int confnonzero(void *ptr) return res; } +static void conf_flush(int fd) +{ + int x; + x = ZT_FLUSH_ALL; + if (ioctl(fd, ZT_FLUSH, x)) { + ast_log(LOG_WARNING, "Error flushing channel\n"); + close(fd); + } +} + static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int confflags) { struct ast_conference *prev=NULL, *cur; @@ -785,6 +795,7 @@ zapretry: ast_mutex_unlock(&conflock); goto outrun; } + conf_flush(fd); ast_log(LOG_DEBUG, "Placed channel %s in ZAP conf %d\n", chan->name, conf->zapconf); manager_event(EVENT_FLAG_CALL, "MeetmeJoin", @@ -960,6 +971,15 @@ zapretry: ret = 0; break; } else if (((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*') && (confflags & CONFFLAG_STARMENU)) || ((f->frametype == AST_FRAME_DTMF) && menu_active)) { + int oldconfmode = 0; + oldconfmode = ztc.confmode; + ztc.confmode = 0; + if (ioctl(fd, ZT_SETCONF, &ztc)) { + ast_log(LOG_WARNING, "Error setting conference\n"); + close(fd); + ast_mutex_unlock(&conflock); + goto outrun; + } if (musiconhold) { ast_moh_stop(chan); } @@ -1075,6 +1095,14 @@ zapretry: if (musiconhold) { ast_moh_start(chan, NULL); } + ztc.confmode = oldconfmode; + if (ioctl(fd, ZT_SETCONF, &ztc)) { + ast_log(LOG_WARNING, "Error setting conference\n"); + close(fd); + ast_mutex_unlock(&conflock); + goto outrun; + } + conf_flush(fd); } else if (option_debug) { ast_log(LOG_DEBUG, "Got unrecognized frame on channel %s, f->frametype=%d,f->subclass=%d\n",chan->name,f->frametype,f->subclass); } -- 1.7.9.5