47 switch (snapshot->
state) {
62 if (!old_snapshot && new_snapshot) {
65 }
else if (old_snapshot && !new_snapshot) {
69 if (old_snapshot->
state != new_snapshot->
state) {
154 .
requires =
"res_statsd"
Asterisk main include file. File version handling, generic pbx functions.
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
@ OBJ_NOLOCK
Assume that the ao2_container is already locked.
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
struct stasis_message_type * ast_endpoint_snapshot_type(void)
Message type for ast_endpoint_snapshot.
struct stasis_topic * ast_endpoint_topic_all_cached(void)
Cached topic for all endpoint related messages.
struct stasis_message_type * stasis_cache_update_type(void)
Message type for cache update messages.
struct stasis_cache * ast_endpoint_cache(void)
Backend cache for ast_endpoint_topic_all_cached().
static struct ao2_container * endpoints
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_EXTENDED
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
struct stasis_forward * sub
static int dump_cache_load(void *obj, void *arg, int flags)
static struct stasis_message_router * router
Statsd Endpoint stats.
static void update_endpoint_state(struct ast_endpoint_snapshot *snapshot, const char *delta)
static int dump_cache_unload(void *obj, void *arg, int flags)
static int load_module(void)
static void handle_endpoint_update(struct ast_endpoint_snapshot *old_snapshot, struct ast_endpoint_snapshot *new_snapshot)
static int unload_module(void)
static void cache_update_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct ao2_container * stasis_cache_dump(struct stasis_cache *cache, struct stasis_message_type *type)
Dump cached items to a subscription for the ast_eid_default entity.
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
#define stasis_message_router_create(topic)
Create a new message router object.
int stasis_message_router_add(struct stasis_message_router *router, struct stasis_message_type *message_type, stasis_subscription_cb callback, void *data)
Add a route to a message router.
void stasis_message_router_unsubscribe_and_join(struct stasis_message_router *router)
Unsubscribe the router from the upstream topic, blocking until the final message has been processed.
#define AST_STATSD_GAUGE
Support for publishing to a statsd server.
void ast_statsd_log_string(const char *metric_name, const char *metric_type, const char *value, double sample_rate)
Send a stat to the configured statsd server.
void ast_statsd_log_full_va(const char *metric_name, const char *metric_type, intmax_t value, double sample_rate,...)
Send a stat to the configured statsd server.
A snapshot of an endpoint's state.
const ast_string_field tech
enum ast_endpoint_state state
const ast_string_field resource