Asterisk - The Open Source Telephony Project
18.5.0
|
#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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .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 177 of file res_chan_stats.c.
|
static |
Definition at line 177 of file res_chan_stats.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 177 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. |
topic | The topic the message was posted to. This is not necessarily the topic you subscribed to, since messages may be forwarded between topics. |
message | The message itself. |
Definition at line 130 of file res_chan_stats.c.
References stasis_subscription_final_message().
Referenced by load_module().
|
static |
Definition at line 151 of file res_chan_stats.c.
References ast_channel_snapshot_type(), ast_channel_topic_all(), AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_EXTENDED, ASTERISK_GPL_KEY, default_route(), NULL, stasis_message_router_add(), stasis_message_router_create, stasis_message_router_set_default(), stasis_subscribe, statsmaker(), unload_module(), and updates().
|
static |
Subscription callback for all channel messages.
data | Data pointer given when creating the subscription. |
sub | This subscription. |
topic | The topic the message was posted to. This is not necessarily the topic you subscribed to, since messages may be forwarded between topics. |
message | The message itself. |
Definition at line 57 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(), and stasis_subscription_final_message().
Referenced by load_module().
|
static |
Definition at line 142 of file res_chan_stats.c.
References NULL, stasis_message_router_unsubscribe_and_join(), and stasis_unsubscribe_and_join().
Referenced by load_module().
|
static |
Router callback for ast_channel_snapshot_update messages.
data | Data pointer given when added to router. |
sub | This subscription. |
topic | The topic the message was posted to. This is not necessarily the topic you subscribed to, since messages may be forwarded between topics. |
message | The message itself. |
Definition at line 89 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(), ast_channel_snapshot::base, ast_channel_snapshot_base::creationtime, ast_channel_snapshot::flags, ast_channel_snapshot_update::new_snapshot, ast_channel_snapshot_update::old_snapshot, stasis_message_data(), stasis_message_timestamp(), and update().
Referenced by load_module().
|
static |
Definition at line 177 of file res_chan_stats.c.
|
static |
Definition at line 177 of file res_chan_stats.c.
|
static |
Stasis message router
Definition at line 46 of file res_chan_stats.c.
|
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.