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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27