[asterisk-commits] mvanbaak: branch group/res_clialiases r144997 - /team/group/res_clialiases/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Sep 27 12:52:11 CDT 2008


Author: mvanbaak
Date: Sat Sep 27 12:52:10 2008
New Revision: 144997

URL: http://svn.digium.com/view/asterisk?view=rev&rev=144997
Log:
return to JunkY's patch to show the correct command that's already registered instead of null

The decrementing of the refcounter should be done in the if block instead of always

Modified:
    team/group/res_clialiases/res/res_clialiases.c

Modified: team/group/res_clialiases/res/res_clialiases.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/res/res_clialiases.c?view=diff&rev=144997&r1=144996&r2=144997
==============================================================================
--- team/group/res_clialiases/res/res_clialiases.c (original)
+++ team/group/res_clialiases/res/res_clialiases.c Sat Sep 27 12:52:10 2008
@@ -225,14 +225,15 @@
 		alias->real_cmd = ast_strdup(v->value);
 		alias->cli_entry.handler = cli_alias_passthrough;
 		alias->cli_entry.command = alias->alias;
+		alias->cli_entry._full_cmd = alias->alias;
 		alias->cli_entry.usage = "Aliased CLI Command";
 		if (!ast_cli_register(&alias->cli_entry)) {
 			ao2_link(cli_aliases, alias);
 			ast_verbose(VERBOSE_PREFIX_2 "Aliased CLI command '%s' to '%s'\n", v->name, v->value);
+			ao2_ref(alias, -1);
 		} else {
 			ast_verbose(VERBOSE_PREFIX_2 "Failed to alias '%s' to '%s' as the CLI command already exists\n", v->name, v->value);
 		}
-		ao2_ref(alias, -1);
 	}
 
 	/* Drop any CLI aliases that should no longer exist */




More information about the asterisk-commits mailing list