Asterisk - The Open Source Telephony Project GIT-master-d856a3e
|
#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/stasis_message_router.h"
#include "asterisk/statsd.h"
#include "asterisk/time.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static void | default_route (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Router callback for any message that doesn't otherwise have a route. More... | |
static int | load_module (void) |
static void | statsmaker (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Subscription callback for all channel messages. More... | |
static int | unload_module (void) |
static void | updates (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Router callback for ast_channel_snapshot_update messages. More... | |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Example of how to use Stasis" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_EXTENDED, .load = load_module, .unload = unload_module, .requires = "res_statsd" } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct stasis_message_router * | router |
static struct stasis_subscription * | sub |
Statsd channel stats. Exmaple of how to subscribe to Stasis events. More... | |
|
static |
Definition at line 168 of file res_chan_stats.c.
|
static |
Definition at line 168 of file res_chan_stats.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 168 of file res_chan_stats.c.
|
static |
Router callback for any message that doesn't otherwise have a route.
data | Data pointer given when added to router. |
sub | This subscription. |
message | The message itself. |
Definition at line 121 of file res_chan_stats.c.
References stasis_subscription_final_message(), and sub.
Referenced by load_module().
|
static |
Definition at line 142 of file res_chan_stats.c.
References ast_channel_snapshot_type(), ast_channel_topic_all(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, default_route(), NULL, router, stasis_message_router_add(), stasis_message_router_create, stasis_message_router_set_default(), stasis_subscribe, statsmaker(), sub, unload_module(), and updates().
|
static |
Subscription callback for all channel messages.
data | Data pointer given when creating the subscription. |
sub | This subscription. |
message | The message itself. |
Definition at line 54 of file res_chan_stats.c.
References ast_free, ast_statsd_log(), AST_STATSD_METER, ast_str_buffer(), ast_str_create, ast_str_set(), NULL, RAII_VAR, stasis_message_type(), stasis_message_type_name(), stasis_subscription_final_message(), and sub.
Referenced by load_module().
|
static |
Definition at line 133 of file res_chan_stats.c.
References NULL, router, stasis_message_router_unsubscribe_and_join(), stasis_unsubscribe_and_join(), and sub.
Referenced by load_module().
|
static |
Router callback for ast_channel_snapshot_update messages.
data | Data pointer given when added to router. |
sub | This subscription. |
message | The message itself. |
Definition at line 83 of file res_chan_stats.c.
References AST_FLAG_DEAD, AST_STATSD_GAUGE, ast_statsd_log(), ast_statsd_log_string(), AST_STATSD_TIMER, ast_test_flag, ast_tvdiff_ms(), stasis_message_data(), stasis_message_timestamp(), and update().
Referenced by load_module().
|
static |
Definition at line 168 of file res_chan_stats.c.
|
static |
Definition at line 168 of file res_chan_stats.c.
|
static |
Stasis message router
Definition at line 46 of file res_chan_stats.c.
Referenced by cdr_prop_write(), cdr_read(), cdr_write(), find_route(), forkcdr_exec(), load_module(), pjsip_outbound_registration_metrics_init(), pjsip_outbound_registration_metrics_unload_cb(), publish_app_cdr_message(), router_dispatch(), router_dtor(), stasis_message_router_accept_formatters(), stasis_message_router_add(), stasis_message_router_add_cache_update(), stasis_message_router_create_internal(), stasis_message_router_is_done(), stasis_message_router_publish_sync(), stasis_message_router_remove(), stasis_message_router_remove_cache_update(), stasis_message_router_set_congestion_limits(), stasis_message_router_set_default(), stasis_message_router_set_formatters_default(), stasis_message_router_unsubscribe(), stasis_message_router_unsubscribe_and_join(), and unload_module().
|
static |
Statsd channel stats. Exmaple of how to subscribe to Stasis events.
This module subscribes to the channel caching topic and issues statsd stats based on the received messages.
Regular Stasis subscription
Definition at line 44 of file res_chan_stats.c.
Referenced by default_route(), load_module(), statsmaker(), and unload_module().