Asterisk - The Open Source Telephony Project
18.5.0
|
PJSIP channel CLI functions. More...
#include "asterisk.h"
#include <pjsip.h>
#include <pjlib.h>
#include <pjsip_ua.h>
#include "asterisk/astobj2.h"
#include "asterisk/channel.h"
#include "asterisk/format.h"
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_session.h"
#include "asterisk/res_pjsip_cli.h"
#include "asterisk/stasis.h"
#include "asterisk/time.h"
#include "include/chan_pjsip.h"
#include "include/cli_functions.h"
Go to the source code of this file.
Functions | |
static int | cli_channel_compare (void *obj, void *arg, int flags) |
static struct ao2_container * | cli_channel_get_container (const char *regex) |
static const char * | cli_channel_get_id (const void *obj) |
static int | cli_channel_iterate (void *endpoint, ao2_callback_fn callback, void *arg) |
static int | cli_channel_print_body (void *obj, void *arg, int flags) |
static int | cli_channel_print_header (void *obj, void *arg, int flags) |
static void * | cli_channel_retrieve_by_id (const char *id) |
static int | cli_channel_sort (const void *obj, const void *arg, int flags) |
static int | cli_channelstats_compare (void *obj, void *arg, int flags) |
static struct ao2_container * | cli_channelstats_get_container (const char *regex) |
static int | cli_channelstats_iterate (void *endpoint, ao2_callback_fn callback, void *arg) |
static int | cli_channelstats_print_body (void *obj, void *arg, int flags) |
static int | cli_channelstats_print_header (void *obj, void *arg, int flags) |
static int | cli_channelstats_sort (const void *obj, const void *arg, int flags) |
static int | cli_filter_channels (void *obj, void *arg, int flags) |
static int | cli_message_to_snapshot (void *obj, void *arg, int flags) |
static struct ao2_container * | get_container (const char *regex, ao2_sort_fn sort_fn, ao2_callback_fn compare_fn) |
int | pjsip_channel_cli_register (void) |
Registers the channel cli commands. More... | |
void | pjsip_channel_cli_unregister (void) |
Unregisters the channel cli commands. More... | |
Variables | |
struct ast_sip_cli_formatter_entry * | channel_formatter |
struct ast_sip_cli_formatter_entry * | channelstats_formatter |
static struct ast_cli_entry | cli_commands [] |
PJSIP channel CLI functions.
Definition in file cli_commands.c.
|
static |
Definition at line 109 of file cli_commands.c.
References ast_channel_snapshot::base, CMP_MATCH, CMP_STOP, ast_channel_snapshot_base::name, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by cli_channel_get_container().
|
static |
Definition at line 225 of file cli_commands.c.
References cli_channel_compare(), cli_channel_sort(), and get_container().
Referenced by pjsip_channel_cli_register().
|
static |
Definition at line 235 of file cli_commands.c.
References ast_channel_snapshot::base, and ast_channel_snapshot_base::name.
Referenced by pjsip_channel_cli_register().
|
static |
Definition at line 45 of file cli_commands.c.
References ast_sip_for_each_channel().
Referenced by pjsip_channel_cli_register().
|
static |
Definition at line 271 of file cli_commands.c.
References ast_channel_snapshot_dialplan::appl, ast_assert, ast_format_duration_hh_mm_ss(), ast_state2str(), ast_str_append(), ast_tvnow(), ast_channel_snapshot::base, CLI_INDENT_TO_SPACES, CLI_LAST_TABSTOP, ast_channel_snapshot::connected, context, ast_channel_snapshot_base::creationtime, ast_channel_snapshot::dialplan, ast_channel_snapshot_dialplan::exten, ast_sip_cli_context::indent_level, ast_channel_snapshot_connected::name, ast_channel_snapshot_base::name, NULL, ast_channel_snapshot_connected::number, ast_sip_cli_context::output_buffer, ast_sip_cli_context::recurse, and ast_channel_snapshot::state.
Referenced by pjsip_channel_cli_register().
|
static |
Definition at line 247 of file cli_commands.c.
References ast_assert, ast_str_append(), CLI_HEADER_FILLER, CLI_INDENT_TO_SPACES, CLI_LAST_TABSTOP, context, ast_sip_cli_context::indent_level, NULL, ast_sip_cli_context::output_buffer, and ast_sip_cli_context::recurse.
Referenced by pjsip_channel_cli_register().
|
static |
Definition at line 242 of file cli_commands.c.
References ast_channel_snapshot_get_latest_by_name().
Referenced by pjsip_channel_cli_register().
|
static |
Definition at line 55 of file cli_commands.c.
References ast_channel_snapshot::base, ast_channel_snapshot_base::name, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by cli_channel_get_container().
|
static |
Definition at line 138 of file cli_commands.c.
References ast_channel_snapshot::base, ast_channel_snapshot::bridge, CMP_MATCH, CMP_STOP, ast_channel_snapshot_bridge::id, ast_channel_snapshot_base::name, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by cli_channelstats_get_container().
|
static |
Definition at line 230 of file cli_commands.c.
References cli_channelstats_compare(), cli_channelstats_sort(), and get_container().
Referenced by pjsip_channel_cli_register().
|
static |
Definition at line 50 of file cli_commands.c.
References ast_sip_for_each_channel().
Referenced by pjsip_channel_cli_register().
|
static |
Definition at line 337 of file cli_commands.c.
References ast_sip_session::active_media_state, ao2_cleanup, ast_assert, ast_channel_get_by_name(), ast_channel_lock, ast_channel_rawreadformat(), ast_channel_tech_pvt(), ast_channel_unlock, ast_copy_string(), ast_format_duration_hh_mm_ss(), ast_format_get_name(), AST_MEDIA_TYPE_AUDIO, ast_rtp_instance_get_stats(), AST_RTP_INSTANCE_STAT_ALL, ast_str_append(), ast_strdupa, ast_tvnow(), ast_channel_snapshot::base, ast_channel_snapshot::bridge, context, ast_channel_snapshot_base::creationtime, ast_sip_session_media_state::default_session, ast_channel_snapshot_bridge::id, MIN, ast_channel_snapshot_base::name, ast_rtp_instance_stats::normdevrtt, NULL, ast_sip_cli_context::output_buffer, ast_sip_session_media::rtp, ast_rtp_instance_stats::rxcount, ast_rtp_instance_stats::rxjitter, ast_rtp_instance_stats::rxploss, session, ast_sip_channel_pvt::session, ast_rtp_instance_stats::txcount, ast_rtp_instance_stats::txjitter, and ast_rtp_instance_stats::txploss.
Referenced by pjsip_channel_cli_register().
|
static |
Definition at line 323 of file cli_commands.c.
References ast_assert, ast_str_append(), context, NULL, and ast_sip_cli_context::output_buffer.
Referenced by pjsip_channel_cli_register().
|
static |
Definition at line 80 of file cli_commands.c.
References ast_channel_snapshot::base, ast_channel_snapshot::bridge, ast_channel_snapshot_bridge::id, ast_channel_snapshot_base::name, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by cli_channelstats_get_container().
|
static |
Definition at line 183 of file cli_commands.c.
References ast_channel_snapshot_dialplan::appl, ast_channel_snapshot::base, CMP_MATCH, ast_channel_snapshot::dialplan, ast_channel_snapshot_base::name, and NULL.
Referenced by get_container().
|
static |
Definition at line 170 of file cli_commands.c.
References ao2_link, ast_channel_snapshot::base, CMP_MATCH, and ast_channel_snapshot_base::type.
Referenced by get_container().
|
static |
Definition at line 196 of file cli_commands.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_callback, ao2_cleanup, ao2_container_alloc_list, ao2_ref, ast_channel_cache_by_name(), ast_strlen_zero, cli_filter_channels(), cli_message_to_snapshot(), NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, and RAII_VAR.
Referenced by cli_channel_get_container(), and cli_channelstats_get_container().
int pjsip_channel_cli_register | ( | void | ) |
Registers the channel cli commands.
0 | on success |
-1 | on failure |
Definition at line 448 of file cli_commands.c.
References ao2_alloc, ao2_ref, ARRAY_LEN, ast_cli_register_multiple, ast_log, ast_sip_register_cli_formatter(), cli_channel_get_container(), cli_channel_get_id(), cli_channel_iterate(), cli_channel_print_body(), cli_channel_print_header(), cli_channel_retrieve_by_id(), cli_channelstats_get_container(), cli_channelstats_iterate(), cli_channelstats_print_body(), cli_channelstats_print_header(), ast_sip_cli_formatter_entry::get_container, ast_sip_cli_formatter_entry::get_id, ast_sip_cli_formatter_entry::iterate, LOG_ERROR, ast_sip_cli_formatter_entry::name, NULL, ast_sip_cli_formatter_entry::print_body, ast_sip_cli_formatter_entry::print_header, and ast_sip_cli_formatter_entry::retrieve_by_id.
Referenced by load_module().
void pjsip_channel_cli_unregister | ( | void | ) |
Unregisters the channel cli commands.
Definition at line 484 of file cli_commands.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), and ast_sip_unregister_cli_formatter().
Referenced by unload_module().
struct ast_sip_cli_formatter_entry* channel_formatter |
Definition at line 446 of file cli_commands.c.
struct ast_sip_cli_formatter_entry* channelstats_formatter |
Definition at line 445 of file cli_commands.c.
|
static |
Definition at line 422 of file cli_commands.c.