aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-27 17:36:50 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-27 17:36:50 +0000
commit50978e40e5eaf07cd9fd2119c9f7ad7c1f916179 (patch)
tree4b387dcce4ed7c9ab5146ee4eec60c2aff27b293 /apps/app_chanspy.c
parent079f8b5260de0254b04886058d8f29f43e8d7bac (diff)
Merged revisions 104625 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104625 | russell | 2008-02-27 11:33:04 -0600 (Wed, 27 Feb 2008) | 4 lines Fix a problem in ChanSpy where it could get stuck in an infinite loop without being able to detect that the calling channel hung up. (closes issue #12076, reported by junky, patched by me) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104643 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r--apps/app_chanspy.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index faa665789..70365996e 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -610,6 +610,12 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
break;
}
+ if (ast_check_hangup(chan)) {
+ ast_channel_unlock(peer);
+ chanspy_ds_free(peer_chanspy_ds);
+ break;
+ }
+
if (peer == chan) {
ast_channel_unlock(peer);
continue;
@@ -738,6 +744,8 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
peer = NULL;
}
}
+ if (res == -1 || ast_check_hangup(chan))
+ break;
}
exit: