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





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On September 12th, 2014, 4 p.m. UTC, <b>one47</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;">Personal preference, but is it appropriate to include the "sort" value in the output of "moh show classes" while we're tidying things up?

Just a thought.</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;">Certainly appropriate. But since I won't be seeing any of it because I use realtime moh, it's not on the top of my list.

If you like the feature, feel free to code it up. And you get to defend the extra room it takes in the output ;-)

Thanks for the review though (and you, Mark).</pre>
<br />










<p>- wdoekes</p>


<br />
<p>On September 12th, 2014, 12:22 p.m. UTC, wdoekes 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.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By wdoekes.</div>


<p style="color: grey;"><i>Updated Sept. 12, 2014, 12:22 p.m.</i></p>









<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;">This changeset:

- adds sort=randstart (next to sort=, sort=random, sort=alpha)

- combines duplicate moh option parsing code into a single function

- adds deprecationwarnings for application=r to sort randomly

- adds deprecationwarnings for random=yes to sort randomly

- removes invisible code that was supposed to stay until 1.8 
  ("These names were deprecated in 1.4 and should not be used until
    after the next major release")


The sort=randstart works like sort=alpha, except we start at a random
position.

That means that playlist order will be respected while you don't need
to listen to the same song every time you dial in.


I considered also adding a sort=shuffle which does a shuffle where
sort=alpha now does the qsort. But that would probably only be useful
for those few people that use uncached (realtime) classes.</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 that sort=, sort=alpha, sort=random, sort=randstart all work as
promised.

(Testing was done on an asterisk-10 branch with uncached realtime moh.
But the code in trunk is exactly the same, apart from the
ast_format_cache_get to ast_format_cache_get change.)


Checked that the new option 'randstart' fits within the current alembic
DB schema. It does:

    op.create_table(
        'musiconhold',
        sa.Column('name', sa.String(80), primary_key=True, nullable=False),
...
        sa.Column('sort', sa.String(10)),
        sa.Column('format', sa.String(10)),
        sa.Column('stamp', sa.DateTime())
    )</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>/trunk/res/res_musiconhold.c <span style="color: grey">(422983)</span></li>

 <li>/trunk/configs/samples/musiconhold.conf.sample <span style="color: grey">(422983)</span></li>

</ul>

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







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








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