<p>Joshua Colp <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13587">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jaco Kroon: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Joshua Colp: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">func_curl: Add 'followlocation' option to CURLOPT()<br><br>We allow for 'maxredirs' to be set, but this value is ignored when<br>followlocation is not enabled which, by default, it is not.<br><br>ASTERISK-17491 #close<br>Reported by: candrews<br><br>Change-Id: I96a4ab0142f2fb7d2e96ff976f6cf7b2982c761a<br>---<br>A doc/CHANGES-staging/func_curl.txt<br>M funcs/func_curl.c<br>2 files changed, 15 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/doc/CHANGES-staging/func_curl.txt b/doc/CHANGES-staging/func_curl.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..fa9ad97</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/func_curl.txt</span><br><span>@@ -0,0 +1,5 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: func_curl</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+A new option, followlocation, can now be enabled with the CURLOPT()</span><br><span style="color: hsl(120, 100%, 40%);">+dialplan function. Setting this will instruct cURL to follow 3xx</span><br><span style="color: hsl(120, 100%, 40%);">+redirects, which it does not by default.</span><br><span>diff --git a/funcs/func_curl.c b/funcs/func_curl.c</span><br><span>index 06a8b53..af6b7b0 100644</span><br><span>--- a/funcs/func_curl.c</span><br><span>+++ b/funcs/func_curl.c</span><br><span>@@ -88,6 +88,9 @@</span><br><span>                                        <enum name="dnstimeout"></span><br><span>                                             <para>Number of seconds to wait for DNS to be resolved</para></span><br><span>                                    </enum></span><br><span style="color: hsl(120, 100%, 40%);">+                                 <enum name="followlocation"></span><br><span style="color: hsl(120, 100%, 40%);">+                                          <para>Whether or not to follow HTTP 3xx redirects (boolean)</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                        </enum></span><br><span>                                        <enum name="ftptext"></span><br><span>                                                <para>For FTP URIs, force a text transfer (boolean)</para></span><br><span>                                       </enum></span><br><span>@@ -109,7 +112,9 @@</span><br><span>                                          server response</para></span><br><span>                                         </enum></span><br><span>                                        <enum name="maxredirs"></span><br><span style="color: hsl(0, 100%, 40%);">-                                         <para>Maximum number of redirects to follow</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                                <para>Maximum number of redirects to follow. The default is -1,</span><br><span style="color: hsl(120, 100%, 40%);">+                                         which allows for unlimited redirects. This only makes sense when</span><br><span style="color: hsl(120, 100%, 40%);">+                                              followlocation is also set.</para></span><br><span>                                     </enum></span><br><span>                                        <enum name="proxy"></span><br><span>                                          <para>Hostname or IP address to use as a proxy server</para></span><br><span>@@ -247,6 +252,9 @@</span><br><span>       } else if (!strcasecmp(name, "proxyuserpwd")) {</span><br><span>            *key = CURLOPT_PROXYUSERPWD;</span><br><span>                 *ot = OT_STRING;</span><br><span style="color: hsl(120, 100%, 40%);">+      } else if (!strcasecmp(name, "followlocation")) {</span><br><span style="color: hsl(120, 100%, 40%);">+           *key = CURLOPT_FOLLOWLOCATION;</span><br><span style="color: hsl(120, 100%, 40%);">+                *ot = OT_BOOLEAN;</span><br><span>    } else if (!strcasecmp(name, "maxredirs")) {</span><br><span>               *key = CURLOPT_MAXREDIRS;</span><br><span>            *ot = OT_INTEGER;</span><br><span>@@ -798,6 +806,7 @@</span><br><span> "  cookie         - Send cookie with request [none]\n"</span><br><span> "  conntimeout    - Number of seconds to wait for connection\n"</span><br><span> "  dnstimeout     - Number of seconds to wait for DNS response\n"</span><br><span style="color: hsl(120, 100%, 40%);">+"  followlocation - Follow HTTP 3xx redirects (boolean)\n"</span><br><span> "  ftptext        - For FTP, force a text transfer (boolean)\n"</span><br><span> "  ftptimeout     - For FTP, the server response timeout\n"</span><br><span> "  header         - Retrieve header information (boolean)\n"</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13587">change 13587</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/+/13587"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: I96a4ab0142f2fb7d2e96ff976f6cf7b2982c761a </div>
<div style="display:none"> Gerrit-Change-Number: 13587 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jaco Kroon <jaco@uls.co.za> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>