[asterisk-commits] russell: branch 1.6.1 r141952 - in /branches/1.6.1: ./ main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 8 20:51:29 CDT 2008


Author: russell
Date: Mon Sep  8 20:51:28 2008
New Revision: 141952

URL: http://svn.digium.com/view/asterisk?view=rev&rev=141952
Log:
Merged revisions 141807 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r141807 | russell | 2008-09-08 16:05:01 -0500 (Mon, 08 Sep 2008) | 15 lines

Merged revisions 141806 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r141806 | russell | 2008-09-08 16:02:36 -0500 (Mon, 08 Sep 2008) | 7 lines

When doing an async goto, detect if the channel is already in the middle of a
masquerade.  This can happen when chan_local is trying to optimize itself out.
If this happens, fail the async goto instead of bursting into flames.

(closes issue #13435)
Reported by: geoff2010

........

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

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/main/pbx.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/main/pbx.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/main/pbx.c?view=diff&rev=141952&r1=141951&r2=141952
==============================================================================
--- branches/1.6.1/main/pbx.c (original)
+++ branches/1.6.1/main/pbx.c Mon Sep  8 20:51:28 2008
@@ -6574,17 +6574,23 @@
 				S_OR(context, chan->context), S_OR(exten, chan->exten), priority);
 
 			/* Masquerade into temp channel */
-			ast_channel_masquerade(tmpchan, chan);
-
-			/* Grab the locks and get going */
-			ast_channel_lock(tmpchan);
-			ast_do_masquerade(tmpchan);
-			ast_channel_unlock(tmpchan);
-			/* Start the PBX going on our stolen channel */
-			if (ast_pbx_start(tmpchan)) {
-				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmpchan->name);
+			if (ast_channel_masquerade(tmpchan, chan)) {
+				/* Failed to set up the masquerade.  It's probably chan_local
+				 * in the middle of optimizing itself out.  Sad. :( */
 				ast_hangup(tmpchan);
+				tmpchan = NULL;
 				res = -1;
+			} else {
+				/* Grab the locks and get going */
+				ast_channel_lock(tmpchan);
+				ast_do_masquerade(tmpchan);
+				ast_channel_unlock(tmpchan);
+				/* Start the PBX going on our stolen channel */
+				if (ast_pbx_start(tmpchan)) {
+					ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmpchan->name);
+					ast_hangup(tmpchan);
+					res = -1;
+				}
 			}
 		}
 	}




More information about the asterisk-commits mailing list