Index: channel.c =================================================================== RCS file: /usr/cvsroot/asterisk/channel.c,v retrieving revision 1.183 diff -u -r1.183 channel.c --- channel.c 31 Mar 2005 03:00:37 -0000 1.183 +++ channel.c 31 Mar 2005 08:51:18 -0000 @@ -1311,7 +1311,9 @@ ast_mutex_unlock(&chan->lock); return NULL; } +#ifdef ZAPTEL_OPTIMIZATIONS prestate = chan->_state; +#endif if (!ast_test_flag(chan, AST_FLAG_DEFER_DTMF) && !ast_strlen_zero(chan->dtmfq)) { /* We have DTMF that has been deferred. Return it now */ @@ -1459,7 +1461,11 @@ ast_log(LOG_WARNING, "Dropping deferred DTMF digits on %s\n", chan->name); f = &null_frame; } else if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_ANSWER)) { +#ifdef ZAPTEL_OPTIMIZATIONS if (prestate == AST_STATE_UP) { +#else + if (chan->_state == AST_STATE_UP) { +#endif ast_log(LOG_DEBUG, "Dropping duplicate answer!\n"); f = &null_frame; }