<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10581">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pbx_config: Only the first [globals] section is seen.<br><br>If multiple [globals] sections are used (for example via separate<br>included files), only the first one is processed. This can result in<br>lost global variables when using a modular extensions.conf.<br><br>ASTERISK-28146 #close<br><br>Change-Id: Iaac810c0a7c4d9b1bf8989fcc041cdb910ef08a0<br>---<br>M CHANGES<br>M pbx/pbx_config.c<br>2 files changed, 19 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/CHANGES b/CHANGES</span><br><span>index b191f40..5c254a8 100644</span><br><span>--- a/CHANGES</span><br><span>+++ b/CHANGES</span><br><span>@@ -12,6 +12,12 @@</span><br><span> --- Functionality changes from Asterisk 13.23.0 to Asterisk 13.24.0 ----------</span><br><span> ------------------------------------------------------------------------------</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+pbx_config</span><br><span style="color: hsl(120, 100%, 40%);">+------------------</span><br><span style="color: hsl(120, 100%, 40%);">+ * pbx_config will now find and process multiple 'globals' sections from</span><br><span style="color: hsl(120, 100%, 40%);">+ extensions.conf. Variables are processed in the order they are found</span><br><span style="color: hsl(120, 100%, 40%);">+ and duplicate variables overwrite the previous value.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> res_pjsip</span><br><span> ------------------</span><br><span> * New options 'trust_connected_line' and 'send_connected_line' have been</span><br><span>diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c</span><br><span>index 441a996..6c3b934 100644</span><br><span>--- a/pbx/pbx_config.c</span><br><span>+++ b/pbx/pbx_config.c</span><br><span>@@ -1688,10 +1688,20 @@</span><br><span> </span><br><span> ast_copy_string(userscontext, ast_variable_retrieve(cfg, "general", "userscontext") ?: "default", sizeof(userscontext));</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- for (v = ast_variable_browse(cfg, "globals"); v; v = v->next) {</span><br><span style="color: hsl(0, 100%, 40%);">- pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);</span><br><span style="color: hsl(0, 100%, 40%);">- pbx_builtin_setvar_helper(NULL, v->name, realvalue);</span><br><span style="color: hsl(120, 100%, 40%);">+ /* ast_variable_browse does not merge multiple [globals] sections */</span><br><span style="color: hsl(120, 100%, 40%);">+ for (cxt = ast_category_browse(cfg, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ cxt;</span><br><span style="color: hsl(120, 100%, 40%);">+ cxt = ast_category_browse(cfg, cxt)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (strcasecmp(cxt, "globals")) {</span><br><span style="color: hsl(120, 100%, 40%);">+ continue;</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%);">+ for (v = ast_variable_browse(cfg, cxt); v; v = v->next) {</span><br><span style="color: hsl(120, 100%, 40%);">+ pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);</span><br><span style="color: hsl(120, 100%, 40%);">+ pbx_builtin_setvar_helper(NULL, v->name, realvalue);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> for (cxt = ast_category_browse(cfg, NULL);</span><br><span> cxt;</span><br><span> cxt = ast_category_browse(cfg, cxt)) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10581">change 10581</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/10581"/><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-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Iaac810c0a7c4d9b1bf8989fcc041cdb910ef08a0 </div>
<div style="display:none"> Gerrit-Change-Number: 10581 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>