1. When moh is started, we search first in memory to find the class. If we do not find it in memory, we search realtime instead. 2. When moh is restarted (as in, it had been started on this particular channel, stopped, and now we're starting it again), if using the "files" mode, then realtime will always be rechecked. If you are using other modes, however, we will simply reattach to the external running process which was playing moh earlier in the call. This is a necessary compromise so that we don't end up with too many background processes. 3. musiconhold.conf has a general section now. It has one option: cachertclasses. If set to yes, then moh classes found in realtime will be added to the in-memory list. This has the advantage of not requiring database lookups each time moh is started, but it has the disadvantage of not truly being realtime. I have tested this for functionality, and it passes. I also tested this under valgrind and there are no memory problems reported under typical use. Special thanks to Sergee for implementing this feature and enduring my complaints on the bugtracker! (closes issue #11196, reported and patched by sergee) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
80 lines
2.5 KiB
Text
80 lines
2.5 KiB
Text
;
|
|
; Music on Hold -- Sample Configuration
|
|
;
|
|
[general]
|
|
;cachertclasses=yes ; use 1 instance of moh class for all users who are using it,
|
|
; decrease consumable cpu cycles and memory
|
|
; disabled by default
|
|
|
|
|
|
; valid mode options:
|
|
; files -- read files from a directory in any Asterisk supported
|
|
; media format
|
|
; quietmp3 -- default
|
|
; mp3 -- loud
|
|
; mp3nb -- unbuffered
|
|
; quietmp3nb -- quiet unbuffered
|
|
; custom -- run a custom application (See examples below)
|
|
|
|
; =========
|
|
; File-based (native) music on hold
|
|
; =========
|
|
;
|
|
; This plays files directly from the specified directory, no external
|
|
; processes are required. Files are played in normal sorting order
|
|
; (same as a sorted directory listing), and no volume or other
|
|
; sound adjustments are available. If the file is available in
|
|
; the same format as the channel's codec, then it will be played
|
|
; without transcoding (same as Playback would do in the dialplan).
|
|
; Files can be present in as many formats as you wish, and the
|
|
; 'best' format will be chosen at playback time.
|
|
;
|
|
; NOTE:
|
|
; If you are not using "autoload" in modules.conf, then you
|
|
; must ensure that the format modules for any formats you wish
|
|
; to use are loaded _before_ res_musiconhold. If you do not do
|
|
; this, res_musiconhold will skip the files it is not able to
|
|
; understand when it loads.
|
|
;
|
|
|
|
[default]
|
|
mode=files
|
|
directory=/var/lib/asterisk/moh
|
|
;
|
|
;[native-random]
|
|
;mode=files
|
|
;directory=/var/lib/asterisk/moh
|
|
;digit=# ; If this option is set for a class, then when callers are
|
|
; ; listening to music on hold, they can press this digit, and
|
|
; ; they will switch to listening to this music class.
|
|
;sort=random ; Sort the files in random order
|
|
|
|
;[native-alphabetical]
|
|
;mode=files
|
|
;directory=/var/lib/asterisk/moh
|
|
;sort=alpha ; Sort the files in alphabetical order. If this option is
|
|
; ; not specified, the sort order is undefined.
|
|
|
|
; =========
|
|
; Other (non-native) playback methods
|
|
; =========
|
|
|
|
;[manual]
|
|
;mode=custom
|
|
; Note that with mode=custom, a directory is not required, such as when reading
|
|
; from a stream.
|
|
;directory=/var/lib/asterisk/mohmp3
|
|
;application=/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 --mono -s
|
|
|
|
;[ulawstream]
|
|
;mode=custom
|
|
;application=/usr/bin/streamplayer 192.168.100.52 888
|
|
;format=ulaw
|
|
|
|
; mpg123 on Solaris does not always exit properly; madplay may be a better
|
|
; choice
|
|
;[solaris]
|
|
;mode=custom
|
|
;directory=/var/lib/asterisk/mohmp3
|
|
;application=/site/sw/bin/madplay -Q -o raw:- --mono -R 8000 -a -12
|