<p>sungtae kim has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16430">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">resource_channels.c: Fix wrong external media parameter parse<br><br>Fixed ARI external media handler to accept body parameters.<br><br>ASTERISK-29622<br><br>Change-Id: I49509c48a6cbc0fb4165bfa4f834b5e8b9ace20d<br>---<br>M res/ari/resource_channels.c<br>1 file changed, 12 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/30/16430/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c</span><br><span>index a3d0f31..e792a2a 100644</span><br><span>--- a/res/ari/resource_channels.c</span><br><span>+++ b/res/ari/resource_channels.c</span><br><span>@@ -2188,6 +2188,18 @@</span><br><span> </span><br><span>         ast_assert(response != NULL);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     /* Parse any query parameters out of the body parameter */</span><br><span style="color: hsl(120, 100%, 40%);">+    if (args->variables) {</span><br><span style="color: hsl(120, 100%, 40%);">+             struct ast_json *json_variables;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+            ast_ari_channels_external_media_parse_body(args->variables, args);</span><br><span style="color: hsl(120, 100%, 40%);">+         json_variables = ast_json_object_get(args->variables, "variables");</span><br><span style="color: hsl(120, 100%, 40%);">+              if (json_variables</span><br><span style="color: hsl(120, 100%, 40%);">+                    && json_to_ast_variables(response, json_variables, &variables)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 return;</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  if (ast_strlen_zero(args->app)) {</span><br><span>                 ast_ari_response_error(response, 400, "Bad Request", "app cannot be empty");</span><br><span>             return;</span><br><span>@@ -2222,17 +2234,6 @@</span><br><span>             args->direction = "both";</span><br><span>       }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   if (args->variables) {</span><br><span style="color: hsl(0, 100%, 40%);">-               struct ast_json *json_variables;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                ast_ari_channels_external_media_parse_body(args->variables, args);</span><br><span style="color: hsl(0, 100%, 40%);">-           json_variables = ast_json_object_get(args->variables, "variables");</span><br><span style="color: hsl(0, 100%, 40%);">-                if (json_variables</span><br><span style="color: hsl(0, 100%, 40%);">-                      && json_to_ast_variables(response, json_variables, &variables)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   return;</span><br><span style="color: hsl(0, 100%, 40%);">-         }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    if (strcasecmp(args->encapsulation, "rtp") == 0 && strcasecmp(args->transport, "udp") == 0) {</span><br><span>              external_media_rtp_udp(args, variables, response);</span><br><span>   } else if (strcasecmp(args->encapsulation, "audiosocket") == 0 && strcasecmp(args->transport, "tcp") == 0) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16430">change 16430</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/16430"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I49509c48a6cbc0fb4165bfa4f834b5e8b9ace20d </div>
<div style="display:none"> Gerrit-Change-Number: 16430 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>