163                char *parse, 
char *
buf, 
size_t len)
 
 
  233                  char *parse, 
char *
buf, 
size_t len)
 
 
  272    size_t parselen = strlen(parse);
 
  275    const char *
last = 
"";
 
  278    while (parse[0] == 
'/') {
 
  282    while (parse[parselen - 1] == 
'/') {
 
  283        parse[--parselen] = 
'\0';
 
  293    for (; dbe; dbe = dbe->
next) {
 
  295        char *curkey = &dbe->
key[parselen + 1], *slash;
 
  296        if (*curkey == 
'/') {
 
  300        if ((slash = strchr(curkey, 
'/'))) {
 
  305        if (!strcasecmp(
last, curkey)) {
 
  310        if (orig_dbe != dbe) {
 
 
  327    size_t parselen = strlen(parse);
 
  329    const char *
last = 
"";
 
  333    while (parse[0] == 
'/') {
 
  337    while (parse[parselen - 1] == 
'/') {
 
  338        parse[--parselen] = 
'\0';
 
  343        snprintf(
buf, 
len, 
"%d", keycount);
 
  347    for (; dbe; dbe = dbe->
next) {
 
  349        char *curkey = &dbe->
key[parselen + 1], *slash;
 
  350        if (*curkey == 
'/') {
 
  354        if ((slash = strchr(curkey, 
'/'))) {
 
  359        if (!strcasecmp(
last, curkey)) {
 
  367    snprintf(
buf, 
len, 
"%d", keycount);
 
 
  372    .
name = 
"DB_KEYCOUNT",
 
 
  377                  char *parse, 
char *
buf, 
size_t len)
 
  399        ast_debug(1, 
"DB_DELETE: %s/%s not found in database.\n", 
args.family, 
args.key);
 
  402            ast_debug(1, 
"DB_DELETE: %s/%s could not be deleted from the database\n", 
args.family, 
args.key);
 
 
struct sla_ringing_trunk * last
Persistent data storage (akin to *doze registry)
int ast_db_put(const char *family, const char *key, const char *value)
Store value addressed by family/key.
int ast_db_get(const char *family, const char *key, char *value, int valuelen)
Get key value specified by family/key.
int ast_db_del(const char *family, const char *key)
Delete entry in astdb.
struct ast_db_entry * ast_db_gettree(const char *family, const char *keytree)
Get a list of values within the astdb tree.
void ast_db_freetree(struct ast_db_entry *entry)
Free structure created by ast_db_gettree()
Asterisk main include file. File version handling, generic pbx functions.
General Asterisk PBX channel definitions.
static struct ast_custom_function db_function
static int function_db_read(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
static int function_db_delete_write(struct ast_channel *chan, const char *cmd, char *parse, const char *value)
Wrapper to execute DB_DELETE from a write operation. Allows execution even if live_dangerously is dis...
static int function_db_exists(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
static int function_db_keycount(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
static struct ast_custom_function db_keys_function
static struct ast_custom_function db_delete_function
static int function_db_keys(struct ast_channel *chan, const char *cmd, char *parse, struct ast_str **result, ssize_t maxlen)
static struct ast_custom_function db_exists_function
static struct ast_custom_function db_keycount_function
static int load_module(void)
static int function_db_write(struct ast_channel *chan, const char *cmd, char *parse, const char *value)
static int unload_module(void)
static int function_db_delete(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_NONSTANDARD_APP_ARGS(args, parse, sep)
Performs the 'nonstandard' argument separation process for an application.
#define ast_debug(level,...)
Log a DEBUG message.
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Core PBX routines and definitions.
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name.
#define ast_custom_function_register_escalating(acf, escalation)
Register a custom function which requires escalated privileges.
#define ast_custom_function_register(acf)
Register a custom function.
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
char * ast_str_append_escapecommas(struct ast_str **buf, ssize_t maxlen, const char *src, size_t maxsrc)
Append a non-NULL terminated substring to the end of a dynamic string, with escaping of commas.
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
Main Channel structure associated with a channel.
Data structure associated with a custom dialplan function.
struct ast_db_entry * next
Support for dynamic strings.