diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-07 00:25:19 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-07 00:25:19 +0000 |
commit | edcef29c0730c72e0996bbb376b64bfa3d4347da (patch) | |
tree | e0659c5860d107e4e12288ffad0615bf6d4ebd97 | |
parent | 4c84fb85a095e0b3ff60abfc1bfe7487a152c9c5 (diff) |
Merged revisions 58164 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r58164 | russell | 2007-03-06 18:20:13 -0600 (Tue, 06 Mar 2007) | 4 lines
If the channels acquired using the manager Redirect action are not up, then
don't attempt to do anything with them. It could lead to weird behavior,
including crashes. (issue #8977)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@58165 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/manager.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/main/manager.c b/main/manager.c index 4c6dc30b9..4e4abd064 100644 --- a/main/manager.c +++ b/main/manager.c @@ -1558,8 +1558,19 @@ 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) { + 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) { + astman_send_error(s, m, "Redirect failed, extra channel not up.\n"); + ast_channel_unlock(chan); + ast_channel_unlock(chan2); + return 0; + } res = ast_async_goto(chan, context, exten, pi); if (!res) { if (!ast_strlen_zero(name2)) { |