[asterisk-commits] irroot: branch irroot/distrotech-customers-1.8 r330314 - /team/irroot/distrot...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jul 30 10:56:55 CDT 2011


Author: irroot
Date: Sat Jul 30 10:56:52 2011
New Revision: 330314

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=330314
Log:
Revert kludge to fix orphaned channel

Modified:
    team/irroot/distrotech-customers-1.8/main/channel.c
    team/irroot/distrotech-customers-1.8/main/features.c

Modified: team/irroot/distrotech-customers-1.8/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/main/channel.c?view=diff&rev=330314&r1=330313&r2=330314
==============================================================================
--- team/irroot/distrotech-customers-1.8/main/channel.c (original)
+++ team/irroot/distrotech-customers-1.8/main/channel.c Sat Jul 30 10:56:52 2011
@@ -6324,8 +6324,16 @@
 	 * for deadlock avoidance will not result in any sort of masquerade race condition.
 	 * If masq is called by a different thread while this happens, it will be stuck waiting
 	 * until we unlock the container. */
-	while (ast_channel_trylock(clonechan)) {
+	while ((clonechan = original->masq) && ast_channel_trylock(clonechan)) {
 		CHANNEL_DEADLOCK_AVOIDANCE(original);
+	}
+
+	/* recheck if masq has been done the deadlock avoidance above could cause a double masq
+	 * this is posible with at least ast_hangup*/
+	if (!original->masq) {
+		ast_channel_unlock(original);
+		ao2_unlock(channels);
+		return 0; /* masq already completed by another thread, or never needed to be done to begin with */
 	}
 
 	/* Get any transfer masquerade connected line exchange data. */

Modified: team/irroot/distrotech-customers-1.8/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/main/features.c?view=diff&rev=330314&r1=330313&r2=330314
==============================================================================
--- team/irroot/distrotech-customers-1.8/main/features.c (original)
+++ team/irroot/distrotech-customers-1.8/main/features.c Sat Jul 30 10:56:52 2011
@@ -5863,19 +5863,7 @@
 	res = 0;
 
 pickup_failed:
-	ast_autoservice_start(target);
-
 	ast_channel_lock(target);
-	while (target && !ast_test_flag(target, AST_FLAG_ZOMBIE) && 
-	       !ast_check_hangup(target) && !ast_bridged_channel(target)) {
-		ast_channel_unlock(target);
-		usleep(1000);
-		ast_channel_lock(target);
-	}
-	ast_channel_unlock(target);
-	ast_autoservice_stop(target);
-	ast_channel_lock(target);
-
 	if (!ast_channel_datastore_remove(target, ds_pickup)) {
 		ast_datastore_free(ds_pickup);
 	}




More information about the asterisk-commits mailing list