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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27