1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package net.sf.asterisk.manager.event;
18
19 /***
20 * A DNDStateEvent is triggered by the Zap channel driver when a channel enters
21 * or leaves DND (do not disturb) state.<br>
22 * It is implemented in <code>channels/chan_zap.c</code>.<br>
23 * Available since Asterisk 1.2
24 *
25 * @author srt
26 * @version $Id: DNDStateEvent.java,v 1.3 2005/08/28 12:20:53 srt Exp $
27 * @since 0.2
28 */
29 public class DNDStateEvent extends ManagerEvent
30 {
31 /***
32 * Serializable version identifier
33 */
34 static final long serialVersionUID = 5906599407896179295L;
35
36 /***
37 * The name of the channel.
38 */
39 private String channel;
40
41 /***
42 * The DND state of the channel.
43 */
44 private String state;
45
46 /***
47 * Creates a new DNDStateEvent.
48 *
49 * @param source
50 */
51 public DNDStateEvent(Object source)
52 {
53 super(source);
54 }
55
56 /***
57 * Returns the name of the channel. The channel name is of the form
58 * "Zap/<channel number>".
59 */
60 public String getChannel()
61 {
62 return channel;
63 }
64
65 /***
66 * Sets the name of the channel.
67 */
68 public void setChannel(String channel)
69 {
70 this.channel = channel;
71 }
72
73 /***
74 * Returns DND state of the channel.
75 *
76 * @return "enabled" if do not disturb is on, "disabled" if it is off.
77 */
78 public String getState()
79 {
80 return state;
81 }
82
83 /***
84 * Sets the DND state of the channel.
85 */
86 public void setState(String state)
87 {
88 this.state = state;
89 }
90 }