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



<table bgcolor="#e0e0e0" width="100%" cellpadding="8" style="border: 1px gray solid;">
 <tr>
  <td>
   <h1 style="margin-right: 0.2em; padding: 0; font-size: 10pt;">This change has been discarded.</h1>
  </td>
 </tr>
</table>
<br />


<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 Vitezslav Novy.</div>


<p style="color: grey;"><i>Updated April 28, 2014, 3:26 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-23636">ASTERISK-23636</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;">This patch introduces another approach to dynamically controlled MoH.
Unlike realtime this way is file based.

As a switch between normal and alternative behavior, boolean variable
'dynamic' is used in MoH config file.

By setting

dynamic=yes

new behavior is switched on.

How dynamic behavior works

All static MoH classes in musiconhold.conf and realtime are ignored, except [default]
class. On the other hand dynamic class named 'default' is ignored too.

New variable 'dynamic_dir' defines directory, where dynamic classes are
defined. Each first level subdirectory of dynamic_dir defines one MoH class
with same name as directory name.
If class directory contains playlist file 'playlist.txt' content of
the file defines audiofiles in class and their order. Otherwise directory
is scanned same way as for standard MoH class with mode=files.

Playlist expects one file on line, without path and without extension.
Files must be placed in class directory.
If first line of playlist contains exactly one character '%', files will be
ordered randomly.

</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;">Original 'static' behavior with dynamic=no
Dynamic class without playlist
Dynamic class with playlist
Random ordering with % on first line of playlist 
% as audio file name

</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">(412900)</span></li>

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

 <li>/trunk/CHANGES <span style="color: grey">(412900)</span></li>

</ul>

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







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




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