[asterisk-commits] russell: trunk r58166 - in /trunk: ./ main/manager.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Mar 6 17:26:01 MST 2007


Author: russell
Date: Tue Mar  6 18:26:01 2007
New Revision: 58166

URL: http://svn.digium.com/view/asterisk?view=rev&rev=58166
Log:
Merged revisions 58165 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r58165 | russell | 2007-03-06 18:25:19 -0600 (Tue, 06 Mar 2007) | 12 lines

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)

........

................

Modified:
    trunk/   (props changed)
    trunk/main/manager.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?view=diff&rev=58166&r1=58165&r2=58166
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Tue Mar  6 18:26:01 2007
@@ -1682,8 +1682,19 @@
 		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)) {



More information about the asterisk-commits mailing list