View Javadoc

1   /*
2    * Copyright  2004-2005 Stefan Reuter
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
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  }