From: Terry Wilson Date: Wed, 18 May 2011 20:02:06 +0000 (+0000) Subject: Merged revisions 319527 via svnmerge from X-Git-Tag: 1.6.2.19-rc1~3^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0a4962e60117a7e653caf35bc4b887239c6aaa2;p=thirdparty%2Fasterisk.git Merged revisions 319527 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r319527 | twilson | 2011-05-18 12:56:08 -0700 (Wed, 18 May 2011) | 10 lines 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. (closes issue #19311) Reported by: mspuhler Patches: issue_19311_no_answer.diff uploaded by elguero (license 37) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@319528 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_dial.c b/apps/app_dial.c index 0db0b79e52..80e7d1c042 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1912,6 +1912,17 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags peer = wait_for_answer(chan, outgoing, &to, peerflags, &pa, &num, &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_datastore_free(datastore); + } + ast_channel_unlock(chan); if (!peer) { if (result) { res = result;