summaryrefslogtreecommitdiff
path: root/res/res_clioriginate.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_clioriginate.c')
-rw-r--r--res/res_clioriginate.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/res/res_clioriginate.c b/res/res_clioriginate.c
index 4ed08a44e..beb2522f4 100644
--- a/res/res_clioriginate.c
+++ b/res/res_clioriginate.c
@@ -201,15 +201,14 @@ static char *handle_redirect(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
name = a->argv[2];
dest = a->argv[3];
- chan = ast_get_channel_by_name_locked(name);
- if (!chan) {
+ if (!(chan = ast_channel_get_by_name(name))) {
ast_cli(a->fd, "Channel '%s' not found\n", name);
return CLI_FAILURE;
}
res = ast_async_parseable_goto(chan, dest);
- ast_channel_unlock(chan);
+ chan = ast_channel_unref(chan);
if (!res) {
ast_cli(a->fd, "Channel '%s' successfully redirected to %s\n", name, dest);