Add snapshot cache that indexes by channel name

This adds a new channel snapshot cache in parallel to the existing
cache; the difference being that it indexes the channel snapshots by
channel name instead of channel uniqueid.

Review: https://reviewboard.asterisk.org/r/2576


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2013-05-31 12:27:29 +00:00
parent 12548000dc
commit e1bff7958a
2 changed files with 63 additions and 0 deletions

View File

@@ -102,6 +102,15 @@ struct stasis_topic *ast_channel_topic_all(void);
*/
struct stasis_caching_topic *ast_channel_topic_all_cached(void);
/*!
* \since 12
* \brief A caching topic which caches \ref ast_channel_snapshot messages from
* ast_channel_events_all(void) and indexes them by name.
*
* \retval Topic for all channel events.
*/
struct stasis_caching_topic *ast_channel_topic_all_cached_by_name(void);
/*!
* \since 12
* \brief Message type for \ref ast_channel_snapshot.
@@ -135,6 +144,18 @@ struct ast_channel_snapshot *ast_channel_snapshot_create(
*/
struct ast_channel_snapshot *ast_channel_snapshot_get_latest(const char *uniqueid);
/*!
* \since 12
* \brief Obtain the latest \ref ast_channel_snapshot from the \ref stasis cache. This is
* an ao2 object, so use \ref ao2_cleanup() to deallocate.
*
* \param name The channel's name
*
* \retval A \ref ast_channel_snapshot on success
* \retval NULL on error
*/
struct ast_channel_snapshot *ast_channel_snapshot_get_latest_by_name(const char *name);
/*!
* \since 12
* \brief Creates a \ref ast_channel_blob message.