aboutsummaryrefslogtreecommitdiffstats
path: root/manager.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-04 17:38:47 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-04 17:38:47 +0000
commit47042ec26b98527da64f194ddbd33ea8189c1cfe (patch)
tree6c675ae3bb3dc81d22f6dcf8b69978023667b158 /manager.c
parent2a2914cb6440f9e34970b4924e232ae178038eb4 (diff)
It is valid to redirect channels via the manager interface that are not in the
UP state. Instead of checking for that to prevent to ensure a dead channel doesn't get redirected, just use the ast_check_hangup() API call. (issue #9457, reported by Callmewind, patch by me) (related to issue #8977) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@60134 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'manager.c')
-rw-r--r--manager.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/manager.c b/manager.c
index 30210a2f5..e83c55e20 100644
--- a/manager.c
+++ b/manager.c
@@ -885,15 +885,15 @@ static int action_redirect(struct mansession *s, struct message *m)
astman_send_error(s, m, buf);
return 0;
}
- if (chan->_state != AST_STATE_UP) {
- astman_send_error(s, m, "Redirect failed, channel not up.\n");
+ if (ast_check_hangup(chan)) {
+ astman_send_error(s, m, "Redirect failed, channel hung up.\n");
ast_mutex_unlock(&chan->lock);
return 0;
}
if (!ast_strlen_zero(name2))
chan2 = ast_get_channel_by_name_locked(name2);
- if (chan2 && chan2->_state != AST_STATE_UP) {
- astman_send_error(s, m, "Redirect failed, extra channel not up.\n");
+ if (chan2 && ast_check_hangup(chan2)) {
+ astman_send_error(s, m, "Redirect failed, extra channel hung up.\n");
ast_mutex_unlock(&chan->lock);
ast_mutex_unlock(&chan2->lock);
return 0;