musiconhold.conf.sample 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. ;
  2. ; Music on Hold -- Sample Configuration
  3. ;
  4. [general]
  5. ;cachertclasses=yes ; use 1 instance of moh class for all users who are using it,
  6. ; decrease consumable cpu cycles and memory
  7. ; disabled by default
  8. ; valid mode options:
  9. ; files -- read files from a directory in any Asterisk supported
  10. ; media format
  11. ; quietmp3 -- default
  12. ; mp3 -- loud
  13. ; mp3nb -- unbuffered
  14. ; quietmp3nb -- quiet unbuffered
  15. ; custom -- run a custom application (See examples below)
  16. ; =========
  17. ; File-based (native) music on hold
  18. ; =========
  19. ;
  20. ; This plays files directly from the specified directory, no external
  21. ; processes are required. Files are played in normal sorting order
  22. ; (same as a sorted directory listing), and no volume or other
  23. ; sound adjustments are available. If the file is available in
  24. ; the same format as the channel's codec, then it will be played
  25. ; without transcoding (same as Playback would do in the dialplan).
  26. ; Files can be present in as many formats as you wish, and the
  27. ; 'best' format will be chosen at playback time.
  28. ;
  29. ; The path specified can be either an absolute path (starts with '/'),
  30. ; or a relative path; relative paths are interpreted as being relative
  31. ; to the 'astdatalibdir' in asterisk.conf, which defaults to
  32. ; /var/lib/asterisk.
  33. ;
  34. ; NOTE:
  35. ; If you are not using "autoload" in modules.conf, then you
  36. ; must ensure that the format modules for any formats you wish
  37. ; to use are loaded _before_ res_musiconhold. If you do not do
  38. ; this, res_musiconhold will skip the files it is not able to
  39. ; understand when it loads.
  40. ;
  41. [default]
  42. mode=files
  43. directory=moh
  44. ;
  45. ;[native-random]
  46. ;mode=files
  47. ;directory=moh
  48. ;digit=# ; If this option is set for a class, then when callers are
  49. ; ; listening to music on hold, they can press this digit, and
  50. ; ; they will switch to listening to this music class.
  51. ;announcement=queue-thankyou ;If this option is set for a class, then
  52. ; ; when callers get put on hold, the specified sound will be
  53. ; ; be played to them. Also, if using modes that Asterisk
  54. ; ; controls the playlist for (files, mp3, etc), the same
  55. ; ; sound will also be played between MOH songs.
  56. ;sort=random ; Sort the files in random order
  57. ;[native-alphabetical]
  58. ;mode=files
  59. ;directory=moh
  60. ;sort=alpha ; Sort the files in alphabetical order. If this option is
  61. ; ; not specified, the sort order is undefined.
  62. ; =========
  63. ; Other (non-native) playback methods
  64. ; =========
  65. ;[manual]
  66. ;mode=custom
  67. ; Note that with mode=custom, a directory is not required, such as when reading
  68. ; from a stream.
  69. ;directory=/var/lib/asterisk/mohmp3
  70. ;application=/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 --mono -s
  71. ;[ulawstream]
  72. ;mode=custom
  73. ;application=/usr/bin/streamplayer 192.168.100.52 888
  74. ;format=ulaw ; The 'format' option specifies the audio format that the
  75. ; ; 'application' will provide to Asterisk. In this example,
  76. ; ; streamplayer will output ulaw samples so we need to set the
  77. ; ; format to ulaw so that Asterisk knows how to interpret the
  78. ; ; incoming audio.
  79. ; mpg123 on Solaris does not always exit properly; madplay may be a better
  80. ; choice
  81. ;[solaris]
  82. ;mode=custom
  83. ;directory=/var/lib/asterisk/mohmp3
  84. ;application=/site/sw/bin/madplay -Q -o raw:- --mono -R 8000 -a -12
  85. ; By default, when res_musiconhold reloads or unloads, it sends a HUP signal
  86. ; to custom applications (and all descendants), waits 100ms, then sends a
  87. ; TERM signal, waits 100ms, then finally sends a KILL signal. An application
  88. ; which is interacting with an external device and/or spawns children of its
  89. ; own may not be able to exit cleanly in the default times, expecially if sent
  90. ; a KILL signal, or if it's children are getting signals directly from
  91. ; res_musiconhoild. To allow extra time, the 'kill_escalation_delay'
  92. ; class option can be used to set the number of milliseconds res_musiconhold
  93. ; waits before escalating kill signals, with the default being the current
  94. ; 100ms. To control to whom the signals are sent, the "kill_method"
  95. ; class option can be set to "process_group" (the default, existing behavior),
  96. ; which sends signals to the application and its descendants directly, or
  97. ; "process" which sends signals only to the application itself.
  98. ;[sox_from_device]
  99. ;mode=custom
  100. ;directory=/var/lib/asterisk/mohmp3
  101. ;application=/usr/bin/sox -q -t alsa -c 2 -r 48000 hw:1 -c 1 -r 8000 -t raw -s -
  102. ; Wait 500ms before escalating kill signals
  103. ;kill_escalation_delay=500
  104. ; Send signals to just the child process instead of all descendants
  105. ;kill_method=process