reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
MasterProfile.hxx
Go to the documentation of this file.
1#ifndef RESIP_MasterProfile_hxx
2#define RESIP_MasterProfile_hxx
3
4#include <iosfwd>
5#include <set>
6#include <map>
11
12namespace resip
13{
14
16{
17 public:
18
21
31 virtual void addSupportedScheme(const Data& scheme);
32 virtual bool isSchemeSupported(const Data& scheme) const;
33 virtual void clearSupportedSchemes() noexcept;
34
36 virtual void addSupportedMethod(const MethodTypes& method);
37 virtual void removeSupportedMethod(const MethodTypes& method);
38 virtual bool isMethodSupported(MethodTypes method) const;
39 virtual Tokens getAllowedMethods() const;
40 virtual Data getAllowedMethodsData() const;
41
42 virtual void clearSupportedMethods() noexcept;
43
45 virtual void addSupportedOptionTag(const Token& tag);
46 virtual Tokens getUnsupportedOptionsTags(const Tokens& requiresOptionTags); // Returns list of unsupported option tags
47 virtual Tokens getSupportedOptionTags() const;
48 virtual void clearSupportedOptionTags() noexcept;
49
50 typedef enum
51 {
53 SupportedEssential, // If UAS - Only use reliable provisionals if sending a body and far end supports
54 Supported, // If UAS - Always use reliable provisionals if far end supports
55 Required // If UAS - Always use reliable provisionals
57
58 // UAC PRACK support. UPDATE must be enabled(currently defaults to on, do
59 // not disable w/out disabling UAC PRACK support).
60 //
61 // Flows where an an answer is received in a 180rel and subsequent O/A
62 // exchanges using UPDATE occur in the early dialog
63 // have been tested.
64 //
65 // A subsequent O/A exchange using 180rel/PRACK is also supported. This is
66 // a really bad idea, as an answer must be generated; the offer cannot be
67 // rejected. UPDATE should always be used for O/A exchanges once the
68 // dialog is established.
69 //
70 // Invite/18x(offer)/PRACK(ans) also works
71 //
72 // Invite(offer)/18x(ans)/PRACK(offer)/200P(ans) is supported, but not recommended.
73 // The UAC MUST call provideOffer from the onAnswer callback in order to generate
74 // the offer in the PRACK.
75 //
76 // Explicit limitations are:
77 // - Overlapping reliable provisional responses that contain a body are not
78 // handled.
79 //
80 // Note: Using SupportedEssential is exactly the same as using Supported,
81 // SupportedEssential only effects UAS Prack implementation
84
85 // UAS PRACK support. UPDATE must be enabled(currently defaults to on, do
86 // not disable w/out disabling UAS PRACK support).
87 //
88 // All flows and limitations mentioned in UAC Prack comments apply
89 //
90 // Modes work as follows:
91 // SupportedEssential - Only send reliable provisionals if sending a body and far end supports
92 // Supported - Always send reliable provisionals if far end supports
93 // Required - Always send reliable provisionals
96
98 virtual void addSupportedMimeType(const MethodTypes& method, const Mime& mimeType);
99 virtual bool removeSupportedMimeType(const MethodTypes& method, const Mime& mimeType);
100 virtual bool isMimeTypeSupported(const MethodTypes& method, const Mime& mimeType);
101 virtual Mimes getSupportedMimeTypes(const MethodTypes& method);
102 virtual void clearSupportedMimeTypes(const MethodTypes& method);
103 virtual void clearSupportedMimeTypes() noexcept; // Clear for all Methods
104
106 virtual void addSupportedEncoding(const Token& encoding);
107 virtual bool isContentEncodingSupported(const Token& contentEncoding) const;
108 virtual Tokens getSupportedEncodings() const;
109 virtual void clearSupportedEncodings() noexcept;
110
112 virtual void addSupportedLanguage(const Token& lang);
113 virtual bool isLanguageSupported(const Tokens& lang) const;
114 virtual Tokens getSupportedLanguages() const;
115 virtual void clearSupportedLanguages() noexcept;
116
118 virtual void addAllowedEvent(const Token& event);
119 virtual bool isEventAllowed(const Tokens& event) const;
120 virtual Tokens getAllowedEvents() const;
121 virtual void clearAllowedEvents() noexcept;
122
124 virtual bool& validateContentEnabled() noexcept;
125 virtual bool validateContentEnabled() const noexcept;
126
128 virtual bool& validateContentLanguageEnabled() noexcept;
129 virtual bool validateContentLanguageEnabled() const noexcept;
130
132 virtual bool& validateAcceptEnabled() noexcept;
133 virtual bool validateAcceptEnabled() const noexcept;
134
137 virtual bool& allowBadRegistrationEnabled() noexcept;
138 virtual bool allowBadRegistrationEnabled() const noexcept;
139
140
146 virtual uint32_t& serverRegistrationMinExpiresTime() noexcept;
147 virtual uint32_t serverRegistrationMinExpiresTime() const noexcept;
148
152 virtual uint32_t& serverRegistrationMaxExpiresTime() noexcept;
153 virtual uint32_t serverRegistrationMaxExpiresTime() const noexcept;
154
157 virtual uint32_t serverRegistrationDefaultExpiresTime() const noexcept;
158
169
170 virtual bool& checkReqUriInMergeDetectionEnabled() noexcept;
171 virtual bool checkReqUriInMergeDetectionEnabled() const noexcept;
172
188 virtual bool additionalTransactionTerminatingResponsesEnabled() const noexcept;
189
191 virtual bool isAdditionalTransactionTerminatingResponse(int code) const;
192
193 virtual const std::set<int>& getAdditionalTransactionTerminatingResponses() const;
195
196 private:
197 virtual UserProfile* clone() const;
198 std::set<Data> mSupportedSchemes;
199 std::set<MethodTypes> mSupportedMethodTypes;
200 Tokens mSupportedMethods;
201 Tokens mSupportedOptionTags;
202 std::map<MethodTypes, Mimes> mSupportedMimeTypes;
203 Tokens mSupportedEncodings;
204 Tokens mSupportedLanguages;
205 Tokens mAllowedEvents;
206
207 bool mValidateContentEnabled;
208 bool mValidateContentLanguageEnabled;
209 bool mValidateAcceptEnabled;
210 bool mAllowBadRegistrationEnabled;
211 bool mCheckReqUriInMergeDetectionEnabled;
212 ReliableProvisionalMode mUacReliableProvisionalMode;
213 ReliableProvisionalMode mUasReliableProvisionalMode;
214 uint32_t mServerRegistrationMinExpires;
215 uint32_t mServerRegistrationMaxExpires;
216 uint32_t mServerRegistrationDefaultExpires;
217
218 bool mAdditionalTransactionTerminatingResponsesEnabled;
219 std::set<int> mAdditionalTransactionTerminatingResponsess;
220};
221
222}
223
224#endif
225
226/* ====================================================================
227 * The Vovida Software License, Version 1.0
228 *
229 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
230 *
231 * Redistribution and use in source and binary forms, with or without
232 * modification, are permitted provided that the following conditions
233 * are met:
234 *
235 * 1. Redistributions of source code must retain the above copyright
236 * notice, this list of conditions and the following disclaimer.
237 *
238 * 2. Redistributions in binary form must reproduce the above copyright
239 * notice, this list of conditions and the following disclaimer in
240 * the documentation and/or other materials provided with the
241 * distribution.
242 *
243 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
244 * and "Vovida Open Communication Application Library (VOCAL)" must
245 * not be used to endorse or promote products derived from this
246 * software without prior written permission. For written
247 * permission, please contact vocal@vovida.org.
248 *
249 * 4. Products derived from this software may not be called "VOCAL", nor
250 * may "VOCAL" appear in their name, without prior written
251 * permission of Vovida Networks, Inc.
252 *
253 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
254 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
255 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
256 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
257 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
258 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
259 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
260 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
261 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
262 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
263 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
264 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
265 * DAMAGE.
266 *
267 * ====================================================================
268 *
269 * This software consists of voluntary contributions made by Vovida
270 * Networks, Inc. and many individuals on behalf of Vovida Networks,
271 * Inc. For more information on Vovida Networks, Inc., please see
272 * <http://www.vovida.org/>.
273 *
274 */
275
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
virtual bool isSchemeSupported(const Data &scheme) const
virtual void setUasReliableProvisionalMode(ReliableProvisionalMode mode) noexcept
virtual void clearSupportedEncodings() noexcept
virtual void clearSupportedSchemes() noexcept
virtual bool isMimeTypeSupported(const MethodTypes &method, const Mime &mimeType)
virtual uint32_t & serverRegistrationDefaultExpiresTime() noexcept
If no Expires header or individual contact bindings specify an expiration value, use this value.
virtual bool isLanguageSupported(const Tokens &lang) const
virtual void clearAllowedEvents() noexcept
virtual const std::set< int > & getAdditionalTransactionTerminatingResponses() const
virtual bool & validateAcceptEnabled() noexcept
enable/disable Accept header validation
virtual bool isMethodSupported(MethodTypes method) const
virtual void clearSupportedOptionTags() noexcept
virtual void removeSupportedMethod(const MethodTypes &method)
virtual Tokens getSupportedLanguages() const
virtual void clearSupportedMimeTypes() noexcept
virtual bool & validateContentLanguageEnabled() noexcept
enable/disable content language validation
virtual Tokens getSupportedEncodings() const
virtual Tokens getAllowedMethods() const
virtual void addSupportedScheme(const Data &scheme)
Default is "sip".
virtual void addAllowedEvent(const Token &event)
Default is to not send an Allow-Events header.
virtual Tokens getSupportedOptionTags() const
virtual ReliableProvisionalMode getUacReliableProvisionalMode() const noexcept
MasterProfile()
Creates an Identity/Profile with no BaseProfile - this is the root of all profiles.
virtual Tokens getAllowedEvents() const
virtual void addSupportedMimeType(const MethodTypes &method, const Mime &mimeType)
Default is application/sdp for INVITE, OPTIONS, PRACK and UPDATE Methods.
virtual uint32_t & serverRegistrationMaxExpiresTime() noexcept
If an inbound REGISTER has an Expires header or any individual contact bindings with expires greater ...
virtual void addSupportedEncoding(const Token &encoding)
Default is no encoding.
virtual bool isEventAllowed(const Tokens &event) const
virtual bool isContentEncodingSupported(const Token &contentEncoding) const
virtual ReliableProvisionalMode getUasReliableProvisionalMode() const noexcept
virtual Data getAllowedMethodsData() const
virtual bool & validateContentEnabled() noexcept
enable/disable content validation
virtual void addSupportedOptionTag(const Token &tag)
Default is none. Do not use to enable PRACK(100rel) support.
virtual void addSupportedMethod(const MethodTypes &method)
Defaults are: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE.
virtual void setUacReliableProvisionalMode(ReliableProvisionalMode mode) noexcept
virtual void addAdditionalTransactionTerminatingResponses(int code)
virtual bool removeSupportedMimeType(const MethodTypes &method, const Mime &mimeType)
virtual bool & additionalTransactionTerminatingResponsesEnabled() noexcept
Enabling this setting will allow the application layer to provide additional SIP responses,...
virtual Tokens getUnsupportedOptionsTags(const Tokens &requiresOptionTags)
virtual void clearSupportedMethods() noexcept
virtual bool & checkReqUriInMergeDetectionEnabled() noexcept
Set this to include the RequestURI in merge request detection.
virtual uint32_t & serverRegistrationMinExpiresTime() noexcept
Used when receiving a REGISTER request, if the expires value in the request is less than this time,...
virtual bool isAdditionalTransactionTerminatingResponse(int code) const
virtual void clearSupportedLanguages() noexcept
virtual void clearAdditionalTransactionTerminatingResponses() noexcept
virtual bool & allowBadRegistrationEnabled() noexcept
Set this to allow the Registration Server to accept registration requests that contain a To Tag.
virtual void addSupportedLanguage(const Token &lang)
Default is all - if nothing is set, then all are allowed.
virtual Mimes getSupportedMimeTypes(const MethodTypes &method)
Represents the "media-type" element in the RFC 3261 grammar.
Definition Mime.hxx:20
Represents the "token" element in the RFC 3261 grammar.
Definition Token.hxx:18
dcm! – add UnusedChecking(_enum) below;
unsigned int uint32_t
Definition Stun.hxx:34