diff options
author | Kinsey Moore <kmoore@digium.com> | 2013-06-07 12:56:56 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2013-06-07 12:56:56 +0000 |
commit | 759a7e4a30b5e69738670494e5c19b6982a34644 (patch) | |
tree | 56e190b02bf90267738a4da3f0c8bb87e55424eb /main/stasis_channels.c | |
parent | 611416623748504be81c58b455205a4bc7fff414 (diff) |
Rework stasis cache clear events
Stasis cache clear message payloads now consist of a stasis_message
representative of the message to be cleared from the cache. This allows
multiple parallel caches to coexist and be cleared properly by the same
cache clear message even when keyed on different fields.
This change fixes a bug where multiple cache clears could be posted for
channels. The cache clear is now produced in the destructor instead of
ast_hangup.
Additionally, dummy channels are no longer capable of producing channel
snapshots.
Review: https://reviewboard.asterisk.org/r/2596
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/stasis_channels.c')
-rw-r--r-- | main/stasis_channels.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/stasis_channels.c b/main/stasis_channels.c index 52b6ef4ce..65e9f917d 100644 --- a/main/stasis_channels.c +++ b/main/stasis_channels.c @@ -131,6 +131,11 @@ struct ast_channel_snapshot *ast_channel_snapshot_create(struct ast_channel *cha { RAII_VAR(struct ast_channel_snapshot *, snapshot, NULL, ao2_cleanup); + /* no snapshots for dummy channels */ + if (!ast_channel_tech(chan)) { + return NULL; + } + snapshot = ao2_alloc(sizeof(*snapshot), channel_snapshot_dtor); if (!snapshot || ast_string_field_init(snapshot, 1024)) { return NULL; |