<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/3380/">https://reviewboard.asterisk.org/r/3380/</a>
     </td>
    </tr>
   </table>
   <br />



<table bgcolor="#e0e0e0" width="100%" cellpadding="8" style="border: 1px gray solid;">
 <tr>
  <td>
   <h1 style="margin-right: 0.2em; padding: 0; font-size: 10pt;">This change has been marked as submitted.</h1>
  </td>
 </tr>
</table>
<br />


<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.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers, Matt Jordan and opticron.</div>
<div>By Jonathan Rose.</div>


<p style="color: grey;"><i>Updated March 25, 2014, 10:44 a.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</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;">Committed in revision 411086</pre>
  </td>
 </tr>
</table>







<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;">I was examining a testsuite failure (which should be resolved by https://reviewboard.asterisk.org/r/3361/) and stumbled across the following behavior:

A channel enters a stasis application
ARI pushes that channel into a bridge - the bridge is automatically subscribed to the stasis application
ARI pulls the channel from the bridge - the bridge is still subscribed to the stasis application.

Looking into why this was, I became aware that the patch which introduced the aforementioned test failure (which turned out to be just because the test was trying to unsubscribe for something that it probably shouldn't have been trying to unsubscribe) had introduced a two subscription scheme when the stasis channels are added to bridges and that only one of these stasis channels was being cleared.  It turned out to be a rather simple problem where the previously used bridge can't be tracked properly because we are resetting it to NULL all the time. The fix was quite simple and I just had to move the initialization of the bridge used to track through repeat iterations out of the loop.

Today's lesson: Hooray for accidentally looking into test failures that have already been solved!</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;">Pretty much just used the scenario described above twice.  The test still fails with this patch in place simply because the second subscription is still active as the channel exits the bridge and deleting automatically created subscriptions manually is probably just a bad idea in general.</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>/branches/12/res/res_stasis.c <span style="color: grey">(411008)</span></li>

</ul>

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







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




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