diff --git a/res/res_clioriginate.c b/res/res_clioriginate.c
index 09cde4d7cc41db152f8a41d293ad46f40a824d3a..5f2b6ab03dc68d6f707a51efdc3cde5a2a78d7e0 100644
--- a/res/res_clioriginate.c
+++ b/res/res_clioriginate.c
@@ -182,15 +182,15 @@ static struct ast_cli_entry cli_cliorig[] = {
 /*! \brief Unload orginate module */
 static int unload_module(void)
 {
-	ast_cli_unregister_multiple(cli_cliorig, sizeof(cli_cliorig) / sizeof(struct ast_cli_entry));
-	return 0;
+	return ast_cli_unregister_multiple(cli_cliorig, ARRAY_LEN(cli_cliorig));
 }
 
 /*! \brief Load orginate module */
 static int load_module(void)
 {
-	ast_cli_register_multiple(cli_cliorig, sizeof(cli_cliorig) / sizeof(struct ast_cli_entry));
-	return AST_MODULE_LOAD_SUCCESS;
+	int res;
+	res = ast_cli_register_multiple(cli_cliorig, ARRAY_LEN(cli_cliorig));
+	return res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS;
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call origination from the CLI");