View Javadoc

1   /*
2    *  Copyright 2004-2006 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 org.asteriskjava.manager.event;
18  
19  /**
20   * A FaxReceivedEvent is triggered by spandsp after a new fax has been received.
21   * <p>
22   * It is only available if you installed the spandsp patches to Asterisk.
23   * <p>
24   * See http://soft-switch.org/installing-spandsp.html for details.
25   * <p>
26   * Implemented in <code>apps/app_rxfax.c</code>.
27   * 
28   * @author srt
29   * @version $Id$
30   * @since 0.2
31   */
32  public class FaxReceivedEvent extends AbstractFaxEvent
33  {
34      /**
35       * Serial version identifier.
36       */
37      private static final long serialVersionUID = 1L;
38  
39      private String exten;
40      private String callerId;
41      private String remoteStationId;
42      private String localStationId;
43      private Integer pagesTransferred;
44      private Integer resolution;
45      private Integer transferRate;
46      private String filename;
47  
48      public FaxReceivedEvent(Object source)
49      {
50          super(source);
51      }
52  
53      /**
54       * Returns the extension in Asterisk's dialplan the fax was received
55       * through.
56       * 
57       * @return the extension the fax was received through.
58       */
59      public String getExten()
60      {
61          return exten;
62      }
63  
64      /**
65       * Sets the extension the fax was received through.
66       * 
67       * @param exten the extension the fax was received through.
68       */
69      public void setExten(String exten)
70      {
71          this.exten = exten;
72      }
73  
74      /**
75       * Returns the Caller*ID of the calling party or an empty string if none is
76       * available.
77       * 
78       * @return the Caller*ID of the calling party.
79       */
80      public String getCallerId()
81      {
82          return callerId;
83      }
84  
85      /**
86       * Sets the Caller*ID of the calling party.
87       * 
88       * @param callerId the Caller*ID of the calling party.
89       */
90      public void setCallerId(String callerId)
91      {
92          this.callerId = callerId;
93      }
94  
95      /**
96       * Retruns the identifier of the remote fax station.
97       * 
98       * @return the identifier of the remote fax station.
99       */
100     public String getRemoteStationId()
101     {
102         return remoteStationId;
103     }
104 
105     /**
106      * Sets the identifier of the remote fax station.
107      * 
108      * @param remoteStationId the identifier of the remote fax station.
109      */
110     public void setRemoteStationId(String remoteStationId)
111     {
112         this.remoteStationId = remoteStationId;
113     }
114 
115     /**
116      * Returns the identifier of the local fax station.
117      * 
118      * @return the identifier of the local fax station.
119      */
120     public String getLocalStationId()
121     {
122         return localStationId;
123     }
124 
125     /**
126      * Sets the identifier of the local fax station.
127      * 
128      * @param localStationId the identifier of the local fax station.
129      */
130     public void setLocalStationId(String localStationId)
131     {
132         this.localStationId = localStationId;
133     }
134 
135     /**
136      * Returns the number of pages transferred.
137      * 
138      * @return the number of pages transferred.
139      */
140     public Integer getPagesTransferred()
141     {
142         return pagesTransferred;
143     }
144 
145     /**
146      * Sets the number of pages transferred.
147      * 
148      * @param pagesTransferred the number of pages transferred.
149      */
150     public void setPagesTransferred(Integer pagesTransferred)
151     {
152         this.pagesTransferred = pagesTransferred;
153     }
154 
155     /**
156      * Returns the row resolution of the received fax.
157      * 
158      * @return the row resolution of the received fax.
159      */
160     public Integer getResolution()
161     {
162         return resolution;
163     }
164 
165     /**
166      * Sets the row resolution of the received fax.
167      * 
168      * @param resolution the row resolution of the received fax.
169      */
170     public void setResolution(Integer resolution)
171     {
172         this.resolution = resolution;
173     }
174 
175     /**
176      * Returns the transfer rate in bits/s.
177      * 
178      * @return the transfer rate in bits/s.
179      */
180     public Integer getTransferRate()
181     {
182         return transferRate;
183     }
184 
185     /**
186      * Sets the transfer rate in bits/s.
187      * 
188      * @param transferRate the transfer rate in bits/s.
189      */
190     public void setTransferRate(Integer transferRate)
191     {
192         this.transferRate = transferRate;
193     }
194 
195     /**
196      * Returns the filename of the received fax including its full path on the
197      * Asterisk server.
198      * 
199      * @return the filename of the received fax
200      */
201     public String getFilename()
202     {
203         return filename;
204     }
205 
206     /**
207      * Sets the filename of the received fax.
208      * 
209      * @param filename the filename of the received fax
210      */
211     public void setFilename(String filename)
212     {
213         this.filename = filename;
214     }
215 }