diff options
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r-- | apps/app_chanspy.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 297bbec97..e25389520 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -538,6 +538,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; @@ -633,7 +639,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags, peer = NULL; } } - if (res == -1) + if (res == -1 || ast_check_hangup(chan)) break; } |