From: Russell Bryant Date: Wed, 4 Apr 2007 17:40:10 +0000 (+0000) Subject: Merged revisions 60134 via svnmerge from X-Git-Tag: 1.4.7.1~480 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ab5c3cd84efff8819b97f5407a6b74ef631f620b;p=thirdparty%2Fasterisk.git Merged revisions 60134 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r60134 | russell | 2007-04-04 12:38:47 -0500 (Wed, 04 Apr 2007) | 6 lines 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@60137 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/manager.c b/main/manager.c index 4e4abd0644..04c84cb4b5 100644 --- a/main/manager.c +++ b/main/manager.c @@ -1558,14 +1558,14 @@ static int action_redirect(struct mansession *s, const struct message *m) astman_send_error(s, m, buf); return 0; } - if (chan->_state != AST_STATE_UP) { + if (ast_check_hangup(chan)) { astman_send_error(s, m, "Redirect failed, channel not up.\n"); ast_channel_unlock(chan); return 0; } if (!ast_strlen_zero(name2)) chan2 = ast_get_channel_by_name_locked(name2); - if (chan2 && chan2->_state != AST_STATE_UP) { + if (chan2 && ast_check_hangup(chan2)) { astman_send_error(s, m, "Redirect failed, extra channel not up.\n"); ast_channel_unlock(chan); ast_channel_unlock(chan2);