mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@108584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -427,9 +427,19 @@ static void chanspy_ds_destroy(void *data)
|
||||
ast_mutex_unlock(&chanspy_ds->lock);
|
||||
}
|
||||
|
||||
static void chanspy_ds_chan_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
|
||||
{
|
||||
struct chanspy_ds *chanspy_ds = data;
|
||||
|
||||
ast_mutex_lock(&chanspy_ds->lock);
|
||||
chanspy_ds->chan = new_chan;
|
||||
ast_mutex_unlock(&chanspy_ds->lock);
|
||||
}
|
||||
|
||||
static const struct ast_datastore_info chanspy_ds_info = {
|
||||
.type = "chanspy",
|
||||
.destroy = chanspy_ds_destroy,
|
||||
.chan_fixup = chanspy_ds_chan_fixup,
|
||||
};
|
||||
|
||||
static struct chanspy_ds *chanspy_ds_free(struct chanspy_ds *chanspy_ds)
|
||||
|
Reference in New Issue
Block a user