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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5586 - (show annotations) (download)
Fri Oct 28 21:01:13 2005 UTC (14 years, 1 month ago) by sgodin
File size: 11781 byte(s)
- modified ACK handling
  - mAckId is no longer tracked by Dialog.cxx - all logic is in InviteSession.cxx
  - Authorization and Proxy-Authorization headers are copied to acks from the InviteSession.cxx
  - 2xx retransmission is now detected and handled properly - no more incorrect handler callbacks
- DialogSet destruction bug fixed
- onStaleCallTimeout callback no has a default handler to send a BYE - app can override and send a CANCEL if desired
- 

1 #if !defined(RESIP_PROFILE_HXX)
2 #define RESIP_PROFILE_HXX
3
4 #include <iosfwd>
5 #include <set>
6 #include "resip/stack/Headers.hxx"
7 #include "resip/stack/MethodTypes.hxx"
8 #include "rutil/SharedPtr.hxx"
9
10 namespace resip
11 {
12
13 class Data;
14
15 class Profile
16 {
17 public:
18 Profile(); // Default to no base profile
19 Profile(SharedPtr<Profile> baseProfile);
20 virtual ~Profile();
21
22 // 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 // 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 virtual void unsetDefaultRegistrationTime();
34
35 // 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 virtual void unsetDefaultMaxRegistrationTime();
40
41 // 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 virtual void setDefaultRegistrationRetryTime(int secs);
45 virtual int getDefaultRegistrationRetryTime() const;
46 virtual void unsetDefaultRegistrationRetryTime();
47
48 // This default is used if no value is passed in when creating a subscription
49 virtual void setDefaultSubscriptionTime(int secs);
50 virtual int getDefaultSubscriptionTime() const;
51 virtual void unsetDefaultSubscriptionTime();
52
53 // This default is used if no value is passed in when creating a publication
54 virtual void setDefaultPublicationTime(int secs);
55 virtual int getDefaultPublicationTime() const;
56 virtual void unsetDefaultPublicationTime();
57
58 /// Call is stale if UAC gets no final response within the stale call timeout (default 3 minutes)
59 virtual void setDefaultStaleCallTime(int secs);
60 virtual int getDefaultStaleCallTime() const;
61 virtual void unsetDefaultStaleCallTime();
62
63 // Only used if timer option tag is set in MasterProfile.
64 // Note: Value must be higher than 90 (as specified in RFC 4028)
65 virtual void setDefaultSessionTime(int secs);
66 virtual int getDefaultSessionTime() const;
67 virtual void unsetDefaultSessionTime();
68
69 // 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 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 virtual void unsetDefaultSessionTimerMode();
89
90 // The amount of time that can pass before dum will resubmit an unreliable provisional response
91 virtual void set1xxRetransmissionTime(int secs);
92 virtual int get1xxRetransmissionTime() const;
93 virtual void unset1xxRetransmissionTime();
94
95 //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 virtual void setOverrideHostAndPort(const Uri& hostPort);
101 virtual bool hasOverrideHostAndPort() const;
102 virtual const Uri& getOverrideHostAndPort() const;
103 virtual void unsetOverrideHostAndPort();
104
105 //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 virtual void addAdvertisedCapability(const Headers::Type header);
111 virtual bool isAdvertisedCapability(const Headers::Type header) const;
112 virtual void clearAdvertisedCapabilities();
113 virtual void unsetAdvertisedCapabilities();
114
115 // Use to route all outbound requests through a particular proxy
116 virtual void setOutboundProxy( const Uri& uri );
117 virtual const NameAddr& getOutboundProxy() const;
118 virtual bool hasOutboundProxy() const;
119 virtual void unsetOutboundProxy();
120
121 //enable/disable rport for requests. rport is enabled by default
122 virtual void setRportEnabled(bool enabled);
123 virtual bool getRportEnabled() const;
124 virtual void unsetRportEnabled();
125
126 //if set then UserAgent header is added to outbound messages
127 virtual void setUserAgent( const Data& userAgent );
128 virtual const Data& getUserAgent() const;
129 virtual bool hasUserAgent() const;
130 virtual void unsetUserAgent();
131
132 //if set then ProxyRequires header is added to outbound messages
133 virtual void setProxyRequires( const Tokens& proxyRequires );
134 virtual const Tokens& getProxyRequires() const;
135 virtual bool hasProxyRequires() const;
136 virtual void unsetProxyRequires();
137
138 //time between CR/LF keepalive messages in seconds. Set to 0 to disable. Default is 30.
139 //Note: You must set a KeepAliveManager on DUM for this to work.
140 virtual void setKeepAliveTime(int keepAliveTime);
141 virtual int getKeepAliveTime() const;
142 virtual void unsetKeepAliveTime();
143
144 //If set dum will provide a port in the via for requests sent down to the stack. This
145 //will tell the transport selector to only look at those transports using this port.
146 //Default is 0 (Disabled).
147 //WARNING: Setting this can cause undesirable behaviour in the case when you want
148 // DNS entries to decided your transport and you are supporting TLS.
149 // For example: if you add UDP:5060, TCP:5060 and TLS:5061 and setFixedTransportPort
150 // to 5060 - then the TLS transport cannot be used.
151 virtual void setFixedTransportPort(int fixedTransportPort);
152 virtual int getFixedTransportPort() const;
153 virtual void unsetFixedTransportPort();
154
155 private:
156 bool mHasDefaultRegistrationExpires;
157 int mDefaultRegistrationExpires;
158
159 bool mHasDefaultMaxRegistrationExpires;
160 int mDefaultMaxRegistrationExpires;
161
162 bool mHasDefaultRegistrationRetryInterval;
163 int mDefaultRegistrationRetryInterval;
164
165 bool mHasDefaultSubscriptionExpires;
166 int mDefaultSubscriptionExpires;
167
168 bool mHasDefaultPublicationExpires;
169 int mDefaultPublicationExpires;
170
171 bool mHasDefaultStaleCallTime;
172 int mDefaultStaleCallTime;
173
174 bool mHasDefaultSessionExpires;
175 int mDefaultSessionExpires;
176
177 bool mHasDefaultSessionTimerMode;
178 SessionTimerMode mDefaultSessionTimerMode;
179
180 bool mHas1xxRetransmissionTime;
181 int m1xxRetransmissionTime;
182
183 bool mHasOutboundProxy;
184 NameAddr mOutboundProxy;
185
186 bool mHasAdvertisedCapabilities;
187 std::set<Headers::Type> mAdvertisedCapabilities;
188
189 bool mHasRportEnabled;
190 bool mRportEnabled;
191
192 bool mHasUserAgent;
193 Data mUserAgent;
194
195 bool mHasOverrideHostPort;
196 Uri mOverrideHostPort;
197
198 bool mHasKeepAliveTime;
199 int mKeepAliveTime;
200
201 bool mHasFixedTransportPort;
202 int mFixedTransportPort;
203
204 bool mHasProxyRequires;
205 Tokens mProxyRequires;
206
207 SharedPtr<Profile> mBaseProfile; // All non-set settings will fall through to this Profile (if set)
208 };
209
210 }
211
212 #endif
213
214 /* ====================================================================
215 * The Vovida Software License, Version 1.0
216 *
217 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
218 *
219 * Redistribution and use in source and binary forms, with or without
220 * modification, are permitted provided that the following conditions
221 * are met:
222 *
223 * 1. Redistributions of source code must retain the above copyright
224 * notice, this list of conditions and the following disclaimer.
225 *
226 * 2. Redistributions in binary form must reproduce the above copyright
227 * notice, this list of conditions and the following disclaimer in
228 * the documentation and/or other materials provided with the
229 * distribution.
230 *
231 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
232 * and "Vovida Open Communication Application Library (VOCAL)" must
233 * not be used to endorse or promote products derived from this
234 * software without prior written permission. For written
235 * permission, please contact vocal@vovida.org.
236 *
237 * 4. Products derived from this software may not be called "VOCAL", nor
238 * may "VOCAL" appear in their name, without prior written
239 * permission of Vovida Networks, Inc.
240 *
241 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
242 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
243 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
244 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
245 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
246 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
247 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
248 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
249 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
250 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
252 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
253 * DAMAGE.
254 *
255 * ====================================================================
256 *
257 * This software consists of voluntary contributions made by Vovida
258 * Networks, Inc. and many individuals on behalf of Vovida Networks,
259 * Inc. For more information on Vovida Networks, Inc., please see
260 * <http://www.vovida.org/>.
261 *
262 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27