<p>Walter Doekes has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14564">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue: (Breaking change) shared_lastcall and autofill default to 'no'<br><br>If your queues.conf had _no_ [general] section, they would default to<br>'yes'. Now, they always default to 'no'.<br><br>ASTERISK-28951<br><br>Change-Id: Ic39d8a0202906bc454194368bbfbae62990fe5f6<br>---<br>M apps/app_queue.c<br>M configs/samples/queues.conf.sample<br>A doc/UPGRADE-staging/app_queue_consistent_general.txt<br>3 files changed, 40 insertions(+), 23 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/64/14564/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_queue.c b/apps/app_queue.c</span><br><span>index 3a572ef..02db021 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -1363,34 +1363,34 @@</span><br><span> static const char * const pm_family = "Queue/PersistentMembers";</span><br><span> </span><br><span> /*! \brief queues.conf [general] option */</span><br><span style="color: hsl(0, 100%, 40%);">-static int queue_persistent_members = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+static int queue_persistent_members;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/*! \brief queues.conf per-queue weight option */</span><br><span style="color: hsl(0, 100%, 40%);">-static int use_weight = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+/*! \brief Records that one or more queues use weight */</span><br><span style="color: hsl(120, 100%, 40%);">+static int use_weight;</span><br><span> </span><br><span> /*! \brief queues.conf [general] option */</span><br><span style="color: hsl(0, 100%, 40%);">-static int autofill_default = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+static int autofill_default;</span><br><span> </span><br><span> /*! \brief queues.conf [general] option */</span><br><span style="color: hsl(0, 100%, 40%);">-static int montype_default = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+static int montype_default;</span><br><span> </span><br><span> /*! \brief queues.conf [general] option */</span><br><span style="color: hsl(0, 100%, 40%);">-static int shared_lastcall = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+static int shared_lastcall;</span><br><span> </span><br><span> /*! \brief queuesrules.conf [general] option */</span><br><span style="color: hsl(0, 100%, 40%);">-static int realtime_rules = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+static int realtime_rules;</span><br><span> </span><br><span> /*! \brief Subscription to device state change messages */</span><br><span> static struct stasis_subscription *device_state_sub;</span><br><span> </span><br><span> /*! \brief queues.conf [general] option */</span><br><span style="color: hsl(0, 100%, 40%);">-static int update_cdr = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+static int update_cdr;</span><br><span> </span><br><span> /*! \brief queues.conf [general] option */</span><br><span style="color: hsl(0, 100%, 40%);">-static int negative_penalty_invalid = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+static int negative_penalty_invalid;</span><br><span> </span><br><span> /*! \brief queues.conf [general] option */</span><br><span style="color: hsl(0, 100%, 40%);">-static int log_membername_as_agent = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+static int log_membername_as_agent;</span><br><span> </span><br><span> /*! \brief name of the ringinuse field in the realtime database */</span><br><span> static char *realtime_ringinuse_field;</span><br><span>@@ -8722,14 +8722,19 @@</span><br><span>    .write = queue_function_memberpenalty_write,</span><br><span> };</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! Reset the global queue rules parameters even if there is no "general" section of queuerules.conf */</span><br><span style="color: hsl(120, 100%, 40%);">+static void queue_rules_reset_global_params(void)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+       realtime_rules = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! Set the global queue rules parameters as defined in the "general" section of queuerules.conf */</span><br><span> static void queue_rules_set_global_params(struct ast_config *cfg)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-        const char *general_val = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-        realtime_rules = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-        if ((general_val = ast_variable_retrieve(cfg, "general", "realtime_rules"))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                realtime_rules = ast_true(general_val);</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(120, 100%, 40%);">+       const char *general_val = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+       if ((general_val = ast_variable_retrieve(cfg, "general", "realtime_rules"))) {</span><br><span style="color: hsl(120, 100%, 40%);">+            realtime_rules = ast_true(general_val);</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span> }</span><br><span> </span><br><span> /*! \brief Reload the rules defined in queuerules.conf</span><br><span>@@ -8764,6 +8769,7 @@</span><br><span>                         ast_free(pr_iter);</span><br><span>           ast_free(rl_iter);</span><br><span>   }</span><br><span style="color: hsl(120, 100%, 40%);">+     queue_rules_reset_global_params();</span><br><span>   while ((rulecat = ast_category_browse(cfg, rulecat))) {</span><br><span>              if (!strcasecmp(rulecat, "general")) {</span><br><span>                     queue_rules_set_global_params(cfg);</span><br><span>@@ -8795,36 +8801,41 @@</span><br><span>        return AST_MODULE_LOAD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! Always set the global queue defaults, even if there is no "general" section in queues.conf */</span><br><span style="color: hsl(120, 100%, 40%);">+static void queue_reset_global_params(void)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ queue_persistent_members = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ autofill_default = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ montype_default = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+  update_cdr = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+       shared_lastcall = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+  negative_penalty_invalid = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ log_membername_as_agent = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! Set the global queue parameters as defined in the "general" section of queues.conf */</span><br><span> static void queue_set_global_params(struct ast_config *cfg)</span><br><span> {</span><br><span>         const char *general_val = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">- queue_persistent_members = 0;</span><br><span>        if ((general_val = ast_variable_retrieve(cfg, "general", "persistentmembers"))) {</span><br><span>                queue_persistent_members = ast_true(general_val);</span><br><span>    }</span><br><span style="color: hsl(0, 100%, 40%);">-       autofill_default = 0;</span><br><span>        if ((general_val = ast_variable_retrieve(cfg, "general", "autofill"))) {</span><br><span>                 autofill_default = ast_true(general_val);</span><br><span>    }</span><br><span style="color: hsl(0, 100%, 40%);">-       montype_default = 0;</span><br><span>         if ((general_val = ast_variable_retrieve(cfg, "general", "monitor-type"))) {</span><br><span>             if (!strcasecmp(general_val, "mixmonitor"))</span><br><span>                        montype_default = 1;</span><br><span>         }</span><br><span style="color: hsl(0, 100%, 40%);">-       update_cdr = 0;</span><br><span>      if ((general_val = ast_variable_retrieve(cfg, "general", "updatecdr"))) {</span><br><span>                update_cdr = ast_true(general_val);</span><br><span>  }</span><br><span style="color: hsl(0, 100%, 40%);">-       shared_lastcall = 0;</span><br><span>         if ((general_val = ast_variable_retrieve(cfg, "general", "shared_lastcall"))) {</span><br><span>          shared_lastcall = ast_true(general_val);</span><br><span>     }</span><br><span style="color: hsl(0, 100%, 40%);">-       negative_penalty_invalid = 0;</span><br><span>        if ((general_val = ast_variable_retrieve(cfg, "general", "negative_penalty_invalid"))) {</span><br><span>                 negative_penalty_invalid = ast_true(general_val);</span><br><span>    }</span><br><span style="color: hsl(0, 100%, 40%);">-       log_membername_as_agent = 0;</span><br><span>         if ((general_val = ast_variable_retrieve(cfg, "general", "log_membername_as_agent"))) {</span><br><span>          log_membername_as_agent = ast_true(general_val);</span><br><span>     }</span><br><span>@@ -9128,6 +9139,7 @@</span><br><span> </span><br><span>        /* Chug through config file. */</span><br><span>      cat = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+   queue_reset_global_params();</span><br><span>         while ((cat = ast_category_browse(cfg, cat)) ) {</span><br><span>             if (!strcasecmp(cat, "general") && queue_reload) {</span><br><span>                         queue_set_global_params(cfg);</span><br><span>diff --git a/configs/samples/queues.conf.sample b/configs/samples/queues.conf.sample</span><br><span>index 5c8a80f..f169492 100644</span><br><span>--- a/configs/samples/queues.conf.sample</span><br><span>+++ b/configs/samples/queues.conf.sample</span><br><span>@@ -23,7 +23,7 @@</span><br><span> ;    no more available members or no more waiting callers. This is</span><br><span> ;    probably more along the lines of how a queue should work and</span><br><span> ;    in most cases, you will want to enable this behavior. If you</span><br><span style="color: hsl(0, 100%, 40%);">-;    do not specify or comment out this option, it will default to yes.</span><br><span style="color: hsl(120, 100%, 40%);">+;    do not specify or comment out this option, it will default to no.</span><br><span> ;</span><br><span> ;autofill = no</span><br><span> ;</span><br><span>diff --git a/doc/UPGRADE-staging/app_queue_consistent_general.txt b/doc/UPGRADE-staging/app_queue_consistent_general.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..544bbf0</span><br><span>--- /dev/null</span><br><span>+++ b/doc/UPGRADE-staging/app_queue_consistent_general.txt</span><br><span>@@ -0,0 +1,5 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_queue</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+If they are not specified in [general], "shared_lastcall" and "autofill"</span><br><span style="color: hsl(120, 100%, 40%);">+now always default to OFF.  Before this version, they would be off ('no') if</span><br><span style="color: hsl(120, 100%, 40%);">+queues.conf did not have a [general] section, but on ('yes') if it did.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14564">change 14564</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/+/14564"/><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: Ic39d8a0202906bc454194368bbfbae62990fe5f6 </div>
<div style="display:none"> Gerrit-Change-Number: 14564 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Walter Doekes <walter+asterisk@wjd.nu> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>