<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18441">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bridge_simple.c: Unhold channels on join simple bridge.<br><br>Patch provided inline by Yury Kirsanov on the linked issue and<br>approved by Josh Colp.<br><br>ASTERISK-29253 #close<br><br>Change-Id: I5b9ccc67ebf06e875ed061d9e7fc21f47b0a4e1f<br>---<br>M bridges/bridge_simple.c<br>1 file changed, 21 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/41/18441/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/bridges/bridge_simple.c b/bridges/bridge_simple.c</span><br><span>index 1e224f7..ba300ed 100644</span><br><span>--- a/bridges/bridge_simple.c</span><br><span>+++ b/bridges/bridge_simple.c</span><br><span>@@ -128,6 +128,7 @@</span><br><span>         struct ast_stream_topology *new_top;</span><br><span>         struct ast_channel *c0 = AST_LIST_FIRST(&bridge->channels)->chan;</span><br><span>  struct ast_channel *c1 = AST_LIST_LAST(&bridge->channels)->chan;</span><br><span style="color: hsl(120, 100%, 40%);">+    int unhold_c0, unhold_c1;</span><br><span> </span><br><span>        /*</span><br><span>    * If this is the first channel we can't make it compatible...</span><br><span>@@ -152,9 +153,29 @@</span><br><span>            SWAP(c0, c1);</span><br><span>        }</span><br><span>    new_top = simple_bridge_request_stream_topology_update(existing_top, req_top);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      /* The ast_channel_hold_state() and ast_channel_name() accessors need to be</span><br><span style="color: hsl(120, 100%, 40%);">+    * called with the associated channel lock held.</span><br><span style="color: hsl(120, 100%, 40%);">+       */</span><br><span style="color: hsl(120, 100%, 40%);">+   if ((unhold_c1 = ast_channel_hold_state(c1) == AST_CONTROL_HOLD)) {</span><br><span style="color: hsl(120, 100%, 40%);">+           ast_debug(1, "Channel %s simulating UNHOLD for bridge simple join.\n", ast_channel_name(c1));</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   if ((unhold_c0 = ast_channel_hold_state(c0) == AST_CONTROL_HOLD)) {</span><br><span style="color: hsl(120, 100%, 40%);">+           ast_debug(1, "Channel %s simulating UNHOLD for bridge simple join.\n", ast_channel_name(c0));</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  ast_channel_unlock(c0);</span><br><span>      ast_channel_unlock(c1);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   if (unhold_c1) {</span><br><span style="color: hsl(120, 100%, 40%);">+              ast_indicate(c1, AST_CONTROL_UNHOLD);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   if (unhold_c0) {</span><br><span style="color: hsl(120, 100%, 40%);">+              ast_indicate(c0, AST_CONTROL_UNHOLD);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  if (!new_top) {</span><br><span>              /* Failure.  We'll just have to live with the current topology. */</span><br><span>               return 0;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18441">change 18441</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/+/18441"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I5b9ccc67ebf06e875ed061d9e7fc21f47b0a4e1f </div>
<div style="display:none"> Gerrit-Change-Number: 18441 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>