[asterisk-dev] [Code Review] 3471: Filesystem based dynamic MoH classes

Vitezslav Novy reviewboard at asterisk.org
Tue Apr 22 08:57:27 CDT 2014

This is an automatically generated e-mail. To reply, visit:

Review request for Asterisk Developers.

Bugs: ASTERISK-23636

Repository: Asterisk


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


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.


  /trunk/res/res_musiconhold.c 412895 
  /trunk/configs/musiconhold.conf.sample 412895 
  /trunk/CHANGES 412895 

Diff: https://reviewboard.asterisk.org/r/3471/diff/


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


Vitezslav Novy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140422/12bc37f8/attachment.html>

More information about the asterisk-dev mailing list