[asterisk-commits] mmichelson: branch 10 r360885 - in /branches/10: ./ main/features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 29 18:34:03 CDT 2012


Author: mmichelson
Date: Thu Mar 29 18:33:59 2012
New Revision: 360885

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=360885
Log:
Fix potential race condition during call pickup.

Prior to this patch, a connected line update was queued during
call pickup and then an answer frame was queued. The original
caller would presumably then have his connected line updated
and then the call would be answered.

In actuality, the answer frame was not how the call ended up
being answered. Rather, an odd section in app_dial that checks
if the called channel's state is up.

The result is that the order of the connected line update and
the answer were variable. In most cases, this wasn't actually
a bad thing. However, if the 'I' option was passed to dial, the
connected line update would be inhibited.

The fix is to queued the connected line after the answer frame is
queued. This way the race in app_dial is between two
conditions resulting in an answer. This way the connected line
update occurs after the answer every time.

(closes issue ASTERISK-19183)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
    Mark Michelson
Patches:
    ASTERISK-19183.patch uploaded by Mark Michelson (license 5049)
........

Merged revisions 360884 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/main/features.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/main/features.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/features.c?view=diff&rev=360885&r1=360884&r2=360885
==============================================================================
--- branches/10/main/features.c (original)
+++ branches/10/main/features.c Thu Mar 29 18:33:59 2012
@@ -7281,8 +7281,6 @@
 	ast_connected_line_copy_from_caller(&connected_caller, &chan->caller);
 	ast_channel_unlock(chan);
 	connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-	ast_channel_queue_connected_line_update(chan, &connected_caller, NULL);
-	ast_party_connected_line_free(&connected_caller);
 
 	ast_cel_report_event(target, AST_CEL_PICKUP, NULL, NULL, chan);
 
@@ -7296,6 +7294,8 @@
 		goto pickup_failed;
 	}
 	
+	ast_channel_queue_connected_line_update(chan, &connected_caller, NULL);
+
 	/* setting this flag to generate a reason header in the cancel message to the ringing channel */
 	ast_set_flag(chan, AST_FLAG_ANSWERED_ELSEWHERE);
 
@@ -7320,6 +7320,7 @@
 	if (!ast_channel_datastore_remove(target, ds_pickup)) {
 		ast_datastore_free(ds_pickup);
 	}
+	ast_party_connected_line_free(&connected_caller);
 
 	return res;
 }




More information about the asterisk-commits mailing list