From 698cd736b65ebb8b02edf361c9c42885fe588e41 Mon Sep 17 00:00:00 2001 From: Jonathan Rose Date: Fri, 16 Mar 2012 20:13:56 +0000 Subject: [PATCH] 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/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@359892 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_chanspy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index e0279f9ae0..d76854b520 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -526,7 +526,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; } -- 2.47.3