<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/2474/">https://reviewboard.asterisk.org/r/2474/</a>
     </td>
    </tr>
   </table>
   <br />



 <p>Ship it!</p>



 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Looks spot on.</pre>
 <br />









<p>- jrose</p>


<br />
<p>On April 25th, 2013, 2:57 a.m. UTC, rmudgett wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By rmudgett.</div>


<p style="color: grey;"><i>Updated April 25, 2013, 2:57 a.m.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-21058">ASTERISK-21058</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Follow up to https://reviewboard.asterisk.org/r/2461/

Added the additional way to optimize out local channels in more circumstances.  Swap the Local;2 channel in BridgeB with the only peer channel (A) in BridgeA.  This optimization strategy is needed for the parking and conference bridges to keep bridge channel information associated with the same call.

A -- BridgeA -- Local;1-Local;2 -- BridgeB -- B

* Extracted the ast_bridge_channel_peer() routine from the simple_bridge so local channel swap optimization can utilize it as well.

* Implemented ast_bridge_move() as a side benefit to the swap optimization.

* Refactored ast_bridge_local_optimized_out() to simplify its structure because the swap optimization needs to be checked before the merge optimization.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The local channel optimization now normally does the swap method.

* Checked that local channels can optimize themselves out in the normal situation as shown in the description.

* Checked that the local channels can optimize themselves out in the situation where there is a chain of 300 local channel pairs.  This seems to work faster than it used to, but that was not quantified.
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/team/group/bridge_construction/apps/app_bridgewait.c <span style="color: grey">(386482)</span></li>

 <li>/team/group/bridge_construction/apps/confbridge/conf_config_parser.c <span style="color: grey">(386482)</span></li>

 <li>/team/group/bridge_construction/bridges/bridge_simple.c <span style="color: grey">(386482)</span></li>

 <li>/team/group/bridge_construction/include/asterisk/bridging.h <span style="color: grey">(386482)</span></li>

 <li>/team/group/bridge_construction/include/asterisk/bridging_features.h <span style="color: grey">(386482)</span></li>

 <li>/team/group/bridge_construction/main/bridging.c <span style="color: grey">(386482)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/2474/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>