[svn-commits] mmichelson: branch group/issue8824 r185418 - /team/group/issue8824/channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 31 12:30:22 CDT 2009


Author: mmichelson
Date: Tue Mar 31 12:30:08 2009
New Revision: 185418

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=185418
Log:
Fix crash that could occur on SIP attended transfers of unbridged calls.

If trying to fax a Meetme conference or an IVR where there is no bridged
channel that is being transferred, there is no collected line information
to gather. Trying to do so means accessing NULL pointers and generally leads
to horrible suffering, anguish, and other hyperbole to describe a crash.

AST-200


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=185418&r1=185417&r2=185418
==============================================================================
--- team/group/issue8824/channels/chan_sip.c (original)
+++ team/group/issue8824/channels/chan_sip.c Tue Mar 31 12:30:08 2009
@@ -19886,18 +19886,20 @@
 		}
 
 		if (target.chan2) {
-			/* Tell each of the other channels to whom they are now connected */
-			ast_channel_lock(current->chan2);
-			ast_connected_line_copy_from_caller(&connected_caller, &current->chan2->cid);
-			ast_channel_unlock(current->chan2);
-			connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
-			ast_channel_update_connected_line(target.chan2, &connected_caller);
-			ast_channel_lock(target.chan2);
-			ast_connected_line_copy_from_caller(&connected_caller, &target.chan2->cid);
-			ast_channel_unlock(target.chan2);
-			connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
-			ast_channel_update_connected_line(current->chan2, &connected_caller);
-			ast_party_connected_line_free(&connected_caller);
+			if (current->chan2) {
+				/* Tell each of the other channels to whom they are now connected */
+				ast_channel_lock(current->chan2);
+				ast_connected_line_copy_from_caller(&connected_caller, &current->chan2->cid);
+				ast_channel_unlock(current->chan2);
+				connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
+				ast_channel_update_connected_line(target.chan2, &connected_caller);
+				ast_channel_lock(target.chan2);
+				ast_connected_line_copy_from_caller(&connected_caller, &target.chan2->cid);
+				ast_channel_unlock(target.chan2);
+				connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
+				ast_channel_update_connected_line(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. */




More information about the svn-commits mailing list