Index: channels/chan_iax2.c =================================================================== --- channels/chan_iax2.c (revision 166469) +++ channels/chan_iax2.c (working copy) @@ -61,9 +61,9 @@ #if defined(HAVE_ZAPTEL) || defined (HAVE_DAHDI) #include -#include "asterisk/dahdi_compat.h" #endif +#include "asterisk/dahdi_compat.h" #include "asterisk/lock.h" #include "asterisk/frame.h" #include "asterisk/channel.h" Index: channels/chan_local.c =================================================================== --- channels/chan_local.c (revision 166469) +++ channels/chan_local.c (working copy) @@ -168,10 +168,6 @@ /* Recalculate outbound channel */ other = isoutbound ? p->owner : p->chan; - /* do not queue frame if generator is on both local channels */ - if (us && us->generator && other->generator) - return 0; - /* Set glare detection */ ast_set_flag(p, LOCAL_GLARE_DETECT); if (ast_test_flag(p, LOCAL_CANCEL_QUEUE)) { @@ -181,10 +177,15 @@ p = local_pvt_destroy(p); return -1; } + if (!other) { ast_clear_flag(p, LOCAL_GLARE_DETECT); return 0; } + + /* do not queue frame if generator is on both local channels */ + if (us && us->generator && other->generator) + return 0; /* Ensure that we have both channels locked */ while (other && ast_channel_trylock(other)) { Index: main/channel.c =================================================================== --- main/channel.c (revision 166469) +++ main/channel.c (working copy) @@ -39,10 +39,10 @@ #if defined(HAVE_DAHDI) #include -#include "asterisk/dahdi_compat.h" #endif #include "asterisk/pbx.h" +#include "asterisk/dahdi_compat.h" #include "asterisk/frame.h" #include "asterisk/sched.h" #include "asterisk/options.h" Index: main/asterisk.c =================================================================== --- main/asterisk.c (revision 166469) +++ main/asterisk.c (working copy) @@ -76,9 +76,9 @@ #if defined(HAVE_ZAPTEL) || defined (HAVE_DAHDI) #include -#include "asterisk/dahdi_compat.h" #endif +#include "asterisk/dahdi_compat.h" #ifdef linux #include #ifdef HAVE_CAP