<p>Holger Hans Peter Freyther has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11255">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stasis: Re-set the PBX pointer before attempting to join the dial bridge<br><br>As part of departing the pbx of the stasis control will be restored. Attempting<br>to join the dial bridge will then fail. Swap out the PBX again.<br><br>TODO: Does this hold true universally, if not remove the assert.<br><br> 0x000055555561a234 in ast_channel_pbx_set<br> 692             chan->pbx = value;<br> (gdb) bt<br> #0  0x000055555561a234 in ast_channel_pbx_set<br> #1  0x00007fffc9fee0ea in internal_bridge_after_cb<br>     at stasis/control.c:1139<br> #2  bridge_after_cb_failed<br> #3  0x00005555555d95ef in after_bridge_cb_failed<br> #4  after_bridge_cb_run_discard<br> #5  ast_bridge_discard_after_callback<br> #6  0x00005555555d070b in bridge_channel_depart_thread<br> #7  0x0000555555710e7c in dummy_start<br> #8  0x00007ffff5b5c4a4 in start_thread<br> #9  0x00007ffff4766d0f in clone<br><br>Change-Id: I788151b7045791d1d5d35453875027a60e6d527a<br>---<br>M res/stasis/control.c<br>1 file changed, 9 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/55/11255/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/stasis/control.c b/res/stasis/control.c</span><br><span>index ffac8d4..a2bfda4 100644</span><br><span>--- a/res/stasis/control.c</span><br><span>+++ b/res/stasis/control.c</span><br><span>@@ -1087,6 +1087,15 @@</span><br><span>      ast_bridge_depart(chan);</span><br><span> </span><br><span>         if (!ast_check_hangup(chan) && ast_channel_state(chan) != AST_STATE_UP) {</span><br><span style="color: hsl(120, 100%, 40%);">+             /* Save off the channel's PBX */</span><br><span style="color: hsl(120, 100%, 40%);">+          ao2_lock(control);</span><br><span style="color: hsl(120, 100%, 40%);">+            ast_assert(control->pbx == NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+          if (!control->pbx) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       control->pbx = ast_channel_pbx(chan);</span><br><span style="color: hsl(120, 100%, 40%);">+                      ast_channel_pbx_set(chan, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span style="color: hsl(120, 100%, 40%);">+             ao2_unlock(control);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>               /* Channel is still being dialed, so put it back in the dialing bridge */</span><br><span>            add_to_dial_bridge(control, chan);</span><br><span>   }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11255">change 11255</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/+/11255"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16.3 </div>
<div style="display:none"> Gerrit-Change-Id: I788151b7045791d1d5d35453875027a60e6d527a </div>
<div style="display:none"> Gerrit-Change-Number: 11255 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Holger Hans Peter Freyther <automatic@freyther.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>