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









<div>




<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/1397/diff/1/?file=19535#file19535line6483" style="color: black; font-weight: bold; text-decoration: underline;">/team/irroot/distrotech-customers-1.8/main/channel.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_do_masquerade(struct ast_channel *original)</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">6483</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">ast_channel_unlock</span><span class="p">(</span><span class="n">clonechan</span><span class="p">);</span></pre></td>
  </tr>

  <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">6484</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">ast_hangup</span><span class="p">(</span><span class="n">clonechan</span><span class="p">);</span></pre></td>
  </tr>

  <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">6485</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">clonechan</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This is attempting to hide the fact that &quot;bad things&quot; have happened.  The channel is in an unknown state at this point and there is not a good way to recover.</pre>
</div>
<br />

<div>




<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/1397/diff/1/?file=19536#file19536line6928" style="color: black; font-weight: bold; text-decoration: underline;">/team/irroot/distrotech-customers-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; ">static int manager_park(struct mansession *s, const struct message *m)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">6928</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">chan</span><span class="o">-&gt;</span><span class="n">pbx</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="n">chan</span><span class="o">-&gt;</span><span class="n">masq</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="n">ast_test_flag</span><span class="p">(</span><span class="n">chan</span><span class="p">,</span> <span class="n">AST_FLAG_ZOMBIE</span><span class="p">)</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">6928</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">if</span> <span class="p">(</span><span class="n"><span class="hl">chan</span></span><span class="o"><span class="hl">-&gt;</span></span><span class="n"><span class="hl">tech_pvt</span></span><span class="hl"> </span><span class="o"><span class="hl">&amp;&amp;</span></span><span class="hl"> </span><span class="o">!</span><span class="n">chan</span><span class="o">-&gt;</span><span class="n">pbx</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="n">chan</span><span class="o">-&gt;</span><span class="n">masq</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="n">ast_test_flag</span><span class="p">(</span><span class="n">chan</span><span class="p">,</span> <span class="n">AST_FLAG_ZOMBIE</span><span class="p">)</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Testing for chan-&gt;tech_pvt is not a good thing to do here.  It is unlikely that a channel driver will not need a tech_pvt to operate but it must be allowed.
</pre>
</div>
<br />



<p>- rmudgett</p>


<br />
<p>On August 29th, 2011, 8:30 a.m., irroot 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 irroot.</div>


<p style="color: grey;"><i>Updated Aug. 29, 2011, 8:30 a.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 sip phone tries to pickup a call but for some reason looses the pvt this causes all sorts of mischief.

Im proposing that sip_hangup return -1 when there is no private it has failed what it should be doing.
if the hangup fails ast_do_masquerade will kill the channel and return not leaving the channel orphaned.

[Aug 26 10:50:21] NOTICE[29961] app_directed_pickup.c: pickup SIP/2201-0000167c attempt by SIP/2225-0000168c
[Aug 26 10:50:22] WARNING[29961] chan_sip.c: No SIP tech_pvt! Fixup of SIP/2225-0000168c failed.
[Aug 26 10:50:22] WARNING[29961] channel.c: Fixup failed on channel SIP/2225-0000168c&lt;MASQ&gt;, strange things may happen.
[Aug 26 10:51:23] NOTICE[21093] chan_sip.c: Disconnecting call &#39;SIP/2225-0000168c&#39; for lack of RTP activity in 61 seconds
</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-18273">ASTERISK-18273</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>/team/irroot/distrotech-customers-1.8/channels/chan_sip.c <span style="color: grey">(333499)</span></li>

 <li>/team/irroot/distrotech-customers-1.8/main/channel.c <span style="color: grey">(333499)</span></li>

 <li>/team/irroot/distrotech-customers-1.8/main/features.c <span style="color: grey">(333499)</span></li>

</ul>

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




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








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