Display a message if no config mappings are found with "core show config mappings".

Closes issue #11704, patch by kshumard.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jason Parker 2008-01-07 21:12:33 +00:00
parent 19b18414f5
commit 3def286b5b
1 changed files with 13 additions and 8 deletions

View File

@ -2249,16 +2249,21 @@ static char *handle_cli_core_show_config_mappings(struct ast_cli_entry *e, int c
ast_mutex_lock(&config_lock);
ast_cli(a->fd, "\n\n");
for (eng = config_engine_list; eng; eng = eng->next) {
ast_cli(a->fd, "\nConfig Engine: %s\n", eng->name);
for (map = config_maps; map; map = map->next)
if (!strcasecmp(map->driver, eng->name)) {
ast_cli(a->fd, "===> %s (db=%s, table=%s)\n", map->name, map->database,
map->table ? map->table : map->name);
if (!config_engine_list) {
ast_cli(a->fd, "No config mappings found.\n");
} else {
ast_cli(a->fd, "\n\n");
for (eng = config_engine_list; eng; eng = eng->next) {
ast_cli(a->fd, "\nConfig Engine: %s\n", eng->name);
for (map = config_maps; map; map = map->next) {
if (!strcasecmp(map->driver, eng->name)) {
ast_cli(a->fd, "===> %s (db=%s, table=%s)\n", map->name, map->database,
map->table ? map->table : map->name);
}
}
}
ast_cli(a->fd,"\n\n");
}
ast_cli(a->fd,"\n\n");
ast_mutex_unlock(&config_lock);