Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_ua.h>
#include "asterisk/res_pjsip.h"
#include "include/res_pjsip_private.h"
#include "asterisk/res_pjsip_cli.h"
#include "asterisk/acl.h"
#include "asterisk/cli.h"
#include "asterisk/astobj2.h"
#include "asterisk/hashtab.h"
#include "asterisk/utils.h"
#include "asterisk/sorcery.h"
Go to the source code of this file.
Functions | |
int | ast_sip_cli_print_sorcery_objectset (void *obj, void *arg, int flags) |
Prints a sorcery object's ast_variable list. More... | |
char * | ast_sip_cli_traverse_objects (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
void | ast_sip_destroy_cli (void) |
int | ast_sip_initialize_cli (void) |
struct ast_sip_cli_formatter_entry * | ast_sip_lookup_cli_formatter (const char *name) |
Looks up a CLI formatter by type. More... | |
int | ast_sip_register_cli_formatter (struct ast_sip_cli_formatter_entry *formatter) |
Registers a CLI formatter. More... | |
int | ast_sip_unregister_cli_formatter (struct ast_sip_cli_formatter_entry *formatter) |
Unregisters a CLI formatter. More... | |
static void | complete_show_sorcery_object (struct ao2_container *container, struct ast_sip_cli_formatter_entry *formatter_entry, const char *word) |
static void | dump_str_and_free (int fd, struct ast_str *buf) |
static int | formatter_compare (void *obj, void *arg, int flags) |
static int | formatter_hash (const void *obj, int flags) |
static int | formatter_sort (const void *obj, const void *arg, int flags) |
static char * | handle_pjsip_show_version (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Variables | |
static struct ao2_container * | formatter_registry |
static struct ast_cli_entry | pjsip_cli [] |
int ast_sip_cli_print_sorcery_objectset | ( | void * | obj, |
void * | arg, | ||
int | flags | ||
) |
Prints a sorcery object's ast_variable list.
obj | The sorcery object |
arg | The ast_sip_cli_context. |
0 | Success, non-zero on failure |
Definition at line 36 of file pjsip_cli.c.
References ast_alloca, ast_sip_get_sorcery(), ast_sorcery_objectset_create, ast_str_append(), ast_variable_list_sort(), ast_variables_destroy(), context, ast_variable::name, ast_variable::next, ast_sip_cli_context::output_buffer, and ast_variable::value.
Referenced by cli_aor_print_body(), cli_endpoint_print_body(), cli_print_body(), sip_cli_print_global(), and sip_cli_print_system().
char* ast_sip_cli_traverse_objects | ( | struct ast_cli_entry * | e, |
int | cmd, | ||
struct ast_cli_args * | a | ||
) |
Definition at line 109 of file pjsip_cli.c.
References ao2_callback, ao2_cleanup, ao2_container_count(), ast_cli_args::argc, ast_cli_args::argv, ast_cli(), ast_copy_string(), ast_ends_with(), ast_free, ast_log, ast_sip_lookup_cli_formatter(), ast_str_append(), ast_str_create, ast_strlen_zero, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::cmda, complete_show_sorcery_object(), container, dump_str_and_free(), ast_cli_args::fd, ast_sip_cli_context::indent_level, LOG_ERROR, NULL, OBJ_NODATA, ast_sip_cli_context::output_buffer, RAII_VAR, ast_sip_cli_context::recurse, regex(), ast_sip_cli_context::show_details_only_level_0, and ast_cli_args::word.
Referenced by my_cli_traverse_objects().
void ast_sip_destroy_cli | ( | void | ) |
Definition at line 375 of file pjsip_cli.c.
References ao2_ref, ARRAY_LEN, and ast_cli_unregister_multiple().
Referenced by ast_res_pjsip_destroy_configuration().
int ast_sip_initialize_cli | ( | void | ) |
Definition at line 360 of file pjsip_cli.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_container_alloc_hash, ARRAY_LEN, ast_cli_register_multiple, ast_log, formatter_compare(), formatter_hash(), formatter_sort(), and LOG_ERROR.
Referenced by ast_res_pjsip_initialize_configuration().
struct ast_sip_cli_formatter_entry* ast_sip_lookup_cli_formatter | ( | const char * | name | ) |
Looks up a CLI formatter by type.
name | The name of the formatter, usually the sorcery object type. |
Pointer | to formatter entry structure |
Definition at line 305 of file pjsip_cli.c.
References ao2_find, OBJ_NOLOCK, and OBJ_SEARCH_KEY.
Referenced by ast_sip_cli_traverse_objects(), cli_aor_print_body(), cli_aor_print_header(), cli_endpoint_print_child_body(), and cli_endpoint_print_child_header().
int ast_sip_register_cli_formatter | ( | struct ast_sip_cli_formatter_entry * | formatter | ) |
Registers a CLI formatter.
name | The name of the formatter, usually the sorcery object type. |
formatter | An ao2_callback_fn that outputs the formatted data. |
0 | Success, non-zero on failure |
Definition at line 310 of file pjsip_cli.c.
References ao2_link, ast_assert, ast_sip_cli_formatter_entry::get_container, ast_sip_cli_formatter_entry::get_id, ast_sip_cli_formatter_entry::iterate, 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 ast_res_pjsip_initialize_configuration(), ast_sip_initialize_distributor(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_location(), ast_sip_initialize_sorcery_transport(), load_module(), and pjsip_channel_cli_register().
int ast_sip_unregister_cli_formatter | ( | struct ast_sip_cli_formatter_entry * | formatter | ) |
Unregisters a CLI formatter.
name | The name of the formatter, usually the sorcery object type. |
0 | Success, non-zero on failure |
Definition at line 326 of file pjsip_cli.c.
References ao2_ref, ao2_unlink_flags, ao2_unlock, ao2_wrlock, and OBJ_NOLOCK.
Referenced by ast_res_pjsip_destroy_configuration(), ast_sip_destroy_distributor(), ast_sip_destroy_sorcery_auth(), ast_sip_destroy_sorcery_location(), ast_sip_destroy_sorcery_transport(), pjsip_channel_cli_unregister(), and unload_module().
|
static |
Definition at line 85 of file pjsip_cli.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_t_iterator_next, ao2_t_ref, ast_cli_completion_add(), ast_strdup, ast_sip_cli_formatter_entry::get_id, and ast_variable::object.
Referenced by ast_sip_cli_traverse_objects().
|
static |
Definition at line 103 of file pjsip_cli.c.
References ast_cli(), ast_free, and ast_str_buffer().
Referenced by ast_sip_cli_traverse_objects().
|
static |
Definition at line 264 of file pjsip_cli.c.
References CMP_MATCH, CMP_STOP, ast_sip_cli_formatter_entry::name, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by ast_sip_initialize_cli().
|
static |
Definition at line 293 of file pjsip_cli.c.
References ast_str_hash(), ast_sip_cli_formatter_entry::name, OBJ_SEARCH_KEY, and OBJ_SEARCH_OBJECT.
Referenced by ast_sip_initialize_cli().
|
static |
Definition at line 239 of file pjsip_cli.c.
References ast_sip_cli_formatter_entry::name, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by ast_sip_initialize_cli().
|
static |
Definition at line 338 of file pjsip_cli.c.
References ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 34 of file pjsip_cli.c.
|
static |
Definition at line 356 of file pjsip_cli.c.