diff options
author | Corey Farrell <git@cfware.com> | 2015-05-04 17:41:08 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2015-05-04 20:47:18 -0400 |
commit | df6c1d755f39308c77f3c49ef0f5fa539e627330 (patch) | |
tree | 21f12dd8173c44ce1caa6f3797be062910db2b55 /res/res_clioriginate.c | |
parent | a8bfa9e10445744581d18819c64729844ae837fb (diff) |
CLI: Enable automatic references to modules.
* Pass module to ast_cli_register and ast_cli_register_multiple.
* Add a module reference before executing any CLI callback, remove
the reference when complete.
ASTERISK-25049 #close
Reported by: Corey Farrell
Change-Id: I7aafc7c9f2b912918f28fe51d51e9e8a755750e3
Diffstat (limited to 'res/res_clioriginate.c')
-rw-r--r-- | res/res_clioriginate.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/res/res_clioriginate.c b/res/res_clioriginate.c index 173f9f579..451b1745d 100644 --- a/res/res_clioriginate.c +++ b/res/res_clioriginate.c @@ -156,8 +156,6 @@ static char *handle_orig(struct ast_cli_entry *e, int cmd, struct ast_cli_args * "used. If no extension is given, the 's' extension will be used.\n"; return NULL; case CLI_GENERATE: - /* ugly, can be removed when CLI entries have ast_module pointers */ - ast_module_ref(ast_module_info->self); if (a->pos == 3) { res = ast_cli_complete(a->word, choices, a->n); } else if (a->pos == 4) { @@ -165,16 +163,12 @@ static char *handle_orig(struct ast_cli_entry *e, int cmd, struct ast_cli_args * res = ast_complete_applications(a->line, a->word, a->n); } } - ast_module_unref(ast_module_info->self); return res; } if (ast_strlen_zero(a->argv[2]) || ast_strlen_zero(a->argv[3])) return CLI_SHOWUSAGE; - /* ugly, can be removed when CLI entries have ast_module pointers */ - ast_module_ref(ast_module_info->self); - if (!strcasecmp("application", a->argv[3])) { res = orig_app(a->fd, a->argv[2], a->argv[4], a->argv[5]); } else if (!strcasecmp("extension", a->argv[3])) { @@ -183,8 +177,6 @@ static char *handle_orig(struct ast_cli_entry *e, int cmd, struct ast_cli_args * res = CLI_SHOWUSAGE; } - ast_module_unref(ast_module_info->self); - return res; } |