diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-13 21:38:16 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-13 21:38:16 +0000 |
commit | 9de01fb3abcbdb0ff3f86cf681312d069a637e62 (patch) | |
tree | 328a01455a79762006feaaa5e9a01d520465436d /main | |
parent | 89a1622c3cce158491be6cf1d4eca05a51534f4f (diff) |
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.4@108583 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c index 198e9faf7..bef560243 100644 --- a/main/channel.c +++ b/main/channel.c @@ -3494,8 +3494,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 */ |