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








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On January 20th, 2012, 5:43 p.m., <b>Mark Michelson</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/1685/diff/1/?file=23502#file23502line4107" style="color: black; font-weight: bold; text-decoration: underline;">/branches/1.8/main/features.c</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config)</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">4107</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                                <span class="n">ast_set_flag</span><span class="p">(</span><span class="n">chan</span><span class="p">,</span> <span class="n">AST_FLAG_BRIDGE_HANGUP_DONT</span><span class="p">);</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This flag gets cleared later in the bridge code. In the stock 1.8 branch, this is on lines 4255 and 4266.

As far as I can tell, the AST_BRIDGE_HANGUP_DONT flag was created specifically for this purpose. The only place I can find where it is set, prior to this patch&#39;s introduction, is in builtin transfer code. It is set to make sure that a transferee does not have his h extension run. This does the same thing except that it applies the principal to technology-specific transfers.</pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This was meant to be in response to Richard&#39;s comment. Oops.</pre>
<br />




<p>- Mark</p>


<br />
<p>On January 20th, 2012, 4:54 p.m., Mark Michelson wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/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 Mark Michelson.</div>


<p style="color: grey;"><i>Updated Jan. 20, 2012, 4:54 p.m.</i></p>




<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;">A recent change (rev 347595) caused channel technology-specific blind transfers to fail if the called channel transferred the calling channel, and the calling channel was in a context or macro with an h extension.

Presumably, there was a pre-existing problem since the h extension was being run on the transferee channel, and the transferee channel was not being hung up in the first place. Rather, the transferer (who does not have a PBX running on his channel) was the one being hung up. With the addition of setting the softhangup flag, the problem was compounded since the channel would be hung up unexpectedly.

My change is to examine the softhangup value on the channel when a bridge is broken and set the AST_FLAG_BRIDGE_HANGUP_DONT flag on the channel if the cause of the bridge breakage is for a &quot;fake&quot; hangup, such as an async goto. This makes it so the h extension is not run on a channel that&#39;s actually still alive, and it makes it so that blind transfers are once again fixed.

My only hesitation with just committing this is that it means that the h extension is no longer run in situations where it once was. However, in my opinion, it was buggy to be running the h extension since the channel was not actually being hung up.</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;">Tested blind transfers using SIP phones. Worked for me. Asked reporter of ASTERISK-19173 for testing feedback as well.</pre>
  </td>
 </tr>
</table>



<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-19173">ASTERISK-19173</a>


</div>


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

 <li>/branches/1.8/main/features.c <span style="color: grey">(351501)</span></li>

</ul>

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




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








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