[asterisk-commits] twilson: branch 1.4 r317574 - /branches/1.4/apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 6 02:55:28 CDT 2011


Author: twilson
Date: Fri May  6 02:55:21 2011
New Revision: 317574

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=317574
Log:
Re-fix queue round-robin

This part of the change for r315596 was incorrect. No bridge occurs
when doing a roundrobin dial and no one answers, so this code shouldn't
have been removed.

Modified:
    branches/1.4/apps/app_queue.c

Modified: branches/1.4/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/apps/app_queue.c?view=diff&rev=317574&r1=317573&r2=317574
==============================================================================
--- branches/1.4/apps/app_queue.c (original)
+++ branches/1.4/apps/app_queue.c Fri May  6 02:55:21 2011
@@ -3047,6 +3047,17 @@
 	if (need_weight)
 		AST_LIST_UNLOCK(&queues);
 	lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed);
+	/* The ast_channel_datastore_remove() function could fail here if the
+	 * datastore was moved to another channel during a masquerade. If this is
+	 * the case, don't free the datastore here because later, when the channel
+	 * to which the datastore was moved hangs up, it will attempt to free this
+	 * datastore again, causing a crash
+	 */
+	ast_channel_lock(qe->chan);
+	if (datastore && !ast_channel_datastore_remove(qe->chan, datastore)) {
+		ast_channel_datastore_free(datastore);
+	}
+	ast_channel_unlock(qe->chan);
 	ao2_lock(qe->parent);
 	if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY || qe->parent->strategy == QUEUE_STRATEGY_RRORDERED) {
 		store_next(qe, outgoing);




More information about the asterisk-commits mailing list