<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10581">View Change</a></p><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 pbx/pbx_config.c<br>1 file changed, 13 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/81/10581/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><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: newchange </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: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>