<p>Niklas Larsson has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19741">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">apps/app_queue: Preserve reason for realtime queues<br><br>When the Asterisk is restared it does not preserve paused reason for<br>members of realtime queues. This was fixed for non-realtime queues in<br>https://gerrit.asterisk.org/c/asterisk/+/2131/<br><br>ASTERISK-30366<br><br>Change-Id: Ica08baa5cab6b18105b5d719a183f9fd582fcf09<br>---<br>M apps/app_queue.c<br>1 file changed, 26 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/41/19741/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 288c0ff..7b99d12 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -3587,6 +3587,7 @@</span><br><span> const char *penalty_str = ast_variable_retrieve(member_config, category, "penalty");</span><br><span> const char *paused_str = ast_variable_retrieve(member_config, category, "paused");</span><br><span> const char *wrapuptime_str = ast_variable_retrieve(member_config, category, "wrapuptime");</span><br><span style="color: hsl(120, 100%, 40%);">+ const char *reason_paused = ast_variable_retrieve(member_config, category, "reason_paused");</span><br><span> </span><br><span> if (ast_strlen_zero(rt_uniqueid)) {</span><br><span> ast_log(LOG_WARNING, "Realtime field 'uniqueid' is empty for member %s\n",</span><br><span>@@ -3653,6 +3654,7 @@</span><br><span> m->penalty = penalty;</span><br><span> m->ringinuse = ringinuse;</span><br><span> m->wrapuptime = wrapuptime;</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_copy_string(m->reason_paused, (reason_paused ? reason_paused : "\0"), sizeof(m->reason_paused));</span><br><span> found = 1;</span><br><span> ao2_ref(m, -1);</span><br><span> break;</span><br><span>@@ -3667,6 +3669,9 @@</span><br><span> m->dead = 0;</span><br><span> m->realtime = 1;</span><br><span> ast_copy_string(m->rt_uniqueid, rt_uniqueid, sizeof(m->rt_uniqueid));</span><br><span style="color: hsl(120, 100%, 40%);">+ if(!ast_strlen_zero(reason_paused)){</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_copy_string(m->reason_paused, reason_paused, sizeof(m->reason_paused));</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> if (!log_membername_as_agent) {</span><br><span> ast_queue_log(q->name, "REALTIME", m->interface, "ADDMEMBER", "%s", paused ? "PAUSED" : "");</span><br><span> } else {</span><br><span>@@ -7745,6 +7750,12 @@</span><br><span> ast_log(LOG_WARNING, "Failed %spause update of realtime queue member %s:%s\n",</span><br><span> (paused ? "" : "un"), q->name, mem->interface);</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+ if(strcmp(mem->reason_paused, reason ? reason : "\0")){</span><br><span style="color: hsl(120, 100%, 40%);">+ if (update_realtime_member_field(mem, q->name, "reason_paused", reason ? reason : "")) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_WARNING, "Failed reason '%s' update of realtime queue member %s:%s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ reason ? reason : "", q->name, mem->interface);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> </span><br><span> mem->paused = paused;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19741">change 19741</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/+/19741"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: Ica08baa5cab6b18105b5d719a183f9fd582fcf09 </div>
<div style="display:none"> Gerrit-Change-Number: 19741 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Niklas Larsson <niklas@tese.se> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>