Asterisk - The Open Source Telephony Project GIT-master-a63eec2
Loading...
Searching...
No Matches
Functions
cli_functions.h File Reference

PJSIP CLI functions header file. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int pjsip_channel_cli_register (void)
 Registers the channel cli commands.
 
void pjsip_channel_cli_unregister (void)
 Unregisters the channel cli commands.
 

Detailed Description

PJSIP CLI functions header file.

Author
George Joseph <george.joseph@fairview5.com> 

Definition in file cli_functions.h.

Function Documentation

◆ pjsip_channel_cli_register()

int pjsip_channel_cli_register ( void  )

Registers the channel cli commands.

Since
13.9.0
Return values
0on success
-1on failure

Definition at line 462 of file cli_commands.c.

463{
465 if (!channel_formatter) {
466 ast_log(LOG_ERROR, "Unable to allocate memory for channel_formatter\n");
467 return -1;
468 }
469 channel_formatter->name = "channel";
476
480 ast_log(LOG_ERROR, "Unable to allocate memory for channelstats_formatter\n");
481 return -1;
482 }
483 channelstats_formatter->name = "channelstat";
490
494
495 return 0;
496}
#define ast_log
Definition astobj2.c:42
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition astobj2.h:459
#define ao2_alloc(data_size, destructor_fn)
Definition astobj2.h:409
#define ast_cli_register_multiple(e, len)
Register multiple commands.
Definition cli.h:265
static int cli_channelstats_print_header(void *obj, void *arg, int flags)
static struct ast_cli_entry cli_commands[]
static int cli_channelstats_print_body(void *obj, void *arg, int flags)
static const char * cli_channel_get_id(const void *obj)
static int cli_channel_print_header(void *obj, void *arg, int flags)
static int cli_channelstats_iterate(void *endpoint, ao2_callback_fn callback, void *arg)
static struct ao2_container * cli_channelstats_get_container(const char *regex)
struct ast_sip_cli_formatter_entry * channelstats_formatter
struct ast_sip_cli_formatter_entry * channel_formatter
static int cli_channel_iterate(void *endpoint, ao2_callback_fn callback, void *arg)
static struct ao2_container * cli_channel_get_container(const char *regex)
static void * cli_channel_retrieve_by_id(const char *id)
static int cli_channel_print_body(void *obj, void *arg, int flags)
#define LOG_ERROR
int ast_sip_register_cli_formatter(struct ast_sip_cli_formatter_entry *formatter)
Registers a CLI formatter.
Definition pjsip_cli.c:310
#define NULL
Definition resample.c:96
CLI Formatter Registry Entry.
int(* iterate)(void *container, ao2_callback_fn callback, void *args)
ao2_callback_fn * print_header
void *(* retrieve_by_id)(const char *id)
const char *(* get_id)(const void *obj)
const char * name
ao2_callback_fn * print_body
struct ao2_container *(* get_container)(const char *regex)
#define ARRAY_LEN(a)
Definition utils.h:703

References ao2_alloc, ao2_ref, ARRAY_LEN, ast_cli_register_multiple, ast_log, ast_sip_register_cli_formatter(), channel_formatter, channelstats_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(), cli_commands, 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().

◆ pjsip_channel_cli_unregister()

void pjsip_channel_cli_unregister ( void  )

Unregisters the channel cli commands.

Since
13.9.0

Definition at line 498 of file cli_commands.c.

499{
503}
void ast_cli_unregister_multiple(void)
Definition ael_main.c:408
int ast_sip_unregister_cli_formatter(struct ast_sip_cli_formatter_entry *formatter)
Unregisters a CLI formatter.
Definition pjsip_cli.c:326

References ARRAY_LEN, ast_cli_unregister_multiple(), ast_sip_unregister_cli_formatter(), channel_formatter, channelstats_formatter, and cli_commands.

Referenced by unload_module().