sipXcallLib home page


CpGatewayManager.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 
12 #ifndef _CpGatewayManager_h_
13 #define _CpGatewayManager_h_
14 
15 // SYSTEM INCLUDES
16 //#include <...>
17 
18 // APPLICATION INCLUDES
19 #include <os/OsServerTask.h>
20 
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 // FORWARD DECLARATIONS
29 class PtGatewayInterface;
30 
31 //:Class short description which may consist of multiple lines (note the ':')
32 // Class detailed description which may extend to multiple lines
33 class CpGatewayManager : public OsServerTask
34 {
35 /* //////////////////////////// PUBLIC //////////////////////////////////// */
36 public:
37 
38 /* ============================ CREATORS ================================== */
39 
41  //:Default constructor
42 
43  CpGatewayManager(const CpGatewayManager& rCpGatewayManager);
44  //:Copy constructor
45 
46  virtual
48  //:Destructor
49 
50 /* ============================ MANIPULATORS ============================== */
51 
53  //: Singleton constructor/accessor
54  // Note: this class does not need to be a singleton. The only method that
55  // assumes singleton is getCpGatewayManager.
56 
58  //:Assignment operator
59 
60  OsStatus setGatewayInterface(const char* terminalName,
61  PtGatewayInterface* pInterface);
62  //: Add a PtGatewayInterface call back object for media setup on the named
63  //: terminal.
64  // Note this method does not validate the terminal name in any way. One
65  // validate the terminal name and be sure that it is registered with the
66  // provider (i.e. proxy server) if calls are to work with the provider.
70 
71  void getNewCallId(UtlString& callId);
72  //: Get a valid callId with which to create a new call
73  // The callId is needed to call methods (i.e. <I>dialUrl</I>) requiring
74  // a callId to create a new call.
75 
76  OsStatus connect(const char* callId,
77  const char* fromAddressUrl,
78  const char* fromTerminalName,
79  const char* toAddressUrl);
80  //: Create a call if one does not exist and setup a connection between
81  //: the to and from addresses originating on the given terminal.
88 
89  OsStatus answer(const char* callId, const char* terminalName);
90  //: Answer an incoming call on the given terminal.
95 
96  OsStatus disconnectConnection(const char* callId,
97  const char* connectionAddressUrl);
98  //: Disconnects the indicated connection in the given call.
103 
104 /* ============================ ACCESSORS ================================= */
105 
106  UtlBoolean gatewayInterfaceExists(const char* terminalName);
107  //: Checks if the named terminal has a registered gateway interface.
108  // Note: this does not validate that the terminal name is valid with respect to the provider or proxy.
109 
110 /* ============================ INQUIRY =================================== */
111 
112 /* //////////////////////////// PROTECTED ///////////////////////////////// */
113 protected:
114 
115 /* //////////////////////////// PRIVATE /////////////////////////////////// */
116 private:
117 
118 };
119 
120 /* ============================ INLINE METHODS ============================ */
121 
122 #endif // _CpGatewayManager_h_
void getNewCallId(UtlString &callId)
param: (in) terminalName - the terminalName with which the interface is to work. param: (in) pInterfa...
Definition: CpGatewayManager.cpp:56
virtual ~CpGatewayManager()
Definition: CpGatewayManager.cpp:39
OsStatus disconnectConnection(const char *callId, const char *connectionAddressUrl)
param: callId - identifies an existing incomming call. param: terminalName - this should be a valid g...
Definition: CpGatewayManager.cpp:74
OsStatus answer(const char *callId, const char *terminalName)
param: (in) callId - must refer to an existing call or a valid callId from getNewCallId. In the latter case a new call will be created. param: (in) fromAddressUrl - the originating terminal url. Note: this should be validated if it is used in conjuction with the provider or proxy server. param: (in) fromTerminalname - this should be a valid gateway terminal having a registered (via setGatewayInterface) PtGatewayInterface. param: (in) toAddressUrl - destination url. Note: in general this cannot be validated as the call may be to an address which is outside the domain of the provider. retcode: OS_SUCCESS - the callId is valid and an attempt will be made to connect the call. This does not indicate that the connect was successful or completed. retcode: OS_INVALID_ARGUMENT - the call indicated by callId previously existed, but was in an invalid state to connect a call.
Definition: CpGatewayManager.cpp:68
CpGatewayManager()
Definition: CpGatewayManager.cpp:29
CpGatewayManager & operator=(const CpGatewayManager &rhs)
Definition: CpGatewayManager.cpp:82
OsStatus setGatewayInterface(const char *terminalName, PtGatewayInterface *pInterface)
Definition: CpGatewayManager.cpp:50
Definition: PtGatewayInterface.h:76
Definition: CpGatewayManager.h:33
static CpGatewayManager * getCpGatewayManager()
Definition: CpGatewayManager.cpp:45
OsStatus connect(const char *callId, const char *fromAddressUrl, const char *fromTerminalName, const char *toAddressUrl)
Definition: CpGatewayManager.cpp:60
UtlBoolean gatewayInterfaceExists(const char *terminalName)
param: (in) callId - the handle indicating which call contains the connection to disconnect. param: (in) connectionAddressUrl - indicates which leg of the call is to be disconnected. retcode: OS_SUCCESS - the callId and connectionAddressUrl are valid and an attempt will be made to disconnect the connection. This does not indicate that the disconnect was successful or completed. retcode: OS_INVALID_ARGUMENT - the call indicated by callId or the connection indicated by connectionAddressUrl does not exist.
Definition: CpGatewayManager.cpp:92