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 * Sends the given text on a channel.<br>
21 * Most channels do not support the transmission of text.<br>
22 * Returns 0 if text is sent, or if the channel does not support text
23 * transmission. Returns -1 only on error/hangup.
24 *
25 * @author srt
26 * @version $Id: SendTextCommand.java,v 1.2 2005/03/08 16:48:34 srt Exp $
27 */
28 public class SendTextCommand extends AGICommand
29 {
30 /***
31 * Serial version identifier.
32 */
33 private static final long serialVersionUID = 3904959746380281145L;
34
35 /***
36 * The text to send.
37 */
38 private String text;
39
40 /***
41 * Creates a new SendTextCommand.
42 *
43 * @param text the text to send.
44 */
45 public SendTextCommand(String text)
46 {
47 this.text = text;
48 }
49
50 /***
51 * Returns the text to send.
52 *
53 * @return the text to send.
54 */
55 public String getText()
56 {
57 return text;
58 }
59
60 /***
61 * Sets the text to send.
62 *
63 * @param text the text to send.
64 */
65 public void setText(String text)
66 {
67 this.text = text;
68 }
69
70 public String buildCommand()
71 {
72 return "SEND TEXT " + escapeAndQuote(text);
73 }
74 }