1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package net.sf.asterisk.fastagi.command;
18
19 /***
20 * Turns on music on hold on the current channel.<br>
21 * Always returns 0.
22 *
23 * @author srt
24 * @version $Id: SetMusicOnCommand.java,v 1.3 2005/03/11 19:50:35 srt Exp $
25 */
26 public class SetMusicOnCommand extends AGICommand
27 {
28 /***
29 * Serial version identifier.
30 */
31 private static final long serialVersionUID = 3762248656229053753L;
32
33 /***
34 * The music on hold class to play music from.
35 */
36 private String musicOnHoldClass;
37
38 /***
39 * Creates a new SetMusicOnCommand playing music from the default music on
40 * hold class.
41 */
42 public SetMusicOnCommand()
43 {
44 this.musicOnHoldClass = null;
45 }
46
47 /***
48 * Creates a new SetMusicOnCommand playing music from the default music on
49 * hold class.
50 *
51 * @param musicOnHoldClass the music on hold class to play music from.
52 */
53 public SetMusicOnCommand(String musicOnHoldClass)
54 {
55 this.musicOnHoldClass = musicOnHoldClass;
56 }
57
58 /***
59 * Returns the music on hold class to play music from.
60 *
61 * @return the music on hold class to play music from or <code>null</code>
62 * for the default class.
63 */
64 public String getMusicOnHoldClass()
65 {
66 return musicOnHoldClass;
67 }
68
69 /***
70 * Sets the music on hold class to play music from.
71 *
72 * @param musicOnHoldClass the music on hold class to play music from or
73 * <code>null</code> for the default class.
74 */
75 public void setMusicOnHoldClass(String musicOnHoldClass)
76 {
77 this.musicOnHoldClass = musicOnHoldClass;
78 }
79
80 public String buildCommand()
81 {
82 return "SET MUSIC ON"
83 + (musicOnHoldClass == null ? "" : " "
84 + escapeAndQuote(musicOnHoldClass));
85 }
86 }