diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-15 23:32:18 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-15 23:32:18 +0000 |
commit | 527da29a253e975e6702a673fc72f5357ff9d071 (patch) | |
tree | aa43c13d72a436cf534d9baea6c8426799ac4431 /channels/chan_iax2.c | |
parent | 61bb9aa3d2a317c637c41f3e6030ccf6b2646625 (diff) |
Merged revisions 103741 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r103741 | russell | 2008-02-15 17:31:39 -0600 (Fri, 15 Feb 2008) | 8 lines
Fix a crash in chan_iax2 due to a race condition
(closes issue #11780)
Reported by: guillecabeza
Patches:
bug_iax2_jb_1.4.patch uploaded by guillecabeza (license 380)
bug_iax2_jb_trunk.patch uploaded by guillecabeza (license 380)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103742 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 6418d0d46..6cad00ccf 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -2784,7 +2784,9 @@ static int schedule_delivery(struct iax_frame *fr, int updatehistory, int fromtr 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); @@ -2815,11 +2817,12 @@ static int schedule_delivery(struct iax_frame *fr, int updatehistory, int fromtr return -1; } + if ((owner = iaxs[fr->callno]->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 */ |