Asterisk - The Open Source Telephony Project
21.4.1
|
Stasis application support. More...
#include "asterisk.h"
#include "app.h"
#include "control.h"
#include "messaging.h"
#include "asterisk/callerid.h"
#include "asterisk/cli.h"
#include "asterisk/stasis_app.h"
#include "asterisk/stasis_bridges.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/stasis_endpoints.h"
#include "asterisk/stasis_message_router.h"
Go to the source code of this file.
Data Structures | |
struct | app_forwards |
struct | stasis_app |
Macros | |
#define | BRIDGE_ALL "__AST_BRIDGE_ALL_TOPIC" |
#define | CHANNEL_ALL "__AST_CHANNEL_ALL_TOPIC" |
#define | ENDPOINT_ALL "__AST_ENDPOINT_ALL_TOPIC" |
Typedefs | |
typedef struct ast_json *(* | channel_snapshot_monitor) (struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv) |
Typedef for callbacks that get called on channel snapshot updates. | |
Enumerations | |
enum | forward_type { FORWARD_CHANNEL, FORWARD_BRIDGE, FORWARD_ENDPOINT } |
Functions | |
struct stasis_app * | app_create (const char *name, stasis_app_cb handler, void *data, enum stasis_app_subscription_model subscription_model) |
Create a res_stasis application. More... | |
void | app_deactivate (struct stasis_app *app) |
Deactivates an application. More... | |
static void | app_dtor (void *obj) |
static int | app_event_filter_matched (struct ast_json *array, struct ast_json *event, int empty) |
static int | app_event_filter_set (struct stasis_app *app, struct ast_json **member, struct ast_json *filter, const char *filter_type) |
static int | app_events_allowed_set (struct stasis_app *app, struct ast_json *filter) |
static int | app_events_disallowed_set (struct stasis_app *app, struct ast_json *filter) |
int | app_is_active (struct stasis_app *app) |
Checks whether an app is active. More... | |
int | app_is_finished (struct stasis_app *app) |
Checks whether a deactivated app has no channels. More... | |
int | app_is_subscribed_bridge_id (struct stasis_app *app, const char *bridge_id) |
Test if an app is subscribed to a bridge. More... | |
int | app_is_subscribed_channel_id (struct stasis_app *app, const char *channel_id) |
Test if an app is subscribed to a channel. More... | |
int | app_is_subscribed_endpoint_id (struct stasis_app *app, const char *endpoint_id) |
Test if an app is subscribed to a endpoint. More... | |
void | app_send (struct stasis_app *app, struct ast_json *message) |
Send a message to an application. More... | |
void | app_shutdown (struct stasis_app *app) |
Tears down an application. More... | |
int | app_subscribe_bridge (struct stasis_app *app, struct ast_bridge *bridge) |
Add a bridge subscription to an existing channel subscription. More... | |
int | app_subscribe_channel (struct stasis_app *app, struct ast_channel *chan) |
Subscribes an application to a channel. More... | |
int | app_subscribe_endpoint (struct stasis_app *app, struct ast_endpoint *endpoint) |
Subscribes an application to a endpoint. More... | |
struct ast_json * | app_to_json (const struct stasis_app *app) |
Create a JSON representation of a stasis_app . More... | |
int | app_unsubscribe_bridge (struct stasis_app *app, struct ast_bridge *bridge) |
Cancel the bridge subscription for an application. More... | |
int | app_unsubscribe_bridge_id (struct stasis_app *app, const char *bridge_id) |
Cancel the subscription an app has for a bridge. More... | |
int | app_unsubscribe_channel (struct stasis_app *app, struct ast_channel *chan) |
Cancel the subscription an app has for a channel. More... | |
int | app_unsubscribe_channel_id (struct stasis_app *app, const char *channel_id) |
Cancel the subscription an app has for a channel. More... | |
int | app_unsubscribe_endpoint_id (struct stasis_app *app, const char *endpoint_id) |
Cancel the subscription an app has for a endpoint. More... | |
void | app_update (struct stasis_app *app, stasis_app_cb handler, void *data) |
Update the handler and data for a res_stasis application. More... | |
struct stasis_topic * | ast_app_get_topic (struct stasis_app *app) |
Returns the stasis topic for an app. More... | |
static int | bridge_app_subscribed (struct stasis_app *app, const char *uniqueid) |
Helper function for determining if the application is subscribed to a given entity. | |
static int | bridge_app_subscribed_involved (struct stasis_app *app, struct ast_bridge_snapshot *snapshot) |
Callback function for checking if channels in a bridge are subscribed to. | |
static void | bridge_attended_transfer_handler (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | bridge_blind_transfer_handler (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void * | bridge_find (const struct stasis_app *app, const char *id) |
static void | bridge_merge_handler (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | bridge_subscription_change_handler (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | call_forwarded_handler (struct stasis_app *app, struct stasis_message *message) |
static struct ast_json * | channel_callerid (struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv) |
static struct ast_json * | channel_connected_line (struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv) |
static struct ast_json * | channel_created_event (struct ast_channel_snapshot *snapshot, const struct timeval *tv) |
static struct ast_json * | channel_destroyed_event (struct ast_channel_snapshot *snapshot, const struct timeval *tv) |
static struct ast_json * | channel_dialplan (struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv) |
static void * | channel_find (const struct stasis_app *app, const char *id) |
static struct ast_json * | channel_state (struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *tv) |
Handle channel state changes. | |
static struct ast_json * | channel_state_change_event (struct ast_channel_snapshot *snapshot, const struct timeval *tv) |
static void * | endpoint_find (const struct stasis_app *app, const char *id) |
static void | endpoint_state_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static struct app_forwards * | forwards_create (struct stasis_app *app, const char *id) |
static struct app_forwards * | forwards_create_bridge (struct stasis_app *app, struct ast_bridge *bridge) |
static struct app_forwards * | forwards_create_channel (struct stasis_app *app, struct ast_channel *chan) |
static struct app_forwards * | forwards_create_endpoint (struct stasis_app *app, struct ast_endpoint *endpoint) |
static void | forwards_dtor (void *obj) |
static int | forwards_filter_by_type (void *obj, void *arg, int flags) |
static int | forwards_sort (const void *obj_left, const void *obj_right, int flags) |
static void | forwards_unsubscribe (struct app_forwards *forwards) |
static int | message_received_handler (const char *endpoint_id, struct ast_json *json_msg, void *pvt) |
static struct ast_json * | simple_bridge_event (const char *type, struct ast_bridge_snapshot *snapshot, const struct timeval *tv) |
static struct ast_json * | simple_channel_event (const char *type, struct ast_channel_snapshot *snapshot, const struct timeval *tv) |
static struct ast_json * | simple_endpoint_event (const char *type, struct ast_endpoint_snapshot *snapshot, const struct timeval *tv) |
int | stasis_app_event_allowed (const char *app_name, struct ast_json *event) |
Check if the given event should be filtered. More... | |
int | stasis_app_event_filter_set (struct stasis_app *app, struct ast_json *filter) |
Set the application's event type filter. More... | |
struct ast_json * | stasis_app_event_filter_to_json (struct stasis_app *app, struct ast_json *json) |
Convert and add the app's event type filter(s) to the given json object. More... | |
int | stasis_app_get_debug (struct stasis_app *app) |
Get debug status of an application. More... | |
int | stasis_app_get_debug_by_name (const char *app_name) |
Get debug status of an application. More... | |
const char * | stasis_app_name (const struct stasis_app *app) |
Retrieve an application's name. More... | |
void | stasis_app_register_event_sources (void) |
Register core event sources. | |
void | stasis_app_set_debug (struct stasis_app *app, int debug) |
Enable/disable request/response and event logging on an application. More... | |
void | stasis_app_set_debug_by_name (const char *app_name, int debug) |
Enable/disable request/response and event logging on an application. More... | |
void | stasis_app_set_global_debug (int debug) |
Enable/disable request/response and event logging on all applications. More... | |
void | stasis_app_to_cli (const struct stasis_app *app, struct ast_cli_args *a) |
Dump properties of a stasis_app to the CLI. More... | |
void | stasis_app_unregister_event_sources (void) |
Unregister core event sources. | |
static void | sub_bridge_update_handler (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | sub_channel_update_handler (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | sub_default_handler (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | sub_endpoint_update_handler (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | sub_subscription_change_handler (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static int | subscribe_bridge (struct stasis_app *app, void *obj) |
static int | subscribe_channel (struct stasis_app *app, void *obj) |
static int | subscribe_endpoint (struct stasis_app *app, void *obj) |
static int | unsubscribe (struct stasis_app *app, const char *kind, const char *id, int terminate) |
Variables | |
struct stasis_app_event_source | bridge_event_source |
struct stasis_app_event_source | channel_event_source |
static channel_snapshot_monitor | channel_monitors [] |
struct stasis_app_event_source | endpoint_event_source |
int | global_debug |
Stasis application support.
Definition in file res/stasis/app.c.
struct stasis_app* app_create | ( | const char * | name, |
stasis_app_cb | handler, | ||
void * | data, | ||
enum stasis_app_subscription_model | subscription_model | ||
) |
Create a res_stasis application.
name | Name of the application. |
handler | Callback for messages sent to the application. |
data | Data pointer provided to the callback. |
subscription_model |
res_stasis
application. NULL | on error. |
Definition at line 915 of file res/stasis/app.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_bump, AO2_CONTAINER_ALLOC_OPT_DUPS_OBJ_REJECT, ao2_container_alloc_rbtree, ao2_ref, ast_add_extension(), ast_asprintf, ast_bridge_topic_all(), ast_channel_snapshot_type(), ast_context_find(), ast_context_find_or_create(), ast_endpoint_snapshot_type(), ast_free_ptr(), ast_strdup, stasis_app::bridge_router, stasis_app::data, stasis_app::forwards, stasis_app::handler, stasis_app::name, RAII_VAR, stasis_app::router, stasis_message_router_add(), stasis_message_router_add_cache_update(), stasis_message_router_set_formatters_default(), stasis_subscription_change_type(), STASIS_SUBSCRIPTION_FORMATTER_JSON, stasis_topic_create(), stasis_app::subscription_model, and stasis_app::topic.
void app_deactivate | ( | struct stasis_app * | app | ) |
Deactivates an application.
Any channels currently in the application remain active (since the app might come back), but new channels are rejected.
app | Application to deactivate. |
Definition at line 1061 of file res/stasis/app.c.
References stasis_app::data, stasis_app::handler, and stasis_app::name.
Referenced by stasis_app_unregister().
int app_is_active | ( | struct stasis_app * | app | ) |
Checks whether an app is active.
app | Application to check. |
True | (non-zero) if app is active. |
False | (zero) if app has been deactivated. |
Definition at line 1089 of file res/stasis/app.c.
References stasis_app::handler.
Referenced by stasis_app_exec().
int app_is_finished | ( | struct stasis_app * | app | ) |
Checks whether a deactivated app has no channels.
app | Application to check. |
True | (non-zero) if app is deactivated, and has no associated channels. |
False | (zero) otherwise. |
Definition at line 1100 of file res/stasis/app.c.
References ao2_container_count(), stasis_app::forwards, and stasis_app::handler.
Referenced by app_shutdown().
int app_is_subscribed_bridge_id | ( | struct stasis_app * | app, |
const char * | bridge_id | ||
) |
Test if an app is subscribed to a bridge.
app | Subscribing application. |
bridge_id | Id of bridge to check. |
True | (non-zero) if bridge is subscribed to app. |
False | (zero) if bridge is not subscribed. |
Definition at line 1499 of file res/stasis/app.c.
References stasis_app::forwards, and OBJ_SEARCH_KEY.
int app_is_subscribed_channel_id | ( | struct stasis_app * | app, |
const char * | channel_id | ||
) |
Test if an app is subscribed to a channel.
app | Subscribing application. |
channel_id | Id of channel to check. |
True | (non-zero) if channel is subscribed to app. |
False | (zero) if channel is not subscribed. |
Definition at line 1397 of file res/stasis/app.c.
References stasis_app::forwards, and OBJ_SEARCH_KEY.
int app_is_subscribed_endpoint_id | ( | struct stasis_app * | app, |
const char * | endpoint_id | ||
) |
Test if an app is subscribed to a endpoint.
app | Subscribing application. |
endpoint_id | Id of endpoint to check. |
True | (non-zero) if endpoint is subscribed to app. |
False | (zero) if endpoint is not subscribed. |
Definition at line 1596 of file res/stasis/app.c.
References stasis_app::forwards, and OBJ_SEARCH_KEY.
void app_send | ( | struct stasis_app * | app, |
struct ast_json * | message | ||
) |
Send a message to an application.
app | App to send the message to. |
message | Message to send. |
Definition at line 1033 of file res/stasis/app.c.
References ao2_bump, ast_eid_default, ast_eid_to_str(), ast_json_object_get(), ast_json_object_set(), ast_json_string_create(), ast_json_string_get(), stasis_app::data, stasis_app::handler, and stasis_app::name.
Referenced by app_update(), stasis_app_exec(), and stasis_app_send().
void app_shutdown | ( | struct stasis_app * | app | ) |
Tears down an application.
It should be finished before calling this.
app | Application to unsubscribe. |
Definition at line 1073 of file res/stasis/app.c.
References app_is_finished(), stasis_app::bridge_router, stasis_app::endpoint_router, stasis_app::router, and stasis_message_router_unsubscribe().
int app_subscribe_bridge | ( | struct stasis_app * | app, |
struct ast_bridge * | bridge | ||
) |
Add a bridge subscription to an existing channel subscription.
app | Application. |
bridge | Bridge to subscribe to. |
0 | on success. |
Non-zero | on error. |
Definition at line 1423 of file res/stasis/app.c.
References ao2_link_flags, ao2_ref, ast_debug, stasis_app::forwards, forwards_create_bridge(), app_forwards::interested, stasis_app::name, OBJ_NOLOCK, OBJ_SEARCH_KEY, and ast_bridge::uniqueid.
Referenced by control_swap_channel_in_bridge(), and stasis_app_exec().
int app_subscribe_channel | ( | struct stasis_app * | app, |
struct ast_channel * | chan | ||
) |
Subscribes an application to a channel.
app | Application. |
chan | Channel to subscribe to. |
0 | on success. |
Non-zero | on error. |
Definition at line 1276 of file res/stasis/app.c.
References ao2_link_flags, ao2_ref, ast_debug, stasis_app::forwards, forwards_create_channel(), app_forwards::interested, stasis_app::name, OBJ_NOLOCK, and OBJ_SEARCH_KEY.
Referenced by stasis_app_subscribe_channel().
int app_subscribe_endpoint | ( | struct stasis_app * | app, |
struct ast_endpoint * | endpoint | ||
) |
Subscribes an application to a endpoint.
app | Application. |
endpoint | Endpoint to subscribe to. |
0 | on success. |
Non-zero | on error. |
Definition at line 1526 of file res/stasis/app.c.
References ao2_link_flags, ao2_ref, ast_debug, ast_endpoint_get_id(), stasis_app::forwards, forwards_create_endpoint(), app_forwards::interested, messaging_app_subscribe_endpoint(), stasis_app::name, OBJ_NOLOCK, and OBJ_SEARCH_KEY.
struct ast_json* app_to_json | ( | const struct stasis_app * | app | ) |
Create a JSON representation of a stasis_app
.
app | The application |
NULL | on error |
Definition at line 1223 of file res/stasis/app.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_ref, ast_json_array_append(), ast_json_object_get(), ast_json_pack(), ast_json_string_create(), ast_json_unref(), bridges, endpoints, stasis_app::forwards, app_forwards::id, and stasis_app::name.
Referenced by stasis_app_object_to_json().
int app_unsubscribe_bridge | ( | struct stasis_app * | app, |
struct ast_bridge * | bridge | ||
) |
Cancel the bridge subscription for an application.
app | Subscribing application. |
bridge | Bridge to subscribe to. |
0 | on success. |
Non-zero | on error. |
Definition at line 1481 of file res/stasis/app.c.
References app_unsubscribe_bridge_id(), and ast_bridge::uniqueid.
Referenced by stasis_app_exec().
int app_unsubscribe_bridge_id | ( | struct stasis_app * | app, |
const char * | bridge_id | ||
) |
Cancel the subscription an app has for a bridge.
app | Subscribing application. |
bridge_id | Id of bridge to unsubscribe from. |
0 | on success. |
Non-zero | on error. |
Definition at line 1490 of file res/stasis/app.c.
Referenced by app_unsubscribe_bridge().
int app_unsubscribe_channel | ( | struct stasis_app * | app, |
struct ast_channel * | chan | ||
) |
Cancel the subscription an app has for a channel.
app | Subscribing application. |
chan | Channel to unsubscribe from. |
0 | on success. |
Non-zero | on error. |
Definition at line 1379 of file res/stasis/app.c.
References app_unsubscribe_channel_id().
Referenced by app_send_end_msg().
int app_unsubscribe_channel_id | ( | struct stasis_app * | app, |
const char * | channel_id | ||
) |
Cancel the subscription an app has for a channel.
app | Subscribing application. |
channel_id | Id of channel to unsubscribe from. |
0 | on success. |
Non-zero | on error. |
Definition at line 1388 of file res/stasis/app.c.
Referenced by app_unsubscribe_channel().
int app_unsubscribe_endpoint_id | ( | struct stasis_app * | app, |
const char * | endpoint_id | ||
) |
Cancel the subscription an app has for a endpoint.
app | Subscribing application. |
endpoint_id | Id of endpoint to unsubscribe from. |
0 | on success. |
Non-zero | on error. |
Definition at line 1587 of file res/stasis/app.c.
void app_update | ( | struct stasis_app * | app, |
stasis_app_cb | handler, | ||
void * | data | ||
) |
Update the handler and data for a res_stasis
application.
If app has been deactivated, this will reactivate it.
app | Application to update. |
handler | New application callback. |
data | New data pointer for the callback. |
Definition at line 1111 of file res/stasis/app.c.
References ao2_replace, app_send(), ast_json_pack(), ast_json_timeval(), ast_json_unref(), ast_tvnow(), stasis_app::data, stasis_app::handler, and stasis_app::name.
struct stasis_topic* ast_app_get_topic | ( | struct stasis_app * | app | ) |
Returns the stasis topic for an app.
app | Stasis app to get topic of |
Definition at line 1028 of file res/stasis/app.c.
References stasis_app::topic.
Referenced by app_send_end_msg(), and stasis_app_user_event().
|
static |
Forward a bridge's topics to an app
Definition at line 164 of file res/stasis/app.c.
References ao2_ref, ast_bridge_topic(), stasis_forward_all(), stasis_app::topic, app_forwards::topic_forward, and ast_bridge::uniqueid.
Referenced by app_subscribe_bridge().
|
static |
Forward a channel's topics to an app
Definition at line 136 of file res/stasis/app.c.
References ao2_ref, ast_channel_topic(), ast_channel_topic_all(), stasis_forward_all(), stasis_app::topic, and app_forwards::topic_forward.
Referenced by app_subscribe_channel().
|
static |
Forward a endpoint's topics to an app
Definition at line 199 of file res/stasis/app.c.
References ao2_ref, ast_endpoint_contact_state_type(), ast_endpoint_get_id(), ast_endpoint_state_type(), ast_endpoint_topic(), ast_endpoint_topic_all_cached(), ast_endpoint_topic_cached(), stasis_app::endpoint_router, stasis_forward_all(), stasis_message_router_add(), stasis_app::topic, app_forwards::topic_cached_forward, and app_forwards::topic_forward.
Referenced by app_subscribe_endpoint().
int stasis_app_event_allowed | ( | const char * | app_name, |
struct ast_json * | event | ||
) |
Check if the given event should be filtered.
Attempts first to find the event in the application's disallowed events list. If found then the event won't be sent to the remote. If not found in the disallowed list then a search is done to see if it can be found in the allowed list. If found the event message is sent, otherwise it is not sent.
app_name | The application name |
event | The event to check |
Definition at line 1734 of file res/stasis/app.c.
References ao2_ref, stasis_app::events_allowed, stasis_app::events_disallowed, and stasis_app_get_by_name().
Referenced by stasis_app_message_handler().
int stasis_app_event_filter_set | ( | struct stasis_app * | app, |
struct ast_json * | filter | ||
) |
Set the application's event type filter.
app | The application |
filter | The allowed and/or disallowed event filter |
Definition at line 1708 of file res/stasis/app.c.
Referenced by ast_ari_applications_filter().
struct ast_json* stasis_app_event_filter_to_json | ( | struct stasis_app * | app, |
struct ast_json * | json | ||
) |
Convert and add the app's event type filter(s) to the given json object.
app | The application |
json | The json object to add the filter data to |
Definition at line 1636 of file res/stasis/app.c.
References ast_json_array_create(), ast_json_object_set(), ast_json_ref(), stasis_app::events_allowed, and stasis_app::events_disallowed.
Referenced by stasis_app_object_to_json().
int stasis_app_get_debug | ( | struct stasis_app * | app | ) |
Get debug status of an application.
app | The app to check |
Definition at line 863 of file res/stasis/app.c.
References stasis_app::debug, and global_debug.
int stasis_app_get_debug_by_name | ( | const char * | app_name | ) |
Get debug status of an application.
app_name | The app_name to check |
Definition at line 868 of file res/stasis/app.c.
References ao2_ref, stasis_app::debug, global_debug, and stasis_app_get_by_name().
Referenced by stasis_app_message_handler().
const char* stasis_app_name | ( | const struct stasis_app * | app | ) |
Retrieve an application's name.
app | An application |
Definition at line 1151 of file res/stasis/app.c.
References stasis_app::name.
Referenced by app_compare(), app_hash(), app_send_end_msg(), and stasis_app_exec().
void stasis_app_set_debug | ( | struct stasis_app * | app, |
int | debug | ||
) |
Enable/disable request/response and event logging on an application.
app | The app to debug |
debug | If non-zero, enable debugging. If zero, disable. |
Definition at line 842 of file res/stasis/app.c.
References stasis_app::debug, and debug.
Referenced by stasis_app_set_global_debug().
void stasis_app_set_debug_by_name | ( | const char * | app_name, |
int | debug | ||
) |
Enable/disable request/response and event logging on an application.
app_name | The app name to debug |
debug | If non-zero, enable debugging. If zero, disable. |
Definition at line 851 of file res/stasis/app.c.
References stasis_app::debug, debug, and stasis_app_get_by_name().
void stasis_app_set_global_debug | ( | int | debug | ) |
Enable/disable request/response and event logging on all applications.
debug | If non-zero, enable debugging. If zero, disable. |
Definition at line 887 of file res/stasis/app.c.
References ao2_container_count(), ao2_iterator_init(), app_name(), debug, global_debug, stasis_app_get_all(), stasis_app_get_by_name(), and stasis_app_set_debug().
void stasis_app_to_cli | ( | const struct stasis_app * | app, |
struct ast_cli_args * | a | ||
) |
Dump properties of a stasis_app
to the CLI.
app | The application |
a | The CLI arguments |
Definition at line 1168 of file res/stasis/app.c.
References ao2_callback, ao2_container_count(), ao2_iterator_destroy(), ao2_ref, bridges, stasis_app::debug, endpoints, stasis_app::forwards, app_forwards::id, app_forwards::interested, stasis_app::name, OBJ_MULTIPLE, STASIS_APP_SUBSCRIBE_ALL, and stasis_app::subscription_model.
int global_debug |
Global debug flag. No need for locking
Definition at line 45 of file res/stasis/app.c.
Referenced by stasis_app_get_debug(), stasis_app_get_debug_by_name(), and stasis_app_set_global_debug().