[asterisk-commits] rmudgett: trunk r412580 - in /trunk: ./ apps/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 18 11:27:40 CDT 2014


Author: rmudgett
Date: Fri Apr 18 11:27:31 2014
New Revision: 412580

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=412580
Log:
app_dial and app_queue: Make lock the forwarding channel while taking the channel snapshot.

* Fixed ast_channel_publish_dial_forward() not locking the forwarded
channel when taking the channel snapshot.

* Fixed app_dial.c:do_forward() using the wrong channel to get the
original call forwarding string.

* Removed unnecessary locking when calling ast_channel_publish_dial() and
ast_channel_publish_dial_forward() in app_dial and app_queue.  Holding
channel locks when calling ast_channel_publish_dial_forward() with a
forwarded channel could result in pausing the system while the stasis bus
completes processsing a forwarded channel subscription.

Review: https://reviewboard.asterisk.org/r/3451/
........

Merged revisions 412579 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/apps/app_dial.c
    trunk/apps/app_queue.c
    trunk/main/stasis_channels.c

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

Modified: trunk/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_dial.c?view=diff&rev=412580&r1=412579&r2=412580
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Fri Apr 18 11:27:31 2014
@@ -1001,16 +1001,9 @@
 			c = o->chan = NULL;
 			num->nochan++;
 		} else {
-			ast_channel_lock_both(c, in);
 			ast_channel_publish_dial(in, c, stuff, NULL);
-			ast_channel_unlock(in);
-			ast_channel_unlock(c);
-
-			ast_channel_lock_both(original, in);
 			ast_channel_publish_dial_forward(in, original, c, NULL, "CANCEL",
-				ast_channel_call_forward(c));
-			ast_channel_unlock(in);
-			ast_channel_unlock(original);
+				ast_channel_call_forward(original));
 
 			/* Hangup the original channel now, in case we needed it */
 			ast_hangup(original);

Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=412580&r1=412579&r2=412580
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Fri Apr 18 11:27:31 2014
@@ -4671,16 +4671,11 @@
 							numnochan++;
 						}
 					}
-					ast_channel_lock_both(qe->chan, o->chan);
+
 					ast_channel_publish_dial(qe->chan, o->chan, stuff, NULL);
-					ast_channel_unlock(o->chan);
-					ast_channel_unlock(qe->chan);
-
-					ast_channel_lock_both(qe->chan, original);
-					ast_channel_publish_dial_forward(qe->chan, original, o->chan, NULL, "CANCEL",
-						ast_channel_call_forward(original));
-					ast_channel_unlock(original);
-					ast_channel_unlock(qe->chan);
+					ast_channel_publish_dial_forward(qe->chan, original, o->chan, NULL,
+						"CANCEL", ast_channel_call_forward(original));
+
 					/* Hangup the original channel now, in case we needed it */
 					ast_hangup(winner);
 					continue;

Modified: trunk/main/stasis_channels.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stasis_channels.c?view=diff&rev=412580&r1=412579&r2=412580
==============================================================================
--- trunk/main/stasis_channels.c (original)
+++ trunk/main/stasis_channels.c Fri Apr 18 11:27:31 2014
@@ -336,7 +336,9 @@
 	ast_multi_channel_blob_add_channel(payload, "peer", peer_snapshot);
 
 	if (forwarded) {
+		ast_channel_lock(forwarded);
 		forwarded_snapshot = ast_channel_snapshot_create(forwarded);
+		ast_channel_unlock(forwarded);
 		if (!forwarded_snapshot) {
 			return;
 		}




More information about the asterisk-commits mailing list