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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5606 - (hide annotations) (download)
Sat Nov 5 01:24:29 2005 UTC (14 years, 1 month ago) by derek
File size: 12592 byte(s)
added setFixedTransportInterface to profile. Works like setFixedTransportPort 
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 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 sgodin 5586 // 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 jason 4010 // 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 sgodin 4618 virtual void unsetDefaultSubscriptionTime();
52 jason 3613
53 jason 4010 // 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 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 jason 4010 // Only used if timer option tag is set in MasterProfile.
64 sgodin 4691 // 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     // 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 sgodin 4691 // 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 jason 4010 // 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 sgodin 4618 virtual void unsetDefaultSessionTimerMode();
89 jason 4010
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 sgodin 4618 virtual void unset1xxRetransmissionTime();
94 jason 4010
95 jason 3613 //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 jason 4335 //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 jason 4010 virtual bool isAdvertisedCapability(const Headers::Type header) const;
112 sgodin 4618 virtual void clearAdvertisedCapabilities();
113     virtual void unsetAdvertisedCapabilities();
114 jason 4335
115 jason 4010 // 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 sgodin 4618 virtual void unsetOutboundProxy();
120 jason 3613
121 jason 4010 //enable/disable rport for requests. rport is enabled by default
122     virtual void setRportEnabled(bool enabled);
123     virtual bool getRportEnabled() const;
124 sgodin 4618 virtual void unsetRportEnabled();
125 jason 3613
126 jason 4335 //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 derek 5540 //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 daniel 5599 //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 sgodin 4113 //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 4512 //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     virtual void setFixedTransportPort(int fixedTransportPort);
156     virtual int getFixedTransportPort() const;
157 sgodin 4618 virtual void unsetFixedTransportPort();
158 sgodin 4512
159 derek 5606 //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     virtual void setFixedTransportInterface(const Data& interface);
162     virtual const Data& getFixedTransportInterface() const;
163     virtual void unsetFixedTransportInterface();
164    
165 jason 4010 private:
166 jason 4335 bool mHasDefaultRegistrationExpires;
167 jason 4010 int mDefaultRegistrationExpires;
168 jason 4335
169 jason 4010 bool mHasDefaultMaxRegistrationExpires;
170     int mDefaultMaxRegistrationExpires;
171 jason 3613
172 jason 4010 bool mHasDefaultRegistrationRetryInterval;
173     int mDefaultRegistrationRetryInterval;
174 jason 3613
175 jason 4010 bool mHasDefaultSubscriptionExpires;
176     int mDefaultSubscriptionExpires;
177 jason 3613
178 jason 4010 bool mHasDefaultPublicationExpires;
179     int mDefaultPublicationExpires;
180 jason 3613
181 jason 4010 bool mHasDefaultStaleCallTime;
182     int mDefaultStaleCallTime;
183 jason 3613
184 jason 4010 bool mHasDefaultSessionExpires;
185 jason 3613 int mDefaultSessionExpires;
186    
187 jason 4010 bool mHasDefaultSessionTimerMode;
188     SessionTimerMode mDefaultSessionTimerMode;
189    
190     bool mHas1xxRetransmissionTime;
191     int m1xxRetransmissionTime;
192    
193 jason 3613 bool mHasOutboundProxy;
194     NameAddr mOutboundProxy;
195 jason 4335
196     bool mHasAdvertisedCapabilities;
197     std::set<Headers::Type> mAdvertisedCapabilities;
198    
199     bool mHasRportEnabled;
200 jason 4010 bool mRportEnabled;
201 jason 4335
202 jason 4010 bool mHasUserAgent;
203 jason 3613 Data mUserAgent;
204 jason 4335
205 jason 4010 bool mHasOverrideHostPort;
206 jason 3613 Uri mOverrideHostPort;
207 jason 4335
208 daniel 5599 bool mHasKeepAliveTimeForDatagram;
209     int mKeepAliveTimeForDatagram;
210 sgodin 4512
211 daniel 5599 bool mHasKeepAliveTimeForStream;
212     int mKeepAliveTimeForStream;
213    
214 sgodin 4512 bool mHasFixedTransportPort;
215     int mFixedTransportPort;
216 derek 5606
217     bool mHasFixedTransportInterface;
218     Data mFixedTransportInterface;
219 derek 5540
220     bool mHasProxyRequires;
221     Tokens mProxyRequires;
222 jason 4335
223 sgodin 4778 SharedPtr<Profile> mBaseProfile; // All non-set settings will fall through to this Profile (if set)
224 jason 3613 };
225 jason 4010
226 jason 3613 }
227    
228     #endif
229 jason 4010
230     /* ====================================================================
231     * The Vovida Software License, Version 1.0
232     *
233     * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
234     *
235     * Redistribution and use in source and binary forms, with or without
236     * modification, are permitted provided that the following conditions
237     * are met:
238     *
239     * 1. Redistributions of source code must retain the above copyright
240     * notice, this list of conditions and the following disclaimer.
241     *
242     * 2. Redistributions in binary form must reproduce the above copyright
243     * notice, this list of conditions and the following disclaimer in
244     * the documentation and/or other materials provided with the
245     * distribution.
246     *
247     * 3. The names "VOCAL", "Vovida Open Communication Application Library",
248     * and "Vovida Open Communication Application Library (VOCAL)" must
249     * not be used to endorse or promote products derived from this
250     * software without prior written permission. For written
251     * permission, please contact vocal@vovida.org.
252     *
253     * 4. Products derived from this software may not be called "VOCAL", nor
254     * may "VOCAL" appear in their name, without prior written
255     * permission of Vovida Networks, Inc.
256     *
257     * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
258     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
259     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
260     * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
261     * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
262     * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
263     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
264     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
265     * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
266     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
267     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
268     * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
269     * DAMAGE.
270     *
271     * ====================================================================
272     *
273     * This software consists of voluntary contributions made by Vovida
274     * Networks, Inc. and many individuals on behalf of Vovida Networks,
275     * Inc. For more information on Vovida Networks, Inc., please see
276     * <http://www.vovida.org/>.
277     *
278     */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27