<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18301">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_dahdi: Don't append cadences on dahdi restart.<br><br>Currently, if any custom ring cadences are specified, they are<br>appending to the array of cadences from wherever we left off<br>last time. This works properly the first time, but on subsequent<br>dahdi restarts, it means that the existing cadences are left<br>alone and (most likely) the same cadences are then re-added<br>afterwards. In short order, the cadence array gets maxed out<br>and the user begins seeing warnings that the array is full<br>and no more cadences may be added.<br><br>This buggy behavior persists until Asterisk is completely<br>restarted; however, if and when dahdi restart is run again,<br>then the same problem is reintroduced.<br><br>This fixes this behavior so that cadence parsing is more<br>idempotent, that is so running dahdi restart multiple times<br>starts adding cadences from the beginning, rather than from<br>wherever the last cadence was added.<br><br>As before, it is still not possible to revert to the default<br>cadences by simply removing all cadences in this manner, nor<br>is it possible to delete existing cadences. However, this<br>does make it possible to update existing cadences, which<br>was not possible before, and also ensures that the cadences<br>remain unchanged if the config remains unchanged.<br><br>ASTERISK-29990 #close<br><br>Change-Id: Ie32ea3e8a243b766756b1afce684d4a31ee7421d<br>---<br>M channels/chan_dahdi.c<br>1 file changed, 3 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/01/18301/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c</span><br><span>index ad7a8e5..8d61e62 100644</span><br><span>--- a/channels/chan_dahdi.c</span><br><span>+++ b/channels/chan_dahdi.c</span><br><span>@@ -17873,6 +17873,9 @@</span><br><span> int y;</span><br><span> struct ast_variable *dahdichan = NULL;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* Re-parse any cadences from beginning, rather than appending until we run out of room */</span><br><span style="color: hsl(120, 100%, 40%);">+ user_has_defined_cadences = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> for (; v; v = v->next) {</span><br><span> if (!ast_jb_read_conf(&global_jbconf, v->name, v->value))</span><br><span> continue;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18301">change 18301</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/+/18301"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ie32ea3e8a243b766756b1afce684d4a31ee7421d </div>
<div style="display:none"> Gerrit-Change-Number: 18301 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>