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










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On May 30th, 2013, 10:25 p.m. UTC, <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/2545/diff/3/?file=38763#file38763line614" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/bridge_construction/res/res_parking.c</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

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



 
 

 <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">614</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb">        </span><span class="tb">        </span><span class="cm">/* The following function doesn&#39;t actually destroy contexts. The PBX API is just misleading. */</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 comment is confusing.

ast_context_destroy *does* destroy contexts, from what I can tell. The comment also doesn&#39;t really help matters because it leaves the reader wandering &quot;If ast_context_destroy() doesn&#39;t destroy contexts, then what does it do and why are you calling it?&quot;</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;">Yeah, this comment is misleading.  I&#39;m rewriting it.

                /* Although the function is called ast_context_destroy, the use of this funtion is
                 * intended only to remove extensions, hints, etc registered by the parking lot&#39;s registrar.
                 * It won&#39;t actually destroy the context unless that context is empty afterwards and it is
                 * unreferenced.
                 */</pre>
<br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On May 30th, 2013, 10:25 p.m. UTC, <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/2545/diff/3/?file=38763#file38763line699" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/bridge_construction/res/res_parking.c</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

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



 
 

 <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">699</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb">        </span><span class="n">ast_log</span><span class="p">(</span><span class="n">LOG_ERROR</span><span class="p">,</span> <span class="s">&quot;Parking lot &#39;%s&#39; -- Needs an extension &#39;%s@%s&#39;, but that extension is already owned by %s.</span><span class="se">\n</span><span class="s">&quot;</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">700</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb">        </span>        <span class="n">lot_cfg</span><span class="o">-&gt;</span><span class="n">name</span><span class="p">,</span> <span class="n">extension_name</span><span class="p">,</span> <span class="n">extension_context</span><span class="p">,</span> <span class="n">extension_context</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;">I think you meant to have &quot;extension_registrar&quot; as the final argument.</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;">Good catch. Thanks.</pre>
<br />




<p>- jrose</p>


<br />
<p>On May 28th, 2013, 6:31 p.m. UTC, jrose 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, Matt Jordan and rmudgett.</div>
<div>By jrose.</div>


<p style="color: grey;"><i>Updated May 28, 2013, 6:31 p.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-21645">ASTERISK-21645</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;">Extension generation and removal for:
Park a call to the parkext in the parking context
Retrieve parked calls from the space numbers in the parking context
Hints for ParkedCall extensions

Extension generation (but no removal yet) for:
Dial the peer which parked the call on parking timeout in the park-dial context

Extension removal for the park-dial extensions will eventually be handled when reloads are implemented. Since they can&#39;t reliably be said to belong to
the parking lot, they are registered to the base registrar for the parking system instead.

Applying bridge features in the way features.c did (as arguments to dial) is no longer necessary on account of how features are handled now.

Each parking lot has its own registrar which is &#39;res_parking/&lt;parking lot name&gt;&#39;
The registrar used for non-lot-specific extensions is just &#39;res_parking&#39;

When a parking lot is destroyed or reloaded, all of its registered extensions are flushed and rebuilt.

Note: ParkedCall extensions no longer belong to the parked user involved with them unlike how old parking works. This means that if a parking lot is reloaded and the new configuration specifies that the slot the old call was parked at no longer exists, the extension to retrieve that call will go away even though the call is still parked there. This will resolve itself when the parked call times out (provided timeout hasn&#39;t been disabled), and manually created ParkedCall extensions can still retrieve that call if the parking space option isn&#39;t provided.</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;">Checked that extensions are generated and destroyed for Park and ParkedCall as expected with multiple parking lots.
Overlaps are currently allowed. If two parking lots occupy the same space and parkext exclusive is in use, it&#39;s possible for one parking lot&#39;s extensions to be overwritten in favor of another. When parking lot extensions are overwritten by other parking lot extensions, warnings are issued.
Checked that extensions are generated and appropriately called in park-dial when a parked call times out.
Checked that the timeout is set to the parking lot&#39;s parkdialtimeout value.</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/CHANGES <span style="color: grey">(389247)</span></li>

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

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

 <li>/team/group/bridge_construction/res/parking/parking_bridge_features.c <span style="color: grey">(389247)</span></li>

 <li>/team/group/bridge_construction/res/parking/parking_controller.c <span style="color: grey">(389247)</span></li>

 <li>/team/group/bridge_construction/res/parking/res_parking.h <span style="color: grey">(389247)</span></li>

 <li>/team/group/bridge_construction/res/res_parking.c <span style="color: grey">(389247)</span></li>

</ul>

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







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








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