40 "Usage: ari show status\n" 41 " Shows all ARI settings\n";
56 ast_cli(a->
fd,
"Error getting ARI configuration\n");
63 switch (
conf->general->format) {
72 ast_cli(a->
fd,
"Auth realm: %s\n",
conf->general->auth_realm);
73 ast_cli(a->
fd,
"Allowed Origins: %s\n",
conf->general->allowed_origins);
98 "Usage: ari show users\n" 99 " Shows all ARI users\n";
113 ast_cli(a->
fd,
"Error getting ARI configuration\n");
153 ast_cli(a->
fd,
"Error getting ARI configuration\n");
182 "Usage: ari show user <username>\n" 183 " Shows a specific ARI user\n";
198 ast_cli(a->
fd,
"Error getting ARI configuration\n");
222 "Usage: ari mkpasswd <password>\n" 223 " Encrypts a password for use in ari.conf\n" 224 " Be aware that the password will be shown in the\n" 225 " command line history. The mkpasswd shell command\n" 226 " may be preferable.\n" 241 ast_cli(a->
fd,
"Failed to encrypt password\n");
246 "; Copy the following two lines into ari.conf\n");
247 ast_cli(a->
fd,
"password_format = crypt\n");
248 ast_cli(a->
fd,
"password = %s\n", crypted);
263 "Usage: ari show apps\n" 264 " Lists all registered applications.\n" 279 ast_cli(a->
fd,
"Unable to retrieve registered applications!\n");
284 ast_cli(a->
fd,
"=========================\n");
328 ast_cli(a->
fd,
"Error getting ARI applications\n");
351 "Usage: ari show app <application>\n" 352 " Provide detailed information about a registered application.\n" 386 "Usage: ari set debug <application|all> <on|off>\n" 387 " Enable or disable debugging on a specific application.\n" 400 debug = !strcmp(a->
argv[4],
"on");
402 if (!strcmp(a->
argv[3],
"all")) {
404 ast_cli(a->
fd,
"Debugging on all applications %s\n",
405 debug ?
"enabled" :
"disabled");
417 debug ?
"enabled" :
"disabled");
static char * ari_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
struct stasis_app * stasis_app_get_by_name(const char *name)
Retrieve a handle to a Stasis application by its name.
#define AST_CLI_DEFINE(fn, txt,...)
Asterisk main include file. File version handling, generic pbx functions.
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
Registered applications container.
struct ast_ari_conf * ast_ari_config_get(void)
Get the current ARI configuration.
static char * complete_ari_show_user(struct ast_cli_args *a)
descriptor for a cli entry.
static int debug
Global debug status.
#define ao2_callback(c, flags, cb_fn, arg)
All configuration options for ARI.
static char * ari_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
void stasis_app_to_cli(const struct stasis_app *app, struct ast_cli_args *a)
Dump properties of a stasis_app to the CLI.
static int complete_ari_user_search(void *obj, void *arg, void *data, int flags)
#define ast_cli_register_multiple(e, len)
Register multiple commands.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
#define ast_strdup(str)
A wrapper for strdup()
static char * ari_mkpasswd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
void ast_cli(int fd, const char *fmt,...)
#define ast_strlen_zero(foo)
All configuration options for statsd client.
static char * ari_show_apps(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static struct ast_cli_entry cli_ari[]
The arg parameter is a partial search key similar to OBJ_SEARCH_KEY.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
const char * stasis_app_name(const struct stasis_app *app)
Retrieve an application's name.
#define ao2_ref(o, delta)
static char * complete_ari_app(struct ast_cli_args *a, int include_all)
int ast_ari_cli_register(void)
Register CLI commands for ARI.
Per-user configuration options.
Internal API's for res_ari.
#define ao2_callback_data(container, flags, cb_fn, arg, data)
#define ao2_iterator_next(iter)
void stasis_app_set_global_debug(int debug)
Enable/disable request/response and event logging on all applications.
struct ao2_container * stasis_app_get_all(void)
Gets the names of all registered Stasis applications.
static char * ari_show_app(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
#define ao2_find(container, arg, flags)
structure to hold users read from users.conf
static char * ari_show_user(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static int show_users_cb(void *obj, void *arg, int flags)
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
static char * complete_ari_user(struct ast_cli_args *a)
Standard Command Line Interface.
void ast_ari_cli_unregister(void)
Unregister CLI commands for ARI.
static char * ari_show_users(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
void stasis_app_set_debug(struct stasis_app *app, int debug)
Enable/disable request/response and event logging on an application.
Stasis Application API. See Stasis Application API for detailed documentation.
#define AST_CLI_YESNO(x)
Return Yes or No depending on the argument.
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
int ast_str_container_add(struct ao2_container *str_container, const char *add)
Adds a string to a string container allocated by ast_str_container_alloc.
char * ast_crypt_encrypt(const char *key)
Asterisk wrapper around crypt(3) for encrypting passwords.
static int complete_ari_app_search(void *obj, void *arg, void *data, int flags)