75 cmp = strcasecmp(
name, cur->name);
120 length =
sizeof(*tmp) + strlen(
app) + 1;
176 if (strcasecmp(
tmp->name, cur->name) < 0) {
205 "%s -= Info about application '%s' =- %s\n\n"
232 "%s -= Info about application '%s' =- %s\n\n"
263 int app, no_registered_app = 1;
267 e->
command =
"core show application";
269 "Usage: core show application <application> [<application> [<application> [...]]]\n"
270 " Describes a particular application.\n";
289 if (strcasecmp(aa->name,
a->argv[
app])) {
294 no_registered_app = 0;
302 if (no_registered_app) {
303 ast_cli(
a->fd,
"Your application(s) is (are) not registered\n");
313 int like = 0, describing = 0;
319 e->
command =
"core show applications [like|describing]";
321 "Usage: core show applications [{like|describing} <text>]\n"
322 " List applications which are currently available.\n"
323 " If 'like', <text> will be a substring of the app name\n"
324 " If 'describing', <text> will be a substring of the description\n";
333 ast_cli(
a->fd,
"There are no registered applications\n");
339 if ((
a->argc == 5) && (!strcmp(
a->argv[3],
"like"))) {
341 }
else if ((
a->argc > 4) && (!strcmp(
a->argv[3],
"describing"))) {
346 if ((!like) && (!describing)) {
347 ast_cli(
a->fd,
" -= Registered Asterisk Applications =-\n");
349 ast_cli(
a->fd,
" -= Matching Asterisk Applications =-\n");
360 }
else if (describing) {
365 for (i = 4; i <
a->argc; i++) {
381 if ((!like) && (!describing)) {
382 ast_cli(
a->fd,
" -= %d Applications Registered =-\n",total_apps);
384 ast_cli(
a->fd,
" -= %d Applications Matching =-\n",total_match);
404 cmp = strcasecmp(
app, cur->name);
412 ast_verb(5,
"Unregistered application '%s'\n", cur->name);
435 size_t wordlen = strlen(
word);
439 cmp = strncasecmp(
word,
app->name, wordlen);
446 if (++which <=
state) {
477 const char *saved_c_appl;
478 const char *saved_c_data;
492 res =
app->execute(
c,
S_OR(data,
""));
493 if (
app->module && u)
Prototypes for public functions only of internal interest,.
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.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
#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.
char * strcasestr(const char *, const char *)
#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.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#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.
Registered applications container.
ast_app: A registered application
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.
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_printable(const char *bwinput, int withcolors)
Colorize and put delimiters (instead of tags) to the xmldoc output.