From: Jonathan Rose Date: Fri, 16 Mar 2012 20:20:25 +0000 (+0000) Subject: Prevent chanspy from binding to zombie channels X-Git-Tag: 10.3.0~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba1a6fc5f7ba1f8d9010085b2d05e2a358fa2768;p=thirdparty%2Fasterisk.git Prevent chanspy from binding to zombie channels This patch addresses a bug with chanspy on local channels which roughly 50% of the time would create a situation where chanspy can latch onto a zombie channel, keeping the zombie alive forever and causing the channel doing the spying to never be able to hang up. (closes issue ASTERISK-19493) Reported by: lvl Review: https://reviewboard.asterisk.org/r/1819/ ........ Merged revisions 359892 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@359898 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 4652900779..870c423689 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -529,7 +529,8 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto /* We now hold the channel lock on spyee */ - if (ast_check_hangup(chan) || ast_check_hangup(spyee_autochan->chan)) { + if (ast_check_hangup(chan) || ast_check_hangup(spyee_autochan->chan) || + ast_test_flag(spyee_autochan->chan, AST_FLAG_ZOMBIE)) { return 0; }