Newer
Older
int res = -1;
char db[256]="";
char table[256]="";
va_list ap;
va_start(ap, lookup);
eng = find_engine(family, db, sizeof(db), table, sizeof(table));
if (eng && eng->update_func)
res = eng->update_func(db, table, keyfield, lookup, ap);
va_end(ap);
return res;
static int config_command(int fd, int argc, char **argv)
{
struct ast_config_map *map;
ast_mutex_lock(&config_lock);
ast_cli(fd, "\n\n");
for (eng = config_engine_list; eng; eng = eng->next) {
ast_cli(fd, "\nConfig Engine: %s\n", eng->name);
for (map = config_maps; map; map = map->next)
if (!strcasecmp(map->driver, eng->name)) {
ast_cli(fd, "===> %s (db=%s, table=%s)\n", map->name, map->database,
map->table ? map->table : map->name);
break;
}
}
static struct ast_cli_entry config_command_struct = {
{ "show", "config", "mappings" }, config_command, "Show Config mappings (file names to config engines)"
};
return ast_cli_register(&config_command_struct);
}