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