sipXcallLib home page


PtAddressForwarding.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 _PtAddressForwarding_h_
12 #define _PtAddressForwarding_h_
13 
14 // SYSTEM INCLUDES
15 // APPLICATION INCLUDES
16 #include "os/OsDefs.h"
17 #include "ptapi/PtDefs.h"
18 #include "tao/TaoAddressAdaptor.h"
19 #include "cp/CpCallManager.h"
20 
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 // FORWARD DECLARATIONS
29 
30 //:The PtAddressForwarding class represents a forwarding instruction.
31 // This instruction indicates how the phone system should forward
32 // incoming telephone calls to a specific address. The attributes
33 // of a forwarding instruction are:
34 // <p>
35 // <ul><li>
36 // The forwarding instruction's <b>type</b> tells the phone
37 // system when to forward the call. Currently, three types are
38 // supported: always forward incoming calls, forward incoming calls
39 // when the address is busy, and forward incoming calls when no
40 // one answers.</li>
41 // <br>
42 // <li>
43 // The forwarding instruction's <b>filter</b> identifies the set
44 // of incoming calls to which it applies. A forwarding instruction
45 // can apply to all calls, to external calls only, to internal calls
46 // only, or to calls from a specific calling address. </li>
47 // </ul>
48 
50 {
51 friend class PtAddress;
52 friend class CpCallManager;
54 
55 /* //////////////////////////// PUBLIC //////////////////////////////////// */
56 public:
57 
59  {
63 
64  };
68 
70  {
71  ALL_CALLS = 1,
75  };
80 
81 /* ============================ CREATORS ================================== */
82 
84  //:Default constructor
85 
86  PtAddressForwarding(const char* destinationURL,
87  int type=FORWARD_UNCONDITIONALLY,
88  int noAnswerTimeout = 0);
89  //:Constructor variant #1
90  // Creates a forwarding instruction that forwards all calls of the
91  // indicated type to the <i>destinationURL</i> address.
95  // Returns a newly created PtAddressForwarding object
96 
97  PtAddressForwarding(const char* destinationURL, int type,
98  PtBoolean internalCalls, int noAnswerTimeout);
99  //:Constructor variant #2
100  // Creates a forwarding instruction that forwards calls of the
101  // indicated type to the <i>destinationURL</i> address. Depending
102  // on the value of the <i>internalCalls</i> flag, this instruction
103  // will affect either just internal or just external calls.
108  // Returns a newly created PtAddressForwarding object
109 
110  PtAddressForwarding(const char* destinationURL, int type, const char* callerURL, int noAnswerTimeout);
111  //:Constructor variant #3
112  // Creates a forwarding instruction that applies only to incoming
113  // calls from the indicated <i>callerURL</i>.
118  // Returns a newly created PtAddressForwarding object
119 
120  PtAddressForwarding(const char* destinationURL, int type,
121  int filterType, const char* callerURL, int noAnswerTimeout);
122  //:Constructor variant #4
123  // Creates a forwarding instruction that forwards calls of the
124  // indicated type to the <i>destinationURL</i> address.
130  // Returns a newly created PtAddressForwarding object
131 
132  PtAddressForwarding(const PtAddressForwarding& rPtAddressForwarding);
133  //:Copy constructor
134 
135  virtual
137  //:Destructor
138 
139 /* ============================ MANIPULATORS ============================== */
140 
142  //:Assignment operator
143 
145  //:equal operator
146 
147 /* ============================ ACCESSORS ================================= */
148 
149  PtStatus getDestinationAddress(char* address, int len);
150  //:Returns the destination URL associated with this forwarding
151  //:instruction.
152 
153  PtStatus getFilter(int& filterType);
154  //:Returns the filter type of this forwarding instruction.
155 
156  PtStatus getSpecificCaller(char* address, int len);
157  //:Returns the specific incoming caller address associated with this
158  //:forwarding instruction.
159  // If the filter type for this forwarding instruction is
160  // <i>SPECIFIC_ADDRESS</i>, then this method returns the
161  // calling address URL to which this filter applies. Otherwise, this
162  // method returns an empty string.
163 
164  PtStatus getType(int& type);
165  //:Returns the type of this forwarding instruction.
166  // The forwarding type indicates whether the forwarding instruction
167  // applies unconditionally, upon no answer, or upon busy.
168 
169  PtStatus getNoAnswerTimeout(int& time);
170  //:Returns the no-answer-timeout value.
171 
172 /* ============================ INQUIRY =================================== */
173 
174 /* //////////////////////////// PROTECTED ///////////////////////////////// */
175 protected:
176 /* //////////////////////////// PRIVATE /////////////////////////////////// */
177 private:
178 
182 
183  UtlString mDestinationUrl;
184  UtlString mCallerUrl;
185 
186 };
187 
188 /* ============================ INLINE METHODS ============================ */
189 
190 #endif // _PtAddressForwarding_h_
Abstract call manager.
Definition: CpCallManager.h:97
int mForwardingType
Definition: PtAddressForwarding.h:179
PtStatus
Definition: PtDefs.h:49
FilterType
enumcode: FORWARD_UNCONDITIONALLY - Forward calls unconditionally enumcode: FORWARD_ON_BUSY - Forward...
Definition: PtAddressForwarding.h:69
virtual ~PtAddressForwarding()
Definition: PtAddressForwarding.cpp:96
PtStatus getType(int &type)
Definition: PtAddressForwarding.cpp:173
Definition: TaoMessage.h:51
Definition: PtAddressForwarding.h:74
int PtBoolean
Definition: PtDefs.h:71
Definition: PtAddressForwarding.h:72
PtStatus getFilter(int &filterType)
Definition: PtAddressForwarding.cpp:150
Definition: PtAddressForwarding.h:62
PtAddressForwarding()
enumcode: ALL_CALLS - Apply forwarding instruction to all incoming calls enumcode: INTERNAL_CALLS - A...
Definition: PtAddressForwarding.cpp:190
PtAddressForwarding & operator=(const PtAddressForwarding &rhs)
Definition: PtAddressForwarding.cpp:105
UtlString mDestinationUrl
Definition: PtAddressForwarding.h:183
Definition: PtAddressForwarding.h:49
UtlString mCallerUrl
Definition: PtAddressForwarding.h:184
Definition: PtAddressForwarding.h:60
Definition: PtAddressForwarding.h:61
TaoStatus addressSetForwarding(TaoMessage &rMsg)
Definition: TaoAddressAdaptor.cpp:887
Definition: PtAddressForwarding.h:71
ForwardingType
Definition: PtAddressForwarding.h:58
Definition: PtAddressForwarding.h:73
PtStatus getNoAnswerTimeout(int &time)
Definition: PtAddressForwarding.cpp:179
PtStatus getDestinationAddress(char *address, int len)
Definition: PtAddressForwarding.cpp:135
TaoStatus
Definition: TaoDefs.h:41
int mFilterType
Definition: PtAddressForwarding.h:181
PtBoolean operator==(const PtAddressForwarding &rhs)
Definition: PtAddressForwarding.cpp:120
PtStatus getSpecificCaller(char *address, int len)
Definition: PtAddressForwarding.cpp:156
Definition: PtAddress.h:189
int mNoAnswerTimeout
Definition: PtAddressForwarding.h:180