8#define RESIPROCATE_SUBSYSTEM Subsystem::DUM
16 mValidateContentEnabled(true),
17 mValidateContentLanguageEnabled(false),
18 mValidateAcceptEnabled(false),
19 mAllowBadRegistrationEnabled(false),
20 mCheckReqUriInMergeDetectionEnabled(false),
21 mUacReliableProvisionalMode(Never),
22 mUasReliableProvisionalMode(Never),
23 mServerRegistrationMinExpires(0),
24 mServerRegistrationMaxExpires(UINT_MAX),
25 mServerRegistrationDefaultExpires(3600),
26 mAdditionalTransactionTerminatingResponsesEnabled(false)
49 mSupportedSchemes.insert(scheme);
55 return mSupportedSchemes.find(scheme) != mSupportedSchemes.end();
61 mSupportedSchemes.clear();
67 mSupportedMethodTypes.insert(method);
74 mSupportedMethodTypes.erase(method);
75 for (Tokens::iterator i = mSupportedMethods.
begin();
76 i != mSupportedMethods.
end(); ++i)
80 mSupportedMethods.
erase(i);
92 return mSupportedMethodTypes.find(method) != mSupportedMethodTypes.end();
98 return mSupportedMethods;
106 for (Tokens::const_iterator i = mSupportedMethods.
begin();
107 i != mSupportedMethods.
end(); ++i)
109 if (i != mSupportedMethods.
begin())
113 result += i->value();
122 mSupportedMethodTypes.clear();
123 mSupportedMethods.
clear();
141 for (Tokens::const_iterator i=requiresOptionTags.
begin(); i != requiresOptionTags.
end(); ++i)
143 if (!i->isWellFormed())
149 if (mUasReliableProvisionalMode ==
Never)
155 else if (!mSupportedOptionTags.
find(*i))
167 return mSupportedOptionTags;
173 mSupportedOptionTags.
clear();
179 mUacReliableProvisionalMode = mode;
185 mUasReliableProvisionalMode = mode;
191 return mUacReliableProvisionalMode;
197 return mUasReliableProvisionalMode;
203 mSupportedMimeTypes[method].push_back(mimeType);
209 std::map<MethodTypes, Mimes>::iterator foundMethod = mSupportedMimeTypes.find(method);
210 if (foundMethod != mSupportedMimeTypes.end())
212 for (Mimes::iterator i = foundMethod->second.begin();
213 i != foundMethod->second.end(); ++i)
217 foundMethod->second.erase(i);
233 std::map<MethodTypes, Mimes>::iterator found = mSupportedMimeTypes.find(method);
234 if (found != mSupportedMimeTypes.end())
236 return found->second.find(mimeType);
244 std::map<MethodTypes, Mimes>::iterator found = mSupportedMimeTypes.find(method);
245 if (found != mSupportedMimeTypes.end())
247 return found->second;
255 std::map<MethodTypes, Mimes>::iterator found = mSupportedMimeTypes.find(method);
256 if (found != mSupportedMimeTypes.end())
258 found->second.clear();
265 mSupportedMimeTypes.clear();
283 return mSupportedEncodings;
289 mSupportedEncodings.
clear();
301 for (Tokens::const_iterator i=langs.
begin(); i != langs.
end(); ++i)
303 if (!i->isWellFormed() || mSupportedLanguages.
find(*i) ==
false)
314 return mSupportedLanguages;
320 mSupportedLanguages.
clear();
332 for (Tokens::const_iterator i=events.
begin(); i != events.
end(); ++i)
334 if (!i->isWellFormed() || mAllowedEvents.
find(*i) ==
false)
345 return mAllowedEvents;
351 mAllowedEvents.
clear();
357 return mValidateContentEnabled;
363 return mValidateContentEnabled;
369 return mValidateContentLanguageEnabled;
375 return mValidateContentLanguageEnabled;
381 return mValidateAcceptEnabled;
387 return mValidateAcceptEnabled;
393 return mAllowBadRegistrationEnabled;
399 return mAllowBadRegistrationEnabled;
406 return mServerRegistrationMinExpires;
412 return mServerRegistrationMinExpires;
418 return mServerRegistrationMaxExpires;
424 return mServerRegistrationMaxExpires;
430 return mServerRegistrationDefaultExpires;
436 return mServerRegistrationDefaultExpires;
442 return mCheckReqUriInMergeDetectionEnabled;
448 return mCheckReqUriInMergeDetectionEnabled;
452MasterProfile::clone()
const
459 return mAdditionalTransactionTerminatingResponsesEnabled;
464 return mAdditionalTransactionTerminatingResponsesEnabled;
469 DebugLog(<<
"MasterProfile::addAdditionalTransactionTerminatingResponses" <<
"added code: " << code);
470 mAdditionalTransactionTerminatingResponsess.insert(code);
475 bool isAllowed = (mAdditionalTransactionTerminatingResponsess.end() != mAdditionalTransactionTerminatingResponsess.find(code));
477 DebugLog(<<
"MasterProfile::isAdditionalTransactionTerminatingResponse" <<
"is code " << code <<
" allowed: " << isAllowed);
483 return mAdditionalTransactionTerminatingResponsess;
488 mAdditionalTransactionTerminatingResponsess.clear();
#define resip_assert(x)
This file needs to work for both C and C++ code.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
bool isWellFormed() const
Returns true iff this element was parsed successfully, according to the implementation of parse().
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.
bool isEqual(const Mime &rhs) const
void clear()
clear the mParsers vector
iterator end()
Returns an iterator pointing to the last header field value.
iterator erase(iterator i)
Erases the header field value pointed to by i.
iterator begin()
Returns an iterator pointing to the first header field value.
void push_back(const T &t)
Inserts a header field value at the back of this container.
bool find(const T &rhs) const
Finds the first header field value that matches rhs.
static const char * C100rel
static const char * COMMA
Represents the "token" element in the RFC 3261 grammar.
dcm! – add UnusedChecking(_enum) below;
ParserContainer< Mime > Mimes
const Data & getMethodName(MethodTypes t)
MethodTypes getMethodType(const Data &name)