From 0b133a32ecbe73f6dbedea924259557764a70d9c Mon Sep 17 00:00:00 2001 From: sungtae kim Date: Fri, 12 Jun 2020 10:16:14 +0000 Subject: [PATCH] res_ari: Fix create channel request channelId parameter parsing If channelId parameters were passed in the body, the Asterisk doesn't parsing it correctly. Fixed it to parse the channelId, other_channel_id parameter correclty. ASTERISK-28948 Change-Id: I59b49161a94869169ee19c1ffab5afcef7026157 --- res/ari/resource_channels.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c index 81944f8386..8b7cf96d0e 100644 --- a/res/ari/resource_channels.c +++ b/res/ari/resource_channels.c @@ -1776,10 +1776,7 @@ void ast_ari_channels_create(struct ast_variable *headers, struct ast_ari_response *response) { struct ast_variable *variables = NULL; - struct ast_assigned_ids assignedids = { - .uniqueid = args->channel_id, - .uniqueid2 = args->other_channel_id, - }; + struct ast_assigned_ids assignedids; struct ari_channel_thread_data *chan_data; struct ast_channel_snapshot *snapshot; pthread_t thread; @@ -1802,6 +1799,9 @@ void ast_ari_channels_create(struct ast_variable *headers, } } + assignedids.uniqueid = args->channel_id; + assignedids.uniqueid2 = args->other_channel_id; + if (!ast_strlen_zero(args->originator) && !ast_strlen_zero(args->formats)) { ast_ari_response_error(response, 400, "Bad Request", "Originator and formats can't both be specified"); -- 2.47.2