<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18630">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Friendly Automation: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sig_analog: Fix broken three-way conferencing.<br><br>Three-way calling for analog lines is currently broken.<br>If party A is on a call with party B and initiates a<br>three-way call to party C, the behavior differs depending<br>on whether the call is conferenced prior to party C<br>answering. The post-answer case is correct. However,<br>if A flashes before C answers, then the next flash<br>disconnects B rather than C, which is incorrect.<br><br>This error occurs because the subs are not swapped<br>in the misbehaving case. This is because the flash<br>handler only swaps the subs if C has answered already,<br>which is wrong. To fix this, we swap the subs regardless<br>of whether C has answered or not when the call is<br>conferenced. This ensures that C is disconnected<br>on the next hook flash, rather than B as can happen<br>currently.<br><br>ASTERISK-30043 #close<br><br>Change-Id: I96c5bf6c9b7eb2636136b716c677c82c079b6f06<br>---<br>M channels/sig_analog.c<br>1 file changed, 2 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/sig_analog.c b/channels/sig_analog.c</span><br><span>index ea507fe..fb93d5f 100644</span><br><span>--- a/channels/sig_analog.c</span><br><span>+++ b/channels/sig_analog.c</span><br><span>@@ -3386,10 +3386,8 @@</span><br><span>                                             /* Put them in the threeway, and flip */</span><br><span>                                             analog_set_inthreeway(p, ANALOG_SUB_THREEWAY, 1);</span><br><span>                                            analog_set_inthreeway(p, ANALOG_SUB_REAL, 1);</span><br><span style="color: hsl(0, 100%, 40%);">-                                           if (ast_channel_state(ast) == AST_STATE_UP) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                                   analog_swap_subs(p, ANALOG_SUB_THREEWAY, ANALOG_SUB_REAL);</span><br><span style="color: hsl(0, 100%, 40%);">-                                                      orig_3way_sub = ANALOG_SUB_REAL;</span><br><span style="color: hsl(0, 100%, 40%);">-                                                }</span><br><span style="color: hsl(120, 100%, 40%);">+                                             analog_swap_subs(p, ANALOG_SUB_THREEWAY, ANALOG_SUB_REAL);</span><br><span style="color: hsl(120, 100%, 40%);">+                                            orig_3way_sub = ANALOG_SUB_REAL;</span><br><span>                                             ast_queue_unhold(p->subs[orig_3way_sub].owner);</span><br><span>                                           analog_set_new_owner(p, p->subs[ANALOG_SUB_REAL].owner);</span><br><span>                                  } else {</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/+/18630">change 18630</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/+/18630"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I96c5bf6c9b7eb2636136b716c677c82c079b6f06 </div>
<div style="display:none"> Gerrit-Change-Number: 18630 </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: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>