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





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On August 11th, 2011, 9:28 a.m., <b>jrose</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Honestly, patches this huge are very difficult to track with reviewboard, and in fact I don&#39;t really believe there is a diff viewer on Earth that could adequately portray something with this much reordering...

I looked through some of it, but couldn&#39;t really find anything too suspicious, so I just applied the patch and started testing some things and tried to break it.  As far as I can tell, nothing is especially broken.  I tried filling up parking lots, reloading parking lots after deleting them, reloading parking lots after deleting them while they were full... basically anything I had to do back when I was testing the configuration change patch for parking lots before.  It seems to work like it should just fine.

That said, I&#39;m a little curious about the Enabled field that shows up now when features show is used from CLI.  Could you explain that one to me?  At first I thought it would do something like stop a parkinglot from working if reload was used and the parkinglot was in use and couldn&#39;t be deleted, but as far as I can tell, it doesn&#39;t get disabled in that case.</pre>
 </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Try SlickEdit it does a very good job.  It also has options to specify what is considered a difference. /end-commercial :)

The enabled field indicates if you can put calls into that parking lot.  A parking lot becomes disabled if you have deleted it from the config file but it still has calls parked in it.  It also can become disabled if the parking lot could not get activated because items (parking lot context and access extension) failed to be inserted into the dialplan.

