From 28837b6b667608b5914e223615570688d64eef1c Mon Sep 17 00:00:00 2001 From: russell Date: Thu, 13 Mar 2008 21:41:14 +0000 Subject: Merged revisions 108584 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r108584 | russell | 2008-03-13 16:40:43 -0500 (Thu, 13 Mar 2008) | 19 lines Merged revisions 108583 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r108583 | russell | 2008-03-13 16:38:16 -0500 (Thu, 13 Mar 2008) | 11 lines Fix another issue that was causing crashes in chanspy. This introduces a new datastore callback, called chan_fixup(). The concept is exactly like the fixup callback that is used in the channel technology interface. This callback gets called when the owning channel changes due to a masquerade. Before this was introduced, if a masquerade happened on a channel being spyed on, the channel pointer in the datastore became invalid. (closes issue #12187) (reported by, and lots of testing from atis) (props to file for the help with ideas) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@108585 f38db490-d61c-443f-a65b-d21fe96a405b --- main/channel.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'main') diff --git a/main/channel.c b/main/channel.c index 93f6f58f3..aeb4845cc 100644 --- a/main/channel.c +++ b/main/channel.c @@ -3878,8 +3878,14 @@ int ast_do_masquerade(struct ast_channel *original) ast_app_group_update(clone, original); /* Move data stores over */ - if (AST_LIST_FIRST(&clone->datastores)) + if (AST_LIST_FIRST(&clone->datastores)) { + struct ast_datastore *ds; AST_LIST_APPEND_LIST(&original->datastores, &clone->datastores, entry); + AST_LIST_TRAVERSE(&original->datastores, ds, entry) { + if (ds->info->chan_fixup) + ds->info->chan_fixup(ds->data, clone, original); + } + } clone_variables(original, clone); /* Presense of ADSI capable CPE follows clone */ -- cgit v1.2.3