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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4691 - (hide annotations) (download)
Thu May 19 13:10:59 2005 UTC (14 years, 6 months ago) by sgodin
Original Path: main/sip/resiprocate/dum/Profile.hxx
File size: 11240 byte(s)
- fixes to SessionTimer refresher flag
- added MinSE header insertion
- cleaned up session timer code

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

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27