[asterisk-commits] dvossel: branch dvossel/call_forward_api_trunk r198594 - /team/dvossel/call_f...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 1 11:54:46 CDT 2009


Author: dvossel
Date: Mon Jun  1 11:54:43 2009
New Revision: 198594

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=198594
Log:
added locking

Modified:
    team/dvossel/call_forward_api_trunk/main/channel.c

Modified: team/dvossel/call_forward_api_trunk/main/channel.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/dvossel/call_forward_api_trunk/main/channel.c?view=diff&rev=198594&r1=198593&r2=198594
==============================================================================
--- team/dvossel/call_forward_api_trunk/main/channel.c (original)
+++ team/dvossel/call_forward_api_trunk/main/channel.c Mon Jun  1 11:54:43 2009
@@ -3973,7 +3973,6 @@
 	}
 
 	/* Copy important information from orig channel to new channel */
-	//todohere some of this is repeat code and i hate it
 	if (oh) {
 		if (oh->vars)
 			ast_set_variables(new, oh->vars);
@@ -3988,8 +3987,14 @@
 			ast_cdr_setaccount(new, oh->account);
 	}
 
+	ast_channel_lock(orig);
+	while (ast_channel_trylock(new)) {
+		CHANNEL_DEADLOCK_AVOIDANCE(orig);
+	}
 	ast_party_caller_copy(&new->cid, &orig->cid);
 	ast_party_connected_line_copy(&new->connected, &orig->connected);
+	ast_channel_unlock(new);
+	ast_channel_unlock(orig);
 
 	/* call new channel */
 	if ((*timeout = ast_call(new, data, 0))) {




More information about the asterisk-commits mailing list