/[resiprocate]/main/resip/dum/Profile.hxx
ViewVC logotype

Contents of /main/resip/dum/Profile.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5837 - (show annotations) (download)
Tue Jan 31 03:25:38 2006 UTC (13 years, 10 months ago) by daniel
File size: 13032 byte(s)
made rinstance a Profile setting, by default rinstance parameter is added to contacts.
1 #if !defined(RESIP_PROFILE_HXX)
2 #define RESIP_PROFILE_HXX
3
4 #include <iosfwd>
5 #include <set>
6 #include "resip/stack/Headers.hxx"
7 #include "resip/stack/MethodTypes.hxx"
8 #include "rutil/SharedPtr.hxx"
9
10 namespace resip
11 {
12
13 class Data;
14
15 class Profile
16 {
17 public:
18 Profile(); // Default to no base profile
19 Profile(SharedPtr<Profile> baseProfile);
20 virtual ~Profile();
21
22 /// Note:
23 /// setXXXX methods will set this setting internally in this object. If you do not call
24 /// a particular setXXX method on this object then a corresponding getXXXX call will attempt
25 /// to retrieve that value from the BaseProfile (provided in the constructor). This allows
26 /// you to setup a heirarchy of profiles and settings.
27 /// unsetXXX methods are used to re-enable fallthrough after calling a setXXXX method. If
28 /// you call an unsetXXXX method on an object with a NULL BaseProfile it will have no effect.
29
30 /// This default is used if no value is passed in when creating a registration
31 virtual void setDefaultRegistrationTime(int secs);
32 virtual int getDefaultRegistrationTime() const;
33 virtual void unsetDefaultRegistrationTime();
34
35 /// If a registration gets rejected with a 423, then we with the MinExpires value - if it is less than this
36 /// Set to 0 to disable this check and accept any time suggested by the server.
37 virtual void setDefaultMaxRegistrationTime(int secs);
38 virtual int getDefaultMaxRegistrationTime() const;
39 virtual void unsetDefaultMaxRegistrationTime();
40
41 /// The time to retry registrations on error responses (if Retry-After header is not present in error)
42 /// Set to 0 to never retry on errors. Note: onRequestRetry is called before this setting is
43 /// checked. Return -1 from onRequestRetry in order to use this setting.
44 virtual void setDefaultRegistrationRetryTime(int secs);
45 virtual int getDefaultRegistrationRetryTime() const;
46 virtual void unsetDefaultRegistrationRetryTime();
47
48 /// This default is used if no value is passed in when creating a subscription
49 virtual void setDefaultSubscriptionTime(int secs);
50 virtual int getDefaultSubscriptionTime() const;
51 virtual void unsetDefaultSubscriptionTime();
52
53 /// This default is used if no value is passed in when creating a publication
54 virtual void setDefaultPublicationTime(int secs);
55 virtual int getDefaultPublicationTime() const;
56 virtual void unsetDefaultPublicationTime();
57
58 /// Call is stale if UAC gets no final response within the stale call timeout (default 3 minutes)
59 virtual void setDefaultStaleCallTime(int secs);
60 virtual int getDefaultStaleCallTime() const;
61 virtual void unsetDefaultStaleCallTime();
62
63 /// Only used if timer option tag is set in MasterProfile.
64 /// Note: Value must be higher than 90 (as specified in RFC 4028)
65 virtual void setDefaultSessionTime(int secs);
66 virtual int getDefaultSessionTime() const;
67 virtual void unsetDefaultSessionTime();
68
69 /// Only used if timer option tag is set in MasterProfile.
70 /// Set to PreferLocalRefreshes if you prefer that the local UA performs the refreshes.
71 /// Set to PreferRemoteRefreshes if you prefer that the remote UA peforms the refreshes.
72 /// Set to PreferUACRefreshes if you prefer that the UAC (for the session - caller) performs the refreshes.
73 /// Set to PreferUASRefreshes if you prefer that the UAS (for the session - callee) performs the refreshes.
74 /// Note: determining the refresher is a negotiation, so despite this setting the remote
75 /// end may end up enforcing their preference. Also if the remote end doesn't support
76 /// SessionTimers then the refresher will always be local.
77 /// This implementation follows the RECOMMENDED practices from section 7.1 of the draft
78 /// and does not specify a refresher parameter as in UAC requests.
79 typedef enum
80 {
81 PreferLocalRefreshes,
82 PreferRemoteRefreshes,
83 PreferUACRefreshes,
84 PreferUASRefreshes
85 } SessionTimerMode;
86 virtual void setDefaultSessionTimerMode(Profile::SessionTimerMode mode);
87 virtual Profile::SessionTimerMode getDefaultSessionTimerMode() const;
88 virtual void unsetDefaultSessionTimerMode();
89
90 /// The amount of time that can pass before dum will resubmit an unreliable provisional response
91 virtual void set1xxRetransmissionTime(int secs);
92 virtual int get1xxRetransmissionTime() const;
93 virtual void unset1xxRetransmissionTime();
94
95 ///overrides the value used to populate the contact
96 ///?dcm? -- also change via entries? Also, dum currently uses(as a uas)
97 ///the request uri of the dialog constructing request for the local contact
98 ///within that dialog. A transport paramter here could also be used to
99 ///force tcp vs udp vs tls?
100 virtual void setOverrideHostAndPort(const Uri& hostPort);
101 virtual bool hasOverrideHostAndPort() const;
102 virtual const Uri& getOverrideHostAndPort() const;
103 virtual void unsetOverrideHostAndPort();
104
105 ///enable/disable sending of Allow/Supported/Accept-Language/Accept-Encoding headers
106 ///on initial outbound requests (ie. Initial INVITE, REGISTER, etc.) and Invite 200 responses
107 ///Note: Default is to advertise Headers::Allow and Headers::Supported, use clearAdvertisedCapabilities to remove these
108 /// Currently implemented header values are: Headers::Allow,
109 /// Headers::AcceptEncoding, Headers::AcceptLanguage, Headers::Supported
110 virtual void addAdvertisedCapability(const Headers::Type header);
111 virtual bool isAdvertisedCapability(const Headers::Type header) const;
112 virtual void clearAdvertisedCapabilities();
113 virtual void unsetAdvertisedCapabilities();
114
115 /// Use to route all outbound requests through a particular proxy
116 virtual void setOutboundProxy( const Uri& uri );
117 virtual const NameAddr& getOutboundProxy() const;
118 virtual bool hasOutboundProxy() const;
119 virtual void unsetOutboundProxy();
120
121 ///enable/disable rport for requests. rport is enabled by default
122 virtual void setRportEnabled(bool enabled);
123 virtual bool getRportEnabled() const;
124 virtual void unsetRportEnabled();
125
126 ///if set then UserAgent header is added to outbound messages
127 virtual void setUserAgent( const Data& userAgent );
128 virtual const Data& getUserAgent() const;
129 virtual bool hasUserAgent() const;
130 virtual void unsetUserAgent();
131
132 ///if set then ProxyRequires header is added to outbound messages
133 virtual void setProxyRequires( const Tokens& proxyRequires );
134 virtual const Tokens& getProxyRequires() const;
135 virtual bool hasProxyRequires() const;
136 virtual void unsetProxyRequires();
137
138 ///time between CR/LF keepalive messages in seconds. Set to 0 to disable.
139 ///Default is 30 seconds for datagram and 180 seconds for stream.
140 ///Note: You must set a KeepAliveManager on DUM for this to work.
141 virtual void setKeepAliveTimeForDatagram(int keepAliveTime);
142 virtual int getKeepAliveTimeForDatagram() const;
143 virtual void unsetKeepAliveTimeForDatagram();
144 virtual void setKeepAliveTimeForStream(int keepAliveTime);
145 virtual int getKeepAliveTimeForStream() const;
146 virtual void unsetKeepAliveTimeForStream();
147
148 ///If set dum will provide a port in the via for requests sent down to the stack. This
149 ///will tell the transport selector to only look at those transports using this port.
150 ///Default is 0 (Disabled).
151 ///WARNING: Setting this can cause undesirable behaviour in the case when you want
152 /// DNS entries to decided your transport and you are supporting TLS.
153 /// For example: if you add UDP:5060, TCP:5060 and TLS:5061 and setFixedTransportPort
154 /// to 5060 - then the TLS transport cannot be used.
155 virtual void setFixedTransportPort(int fixedTransportPort);
156 virtual int getFixedTransportPort() const;
157 virtual void unsetFixedTransportPort();
158
159 ///If set dum will provide a interface in the via for requests sent down to the stack. This
160 ///will tell the transport selector to only look at those transports using this interface.
161 ///Default is Data::Empty (Disabled).
162 virtual void setFixedTransportInterface(const Data& fixedTransportInterface);
163 virtual const Data& getFixedTransportInterface() const;
164 virtual void unsetFixedTransportInterface();
165
166 ///if enabled then rinstance parameter is added to contacts. rinstance
167 ///parameter is added by default.
168 virtual void setRinstanceEnabled(bool enabled);
169 virtual bool getRinstanceEnabled() const;
170 virtual void unsetRinstanceEnabled();
171
172 private:
173 bool mHasDefaultRegistrationExpires;
174 int mDefaultRegistrationExpires;
175
176 bool mHasDefaultMaxRegistrationExpires;
177 int mDefaultMaxRegistrationExpires;
178
179 bool mHasDefaultRegistrationRetryInterval;
180 int mDefaultRegistrationRetryInterval;
181
182 bool mHasDefaultSubscriptionExpires;
183 int mDefaultSubscriptionExpires;
184
185 bool mHasDefaultPublicationExpires;
186 int mDefaultPublicationExpires;
187
188 bool mHasDefaultStaleCallTime;
189 int mDefaultStaleCallTime;
190
191 bool mHasDefaultSessionExpires;
192 int mDefaultSessionExpires;
193
194 bool mHasDefaultSessionTimerMode;
195 SessionTimerMode mDefaultSessionTimerMode;
196
197 bool mHas1xxRetransmissionTime;
198 int m1xxRetransmissionTime;
199
200 bool mHasOutboundProxy;
201 NameAddr mOutboundProxy;
202
203 bool mHasAdvertisedCapabilities;
204 std::set<Headers::Type> mAdvertisedCapabilities;
205
206 bool mHasRportEnabled;
207 bool mRportEnabled;
208
209 bool mHasUserAgent;
210 Data mUserAgent;
211
212 bool mHasOverrideHostPort;
213 Uri mOverrideHostPort;
214
215 bool mHasKeepAliveTimeForDatagram;
216 int mKeepAliveTimeForDatagram;
217
218 bool mHasKeepAliveTimeForStream;
219 int mKeepAliveTimeForStream;
220
221 bool mHasFixedTransportPort;
222 int mFixedTransportPort;
223
224 bool mHasFixedTransportInterface;
225 Data mFixedTransportInterface;
226
227 bool mHasProxyRequires;
228 Tokens mProxyRequires;
229
230 bool mHasRinstanceEnabled;
231 bool mRinstanceEnabled;
232
233 SharedPtr<Profile> mBaseProfile; // All non-set settings will fall through to this Profile (if set)
234 };
235
236 }
237
238 #endif
239
240 /* ====================================================================
241 * The Vovida Software License, Version 1.0
242 *
243 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
244 *
245 * Redistribution and use in source and binary forms, with or without
246 * modification, are permitted provided that the following conditions
247 * are met:
248 *
249 * 1. Redistributions of source code must retain the above copyright
250 * notice, this list of conditions and the following disclaimer.
251 *
252 * 2. Redistributions in binary form must reproduce the above copyright
253 * notice, this list of conditions and the following disclaimer in
254 * the documentation and/or other materials provided with the
255 * distribution.
256 *
257 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
258 * and "Vovida Open Communication Application Library (VOCAL)" must
259 * not be used to endorse or promote products derived from this
260 * software without prior written permission. For written
261 * permission, please contact vocal@vovida.org.
262 *
263 * 4. Products derived from this software may not be called "VOCAL", nor
264 * may "VOCAL" appear in their name, without prior written
265 * permission of Vovida Networks, Inc.
266 *
267 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
268 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
269 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
270 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
271 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
272 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
273 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
274 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
275 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
276 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
277 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
278 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
279 * DAMAGE.
280 *
281 * ====================================================================
282 *
283 * This software consists of voluntary contributions made by Vovida
284 * Networks, Inc. and many individuals on behalf of Vovida Networks,
285 * Inc. For more information on Vovida Networks, Inc., please see
286 * <http://www.vovida.org/>.
287 *
288 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27