From 46f505591455a8f0967c81c92b48f66ced710535 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Mon, 18 Nov 2013 15:10:51 +0800 Subject: [PATCH] avoid loop and adding a missing complete --- src/mod/applications/mod_commands/mod_commands.c | 3 ++- src/switch_console.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 4ae58d2212..019e3f8563 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -34,7 +34,7 @@ * Rupa Schomaker * Joseph Sullivan * Raymond Chandler - * + * Seven Du * Garmt Boekholt * * mod_commands.c -- Misc. Command Module @@ -6532,6 +6532,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load) switch_console_set_complete("add alias add"); + switch_console_set_complete("add alias stickyadd"); switch_console_set_complete("add alias del"); switch_console_set_complete("add coalesce"); switch_console_set_complete("add complete add"); diff --git a/src/switch_console.c b/src/switch_console.c index 63fe575856..d43f7702e1 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -1921,6 +1921,11 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_alias(const char *string) switch_cache_db_handle_t *db = NULL; char *sql = NULL; + if (!strcmp(argv[1], argv[2])) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Alias and command cannot be the same, this will cause loop!\n"); + return SWITCH_STATUS_FALSE; + } + if (switch_core_db_handle(&db) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Database Error\n"); free(mydata);