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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6507 - (hide annotations) (download)
Tue Aug 15 17:01:21 2006 UTC (13 years, 4 months ago) by sgodin
File MIME type: text/plain
File size: 14565 byte(s)
- changed ExpiresCategory.cxx to be an UInt32 so that Expires parameter can handle up to 2^32-1 as in RFC
- modified dum so that expiration values use UInt32 instead of int for storage

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

Properties

Name Value
svn:eol-style native
svn:mime-type text/plain

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27