Database access functions.
More...
Go to the source code of this file.
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Database Access Functions" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } |
|
static struct ast_module_info * | ast_module_info = &__mod_info |
|
static const char | d_app [] = "DBdel" |
|
static const char | dt_app [] = "DBdeltree" |
|
static void __reg_module |
( |
void |
| ) |
|
|
static |
static void __unreg_module |
( |
void |
| ) |
|
|
static |
static int del_exec |
( |
struct ast_channel * |
chan, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 122 of file app_db.c.
References ast_db_del(), ast_debug, ast_log(), ast_strdupa, ast_verb, LOG_WARNING, and strsep().
Referenced by load_module().
124 char *argv, *family, *key;
125 static int deprecation_warning = 0;
127 if (!deprecation_warning) {
128 deprecation_warning = 1;
129 ast_log(
LOG_WARNING,
"The DBdel application has been deprecated in favor of the DB_DELETE dialplan function!\n");
134 if (strchr(argv,
'/')) {
135 family =
strsep(&argv,
"/");
136 key =
strsep(&argv,
"\0");
137 if (!family || !key) {
138 ast_debug(1,
"Ignoring; Syntax error in argument\n");
141 ast_verb(3,
"DBdel: family=%s, key=%s\n", family, key);
143 ast_verb(3,
"DBdel: Error deleting key from database.\n");
145 ast_debug(1,
"Ignoring, no parameters\n");
char * strsep(char **str, const char *delims)
#define ast_verb(level,...)
#define ast_debug(level,...)
Log a DEBUG message.
#define ast_strdupa(s)
duplicate a string in memory from the stack
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
int ast_db_del(const char *family, const char *key)
Delete entry in astdb.
static int deltree_exec |
( |
struct ast_channel * |
chan, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 89 of file app_db.c.
References ast_db_deltree(), ast_debug, ast_strdupa, ast_strlen_zero(), ast_verb, and strsep().
Referenced by load_module().
91 char *argv, *family, *keytree;
95 if (strchr(argv,
'/')) {
96 family =
strsep(&argv,
"/");
97 keytree =
strsep(&argv,
"\0");
98 if (!family || !keytree) {
99 ast_debug(1,
"Ignoring; Syntax error in argument\n");
110 ast_verb(3,
"DBdeltree: family=%s, keytree=%s\n", family, keytree);
112 ast_verb(3,
"DBdeltree: family=%s\n", family);
116 ast_verb(3,
"DBdeltree: Error deleting key from database.\n");
char * strsep(char **str, const char *delims)
#define ast_verb(level,...)
#define ast_debug(level,...)
Log a DEBUG message.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_strdupa(s)
duplicate a string in memory from the stack
int ast_db_deltree(const char *family, const char *keytree)
Delete one or more entries in astdb If both parameters are NULL, the entire database will be purged...
static int load_module |
( |
void |
| ) |
|
|
static |
Definition at line 161 of file app_db.c.
References ast_register_application_xml, del_exec(), and deltree_exec().
static const char dt_app[]
static const char d_app[]
static int deltree_exec(struct ast_channel *chan, const char *data)
static int del_exec(struct ast_channel *chan, const char *data)
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
static int unload_module |
( |
void |
| ) |
|
|
static |
Definition at line 151 of file app_db.c.
References ast_unregister_application().
static const char dt_app[]
int ast_unregister_application(const char *app)
Unregister an application.
static const char d_app[]
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Database Access Functions" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } |
|
static |
const char d_app[] = "DBdel" |
|
static |
const char dt_app[] = "DBdeltree" |
|
static |