38 static char *app_verbose =
"Verbose";
39 static char *app_log =
"Log";
79 static int verbose_exec(
struct ast_channel *chan,
const char *data)
88 if (ast_strlen_zero(data)) {
95 args.msg = args.level;
99 if (sscanf(args.level,
"%30u", &vsize) != 1) {
101 ast_log(LOG_WARNING,
"'%s' is not a verboser number\n", args.level);
102 }
else if (4 < vsize) {
106 ast_verb(vsize,
"%s\n", args.msg);
111 static int log_exec(
struct ast_channel *chan,
const char *data)
121 if (ast_strlen_zero(data))
127 if (!strcasecmp(args.level,
"ERROR")) {
129 }
else if (!strcasecmp(args.level,
"WARNING")) {
130 lnum = __LOG_WARNING;
131 }
else if (!strcasecmp(args.level,
"NOTICE")) {
133 }
else if (!strcasecmp(args.level,
"DEBUG")) {
135 }
else if (!strcasecmp(args.level,
"VERBOSE")) {
136 lnum = __LOG_VERBOSE;
137 }
else if (!strcasecmp(args.level,
"DTMF")) {
144 snprintf(context,
sizeof(context),
"@ %s", ast_channel_context(chan));
145 snprintf(extension,
sizeof(extension),
"Ext. %s", ast_channel_exten(chan));
147 ast_log(lnum, extension, ast_channel_priority(chan), context,
"%s\n", args.msg);
149 ast_log(LOG_ERROR,
"Unknown log level: '%s'\n", args.level);
156 static int unload_module(
void)
166 static int load_module(
void)
Main Channel structure associated with a channel.
Asterisk main include file. File version handling, generic pbx functions.
int ast_logger_get_dynamic_level(const char *name)
Retrieve dynamic logging level id.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
int ast_unregister_application(const char *app)
Unregister an application.
General Asterisk PBX channel definitions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define AST_MAX_EXTENSION
structure to hold extensions
Support for logging to various files, console and syslog Configuration in file logger.conf.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define AST_APP_ARG(name)
Define an application argument.