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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5948 - (hide annotations) (download)
Fri Feb 17 15:30:16 2006 UTC (13 years, 9 months ago) by dworley
File MIME type: text/plain
File size: 13459 byte(s)
Setting more svn: properties, and adding EOLs to the ends of files
that need it.

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

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