Index: channel.c =================================================================== RCS file: /usr/cvsroot/asterisk/channel.c,v retrieving revision 1.243 diff -u -r1.243 channel.c --- channel.c 29 Sep 2005 17:40:24 -0000 1.243 +++ channel.c 4 Oct 2005 00:10:16 -0000 @@ -1505,7 +1505,7 @@ static struct ast_frame null_frame = { AST_FRAME_NULL, }; - + ast_mutex_lock(&chan->lock); if (chan->masq) { if (ast_do_masquerade(chan)) { @@ -1682,18 +1682,18 @@ ast_cdr_answer(chan->cdr); } - /* Run any generator sitting on the line */ - if (f && (f->frametype == AST_FRAME_VOICE) && chan->generatordata) { - /* Mask generator data temporarily and apply. If there is a timing function, it - will be calling the generator instead */ + /* Run generator sitting on the line if timing device not available + * and synchronous generation of outgoing frames is necessary */ + if (f && (f->frametype == AST_FRAME_VOICE) && chan->generatordata && + !(chan->timingfunc && chan->timingfd > -1)) { void *tmp; int res; - int (*generate)(struct ast_channel *chan, void *tmp, int datalen, int samples); + int (*generate)(struct ast_channel *chan, void *tmp, + int datalen, int samples); - if (chan->timingfunc) { - ast_log(LOG_DEBUG, "Generator got voice, switching to phase locked mode\n"); - ast_settimeout(chan, 0, NULL, NULL); - } +#if 0 + ast_log(LOG_DEBUG, "Synchronous generator used\n"); +#endif tmp = chan->generatordata; chan->generatordata = NULL; generate = chan->generator->generate; @@ -1703,12 +1703,8 @@ ast_log(LOG_DEBUG, "Auto-deactivating generator\n"); ast_deactivate_generator(chan); } - } else if (f && (f->frametype == AST_FRAME_CNG)) { - if (chan->generator && !chan->timingfunc && (chan->timingfd > -1)) { - ast_log(LOG_DEBUG, "Generator got CNG, switching to zap timed mode\n"); - ast_settimeout(chan, 160, generator_force, chan); - } } + /* High bit prints debugging */ if (chan->fin & 0x80000000) ast_frame_dump(chan->name, f, "<<");