The parkinglot_is_marked_cg() function deletes removed parking lots, marks deleted parking lots still in use as disabled, and gives a warning when still in use.</pre>
<br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On August 11th, 2011, 9:28 a.m., <b>jrose</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/1358/diff/2/?file=17923#file17923line1436" style="color: black; font-weight: bold; text-decoration: underline;">/branches/1.8/main/features.c</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </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; ">struct ast_park_call_args {</pre></td>

  </tr>
 </tbody>






 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1084</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                        <span class="n">ast_indicate_data</span><span class="p">(</span><span class="n">pu</span><span class="o">-&gt;</span><span class="n">chan</span><span class="p">,</span> <span class="n">AST_CONTROL_HOLD</span><span class="p">,</span><span class="ew"> </span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1365</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                        <span class="n">ast_indicate_data</span><span class="p">(</span><span class="n">pu</span><span class="o">-&gt;</span><span class="n">chan</span><span class="p">,</span> <span class="n">AST_CONTROL_HOLD</span><span class="p">,</span><span class="ew"> </span></pre></td>
  </tr>

 </tbody>


 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1085</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                                <span class="n">S_OR</span><span class="p">(</span><span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkinglot</span><span class="o">-&gt;</span><span class="n">mohclass</span><span class="p">,</span> <span class="nb">NULL</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">1366</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                                <span class="n">S_OR</span><span class="p">(</span><span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkinglot</span><span class="o">-&gt;</span><span class="n"><span class="hl">cfg</span></span><span class="p"><span class="hl">.</span></span><span class="n">mohclass</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">),</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1086</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                                <span class="o">!</span><span class="n">ast_strlen_zero</span><span class="p">(</span><span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkinglot</span><span class="o">-&gt;</span><span class="n">mohclass</span><span class="p">)</span> <span class="o">?</span> <span class="n">strlen</span><span class="p">(</span><span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkinglot</span><span class="o">-&gt;</span><span class="n">mohclass</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">:</span> <span class="mi">0</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">1367</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                                <span class="o">!</span><span class="n">ast_strlen_zero</span><span class="p">(</span><span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkinglot</span><span class="o">-&gt;</span><span class="n"><span class="hl">cfg</span></span><span class="p"><span class="hl">.</span></span><span class="n">mohclass</span><span class="p">)</span> <span class="o">?</span> <span class="n">strlen</span><span class="p">(</span><span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkinglot</span><span class="o">-&gt;</span><span class="n"><span class="hl">cfg</span></span><span class="p"><span class="hl">.</span></span><span class="n">mohclass</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">:</span> <span class="mi">0</span><span class="p">);</span></pre></td>
  </tr>

 </tbody>





 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1087</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="p">}</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1368</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="p">}</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1088</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="p">}</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1369</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="p">}</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1089</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="ew">        </span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1370</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="ew">        </span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1090</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">pu</span><span class="o">-&gt;</span><span class="n">start</span> <span class="o">=</span> <span class="n">ast_tvnow</span><span class="p">();</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1371</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">pu</span><span class="o">-&gt;</span><span class="n">start</span> <span class="o">=</span> <span class="n">ast_tvnow</span><span class="p">();</span></pre></td>
  </tr>

 </tbody>


 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1091</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkingtime</span> <span class="o">=</span> <span class="p">(</span><span class="n">args</span><span class="o">-&gt;</span><span class="n">timeout</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="n">args</span><span class="o">-&gt;</span><span class="n">timeout</span> <span class="o">:</span> <span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkinglot</span><span class="o">-&gt;</span><span class="n">parkingtime</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">1372</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkingtime</span> <span class="o">=</span> <span class="p">(</span><span class="n">args</span><span class="o">-&gt;</span><span class="n">timeout</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="n">args</span><span class="o">-&gt;</span><span class="n">timeout</span> <span class="o">:</span> <span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkinglot</span><span class="o">-&gt;</span><span class="n"><span class="hl">cfg</span></span><span class="p"><span class="hl">.</span></span><span class="n">parkingtime</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>





 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1092</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">if</span> <span class="p">(</span><span class="n">args</span><span class="o">-&gt;</span><span class="n">extout</span><span class="p">)</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1373</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">if</span> <span class="p">(</span><span class="n">args</span><span class="o">-&gt;</span><span class="n">extout</span><span class="p">)</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1093</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="o">*</span><span class="p">(</span><span class="n">args</span><span class="o">-&gt;</span><span class="n">extout</span><span class="p">)</span> <span class="o">=</span> <span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkingnum</span><span class="p">;</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1374</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="o">*</span><span class="p">(</span><span class="n">args</span><span class="o">-&gt;</span><span class="n">extout</span><span class="p">)</span> <span class="o">=</span> <span class="n">pu</span><span class="o">-&gt;</span><span class="n">parkingnum</span><span class="p">;</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1094</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1375</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1095</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">if</span> <span class="p">(</span><span class="n">peer</span><span class="p">)</span> <span class="p">{</span><span class="ew"> </span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1376</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">if</span> <span class="p">(</span><span class="n">peer</span><span class="p">)</span> <span class="p">{</span><span class="ew"> </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;">Since you are already in the neighborhood for these, you could go ahead and clean up these blobs and add brackets to if (args-&gt;extout)</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;">I think a separate commit to delete trailing whitespace and fix-up code indention should be done rather than adding those changes to this patch.</pre>
<br />




<p>- rmudgett</p>


<br />
<p>On August 10th, 2011, 8:06 p.m., rmudgett 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 rmudgett.</div>


<p style="color: grey;"><i>Updated Aug. 10, 2011, 8:06 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;">Fix multiple parking issues.

JIRA ASTERISK-17183 / SWP-3068
Multi-parkinglot directs calls to wrong parkinglot.
JIRA ASTERISK-17870 / SWP-3520
Cannot retrieve parked calls.
JIRA AST-576 / SWP-3535
Issues with parking lots

* Removed searching for parking lots by extension.  Parking lots can only
be found by the parking lot name since parking lot access extensions and
spaces are not guaranteed to be unique.

* Added parking_lot_name option to the Park and ParkedCall applications.
Updated documentation for Park and ParkedCall applications.

* Add parkext_exclusive configuration option to make parking entry
extensions specify which parking lot they access.


JIRA ASTERISK-17452 / SWP-3157
Parking_offset not used
JIRA AST-624 / SWP-3603
&#39;next&#39; setting for findslot does nothing

* Reimplemented since findslot feature option broken by -r114655.


JIRA ASTERISK-15792 / SWP-1074
Dialplan continues execution after transfer to park.

This happens for DTMF attended transfer, DTMF blind transfer, and DTMF
one-touch-parking if the party initiating these features also initiated
the call.

* Fixed the return code from the affected builtin features when parking a
call.


JIRA AST-607 / SWP-3605:
The courtesytone is not playing to the expected call when picking up a
parked call.

This is mostly a documentation problem.  However, the option is not reset
to the default when features.conf is reloaded.

* Updated features.conf.sample documentation for courtesytone and
parkedplay options.

* Reset the parkedplay option to default when features.conf is reloaded.


JIRA AST-615 / SWP-3613:
AMI Park action followed by features reload results in orphaned channels
in parking lot.

* Reloading features.conf will not touch parking lots that have calls
still parked in them.  Reload again at a later time.


Misc additional fixes:

* Added unit test for parking lot dialplan usage checking.

* Made update connected line when a parked call is retrieved from a
parking lot.

* Made retrieved parked call stop ringing or MOH depending upon how the
call was waiting in the parking lot.

* Made CLI &quot;features show&quot; indicate if the parking lot is enabled for use.

* Added PARKINGDYNEXTEN channel variable to allow dynamic parking lots to
specify the parking lot access extension.

* Made AMI ParkedCalls action ParkedCall events have a Parkinglot header.

* Made AMI ParkedCalls action ParkedCallsComplete event have a Total
header.

* Fixed potential deadlock from AMI Park action holding channel locks
while calling masq_park_call().

* Fixed several places where ast_strdupa() were used inside of loops.
(Mostly fixed by refactoring the loop body into its own function.)

* Fixed copy_parkinglot() copying too much from the source parking lot.
Extracted the parking lot configuration settings into struct
parkinglot_cfg.

* Refactored courtesytone playing code to put the channel not playing the
tone in autoservice.

* Fix when pbx-parkingfailed is played that the other channel is put in
autoservice if it exists.

* Fixed parkinglot reference leak in parked_call_exec() error paths.

* Fixed parkinglot_unref() use of parkinglot after it was unreffed.

* Made destroy the struct ast_parkinglot parkings lock when done.

* Refactored the features.conf parking lot configuration code to eliminate
redundancy.

* Fixed feature reload to better protect parking lots.

* Fixed parking lot container reference leak in handle_parkedcalls().

* Fixed the total count in handle_parkedcalls().
</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;">Able to park and retrieve calls from the expected parking lots.</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-15729">ASTERISK-15729</a>, 

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

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

 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-17870">ASTERISK-17870</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/CHANGES <span style="color: grey">(331573)</span></li>

 <li>/branches/1.8/configs/features.conf.sample <span style="color: grey">(331573)</span></li>

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

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

</ul>

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




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








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