Asterisk - The Open Source Telephony Project
21.4.1
|
Stasis endpoint API. More...
#include "asterisk.h"
#include "asterisk/astobj2.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_endpoints.h"
Go to the source code of this file.
Functions | |
struct stasis_message * | ast_endpoint_blob_create (struct ast_endpoint *endpoint, struct stasis_message_type *type, struct ast_json *blob) |
Creates a ast_endpoint_blob message. More... | |
void | ast_endpoint_blob_publish (struct ast_endpoint *endpoint, struct stasis_message_type *type, struct ast_json *blob) |
Creates and publishes a ast_endpoint_blob message. More... | |
struct stasis_cache * | ast_endpoint_cache (void) |
Backend cache for ast_endpoint_topic_all_cached(). More... | |
struct stasis_cp_all * | ast_endpoint_cache_all (void) |
struct ast_endpoint_snapshot * | ast_endpoint_latest_snapshot (const char *tech, const char *name) |
Retrieve the most recent snapshot for the endpoint with the given name. More... | |
struct ast_json * | ast_endpoint_snapshot_to_json (const struct ast_endpoint_snapshot *snapshot, const struct stasis_message_sanitizer *sanitize) |
Build a JSON object from a ast_endpoint_snapshot. More... | |
int | ast_endpoint_stasis_init (void) |
Initialization function for endpoint stasis support. More... | |
struct stasis_topic * | ast_endpoint_topic_all (void) |
Topic for all endpoint related messages. More... | |
struct stasis_topic * | ast_endpoint_topic_all_cached (void) |
Cached topic for all endpoint related messages. More... | |
static struct ast_manager_event_blob * | contactstatus_to_ami (struct stasis_message *msg) |
static struct ast_json * | contactstatus_to_json (struct stasis_message *msg, const struct stasis_message_sanitizer *sanitize) |
static void | endpoint_blob_dtor (void *obj) |
static const char * | endpoint_snapshot_get_id (struct stasis_message *message) |
Callback extract a unique identity from a snapshot message. More... | |
static void | endpoints_stasis_cleanup (void) |
static struct ast_manager_event_blob * | peerstatus_to_ami (struct stasis_message *msg) |
static struct ast_json * | peerstatus_to_json (struct stasis_message *msg, const struct stasis_message_sanitizer *sanitize) |
STASIS_MESSAGE_TYPE_DEFN (ast_endpoint_snapshot_type) | |
STASIS_MESSAGE_TYPE_DEFN (ast_endpoint_state_type,.to_ami=peerstatus_to_ami,.to_json=peerstatus_to_json,) | |
STASIS_MESSAGE_TYPE_DEFN (ast_endpoint_contact_state_type,.to_ami=contactstatus_to_ami,.to_json=contactstatus_to_json) | |
Variables | |
static struct stasis_cp_all * | endpoint_cache_all |
Stasis endpoint API.
Definition in file stasis_endpoints.c.
struct ast_json* ast_endpoint_snapshot_to_json | ( | const struct ast_endpoint_snapshot * | snapshot, |
const struct stasis_message_sanitizer * | sanitize | ||
) |
Build a JSON object from a ast_endpoint_snapshot.
snapshot | Endpoint snapshot. |
sanitize | The message sanitizer to use on the snapshot |
NULL | on error |
Definition at line 398 of file stasis_endpoints.c.
References ast_endpoint_state_to_string(), ast_json_array_append(), ast_json_integer_create(), ast_json_object_get(), ast_json_object_set(), ast_json_pack(), ast_json_string_create(), ast_json_unref(), stasis_message_sanitizer::channel_id, ast_endpoint_snapshot::channel_ids, ast_endpoint_snapshot::max_channels, ast_endpoint_snapshot::num_channels, ast_endpoint_snapshot::resource, ast_endpoint_snapshot::state, and ast_endpoint_snapshot::tech.
Referenced by ast_ari_endpoints_get(), ast_ari_endpoints_list(), and ast_ari_endpoints_list_by_tech().
int ast_endpoint_stasis_init | ( | void | ) |
Initialization function for endpoint stasis support.
Definition at line 458 of file stasis_endpoints.c.
References ast_endpoint_contact_state_type(), ast_endpoint_snapshot_type(), ast_endpoint_state_type(), ast_register_cleanup(), endpoint_snapshot_get_id(), stasis_cp_all_create(), and STASIS_MESSAGE_TYPE_INIT.
|
static |
Callback extract a unique identity from a snapshot message.
This identity is unique to the underlying object of the snapshot, such as the UniqueId field of a channel.
message | Message to extract id from. |
NULL | if the message_type of the message isn't a handled snapshot. |
Definition at line 384 of file stasis_endpoints.c.
References ast_endpoint_snapshot_type(), ast_endpoint_snapshot::id, stasis_message_data(), and stasis_message_type().
Referenced by ast_endpoint_stasis_init().