--- chan_iax2.c 2007-12-19 01:48:36.097000000 -0300 +++ chan_iax2_patched.c 2008-01-16 18:48:36.187500000 -0300 @@ -2530,7 +2530,9 @@ static int schedule_delivery(struct iax_ int type, len; int ret; int needfree = 0; - + struct ast_channel * owner = NULL; + struct ast_channel * bridge = NULL; + /* Attempt to recover wrapped timestamps */ unwrap_timestamp(fr); @@ -2562,11 +2564,13 @@ static int schedule_delivery(struct iax_ return -1; } + owner = iaxs[fr->callno]->owner; + if (owner) { + bridge = ast_bridged_channel(owner); + } /* if the user hasn't requested we force the use of the jitterbuffer, and we're bridged to * a channel that can accept jitter, then flush and suspend the jb, and send this frame straight through */ - if( (!ast_test_flag(iaxs[fr->callno], IAX_FORCEJITTERBUF)) && - iaxs[fr->callno]->owner && ast_bridged_channel(iaxs[fr->callno]->owner) && - (ast_bridged_channel(iaxs[fr->callno]->owner)->tech->properties & AST_CHAN_TP_WANTSJITTER)) { + if( (!ast_test_flag(iaxs[fr->callno], IAX_FORCEJITTERBUF)) && owner && bridge && bridge->tech->properties & AST_CHAN_TP_WANTSJITTER)) { jb_frame frame; /* deliver any frames in the jb */