[asterisk-commits] mmichelson: branch 1.8 r360884 - /branches/1.8/main/features.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Mar 29 18:32:39 CDT 2012
Author: mmichelson
Date: Thu Mar 29 18:32:35 2012
New Revision: 360884
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=360884
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)
Modified:
branches/1.8/main/features.c
Modified: branches/1.8/main/features.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/features.c?view=diff&rev=360884&r1=360883&r2=360884
==============================================================================
--- branches/1.8/main/features.c (original)
+++ branches/1.8/main/features.c Thu Mar 29 18:32:35 2012
@@ -7266,8 +7266,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);
@@ -7281,6 +7279,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);
@@ -7305,6 +7305,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