122 length =
sizeof(*tmp) + strlen(
app) + 1;
188 if (strcasecmp(tmp->
name, cur->
name) < 0) {
234 "%s -= Info about Application '%s' =- %s\n\n"
275 int app, no_registered_app = 1;
279 e->
command =
"core show application";
281 "Usage: core show application <application> [<application> [<application> [...]]]\n"
282 " Describes a particular application.\n";
301 if (strcasecmp(aa->
name,
a->argv[
app])) {
306 no_registered_app = 0;
314 if (no_registered_app) {
315 ast_cli(
a->fd,
"Your application(s) is (are) not registered\n");
325 int like = 0, describing = 0;
331 e->
command =
"core show applications [like|describing]";
333 "Usage: core show applications [{like|describing} <text>]\n"
334 " List applications which are currently available.\n"
335 " If 'like', <text> will be a substring of the app name\n"
336 " If 'describing', <text> will be a substring of the description\n";
345 ast_cli(
a->fd,
"There are no registered applications\n");
351 if ((
a->argc == 5) && (!strcmp(
a->argv[3],
"like"))) {
353 }
else if ((
a->argc > 4) && (!strcmp(
a->argv[3],
"describing"))) {
358 if ((!like) && (!describing)) {
359 ast_cli(
a->fd,
" -= Registered Asterisk Applications =-\n");
361 ast_cli(
a->fd,
" -= Matching Asterisk Applications =-\n");
372 }
else if (describing) {
377 for (i = 4; i <
a->argc; i++) {
393 if ((!like) && (!describing)) {
394 ast_cli(
a->fd,
" -= %d Applications Registered =-\n",total_apps);
396 ast_cli(
a->fd,
" -= %d Applications Matching =-\n",total_match);
416 cmp = strcasecmp(
app, cur->
name);
424 ast_verb(5,
"Unregistered application '%s'\n", cur->
name);
447 size_t wordlen = strlen(
word);
451 cmp = strncasecmp(
word,
app->name, wordlen);
458 if (++which <=
state) {
489 const char *saved_c_appl;
490 const char *saved_c_data;
504 res =
app->execute(
c,
S_OR(data,
""));
505 if (
app->module && u)
Prototypes for public functions only of internal interest,.
void ast_cli_unregister_multiple(void)
char * strcasestr(const char *, const char *)
Asterisk main include file. File version handling, generic pbx functions.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_calloc(num, len)
A wrapper for calloc()
void ast_channel_appl_set(struct ast_channel *chan, const char *value)
const char * ast_channel_data(const struct ast_channel *chan)
#define ast_channel_lock(chan)
void ast_channel_data_set(struct ast_channel *chan, const char *value)
const char * ast_channel_appl(const struct ast_channel *chan)
#define ast_channel_unlock(chan)
Standard Command Line Interface.
#define AST_CLI_DEFINE(fn, txt,...)
int ast_cli_completion_add(char *value)
Add a result to a request for completion options.
void ast_cli(int fd, const char *fmt,...)
#define ast_cli_register_multiple(e, len)
Register multiple commands.
static SQLHSTMT execute(struct odbc_obj *obj, void *data, int silent)
Common execution function for SQL queries.
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.
#define ast_verb(level,...)
A set of macros to manage forward-linked lists.
#define AST_RWLIST_REMOVE_CURRENT
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_RWLIST_TRAVERSE_SAFE_BEGIN
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized.
#define AST_RWLIST_TRAVERSE_SAFE_END
#define AST_RWLIST_TRAVERSE
#define AST_RWLIST_INSERT_TAIL
#define AST_RWLIST_INSERT_BEFORE_CURRENT
Asterisk module definitions.
struct ast_module_user * __ast_module_user_add(struct ast_module *, struct ast_channel *)
const char * ast_module_name(const struct ast_module *mod)
Get the name of a module.
void __ast_module_user_remove(struct ast_module *, struct ast_module_user *)
void unreference_cached_app(struct ast_app *app)
Core PBX routines and definitions.
void ast_str_substitute_variables(struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ)
int ast_rdlock_contexts(void)
Read locks the context list.
int ast_unlock_contexts(void)
Unlocks contexts.
int ast_register_application2(const char *app, int(*execute)(struct ast_channel *, const char *), const char *synopsis, const char *description, void *mod)
Dynamically register a new dial plan application.
const char * app_name(struct ast_app *app)
int pbx_exec(struct ast_channel *c, struct ast_app *app, const char *data)
Execute an application.
char * ast_complete_applications(const char *line, const char *word, int state)
Command completion for the list of installed applications.
int ast_pbx_exec_application(struct ast_channel *chan, const char *app_name, const char *app_args)
Execute an application.
static struct ast_cli_entry app_cli[]
static void unload_pbx_app(void)
static void print_app_docs(struct ast_app *aa, int fd)
static char * handle_show_application(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
'show application' CLI command implementation function...
int ast_unregister_application(const char *app)
Unregister an application.
struct ast_app * pbx_findapp(const char *app)
Look up an application.
static char * handle_show_applications(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static struct ast_app * pbx_findapp_nolock(const char *name)
Private include file for pbx.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define AST_STRING_FIELD(name)
Declare a string field.
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
String manipulation functions.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
char *attribute_pure ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
Registered applications container.
ast_app: A registered application
const ast_string_field since
const ast_string_field provided_by
struct ast_app::@406 list
struct ast_module *char name[0]
const ast_string_field description
const ast_string_field synopsis
const ast_string_field seealso
const ast_string_field syntax
const ast_string_field arguments
int(* execute)(struct ast_channel *chan, const char *data)
Main Channel structure associated with a channel.
descriptor for a cli entry.
struct ast_channel * chan
Support for dynamic strings.
Handy terminal functions for vt* terms.
const char * ast_term_reset(void)
Returns the terminal reset code.
const char * ast_term_color(int fgcolor, int bgcolor)
Return a color sequence string.
#define COLORIZE(fg, bg, str)
#define COLORIZE_FMT
Shortcut macros for coloring a set of text.
Asterisk XML Documentation API.
char * ast_xmldoc_build_description(const char *type, const char *name, const char *module)
Generate description documentation from XML.
char * ast_xmldoc_build_syntax(const char *type, const char *name, const char *module)
Get the syntax for a specified application or function.
char * ast_xmldoc_build_arguments(const char *type, const char *name, const char *module)
Generate the [arguments] tag based on type of node ('application', 'function' or 'agi') and name.
char * ast_xmldoc_build_synopsis(const char *type, const char *name, const char *module)
Generate synopsis documentation from XML.
char * ast_xmldoc_build_since(const char *type, const char *name, const char *module)
Parse the <since> node content.
ast_doc_src
From where the documentation come from, this structure is useful for use it inside application/functi...
char * ast_xmldoc_build_seealso(const char *type, const char *name, const char *module)
Parse the <see-also> node content.
char * ast_xmldoc_build_provided_by(const char *type, const char *name, const char *module)
Generate provided-by documentation from XML.
char * ast_xmldoc_printable(const char *bwinput, int withcolors)
Colorize and put delimiters (instead of tags) to the xmldoc output.