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