sipXcallLib home page


PtCallListener.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 #ifndef _PtCallListener_h_
12 #define _PtCallListener_h_
13 
14 // SYSTEM INCLUDES
15 // APPLICATION INCLUDES
16 #include <os/OsDefs.h>
17 #include <ptapi/PtEventListener.h>
19 
20 // DEFINES
21 // MACROS
22 // EXTERNAL FUNCTIONS
23 // EXTERNAL VARIABLES
24 // CONSTANTS
25 // STRUCTS
26 // TYPEDEFS
27 // FORWARD DECLARATIONS
28 class PtCallEvent;
29 
30 //:The PtCallListener is used to register with PtAddress, PtTerminal, and
31 //:PtCall objects to receive events from associated PtCall objects.
32 
34 {
35 /* //////////////////////////// PUBLIC //////////////////////////////////// */
36 public:
38 
39 /* ============================ CREATORS ================================== */
40 
41  PtCallListener(PtEventMask* pMask = NULL);
42  //:Default constructor
44 
45  virtual
47  //:Destructor
48 
49 /* ============================ MANIPULATORS ============================== */
50 
51  virtual void callEventTransmissionEnded(const PtCallEvent& rEvent);
52  //:Method invoked on listener for event id =
53  //:CALL_EVENT_TRANSMISSION_ENDED
54  //:indicating that the application will no longer receive call events on
55  //:this instance of the PtCallListener.
56  // The event parameter is valid only within
57  // this method. The implementation must copy the event if
58  // it is needed beyond the scope of an invocation. The implementation
59  // of this method should not block as it may prevent other listeners
60  // from processing events in a timely fashion.
62 
63  virtual void callActive(const PtCallEvent& rEvent);
64  //:Method invoked on listener for event id =
65  //:CALL_ACTIVE
66  //:indicating that the state of the call object has changed to
67  //:PtCall::ACTIVE.
68  // The event parameter is valid only within
69  // this method. The implementation must copy the event if
70  // it is needed beyond the scope of an invocation. The implementation
71  // of this method should not block as it may prevent other listeners
72  // from processing events in a timely fashion.
74 
75  virtual void callInvalid(const PtCallEvent& rEvent);
76  //:Method invoked on listener for event id =
77  //:CALL_INVALID
78  //:indicating that the state of the call object has changed to
79  //:PtCall::INVALID.
80  // The event parameter is valid only within
81  // this method. The implementation must copy the event if
82  // it is needed beyond the scope of an invocation. The implementation
83  // of this method should not block as it may prevent other listeners
84  // from processing events in a timely fashion.
86 
87  virtual void callMetaCallStartStarted(const PtCallEvent& rEvent);
88  //:Method invoked on listener for event id =
89  //:CALL_META_CALL_STARTING_STARTED
90  //:indicating that the starting of a new call.
91  // The event parameter is valid only within
92  // this method. The implementation must copy the event if
93  // it is needed beyond the scope of an invocation. The implementation
94  // of this method should not block as it may prevent other listeners
95  // from processing events in a timely fashion.
97 
98  virtual void callMetaCallStartEnded(const PtCallEvent& rEvent);
99  //:Method invoked on listener for event id =
100  //:CALL_META_CALL_STARTING_ENDED
101  //:indicating that the starting of a new call is completed.
102  // The event parameter is valid only within
103  // this method. The implementation must copy the event if
104  // it is needed beyond the scope of an invocation. The implementation
105  // of this method should not block as it may prevent other listeners
106  // from processing events in a timely fashion.
108 
109  virtual void callMetaCallEndStarted(const PtCallEvent& rEvent);
110  //:Method invoked on listener for event id =
111  //:CALL_META_CALL_ENDING_STARTED
112  //:indicating that the starting of dropping a call.
113  // The event parameter is valid only within
114  // this method. The implementation must copy the event if
115  // it is needed beyond the scope of an invocation. The implementation
116  // of this method should not block as it may prevent other listeners
117  // from processing events in a timely fashion.
119 
120  virtual void callMetaCallEndEnded(const PtCallEvent& rEvent);
121  //:Method invoked on listener for event id =
122  //:CALL_META_CALL_ENDING_ENDED
123  //:indicating that the droping of a call is completed.
124  // The event parameter is valid only within
125  // this method. The implementation must copy the event if
126  // it is needed beyond the scope of an invocation. The implementation
127  // of this method should not block as it may prevent other listeners
128  // from processing events in a timely fashion.
130 
131  virtual void callMetaProgressStarted(const PtCallEvent& rEvent);
132  //:Method invoked on listener for event id =
133  //:CALL_META_PROGRESS_STARTED
134  //:indicating that the current call in the telephony platform has changed
135  //:state, and events will follow which indicate the changes to this call.
136  // The event parameter is valid only within
137  // this method. The implementation must copy the event if
138  // it is needed beyond the scope of an invocation. The implementation
139  // of this method should not block as it may prevent other listeners
140  // from processing events in a timely fashion.
142 
143  virtual void callMetaProgressEnded(const PtCallEvent& rEvent);
144  //:Method invoked on listener for event id =
145  //:CALL_META_PROGRESS_ENDED
146  //:indicating that the current call in the telephony platform has changed
147  //:state, and all the events that were associated with that change have
148  //:now been reported.
149  // The event parameter is valid only within
150  // this method. The implementation must copy the event if
151  // it is needed beyond the scope of an invocation. The implementation
152  // of this method should not block as it may prevent other listeners
153  // from processing events in a timely fashion.
155 
156  virtual void callMetaSnapshotStarted(const PtCallEvent& rEvent);
157  //:Method invoked on listener for event id =
158  //:CALL_META_SNAPSHOT_STARTED
159  //:indicating that the Pingtel implementation is reporting to the
160  //:application the current state of the call on the associated telephony
161  //:platform, by reporting a set of simulated state changes that, in
162  //:effect, construct the current state of the call.
163  // The event parameter is valid only within
164  // this method. The implementation must copy the event if
165  // it is needed beyond the scope of an invocation. The implementation
166  // of this method should not block as it may prevent other listeners
167  // from processing events in a timely fashion.
169 
170  virtual void callMetaSnapshotEnded(const PtCallEvent& rEvent);
171  //:Method invoked on listener for event id =
172  //:CALL_META_SNAPSHOT_ENDED
173  //:indicating that the Pingtel implementation has finished reporting a
174  //:set of simulated state changes that, in effect, construct the current
175  //:state of the call.
176  // The event parameter is valid only within
177  // this method. The implementation must copy the event if
178  // it is needed beyond the scope of an invocation. The implementation
179  // of this method should not block as it may prevent other listeners
180  // from processing events in a timely fashion.
182 
183  virtual void callMetaAddPartyStarted(const PtCallEvent& rEvent);
184  //:Method invoked on listener for event id = CALL_META_ADD_PARTY_STARTED
185  //:indicating that a party has been added to the call. A "party"
186  //:corresponds to a PtConnection being added. Note that if a
187  //:PtTerminalConnection is added, it carries a meta event of
188  //:CALL_META_PROGRESS_STARTED.
189  // The event parameter is valid only within this method.
190  // The implementation must copy the event if it is needed
191  // beyond the scope of an invocation. The implementation of
192  // this method should not block as it may prevent other listeners
193  // from processing events in a timely fashion.
195 
196  virtual void callMetaAddPartyEnded(const PtCallEvent& rEvent);
197  //:Method invoked on listener for event id =
198  //:CALL_META_ADD_PARTY_ENDED
199  //:indicates the end of the group of events related to the add party meta
200  //:event.
201  // The event parameter is valid only within
202  // this method. The implementation must copy the event if
203  // it is needed beyond the scope of an invocation. The implementation
204  // of this method should not block as it may prevent other listeners
205  // from processing events in a timely fashion.
207 
208  virtual void callMetaRemovePartyStarted(const PtCallEvent& rEvent);
209  //:Method invoked on listener for event id =
210  //:CALL_META_REMOVE_PARTY_STARTED
211  //:indicating that a party (i.e. connection) has been removed from the
212  //:call by moving into the PtConnection::DISCONNECTED state.
213  // The event parameter is valid only within
214  // this method. The implementation must copy the event if
215  // it is needed beyond the scope of an invocation. The implementation
216  // of this method should not block as it may prevent other listeners
217  // from processing events in a timely fashion.
219 
220  virtual void callMetaRemovePartyEnded(const PtCallEvent& rEvent);
221  //:Method invoked on listener for event id =
222  //:CALL_META_REMOVE_PARTY_ENDED
223  //:indicating the end of the group of events related to the remove party
224  //:meta event.
225  // The event parameter is valid only within
226  // this method. The implementation must copy the event if
227  // it is needed beyond the scope of an invocation. The implementation
228  // of this method should not block as it may prevent other listeners
229  // from processing events in a timely fashion.
231 
232  virtual void multicallMetaMergeStarted(const PtMultiCallMetaEvent& rEvent);
233  //:Method invoked on listener for event id =
234  //:MULTICALL_META_MERGE_STARTED
235  //:indicating that calls are merging, and events will follow which
236  //:indicate the changes to those calls.
237  // The event parameter is valid only within
238  // this method. The implementation must copy the event if
239  // it is needed beyond the scope of an invocation. The implementation
240  // of this method should not block as it may prevent other listeners
241  // from processing events in a timely fashion.
243 
244  virtual void multicallMetaMergeEnded(const PtMultiCallMetaEvent& rEvent);
245  //:Method invoked on listener for event id =
246  //:MULTICALL_META_MERGE_ENDED
247  //:indicating that calls have merged, and that all state change events
248  //:resulting from this merge have been reported.
249  // The event parameter is valid only within
250  // this method. The implementation must copy the event if
251  // it is needed beyond the scope of an invocation. The implementation
252  // of this method should not block as it may prevent other listeners
253  // from processing events in a timely fashion.
255 
256  virtual void multicallMetaTransferStarted(const PtMultiCallMetaEvent& rEvent);
257  //:Method invoked on listener for event id =
258  //:MULTICALL_META_TRANSFER_STARTED
259  //:indicating that a transfer is occurring, and events will follow which
260  //:indicate the changes to the affected calls.
261  // The event parameter is valid only within
262  // this method. The implementation must copy the event if
263  // it is needed beyond the scope of an invocation. The implementation
264  // of this method should not block as it may prevent other listeners
265  // from processing events in a timely fashion.
267 
268  virtual void multicallMetaTransferEnded(const PtMultiCallMetaEvent& rEvent);
269  //:Method invoked on listener for event id =
270  //:MULTICALL_META_TRANSFER_ENDED
271  //:indicating that a transfer has completed, and that all state change
272  //:events resulting from this transfer have been reported.
273  // The event parameter is valid only within
274  // this method. The implementation must copy the event if
275  // it is needed beyond the scope of an invocation. The implementation
276  // of this method should not block as it may prevent other listeners
277  // from processing events in a timely fashion.
279 
280 /* ============================ ACCESSORS ================================= */
281 
282  static const char* className();
283  //:Returns the name of this class
285 
286 
287  PtStatus getLocation(UtlString* rpLocation);
288 
289 /* ============================ INQUIRY =================================== */
290 
291  virtual PtBoolean isClass(const char* pClassName);
292  //:Determines if this object if of the specified type.
296 
297  virtual PtBoolean isInstanceOf(const char* pClassName);
298  //:Determines if this object is either an instance of or is derived from
299  //:the specified type.
303 
304 /* //////////////////////////// PROTECTED ///////////////////////////////// */
305 protected:
306 
307  UtlString* mpOriginatingIP;
308 
309 /* //////////////////////////// PRIVATE /////////////////////////////////// */
310 private:
311 
312  PtCallListener(const PtCallListener& rPtCallListener);
313  //:Copy constructor
314 
315  PtCallListener& operator=(const PtCallListener& rhs);
316  //:Assignment operator
317 
318 };
319 
320 /* ============================ INLINE METHODS ============================ */
321 
322 #endif // _PtCallListener_h_
PtStatus
Definition: PtDefs.h:49
virtual void callActive(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:60
virtual void multicallMetaTransferEnded(const PtMultiCallMetaEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:128
virtual void callMetaRemovePartyStarted(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:108
virtual PtBoolean isClass(const char *pClassName)
virtual void callMetaCallEndStarted(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:76
int PtBoolean
Definition: PtDefs.h:71
PtCallListener & operator=(const PtCallListener &rhs)
Definition: PtCallListener.cpp:48
virtual void callInvalid(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:64
virtual void callMetaSnapshotStarted(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:92
virtual void callMetaCallStartStarted(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:68
virtual void callMetaAddPartyEnded(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:104
#define PT_CLASS_INFO_MEMBERS
Definition: PtDefs.h:73
virtual void callEventTransmissionEnded(const PtCallEvent &rEvent)
Definition: PtCallListener.cpp:56
Definition: PtCallListener.h:33
PtStatus getLocation(UtlString *rpLocation)
returns: Returns the string representation of the name of this class
Definition: PtCallListener.cpp:133
UtlString * mpOriginatingIP
param: (in) pClassName - the string to compare with the name of this class. retcode: TRUE - if this o...
Definition: PtCallListener.h:307
PT_CLASS_INFO_MEMBERS PtCallListener(PtEventMask *pMask=NULL)
Definition: PtCallListener.cpp:29
Definition: PtEventListener.h:55
virtual void callMetaRemovePartyEnded(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:112
virtual ~PtCallListener()
param: (in) pMask - Event mask defining events the listener is interested in. This must be a subset o...
Definition: PtCallListener.cpp:40
virtual void multicallMetaTransferStarted(const PtMultiCallMetaEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:124
Definition: PtMultiCallMetaEvent.h:51
virtual void multicallMetaMergeStarted(const PtMultiCallMetaEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:116
virtual void multicallMetaMergeEnded(const PtMultiCallMetaEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:120
virtual PtBoolean isInstanceOf(const char *pClassName)
param: (in) pClassName - the string to compare with the name of this class. retcode: TRUE - if the gi...
virtual void callMetaProgressEnded(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:88
Definition: PtCallEvent.h:30
static const char * className()
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
virtual void callMetaSnapshotEnded(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:96
Definition: PtEventMask.h:39
virtual void callMetaCallStartEnded(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:72
virtual void callMetaProgressStarted(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:84
virtual void callMetaCallEndEnded(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:80
virtual void callMetaAddPartyStarted(const PtCallEvent &rEvent)
param: (in) rEvent - Reference to the PtEvent containing the specific event information.
Definition: PtCallListener.cpp:100