<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18415">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_dahdi: Fix broken operator mode clearing.<br><br>Currently, the operator services mode in DAHDI is broken and unusable.<br>The actual operator recall functionality works properly; however,<br>when the operator hangs up (which is the only way that such a call<br>is allowed to end), both lines are permanently taken out of service<br>until "dahdi restart" is run. This prevents this feature from being<br>used.<br><br>Operator mode is one of the few factors that can cause the general<br>analog event handling in sig_analog not to be used. Several years<br>back, much of the analog handling was moved from chan_dahdi to<br>sig_analog. However, this was not done fully or consistently at<br>the time, and when operator mode is active, sig_analog does not<br>get used. Generally this is correct, but in the case of hangup<br>it should be using sig_analog regardless of the operator mode;<br>otherwise, the lines do not properly clear and they become unusable.<br><br>This bug is fixed so the operator can now hang up and properly<br>release the call. It is treated just like any other hangup. The<br>operator mode functionality continues to work as it did before.<br><br>ASTERISK-29993 #close<br><br>Change-Id: Ib2e3ddb40d9c71e8801e0b4bb0a12e2b52f51d24<br>---<br>M channels/chan_dahdi.c<br>1 file changed, 11 insertions(+), 2 deletions(-)<br><br></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 616e317..9135937 100644</span><br><span>--- a/channels/chan_dahdi.c</span><br><span>+++ b/channels/chan_dahdi.c</span><br><span>@@ -6027,7 +6027,9 @@</span><br><span> </span><br><span> ast_mutex_lock(&p->lock);</span><br><span> p->exten[0] = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- if (dahdi_analog_lib_handles(p->sig, p->radio, p->oprmode)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Always use sig_analog hangup handling for operator mode */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (dahdi_analog_lib_handles(p->sig, p->radio, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ p->oprmode = 0;</span><br><span> dahdi_confmute(p, 0);</span><br><span> restore_gains(p);</span><br><span> p->ignoredtmf = 0;</span><br><span>@@ -7643,7 +7645,11 @@</span><br><span> }</span><br><span> if (p->oprmode < 0)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- if (p->oprmode != -1) break;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (p->oprmode != -1) { /* Operator flash recall */</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verb(4, "Operator mode enabled on channel %d, holding line for channel %d\n", p->channel, p->oprpeer->channel);</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Otherwise, immediate recall */</span><br><span> if ((p->sig == SIG_FXOLS) || (p->sig == SIG_FXOKS) || (p->sig == SIG_FXOGS))</span><br><span> {</span><br><span> /* Make sure it starts ringing */</span><br><span>@@ -7651,6 +7657,7 @@</span><br><span> dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_RING);</span><br><span> save_conference(p->oprpeer);</span><br><span> tone_zone_play_tone(p->oprpeer->subs[SUB_REAL].dfd, DAHDI_TONE_RINGTONE);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verb(4, "Operator recall, channel %d ringing back channel %d\n", p->oprpeer->channel, p->channel);</span><br><span> }</span><br><span> break;</span><br><span> }</span><br><span>@@ -7763,6 +7770,7 @@</span><br><span> dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_RINGOFF);</span><br><span> tone_zone_play_tone(p->oprpeer->subs[SUB_REAL].dfd, -1);</span><br><span> restore_conference(p->oprpeer);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(1, "Operator recall by channel %d for channel %d complete\n", p->oprpeer->channel, p->channel);</span><br><span> }</span><br><span> break;</span><br><span> }</span><br><span>@@ -7976,6 +7984,7 @@</span><br><span> dahdi_set_hook(p->oprpeer->subs[SUB_REAL].dfd, DAHDI_RING);</span><br><span> save_conference(p);</span><br><span> tone_zone_play_tone(p->subs[SUB_REAL].dfd, DAHDI_TONE_RINGTONE);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verb(4, "Operator flash recall, channel %d ringing back channel %d\n", p->oprpeer->channel, p->channel);</span><br><span> }</span><br><span> }</span><br><span> break;</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18415">change 18415</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/+/18415"/><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: Ib2e3ddb40d9c71e8801e0b4bb0a12e2b52f51d24 </div>
<div style="display:none"> Gerrit-Change-Number: 18415 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>