[Asterisk-doc] Chapter 7: Music on Hold

Nick Bachmann asterisk-doc@lists.digium.com
Sat, 27 Dec 2003 01:42:02 -0500


This is a multi-part message in MIME format.
--------------020809030605090407050600
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi All-

I've just finished a draft of the Music on Hold section of Chapter 7 and 
wanted to post my work for critique.  I still need to run over it again 
for spelling and grammar mistakes, but I wanted to send what I have to 
avoid duplicating work.  I just ran "cvs diff" and posted the output... 
if you want something else I'll be happy to provide that.

Thanks!

Nick
(hermie on IRC)

--------------020809030605090407050600
Content-Type: text/html;
 name="ch7.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ch7.diff"

Index: chapter07.xml
===================================================================
RCS file: /cvsroot/asterisk/docs/chapter07.xml,v
retrieving revision 1.5
diff -r1.5 chapter07.xml
4a5,7
> 		<para>
> 		Before using Asterisk's Music On Hold feature, mpg123 and a timing system must be in place.
> 		</para>
7c10,29
< 			<para/>
---
> 			<para>
> 			Music on Hold requires mpg123. Note that mpg321, which is often is often linked to /usr/bin/mpg123,
> 			will not work. Additionally, mpg123 must be installed in /usr/bin. 
> 			</para>
> 			<para>
> 			mpg134 can be downloaded from <ulink url="http://www.mpg123.de" type="http">http://www.mpg123.de</ulink>.
> 			Before compiling mpg123, change the line in the Makefile that reads
> 			<blockquote>
> 				<para>
> 				PREFIX=/usr/local
> 				</para>
> 			</blockquote>
> 			to
> 			<blockquote>
> 		        	<para>
>                                 PREFIX=/usr
>                         	</para>
> 			</blockquote>
> 			</para>
> 			
10,11c32,122
< 			<title>Timing: zaptel/ztdummy/ztrtc</title>
< 			<para/>
---
> 			<title>Timing: zaptel/ztdummy/zaprtc</title>
> 			<para>
> 			Asterisk's Music On Hold application requires a timing source to work correctly.  
> 			There are three possible timing sources that can be used.
> 			</para>
> 			<sect3>
> 				<title>Zaptel</title>
> 				<para>
> 				The Zaptel drivers, which run Digium's Wildcard cards, can be used as a timing source. 
> 				If you have a Zaptel card, there is no special setup needed other than loading the standard 
> 				kernel module for the card. Simply set up the Zaptel interface as described previously
> 				in this guide.
> 				</para>
> 			</sect3><sect3>
> 				<title>ztdummy</title>
> 				<para>
> 				ztdummy is a Zaptel driver designed for use as a timing source without having a Wildcard 
> 				board.  It uses the USB devices for timing, so the usb-ohci kernel module must be installed
> 				(lsmod can be used to check). ztdummy is included with the zaptel tree of Asterisk CVS. By
> 				default, however, it is not compiled. To enable the compilation of ztdummy, open the
> 				Makefile in zaptel source directory for editing.  Find the line that reads
> 				<blockquote>
> 					<para>
> 					<literallayout>
> 					MODULES=zaptel.o tor2.o torisa.o wcusb.o wcfxo.o wcfxs.o \
> 					        ztdynamic.o ztd-eth.o wct1xxp.o wct4xxp.o # ztdummy.o
> 					</literallayout>
> 					</para>
> 				</blockquote>
> 				and remove the # before 'ztdummy.o'.  From there, run <command>make</command> and
> 				<command>make install</command> as usual.  Before running Asterisk, you'll need to
> 				load the ztdummy driver by running <command>modproble ztdummy</command>. 
> 				</para>
> 			</sect3><sect3>
> 				<title>zaprtc</title>
> 				<para>
> 				ztrtc uses the system clock rather than the USB subsystem to get timing information.  
> 				Note, however, that ztrtc does not work on multiprocessor systems.  ztrtc does not
> 				come with Asterisk but is available from 
> 				<ulink url="http://www.junghanns.net/asterisk/" type="http">http://www.junghanns.net/asterisk/</ulink>.
> 				</para>
> 			</sect3>
> 		</sect2>
> 		<sect2>
> 			<title>Configuration File: /etc/asterisk/musiconhold.conf</title>
> 			<para>
> 			The musiconhold.conf syntax is simple and similar to other Asterisk files.  Here is a sample
> 			configuration file:
> 			<blockquote>
> 				<para>
> 				<literallayout>
> 				[classes]
> 				default => quietmp3:/var/lib/asterisk/mohmp3
> 				nirvana => quietmp3:/usr/share/mp3/nirvana-music
> 				random-nirvana => quietmp3:/usr/share/mp3/nirvana-music,-z
> 				loud-nirvana => mp3:/usr/share/mp3/nirvana-music
> 				</literallayout>
> 				</para>
> 			</blockquote>
> 			In this example, the class <command>default</command> plays MP3s from the directory 
> 			/var/lib/asterisk/mohmp3/ sequentially. Note the 'quietmp3' directive, which keeps the music
> 			at an appropriate volume for most telephony Music on Hold applications. The class 
> 			<command>nirvana</command> is similar, but uses the directory /usr/share/mp3/nivrana-music/ instead.
> 			<command>random-nirvana</command> picks files in the directory randomly, instead of sequentially,
> 			due to the '-z' option at the end of the line.  The final class, <command>loud-nirvana</command> 
> 			does not reduce the volume of the output, due to 'quietmp3' being replaced by 'mp3'. The 'mp3' 
> 			directive is useful for applications targeting the hearing impaired (as well as Nirvana fans).
> 			</para>
> 		</sect2>
> 		<sect2>
> 			<title>Adding Music on Hold to the Dialplan</title>
> 			<para>
> 			Adding Music on Hold to the dial plan is fairly straightforward and simple. Just add 
> 			<command>MusicOnHold(class)</command> as you would Dial() or Voicemail(). For example:
> 			<blockquote>
> 				<para>
> 				<literallayout>
> 				exten => 6789,1,Answer()
> 				exten => 6789,2,MusicOnHold(nirvana)
> 				</literallayout>
> 				</para>
> 			</blockquote>
> 			</para>
> 		</sect2>
> 		<sect2>
> 			<title>A Final Note on Choosing Music</title>
> 			<para>
> 			In the United States and other countries, playing copyrighted music to strangers who call into your
> 			PBX is probably illegal. However, high-quality, royalty free music does exist.  An excellent source for it is 
> 			 <ulink url="http://www.openmusicregistry.org" type="http">http://www.openmusicregistry.org</ulink>.
> 			</para>

--------------020809030605090407050600--