summaryrefslogtreecommitdiff
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
authorMichael L. Young <elgueromexicano@gmail.com>2012-08-08 22:45:15 +0000
committerMichael L. Young <elgueromexicano@gmail.com>2012-08-08 22:45:15 +0000
commit5cf9eb4645071f2223fe698fa823bd21421c9f19 (patch)
tree07baf43e1eaefe4e994fd80da64a83d2192154ef /apps/app_chanspy.c
parentb03e7cc4c723e417a926ec946d1a9b9f098b30d4 (diff)
Fix Not Unreferencing A Spied Channel
When a channel hangs up while being spied upon and the option to exit the ChanSpy application when the spied on channel hangs up is set, ast_autochan_destroy is not being called and therefore a reference to the spied upon channel is not removed. The symptom being reported was that when using func_group in the dialplan and calling "group show channels" at the cli, the spied upon channel was still being shown while "core show channels" showed that the channel was not up. This patch calls ast_autochan_destroy when a spied upon channel hangs up and the option to exit the ChanSpy application is set, removing the reference to the channel allowing the count for the group that the spied channel was part of to be decremented. (closes issue ASTERISK-17515) Reported by: Arkadiusz Malka Tested by: Alexandr Gordeev, Michael L. Young Patches: asterisk-17515-destroy-autochan.diff uploaded by Michael L. Young (license 5026) ........ Merged revisions 370952 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370954 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r--apps/app_chanspy.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 185cb724a..c5adb78ad 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -1035,6 +1035,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags,
}
}
} else if (res == 0 && ast_test_flag(flags, OPTION_EXITONHANGUP)) {
+ ast_autochan_destroy(autochan);
iter = ast_channel_iterator_destroy(iter);
goto exit;
}