[asterisk-commits] twilson: branch 1.4 r319527 - /branches/1.4/apps/app_dial.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 18 14:56:12 CDT 2011


Author: twilson
Date: Wed May 18 14:56:08 2011
New Revision: 319527

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=319527
Log:
Fix app_dial ring groups

Revert part of r315643. We need to remove the datastore here as well.
The code in bridging code will catch anything that app_dial might miss.

Modified:
    branches/1.4/apps/app_dial.c

Modified: branches/1.4/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/apps/app_dial.c?view=diff&rev=319527&r1=319526&r2=319527
==============================================================================
--- branches/1.4/apps/app_dial.c (original)
+++ branches/1.4/apps/app_dial.c Wed May 18 14:56:08 2011
@@ -1453,6 +1453,17 @@
 	time(&start_time);
 	peer = wait_for_answer(chan, outgoing, &to, peerflags, &sentringing, status, sizeof(status), numbusy, numnochan, numcongestion, ast_test_flag(&opts, OPT_PRIORITY_JUMP), &result);
 
+	/* 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(chan);
+	if (!ast_channel_datastore_remove(chan, datastore)) {
+		ast_channel_datastore_free(datastore);
+	}
+	ast_channel_unlock(chan);
 	if (!peer) {
 		if (result) {
 			res = result;




More information about the asterisk-commits mailing list