2002-05-12 11:48:14 +00:00
|
|
|
;
|
2005-08-22 19:29:29 +00:00
|
|
|
; Music on Hold -- Sample Configuration
|
2002-05-12 11:48:14 +00:00
|
|
|
;
|
Adding support for realtime music on hold. The following are the main points:
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
2007-11-28 00:47:22 +00:00
|
|
|
[general]
|
|
|
|
|
;cachertclasses=yes ; use 1 instance of moh class for all users who are using it,
|
2009-05-28 14:39:21 +00:00
|
|
|
; decrease consumable cpu cycles and memory
|
|
|
|
|
; disabled by default
|
Adding support for realtime music on hold. The following are the main points:
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
2007-11-28 00:47:22 +00:00
|
|
|
|
2005-08-22 19:29:29 +00:00
|
|
|
|
|
|
|
|
; valid mode options:
|
2009-05-28 14:39:21 +00:00
|
|
|
; files -- read files from a directory in any Asterisk supported
|
2006-11-07 18:56:56 +00:00
|
|
|
; media format
|
2009-05-28 14:39:21 +00:00
|
|
|
; quietmp3 -- default
|
2005-08-22 19:29:29 +00:00
|
|
|
; mp3 -- loud
|
|
|
|
|
; mp3nb -- unbuffered
|
|
|
|
|
; quietmp3nb -- quiet unbuffered
|
2006-03-17 08:46:31 +00:00
|
|
|
; custom -- run a custom application (See examples below)
|
2005-08-25 02:40:08 +00:00
|
|
|
|
2006-11-07 18:56:56 +00:00
|
|
|
; =========
|
2005-01-04 20:55:43 +00:00
|
|
|
; File-based (native) music on hold
|
2006-11-07 18:56:56 +00:00
|
|
|
; =========
|
2005-01-04 20:55:43 +00:00
|
|
|
;
|
|
|
|
|
; 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.
|
|
|
|
|
;
|
2008-10-16 08:30:32 +00:00
|
|
|
; The path specified can be either an absolute path (starts with '/'),
|
|
|
|
|
; or a relative path; relative paths are interpreted as being relative
|
2010-10-16 11:51:54 +00:00
|
|
|
; to the 'astdatalibdir' in asterisk.conf, which defaults to
|
2008-10-16 08:30:32 +00:00
|
|
|
; /var/lib/asterisk.
|
|
|
|
|
;
|
2005-01-04 20:55:43 +00:00
|
|
|
; 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.
|
|
|
|
|
;
|
2005-08-22 19:29:29 +00:00
|
|
|
|
2006-06-07 22:37:31 +00:00
|
|
|
[default]
|
|
|
|
|
mode=files
|
2008-10-16 08:30:32 +00:00
|
|
|
directory=moh
|
2005-08-22 19:29:29 +00:00
|
|
|
;
|
|
|
|
|
;[native-random]
|
|
|
|
|
;mode=files
|
2008-10-16 08:30:32 +00:00
|
|
|
;directory=moh
|
2007-05-22 18:52:59 +00:00
|
|
|
;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.
|
2012-01-23 18:34:47 +00:00
|
|
|
;announcement=queue-thankyou ;If this option is set for a class, then
|
|
|
|
|
; ; when callers get put on hold, the specified sound will be
|
|
|
|
|
; ; be played to them. Also, if using modes that Asterisk
|
|
|
|
|
; ; controls the playlist for (files, mp3, etc), the same
|
|
|
|
|
; ; sound will also be played between MOH songs.
|
2007-10-01 14:43:56 +00:00
|
|
|
;sort=random ; Sort the files in random order
|
2006-11-07 18:56:56 +00:00
|
|
|
|
2007-10-01 14:43:56 +00:00
|
|
|
;[native-alphabetical]
|
|
|
|
|
;mode=files
|
2008-10-16 08:30:32 +00:00
|
|
|
;directory=moh
|
2007-10-01 14:43:56 +00:00
|
|
|
;sort=alpha ; Sort the files in alphabetical order. If this option is
|
|
|
|
|
; ; not specified, the sort order is undefined.
|
2006-11-07 18:56:56 +00:00
|
|
|
|
|
|
|
|
; =========
|
|
|
|
|
; 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
|
2017-03-27 10:35:15 -04:00
|
|
|
;format=ulaw ; The 'format' option specifies the audio format that the
|
|
|
|
|
; ; 'application' will provide to Asterisk. In this example,
|
|
|
|
|
; ; streamplayer will output ulaw samples so we need to set the
|
|
|
|
|
; ; format to ulaw so that Asterisk knows how to interpret the
|
|
|
|
|
; ; incoming audio.
|
2006-11-07 18:56:56 +00:00
|
|
|
|
|
|
|
|
; 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
|
res_musiconhold: Add kill_escalation_delay, kill_method to class
By default, when res_musiconhold reloads or unloads, it sends a HUP
signal to custom applications (and all descendants), waits 100ms,
then sends a TERM signal, waits 100ms, then finally sends a KILL
signal. An application which is interacting with an external
device and/or spawns children of its own may not be able to exit
cleanly in the default times, expecially if sent a KILL signal, or
if it's children are getting signals directly from
res_musiconhoild.
* To allow extra time, the 'kill_escalation_delay'
class option can be used to set the number of milliseconds
res_musiconhold waits before escalating kill signals, with the
default being the current 100ms.
* To control to whom the signals are sent, the "kill_method" class
option can be set to "process_group" (the default, existing
behavior), which sends signals to the application and its
descendants directly, or "process" which sends signals only to the
application itself.
Change-Id: Iff70a1a9405685a9021a68416830c0db5158603b
2017-07-11 06:26:27 -06:00
|
|
|
|
|
|
|
|
; By default, when res_musiconhold reloads or unloads, it sends a HUP signal
|
|
|
|
|
; to custom applications (and all descendants), waits 100ms, then sends a
|
|
|
|
|
; TERM signal, waits 100ms, then finally sends a KILL signal. An application
|
|
|
|
|
; which is interacting with an external device and/or spawns children of its
|
|
|
|
|
; own may not be able to exit cleanly in the default times, expecially if sent
|
|
|
|
|
; a KILL signal, or if it's children are getting signals directly from
|
|
|
|
|
; res_musiconhoild. To allow extra time, the 'kill_escalation_delay'
|
|
|
|
|
; class option can be used to set the number of milliseconds res_musiconhold
|
|
|
|
|
; waits before escalating kill signals, with the default being the current
|
|
|
|
|
; 100ms. To control to whom the signals are sent, the "kill_method"
|
|
|
|
|
; class option can be set to "process_group" (the default, existing behavior),
|
|
|
|
|
; which sends signals to the application and its descendants directly, or
|
|
|
|
|
; "process" which sends signals only to the application itself.
|
|
|
|
|
|
|
|
|
|
;[sox_from_device]
|
|
|
|
|
;mode=custom
|
|
|
|
|
;directory=/var/lib/asterisk/mohmp3
|
|
|
|
|
;application=/usr/bin/sox -q -t alsa -c 2 -r 48000 hw:1 -c 1 -r 8000 -t raw -s -
|
|
|
|
|
; Wait 500ms before escalating kill signals
|
|
|
|
|
;kill_escalation_delay=500
|
|
|
|
|
; Send signals to just the child process instead of all descendants
|
|
|
|
|
;kill_method=process
|