<p>Friendly Automation <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11254">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;">stasis: Call callbacks when imparting fails<br><br>After a bridge has been deleted the stasis control will depart<br>the channel and might attempt to re-add it to the dial bridge.<br><br>The later can fail and this can lead to a situation that the stasis<br>control is unlinked but the after_bridge_cb_failed cb is executed trying<br>to access a dangling control object.<br><br>Fix it by calling the after_cb's before bridge_channel_impart_signal.<br><br>ASTERISK-26718<br><br>Change-Id: Ib4e8f70d7a21bd54afe3cb51cc6717ef7c355496<br>---<br>M include/asterisk/bridge.h<br>M main/bridge.c<br>2 files changed, 4 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/asterisk/bridge.h b/include/asterisk/bridge.h</span><br><span>index dc8ebe5..13fa191 100644</span><br><span>--- a/include/asterisk/bridge.h</span><br><span>+++ b/include/asterisk/bridge.h</span><br><span>@@ -594,6 +594,9 @@</span><br><span>  * it were placed into the bridge by ast_bridge_join().</span><br><span>  * Channels placed into a bridge by ast_bridge_join() are</span><br><span>  * removed by a third party using ast_bridge_remove().</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * \note Any callbacks on the channel will be invoked on failure</span><br><span style="color: hsl(120, 100%, 40%);">+ * with the reason as AST_BRIDGE_AFTER_CB_REASON_IMPART_FAILED.</span><br><span>  */</span><br><span> int ast_bridge_impart(struct ast_bridge *bridge,</span><br><span>         struct ast_channel *chan,</span><br><span>diff --git a/main/bridge.c b/main/bridge.c</span><br><span>index f3c34d1..9c53cfb 100644</span><br><span>--- a/main/bridge.c</span><br><span>+++ b/main/bridge.c</span><br><span>@@ -1953,6 +1953,7 @@</span><br><span>   res = bridge_impart_internal(bridge, chan, swap, features, flags, &cond);</span><br><span>        if (res) {</span><br><span>           /* Impart failed.  Signal any other waiting impart threads */</span><br><span style="color: hsl(120, 100%, 40%);">+         ast_bridge_discard_after_callback(chan, AST_BRIDGE_AFTER_CB_REASON_IMPART_FAILED);</span><br><span>           bridge_channel_impart_signal(chan);</span><br><span>  }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11254">change 11254</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/+/11254"/><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: Ib4e8f70d7a21bd54afe3cb51cc6717ef7c355496 </div>
<div style="display:none"> Gerrit-Change-Number: 11254 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Holger Hans Peter Freyther <automatic@freyther.de> </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: Holger Hans Peter Freyther <automatic@freyther.de> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>