[asterisk-commits] mmichelson: branch group/issue8824 r183830 - /team/group/issue8824/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 23 17:32:33 CDT 2009


Author: mmichelson
Date: Mon Mar 23 17:32:29 2009
New Revision: 183830

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=183830
Log:
Take care of some locking issues in chan_sip as per Russell's comments.


Modified:
    team/group/issue8824/channels/chan_sip.c

Modified: team/group/issue8824/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/channels/chan_sip.c?view=diff&rev=183830&r1=183829&r2=183830
==============================================================================
--- team/group/issue8824/channels/chan_sip.c (original)
+++ team/group/issue8824/channels/chan_sip.c Mon Mar 23 17:32:29 2009
@@ -19908,19 +19908,28 @@
 
 		if (target.chan2) {
 			/* Tell each of the other channels to whom they are now connected */
-			ast_party_connected_line_collect_caller(&connected_caller, &current->chan2->cid);
+			ast_channel_lock(current->chan2);
+			ast_copy_caller_to_connected(&connected_caller, &current->chan2->cid);
+			ast_channel_unlock(current->chan2);
 			connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
 			ast_connected_line_update(target.chan2, &connected_caller);
-			ast_party_connected_line_collect_caller(&connected_caller, &target.chan2->cid);
+			ast_channel_lock(target.chan2);
+			ast_copy_caller_to_connected(&connected_caller, &target.chan2->cid);
+			ast_channel_unlock(target.chan2);
 			connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
 			ast_connected_line_update(current->chan2, &connected_caller);
+			ast_party_connected_line_free(&connected_caller);
 		} else {
 			/* Notify the first other party that they are connected to someone else assuming that target.chan1
 			   has progressed far enough through the dialplan to have it's called party information set. */
 			if (current->chan2) {
+				ast_channel_lock(target.chan1);
+				ast_party_connected_line_copy(&connected_caller, &target.chan1->connected);
+				ast_channel_unlock(target.chan1);
 				connected_caller = target.chan1->connected;
 				connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
 				ast_connected_line_update(current->chan2, &connected_caller);
+				ast_party_connected_line_free(&connected_caller);
 			}
 
 			/* We can't indicate to the called channel directly so we force the masquerade to complete




More information about the asterisk-commits mailing list