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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5640 - (hide annotations) (download)
Mon Nov 14 18:49:56 2005 UTC (14 years ago) by sgodin
File size: 12704 byte(s)
- added a MasterProfile setting (allowBadRegistrationsEnabled) to allow DUM to accept Registrations that have a To: tag
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 5640 /// 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 sgodin 4618
30 sgodin 5640 /// This default is used if no value is passed in when creating a registration
31 jason 4010 virtual void setDefaultRegistrationTime(int secs);
32     virtual int getDefaultRegistrationTime() const;
33 sgodin 4618 virtual void unsetDefaultRegistrationTime();
34 jason 3613
35 sgodin 5640 /// 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 jason 4010 virtual void setDefaultMaxRegistrationTime(int secs);
38     virtual int getDefaultMaxRegistrationTime() const;
39 sgodin 4618 virtual void unsetDefaultMaxRegistrationTime();
40 jason 3613
41 sgodin 5640 /// 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 jason 4010 virtual void setDefaultRegistrationRetryTime(int secs);
45     virtual int getDefaultRegistrationRetryTime() const;
46 sgodin 4618 virtual void unsetDefaultRegistrationRetryTime();
47 jason 3613
48 sgodin 5640 /// This default is used if no value is passed in when creating a subscription
49 jason 4010 virtual void setDefaultSubscriptionTime(int secs);
50     virtual int getDefaultSubscriptionTime() const;
51 sgodin 4618 virtual void unsetDefaultSubscriptionTime();
52 jason 3613
53 sgodin 5640 /// This default is used if no value is passed in when creating a publication
54 jason 4010 virtual void setDefaultPublicationTime(int secs);
55     virtual int getDefaultPublicationTime() const;
56 sgodin 4618 virtual void unsetDefaultPublicationTime();
57 jason 4010
58 jason 3613 /// Call is stale if UAC gets no final response within the stale call timeout (default 3 minutes)
59 jason 4010 virtual void setDefaultStaleCallTime(int secs);
60     virtual int getDefaultStaleCallTime() const;
61 sgodin 4618 virtual void unsetDefaultStaleCallTime();
62 jason 3613
63 sgodin 5640 /// Only used if timer option tag is set in MasterProfile.
64     /// Note: Value must be higher than 90 (as specified in RFC 4028)
65 jason 4010 virtual void setDefaultSessionTime(int secs);
66     virtual int getDefaultSessionTime() const;
67 sgodin 4618 virtual void unsetDefaultSessionTime();
68 jason 4010
69 sgodin 5640 /// 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 jason 4010 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 sgodin 4618 virtual void unsetDefaultSessionTimerMode();
89 jason 4010
90 sgodin 5640 /// The amount of time that can pass before dum will resubmit an unreliable provisional response
91 jason 4010 virtual void set1xxRetransmissionTime(int secs);
92     virtual int get1xxRetransmissionTime() const;
93 sgodin 4618 virtual void unset1xxRetransmissionTime();
94 jason 4010
95 sgodin 5640 ///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 jason 4010 virtual void setOverrideHostAndPort(const Uri& hostPort);
101     virtual bool hasOverrideHostAndPort() const;
102     virtual const Uri& getOverrideHostAndPort() const;
103 sgodin 4618 virtual void unsetOverrideHostAndPort();
104 jason 3613
105 sgodin 5640 ///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 jason 4335 virtual void addAdvertisedCapability(const Headers::Type header);
111 jason 4010 virtual bool isAdvertisedCapability(const Headers::Type header) const;
112 sgodin 4618 virtual void clearAdvertisedCapabilities();
113     virtual void unsetAdvertisedCapabilities();
114 jason 4335
115 sgodin 5640 /// Use to route all outbound requests through a particular proxy
116 jason 4010 virtual void setOutboundProxy( const Uri& uri );
117     virtual const NameAddr& getOutboundProxy() const;
118     virtual bool hasOutboundProxy() const;
119 sgodin 4618 virtual void unsetOutboundProxy();
120 jason 3613
121 sgodin 5640 ///enable/disable rport for requests. rport is enabled by default
122 jason 4010 virtual void setRportEnabled(bool enabled);
123     virtual bool getRportEnabled() const;
124 sgodin 4618 virtual void unsetRportEnabled();
125 jason 3613
126 sgodin 5640 ///if set then UserAgent header is added to outbound messages
127 jason 4010 virtual void setUserAgent( const Data& userAgent );
128     virtual const Data& getUserAgent() const;
129     virtual bool hasUserAgent() const;
130 sgodin 4618 virtual void unsetUserAgent();
131 jason 3613
132 sgodin 5640 ///if set then ProxyRequires header is added to outbound messages
133 derek 5540 virtual void setProxyRequires( const Tokens& proxyRequires );
134     virtual const Tokens& getProxyRequires() const;
135     virtual bool hasProxyRequires() const;
136     virtual void unsetProxyRequires();
137    
138 sgodin 5640 ///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 daniel 5599 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 sgodin 4113
148 sgodin 5640 ///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 sgodin 4512 virtual void setFixedTransportPort(int fixedTransportPort);
156     virtual int getFixedTransportPort() const;
157 sgodin 4618 virtual void unsetFixedTransportPort();
158 sgodin 4512
159 sgodin 5640 ///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 sgodin 5607 virtual void setFixedTransportInterface(const Data& fixedTransportInterface);
163 derek 5606 virtual const Data& getFixedTransportInterface() const;
164     virtual void unsetFixedTransportInterface();
165    
166 jason 4010 private:
167 jason 4335 bool mHasDefaultRegistrationExpires;
168 jason 4010 int mDefaultRegistrationExpires;
169 jason 4335
170 jason 4010 bool mHasDefaultMaxRegistrationExpires;
171     int mDefaultMaxRegistrationExpires;
172 jason 3613
173 jason 4010 bool mHasDefaultRegistrationRetryInterval;
174     int mDefaultRegistrationRetryInterval;
175 jason 3613
176 jason 4010 bool mHasDefaultSubscriptionExpires;
177     int mDefaultSubscriptionExpires;
178 jason 3613
179 jason 4010 bool mHasDefaultPublicationExpires;
180     int mDefaultPublicationExpires;
181 jason 3613
182 jason 4010 bool mHasDefaultStaleCallTime;
183     int mDefaultStaleCallTime;
184 jason 3613
185 jason 4010 bool mHasDefaultSessionExpires;
186 jason 3613 int mDefaultSessionExpires;
187    
188 jason 4010 bool mHasDefaultSessionTimerMode;
189     SessionTimerMode mDefaultSessionTimerMode;
190    
191     bool mHas1xxRetransmissionTime;
192     int m1xxRetransmissionTime;
193    
194 jason 3613 bool mHasOutboundProxy;
195     NameAddr mOutboundProxy;
196 jason 4335
197     bool mHasAdvertisedCapabilities;
198     std::set<Headers::Type> mAdvertisedCapabilities;
199    
200     bool mHasRportEnabled;
201 jason 4010 bool mRportEnabled;
202 jason 4335
203 jason 4010 bool mHasUserAgent;
204 jason 3613 Data mUserAgent;
205 jason 4335
206 jason 4010 bool mHasOverrideHostPort;
207 jason 3613 Uri mOverrideHostPort;
208 jason 4335
209 daniel 5599 bool mHasKeepAliveTimeForDatagram;
210     int mKeepAliveTimeForDatagram;
211 sgodin 4512
212 daniel 5599 bool mHasKeepAliveTimeForStream;
213     int mKeepAliveTimeForStream;
214    
215 sgodin 4512 bool mHasFixedTransportPort;
216     int mFixedTransportPort;
217 derek 5606
218     bool mHasFixedTransportInterface;
219     Data mFixedTransportInterface;
220 derek 5540
221     bool mHasProxyRequires;
222     Tokens mProxyRequires;
223 jason 4335
224 sgodin 4778 SharedPtr<Profile> mBaseProfile; // All non-set settings will fall through to this Profile (if set)
225 jason 3613 };
226 jason 4010
227 jason 3613 }
228    
229     #endif
230 jason 4010
231     /* ====================================================================
232     * The Vovida Software License, Version 1.0
233     *
234     * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
235     *
236     * Redistribution and use in source and binary forms, with or without
237     * modification, are permitted provided that the following conditions
238     * are met:
239     *
240     * 1. Redistributions of source code must retain the above copyright
241     * notice, this list of conditions and the following disclaimer.
242     *
243     * 2. Redistributions in binary form must reproduce the above copyright
244     * notice, this list of conditions and the following disclaimer in
245     * the documentation and/or other materials provided with the
246     * distribution.
247     *
248     * 3. The names "VOCAL", "Vovida Open Communication Application Library",
249     * and "Vovida Open Communication Application Library (VOCAL)" must
250     * not be used to endorse or promote products derived from this
251     * software without prior written permission. For written
252     * permission, please contact vocal@vovida.org.
253     *
254     * 4. Products derived from this software may not be called "VOCAL", nor
255     * may "VOCAL" appear in their name, without prior written
256     * permission of Vovida Networks, Inc.
257     *
258     * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
259     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
260     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
261     * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
262     * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
263     * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
264     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
265     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
266     * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
267     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
268     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
269     * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
270     * DAMAGE.
271     *
272     * ====================================================================
273     *
274     * This software consists of voluntary contributions made by Vovida
275     * Networks, Inc. and many individuals on behalf of Vovida Networks,
276     * Inc. For more information on Vovida Networks, Inc., please see
277     * <http://www.vovida.org/>.
278     *
279     */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27