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 * Cause the channel to automatically hangup at the given number of seconds in
21 * the future.<br>
22 * Of course it can be hungup before then as well. Setting to 0 will cause the
23 * autohangup feature to be disabled on this channel.
24 *
25 * @author srt
26 * @version $Id: SetAutoHangupCommand.java,v 1.3 2005/03/10 21:48:11 srt Exp $
27 */
28 public class SetAutoHangupCommand extends AGICommand
29 {
30 /***
31 * Serial version identifier.
32 */
33 private static final long serialVersionUID = 3257562923458443314L;
34
35 /***
36 * The number of seconds before this channel is automatically hung up.
37 */
38 private int time;
39
40 /***
41 * Creates a new SetAutoHangupCommand.
42 *
43 * @param time the number of seconds before this channel is automatically
44 * hung up.<br>
45 * 0 disables the autohangup feature.
46 */
47 public SetAutoHangupCommand(int time)
48 {
49 this.time = time;
50 }
51
52 /***
53 * Returns the number of seconds before this channel is automatically hung
54 * up.
55 *
56 * @return the number of seconds before this channel is automatically hung
57 * up.
58 */
59 public int getTime()
60 {
61 return time;
62 }
63
64 /***
65 * Sets the number of seconds before this channel is automatically hung up.
66 *
67 * @param time the number of seconds before this channel is automatically
68 * hung up.<br>
69 * 0 disables the autohangup feature.
70 */
71 public void setTime(int time)
72 {
73 this.time = time;
74 }
75
76 public String buildCommand()
77 {
78 return "SET AUTOHANGUP " + time;
79 }
80 }