sipXcallLib home page


CpGhostConnection.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005-2011 SIPez LLC. All rights reserved.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2007 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 // Author: Daniel Petrie dpetrie AT SIPez DOT com
15 
16 #ifndef _CpGhostConnection_h_
17 #define _CpGhostConnection_h_
18 
19 // SYSTEM INCLUDES
20 //#include <...>
21 
22 // APPLICATION INCLUDES
23 #include <cp/Connection.h>
24 #include <net/SipContactDb.h>
25 
26 // DEFINES
27 // MACROS
28 // EXTERNAL FUNCTIONS
29 // EXTERNAL VARIABLES
30 // CONSTANTS
31 // STRUCTS
32 // TYPEDEFS
33 // FORWARD DECLARATIONS
34 
35 
36 //:logical Connection within a call
37 // The Connection encapsulates the call setup protocol and state
38 // information for the leg of a call to a particular address.
40 {
41 /* //////////////////////////// PUBLIC //////////////////////////////////// */
42 public:
43 
44  static const UtlContainableType TYPE;
45 
46 /* ============================ CREATORS ================================== */
47 
48  CpGhostConnection(CpCallManager* callMgr = NULL,
49  CpCall* call = NULL, const char* callId = NULL);
50  //:Default constructor
51 
52 
53  virtual
55  //:Destructor
56 
57 /* ============================ MANIPULATORS ============================== */
58 
59  virtual UtlBoolean dequeue();
60 
61  virtual UtlBoolean dial(const char* dialString,
62  const char* callerId,
63  const char* callId,
64  const char* callController = NULL,
65  const char* originalCallConnection = NULL,
66  UtlBoolean requestQueuedCall = FALSE,
67  const void* pDisplay = NULL,
68  const void* pSecurity = NULL,
69  const char* locationHeader = NULL,
70  const int bandWidth = AUDIO_MICODEC_BW_DEFAULT,
71  UtlBoolean bOnHold = FALSE,
72  const char* originalCallId = NULL,
73  const RTP_TRANSPORT rtpTransportOptions = RTP_TRANSPORT_UDP);
74 
76 
77  virtual UtlBoolean originalCallTransfer(UtlString& transferTargetAddress,
78  const char* transferControllerAddress,
79  const char* targetCallId);
80  // Initiate blind transfer on transfer controller connection in
81  // the original call.
82 
83  virtual UtlBoolean targetCallBlindTransfer(const char* transferTargetAddress,
84  const char* transferControllerAddress);
85  // Communicate blind transfer on transfer controller connection in
86  // the target call. This is signaled by the transfer controller in the
87  // original call.
88 
89  virtual UtlBoolean transfereeStatus(int connectionState, int response);
90  // Method to communicate status to original call on transferee side
91 
92  virtual UtlBoolean transferControllerStatus(int connectionState, int cause);
93  // Method to communicate status to target call on transfer
94  // controller side
95 
96  virtual UtlBoolean answer(const void* hWnd = NULL);
97 
98  virtual void outOfFocus();
99 
100  virtual UtlBoolean hangUp();
101 
102  virtual UtlBoolean hold();
103 
104  virtual UtlBoolean reject(int errorCode = 0, const char* errorText = "");
105 
106  virtual UtlBoolean redirect(const char* forwardAddress);
107 
108  virtual UtlBoolean offHold();
109 
110  virtual UtlBoolean renegotiateCodecs();
111 
112  virtual UtlBoolean silentRemoteHold() ;
113 
114  virtual UtlBoolean accept(int forwardOnNoAnswerSeconds,
115  const void *pSecurity = NULL,
116  const char* locationHeader = NULL,
117  const int bandWidth = AUDIO_MICODEC_BW_DEFAULT,
118  UtlBoolean sendEarlyMedia = FALSE);
119 
120  virtual UtlBoolean processMessage(OsMsg& eventMessage);
121 
122 /* ============================ ACCESSORS ================================= */
123 
124  virtual UtlContainableType getContainableType() const;
125 
126  virtual UtlBoolean getRemoteAddress(UtlString* remoteAddress) const;
127  //: get Connection address
129 
130  virtual UtlBoolean getRemoteAddress(UtlString* remoteAddress, UtlBoolean leaveFieldParametersIn) const;
131  //: get Connection address
133 
134  virtual UtlBoolean getSession(SipSession& session);
135 
139  virtual void getLocalContactAddresses( SIPX_CONTACT_ADDRESS contacts[],
140  size_t nMaxContacts,
141  size_t& nActualContacts) ;
142 
143  virtual void getRemoteUserAgent(UtlString* pUserAgent);
144 
145 
146 /* ============================ INQUIRY =================================== */
147 
148  virtual UtlBoolean isInstanceOf(const UtlContainableType type) const;
149 
150  virtual UtlBoolean willHandleMessage(OsMsg& eventMessage) const;
151 
152  virtual UtlBoolean isConnection(const char* callId,
153  const char* toTag,
154  const char* fromTag,
155  UtlBoolean strictCompare) const;
156 
157  virtual UtlBoolean isSameRemoteAddress(Url& remoteAddress) const;
158 
159 /* //////////////////////////// PROTECTED ///////////////////////////////// */
160 protected:
161 
162 
163 
164 /* //////////////////////////// PRIVATE /////////////////////////////////// */
165 private:
166 
167  CpGhostConnection(const CpGhostConnection& rCpGhostConnection);
168  //:Copy constructor (disabled)
170  //:Assignment operator (disabled)
171 
172  UtlString mRemoteAddress;
173 
174 };
175 
176 /* ============================ INLINE METHODS ============================ */
177 
178 #endif // _CpGhostConnection_h_
Abstract call manager.
Definition: CpCallManager.h:97
virtual UtlBoolean transfereeStatus(int connectionState, int response)
Definition: CpGhostConnection.cpp:110
virtual UtlBoolean targetCallBlindTransfer(const char *transferTargetAddress, const char *transferControllerAddress)
Definition: CpGhostConnection.cpp:100
virtual UtlBoolean dial(const char *dialString, const char *callerId, const char *callId, const char *callController=NULL, const char *originalCallConnection=NULL, UtlBoolean requestQueuedCall=FALSE, const void *pDisplay=NULL, const void *pSecurity=NULL, const char *locationHeader=NULL, const int bandWidth=AUDIO_MICODEC_BW_DEFAULT, UtlBoolean bOnHold=FALSE, const char *originalCallId=NULL, const RTP_TRANSPORT rtpTransportOptions=RTP_TRANSPORT_UDP)
Definition: CpGhostConnection.cpp:74
UtlString mRemoteAddress
Definition: CpGhostConnection.h:172
CpGhostConnection & operator=(const CpGhostConnection &rhs)
Definition: CpGhostConnection.cpp:61
virtual UtlContainableType getContainableType() const
Definition: CpGhostConnection.cpp:208
virtual UtlBoolean originalCallTransfer(UtlString &transferTargetAddress, const char *transferControllerAddress, const char *targetCallId)
param: requestQueuedCall - indicates that the caller wishes to have the callee queue the call if busy...
Definition: CpGhostConnection.cpp:92
virtual UtlBoolean willHandleMessage(OsMsg &eventMessage) const
Definition: CpGhostConnection.cpp:256
static const UtlContainableType TYPE
Definition: CpGhostConnection.h:44
virtual UtlBoolean getSession(SipSession &session)
returns: TRUE/FALSE if the connection has an address. The connection may not have an address assigned...
Definition: CpGhostConnection.cpp:225
virtual UtlBoolean getRemoteAddress(UtlString *remoteAddress) const
Definition: CpGhostConnection.cpp:213
virtual void getRemoteUserAgent(UtlString *pUserAgent)
Definition: CpGhostConnection.cpp:240
virtual void outOfFocus()
Definition: CpGhostConnection.cpp:144
virtual UtlBoolean isInstanceOf(const UtlContainableType type) const
Definition: CpGhostConnection.cpp:248
Definition: Connection.h:58
virtual UtlBoolean hold()
Definition: CpGhostConnection.cpp:158
virtual UtlBoolean silentRemoteHold()
Definition: CpGhostConnection.cpp:185
CpGhostConnection(CpCallManager *callMgr=NULL, CpCall *call=NULL, const char *callId=NULL)
Definition: CpGhostConnection.cpp:36
virtual UtlBoolean isConnection(const char *callId, const char *toTag, const char *fromTag, UtlBoolean strictCompare) const
Definition: CpGhostConnection.cpp:262
virtual UtlBoolean hangUp()
Definition: CpGhostConnection.cpp:150
virtual UtlBoolean renegotiateCodecs()
Definition: CpGhostConnection.cpp:179
virtual UtlBoolean accept(int forwardOnNoAnswerSeconds, const void *pSecurity=NULL, const char *locationHeader=NULL, const int bandWidth=AUDIO_MICODEC_BW_DEFAULT, UtlBoolean sendEarlyMedia=FALSE)
Accept and incoming INVITE and change from OFFERING to ALERTING state.
Definition: CpGhostConnection.cpp:191
virtual UtlBoolean processMessage(OsMsg &eventMessage)
Definition: CpGhostConnection.cpp:201
virtual UtlBoolean reject(int errorCode=0, const char *errorText="")
Definition: CpGhostConnection.cpp:163
virtual ~CpGhostConnection()
Definition: CpGhostConnection.cpp:53
virtual UtlBoolean transferControllerStatus(int connectionState, int cause)
Definition: CpGhostConnection.cpp:115
Definition: CpGhostConnection.h:39
virtual UtlBoolean isSameRemoteAddress(Url &remoteAddress) const
Definition: CpGhostConnection.cpp:271
virtual UtlBoolean offHold()
Definition: CpGhostConnection.cpp:173
virtual UtlBoolean dequeue()
Definition: CpGhostConnection.cpp:69
virtual void getLocalContactAddresses(SIPX_CONTACT_ADDRESS contacts[], size_t nMaxContacts, size_t &nActualContacts)
Enumerate possible contact addresses.
Definition: CpGhostConnection.cpp:233
Definition: CpCall.h:56
The CONTACT_ADDRESS structure includes contact information (IP-address and port), address source type...
Definition: sipXtapi.h:640
virtual UtlBoolean redirect(const char *forwardAddress)
Definition: CpGhostConnection.cpp:168
virtual UtlBoolean answer(const void *hWnd=NULL)
Definition: CpGhostConnection.cpp:138