aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: