reSIProcate/DialogUsageManager  9694
Public Types | Public Member Functions | Private Member Functions | Private Attributes
resip::MasterProfile Class Reference

#include <MasterProfile.hxx>

Inheritance diagram for resip::MasterProfile:
Inheritance graph
[legend]
Collaboration diagram for resip::MasterProfile:
Collaboration graph
[legend]

List of all members.

Public Types

enum  ReliableProvisionalMode { Never, Supported, Required }

Public Member Functions

 MasterProfile ()
 Creates an Indentity/Profile with no BaseProfile - this is the root of all profiles.
virtual void addSupportedScheme (const Data &scheme)
 Default is "sip".
virtual bool isSchemeSupported (const Data &scheme) const
virtual void clearSupportedSchemes (void)
virtual void addSupportedMethod (const MethodTypes &method)
 Defaults are: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE.
virtual bool isMethodSupported (MethodTypes method) const
virtual Tokens getAllowedMethods () const
virtual Data getAllowedMethodsData () const
virtual void clearSupportedMethods (void)
virtual void addSupportedOptionTag (const Token &tag)
 Default is none. Do not use to enable PRACK(100rel) support.
virtual Tokens getUnsupportedOptionsTags (const Tokens &requires)
virtual Tokens getSupportedOptionTags () const
virtual void clearSupportedOptionTags (void)
virtual void setUacReliableProvisionalMode (ReliableProvisionalMode mode)
virtual ReliableProvisionalMode getUacReliableProvisionalMode () const
virtual void setUasReliableProvisionalMode (ReliableProvisionalMode mode)
virtual ReliableProvisionalMode getUasReliableProvisionalMode () const
virtual void addSupportedMimeType (const MethodTypes &method, const Mime &mimeType)
 Default is application/sdp for INVITE, OPTIONS, PRACK and UPDATE Methods.
virtual bool removeSupportedMimeType (const MethodTypes &method, const Mime &mimeType)
virtual bool isMimeTypeSupported (const MethodTypes &method, const Mime &mimeType)
virtual Mimes getSupportedMimeTypes (const MethodTypes &method)
virtual void clearSupportedMimeTypes (const MethodTypes &method)
virtual void clearSupportedMimeTypes (void)
virtual void addSupportedEncoding (const Token &encoding)
 Default is no encoding.
virtual bool isContentEncodingSupported (const Token &contentEncoding) const
virtual Tokens getSupportedEncodings () const
virtual void clearSupportedEncodings (void)
virtual void addSupportedLanguage (const Token &lang)
 Default is all - if nothing is set, then all are allowed.
virtual bool isLanguageSupported (const Tokens &lang) const
virtual Tokens getSupportedLanguages () const
virtual void clearSupportedLanguages (void)
virtual void addAllowedEvent (const Token &event)
 Default is to not send an Allow-Events header.
virtual bool isEventAllowed (const Tokens &event) const
virtual Tokens getAllowedEvents () const
virtual void clearAllowedEvents (void)
virtual bool & validateContentEnabled ()
 enable/disable content validation
virtual bool validateContentEnabled () const
virtual bool & validateContentLanguageEnabled ()
 enable/disable content language validation
virtual bool validateContentLanguageEnabled () const
virtual bool & validateAcceptEnabled ()
 enable/disable Accept header validation
virtual bool validateAcceptEnabled () const
virtual bool & allowBadRegistrationEnabled ()
 Set this to allow the Registration Server to accept registration requests that contain a To Tag.
virtual bool allowBadRegistrationEnabled () const
virtual UInt32serverRegistrationMinExpiresTime (void)
 Used when receiveing a REGISTER request, if the expires value in the request is less than this time, then dum will reject the message with a 423 and set the min-expires header to the value specified here.
virtual const UInt32 serverRegistrationMinExpiresTime (void) const
virtual UInt32serverRegistrationMaxExpiresTime (void)
 If an inbound REGISTER has an Expires header or any individual contact bindings with expires greater than this value, use this Max expires instead of the one given by the client.
virtual const UInt32 serverRegistrationMaxExpiresTime (void) const
virtual UInt32serverRegistrationDefaultExpiresTime (void)
 If no Expires header or individual contact bindings specify an expiration value, use this value.
virtual const UInt32 serverRegistrationDefaultExpiresTime (void) const
virtual bool & checkReqUriInMergeDetectionEnabled ()
 Set this to include the RequestURI in merge request detection.
virtual bool checkReqUriInMergeDetectionEnabled () const

Private Member Functions

virtual UserProfileclone () const

Private Attributes

std::set< DatamSupportedSchemes
std::set< MethodTypes > mSupportedMethodTypes
Tokens mSupportedMethods
Tokens mSupportedOptionTags
std::map< MethodTypes, MimesmSupportedMimeTypes
Tokens mSupportedEncodings
Tokens mSupportedLanguages
Tokens mAllowedEvents
bool mValidateContentEnabled
bool mValidateContentLanguageEnabled
bool mValidateAcceptEnabled
bool mAllowBadRegistrationEnabled
bool mHasServerRegistrationMinExpires
bool mCheckReqUriInMergeDetectionEnabled
ReliableProvisionalMode mUacReliableProvisionalMode
ReliableProvisionalMode mUasReliableProvisionalMode
UInt32 mServerRegistrationMinExpires
UInt32 mServerRegistrationMaxExpires
UInt32 mServerRegistrationDefaultExpires

Detailed Description

Definition at line 17 of file MasterProfile.hxx.


Member Enumeration Documentation

Enumerator:
Never 
Supported 
Required 

Definition at line 43 of file MasterProfile.hxx.


Constructor & Destructor Documentation

MasterProfile::MasterProfile ( )

Creates an Indentity/Profile with no BaseProfile - this is the root of all profiles.

Definition at line 14 of file MasterProfile.cxx.

References addSupportedLanguage(), addSupportedMethod(), addSupportedMimeType(), addSupportedScheme(), and resip::Symbols::Sip.

Referenced by clone().

Here is the call graph for this function:


Member Function Documentation

void MasterProfile::addAllowedEvent ( const Token event) [virtual]

Default is to not send an Allow-Events header.

Definition at line 301 of file MasterProfile.cxx.

References mAllowedEvents, and resip::ParserContainer< T >::push_back().

Here is the call graph for this function:

void MasterProfile::addSupportedEncoding ( const Token encoding) [virtual]

Default is no encoding.

Definition at line 246 of file MasterProfile.cxx.

References mSupportedEncodings, and resip::ParserContainer< T >::push_back().

Here is the call graph for this function:

void MasterProfile::addSupportedLanguage ( const Token lang) [virtual]

Default is all - if nothing is set, then all are allowed.

Definition at line 270 of file MasterProfile.cxx.

References mSupportedLanguages, and resip::ParserContainer< T >::push_back().

Referenced by MasterProfile().

Here is the call graph for this function:

void MasterProfile::addSupportedMethod ( const MethodTypes &  method) [virtual]

Defaults are: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE.

Definition at line 61 of file MasterProfile.cxx.

References getMethodName(), mSupportedMethods, mSupportedMethodTypes, and resip::ParserContainer< T >::push_back().

Referenced by MasterProfile().

Here is the call graph for this function:

void MasterProfile::addSupportedMimeType ( const MethodTypes &  method,
const Mime mimeType 
) [virtual]

Default is application/sdp for INVITE, OPTIONS, PRACK and UPDATE Methods.

Definition at line 178 of file MasterProfile.cxx.

References mSupportedMimeTypes.

Referenced by MasterProfile().

{
   mSupportedMimeTypes[method].push_back(mimeType);
}
void MasterProfile::addSupportedOptionTag ( const Token tag) [virtual]

Default is none. Do not use to enable PRACK(100rel) support.

Definition at line 105 of file MasterProfile.cxx.

References resip::Symbols::C100rel, mSupportedOptionTags, and resip::ParserContainer< T >::push_back().

{
   if (tag == Token(Symbols::C100rel))
   {
      //use enablePrackUas and enablePrackUac
      assert(0);
   }
   mSupportedOptionTags.push_back(tag);
}

Here is the call graph for this function:

void MasterProfile::addSupportedScheme ( const Data scheme) [virtual]

Default is "sip".

Definition at line 43 of file MasterProfile.cxx.

References mSupportedSchemes.

Referenced by MasterProfile().

{
   mSupportedSchemes.insert(scheme);
}
bool & MasterProfile::allowBadRegistrationEnabled ( ) [virtual]

Set this to allow the Registration Server to accept registration requests that contain a To Tag.

Definition at line 374 of file MasterProfile.cxx.

References mAllowBadRegistrationEnabled.

bool MasterProfile::allowBadRegistrationEnabled ( ) const [virtual]

Definition at line 368 of file MasterProfile.cxx.

References mAllowBadRegistrationEnabled.

bool & MasterProfile::checkReqUriInMergeDetectionEnabled ( ) [virtual]

Set this to include the RequestURI in merge request detection.

!*!*!*!*!*! RED FLASHING LIGHT *!*!*!*!*!*! When false, DUM implements the policy that all RURIs that arrive are equivalent, so if a request forks and arives here with different RURIs, we reject all but one of them as merged requests. This makes sense for single-line endpoints. Nodes responsible for multiple simultaneous resources (like gateways, media-servers, B2BUAs, etc) need to set this to true. Applications like multi-line business phones will want to carefully consider the edge case of a request that forks to more than one line - if you want only one line to ring, leave this false. If you want them all to ring, set it to true.

Definition at line 423 of file MasterProfile.cxx.

References mCheckReqUriInMergeDetectionEnabled.

bool MasterProfile::checkReqUriInMergeDetectionEnabled ( ) const [virtual]
void MasterProfile::clearAllowedEvents ( void  ) [virtual]

Definition at line 326 of file MasterProfile.cxx.

References resip::ParserContainerBase::clear(), and mAllowedEvents.

Here is the call graph for this function:

void MasterProfile::clearSupportedEncodings ( void  ) [virtual]

Definition at line 264 of file MasterProfile.cxx.

References resip::ParserContainerBase::clear(), and mSupportedEncodings.

Here is the call graph for this function:

void MasterProfile::clearSupportedLanguages ( void  ) [virtual]

Definition at line 295 of file MasterProfile.cxx.

References resip::ParserContainerBase::clear(), and mSupportedLanguages.

Here is the call graph for this function:

void MasterProfile::clearSupportedMethods ( void  ) [virtual]

Definition at line 98 of file MasterProfile.cxx.

References resip::ParserContainerBase::clear(), mSupportedMethods, and mSupportedMethodTypes.

Referenced by CertServer::CertServer().

Here is the call graph for this function:

void MasterProfile::clearSupportedMimeTypes ( const MethodTypes &  method) [virtual]

Definition at line 230 of file MasterProfile.cxx.

References mSupportedMimeTypes.

{
   std::map<MethodTypes, Mimes>::iterator found = mSupportedMimeTypes.find(method); 
   if (found != mSupportedMimeTypes.end()) 
   { 
      found->second.clear(); 
   } 
}
void MasterProfile::clearSupportedMimeTypes ( void  ) [virtual]

Definition at line 240 of file MasterProfile.cxx.

References mSupportedMimeTypes.

{
   mSupportedMimeTypes.clear();
}
void MasterProfile::clearSupportedOptionTags ( void  ) [virtual]

Definition at line 146 of file MasterProfile.cxx.

References resip::ParserContainerBase::clear(), and mSupportedOptionTags.

Here is the call graph for this function:

void MasterProfile::clearSupportedSchemes ( void  ) [virtual]

Definition at line 55 of file MasterProfile.cxx.

References mSupportedSchemes.

{
   mSupportedSchemes.clear();
}
UserProfile * MasterProfile::clone ( ) const [private, virtual]

Reimplemented from resip::UserProfile.

Definition at line 429 of file MasterProfile.cxx.

References MasterProfile().

{
   return new MasterProfile(*this);
}

Here is the call graph for this function:

Tokens MasterProfile::getAllowedEvents ( ) const [virtual]

Definition at line 320 of file MasterProfile.cxx.

References mAllowedEvents.

{
   return mAllowedEvents;
}
Tokens MasterProfile::getAllowedMethods ( ) const [virtual]

Definition at line 74 of file MasterProfile.cxx.

References mSupportedMethods.

{
   return mSupportedMethods;
}
Data MasterProfile::getAllowedMethodsData ( ) const [virtual]

Definition at line 80 of file MasterProfile.cxx.

References resip::ParserContainer< T >::begin(), resip::Symbols::COMMA, resip::ParserContainer< T >::end(), and mSupportedMethods.

{
   Data result;
   
   for (Tokens::const_iterator i = mSupportedMethods.begin();
        i != mSupportedMethods.end(); ++i)
   {
      if (i != mSupportedMethods.begin())
      {
         result += Symbols::COMMA[0];
      }
      result += i->value();
   }
   
   return result;
}

Here is the call graph for this function:

Tokens MasterProfile::getSupportedEncodings ( ) const [virtual]

Definition at line 258 of file MasterProfile.cxx.

References mSupportedEncodings.

{
   return mSupportedEncodings;
}
Tokens MasterProfile::getSupportedLanguages ( ) const [virtual]

Definition at line 289 of file MasterProfile.cxx.

References mSupportedLanguages.

{
   return mSupportedLanguages;
}
Mimes MasterProfile::getSupportedMimeTypes ( const MethodTypes &  method) [virtual]

Definition at line 219 of file MasterProfile.cxx.

References mSupportedMimeTypes.

{
   std::map<MethodTypes, Mimes>::iterator found = mSupportedMimeTypes.find(method); 
   if (found != mSupportedMimeTypes.end()) 
   { 
      return found->second; 
   } 
   return Mimes(); 
}
Tokens MasterProfile::getSupportedOptionTags ( ) const [virtual]

Definition at line 140 of file MasterProfile.cxx.

References mSupportedOptionTags.

MasterProfile::ReliableProvisionalMode MasterProfile::getUacReliableProvisionalMode ( ) const [virtual]

Definition at line 166 of file MasterProfile.cxx.

References mUacReliableProvisionalMode.

MasterProfile::ReliableProvisionalMode MasterProfile::getUasReliableProvisionalMode ( ) const [virtual]

Definition at line 172 of file MasterProfile.cxx.

References mUasReliableProvisionalMode.

Tokens MasterProfile::getUnsupportedOptionsTags ( const Tokens requires) [virtual]

Definition at line 116 of file MasterProfile.cxx.

References resip::ParserContainer< T >::begin(), resip::Symbols::C100rel, resip::ParserContainer< T >::end(), resip::ParserContainer< T >::find(), mSupportedOptionTags, mUasReliableProvisionalMode, Never, and resip::ParserContainer< T >::push_back().

{
   Tokens tokens;
   for (Tokens::const_iterator i=requiresOptionTags.begin(); i != requiresOptionTags.end(); ++i)
   {
      if (!i->isWellFormed())
      {
         tokens.push_back(Token("malformedTag"));
      }
      else if (*i == Token(Symbols::C100rel) && mUasReliableProvisionalMode == Never)
      {
         tokens.push_back(*i);
      }
      // if this option is not supported
      else if (!mSupportedOptionTags.find(*i))
      {
         tokens.push_back(*i);
      }
   }
   
   return tokens;
}

Here is the call graph for this function:

bool MasterProfile::isContentEncodingSupported ( const Token contentEncoding) const [virtual]

Definition at line 252 of file MasterProfile.cxx.

References resip::ParserContainer< T >::find(), resip::LazyParser::isWellFormed(), and mSupportedEncodings.

{
   return encoding.isWellFormed() && mSupportedEncodings.find(encoding);
}

Here is the call graph for this function:

bool MasterProfile::isEventAllowed ( const Tokens event) const [virtual]

Definition at line 307 of file MasterProfile.cxx.

References resip::ParserContainer< T >::begin(), resip::ParserContainer< T >::end(), resip::ParserContainer< T >::find(), and mAllowedEvents.

{
   for (Tokens::const_iterator i=events.begin(); i != events.end(); ++i)
   {
      if (!i->isWellFormed() || mAllowedEvents.find(*i) == false)
      {
         return false;
      }
   }
   return true;
}

Here is the call graph for this function:

bool MasterProfile::isLanguageSupported ( const Tokens lang) const [virtual]

Definition at line 276 of file MasterProfile.cxx.

References resip::ParserContainer< T >::begin(), resip::ParserContainer< T >::end(), resip::ParserContainer< T >::find(), and mSupportedLanguages.

{
   for (Tokens::const_iterator i=langs.begin(); i != langs.end(); ++i)
   {
      if (!i->isWellFormed() || mSupportedLanguages.find(*i) == false)
      {
         return false;
      }
   }
   return true;
}

Here is the call graph for this function:

bool MasterProfile::isMethodSupported ( MethodTypes  method) const [virtual]

Definition at line 68 of file MasterProfile.cxx.

References mSupportedMethodTypes.

{
   return mSupportedMethodTypes.count(method) != 0;
}
bool MasterProfile::isMimeTypeSupported ( const MethodTypes &  method,
const Mime mimeType 
) [virtual]

Definition at line 203 of file MasterProfile.cxx.

References resip::LazyParser::isWellFormed(), and mSupportedMimeTypes.

{
   if(!mimeType.isWellFormed())
   {
      return false;
   }
   
   std::map<MethodTypes, Mimes>::iterator found = mSupportedMimeTypes.find(method); 
   if (found != mSupportedMimeTypes.end()) 
   { 
      return found->second.find(mimeType); 
   } 
   return false; 
}

Here is the call graph for this function:

bool MasterProfile::isSchemeSupported ( const Data scheme) const [virtual]

Definition at line 49 of file MasterProfile.cxx.

References mSupportedSchemes.

{
   return mSupportedSchemes.count(scheme) != 0;
}
bool MasterProfile::removeSupportedMimeType ( const MethodTypes &  method,
const Mime mimeType 
) [virtual]

Definition at line 184 of file MasterProfile.cxx.

References resip::Mime::isEqual(), and mSupportedMimeTypes.

{
   std::map<MethodTypes, Mimes>::iterator foundMethod = mSupportedMimeTypes.find(method);
   if (foundMethod != mSupportedMimeTypes.end())
   {
      for (Mimes::iterator i = foundMethod->second.begin();
         i != foundMethod->second.end(); ++i)
      {
         if (mimeType.isEqual(*i))
         {
            foundMethod->second.erase(i);
            return true;
         }
      }
   }
   return false;
}

Here is the call graph for this function:

UInt32 & MasterProfile::serverRegistrationDefaultExpiresTime ( void  ) [virtual]

If no Expires header or individual contact bindings specify an expiration value, use this value.

Definition at line 405 of file MasterProfile.cxx.

References mServerRegistrationDefaultExpires.

const UInt32 MasterProfile::serverRegistrationDefaultExpiresTime ( void  ) const [virtual]
UInt32 & MasterProfile::serverRegistrationMaxExpiresTime ( void  ) [virtual]

If an inbound REGISTER has an Expires header or any individual contact bindings with expires greater than this value, use this Max expires instead of the one given by the client.

Definition at line 393 of file MasterProfile.cxx.

References mServerRegistrationMaxExpires.

const UInt32 MasterProfile::serverRegistrationMaxExpiresTime ( void  ) const [virtual]

Definition at line 399 of file MasterProfile.cxx.

References mServerRegistrationMaxExpires.

UInt32 & MasterProfile::serverRegistrationMinExpiresTime ( void  ) [virtual]

Used when receiveing a REGISTER request, if the expires value in the request is less than this time, then dum will reject the message with a 423 and set the min-expires header to the value specified here.

Definition at line 381 of file MasterProfile.cxx.

References mServerRegistrationMinExpires.

const UInt32 MasterProfile::serverRegistrationMinExpiresTime ( void  ) const [virtual]

Definition at line 387 of file MasterProfile.cxx.

References mServerRegistrationMinExpires.

void MasterProfile::setUacReliableProvisionalMode ( ReliableProvisionalMode  mode) [virtual]

Definition at line 152 of file MasterProfile.cxx.

References mUacReliableProvisionalMode.

void MasterProfile::setUasReliableProvisionalMode ( ReliableProvisionalMode  mode) [virtual]

Definition at line 158 of file MasterProfile.cxx.

References mUasReliableProvisionalMode.

{
   //.dcm. not supported yet
  assert(0);
  mUasReliableProvisionalMode = mode;
}
bool & MasterProfile::validateAcceptEnabled ( ) [virtual]

enable/disable Accept header validation

Definition at line 356 of file MasterProfile.cxx.

References mValidateAcceptEnabled.

bool MasterProfile::validateAcceptEnabled ( ) const [virtual]

Definition at line 362 of file MasterProfile.cxx.

References mValidateAcceptEnabled.

bool & MasterProfile::validateContentEnabled ( ) [virtual]

enable/disable content validation

Definition at line 332 of file MasterProfile.cxx.

References mValidateContentEnabled.

bool MasterProfile::validateContentEnabled ( ) const [virtual]

Definition at line 338 of file MasterProfile.cxx.

References mValidateContentEnabled.

bool & MasterProfile::validateContentLanguageEnabled ( ) [virtual]

enable/disable content language validation

Definition at line 344 of file MasterProfile.cxx.

References mValidateContentLanguageEnabled.

bool MasterProfile::validateContentLanguageEnabled ( ) const [virtual]

Definition at line 350 of file MasterProfile.cxx.

References mValidateContentLanguageEnabled.


Member Data Documentation

Definition at line 168 of file MasterProfile.hxx.

Referenced by allowBadRegistrationEnabled().

Definition at line 170 of file MasterProfile.hxx.

Referenced by checkReqUriInMergeDetectionEnabled().

Definition at line 169 of file MasterProfile.hxx.

Definition at line 175 of file MasterProfile.hxx.

Referenced by serverRegistrationDefaultExpiresTime().

Definition at line 174 of file MasterProfile.hxx.

Referenced by serverRegistrationMaxExpiresTime().

Definition at line 173 of file MasterProfile.hxx.

Referenced by serverRegistrationMinExpiresTime().

std::set<MethodTypes> resip::MasterProfile::mSupportedMethodTypes [private]

Definition at line 157 of file MasterProfile.hxx.

Referenced by addSupportedMethod(), clearSupportedMethods(), and isMethodSupported().

std::map<MethodTypes, Mimes> resip::MasterProfile::mSupportedMimeTypes [private]

Definition at line 156 of file MasterProfile.hxx.

Referenced by addSupportedScheme(), clearSupportedSchemes(), and isSchemeSupported().

Definition at line 167 of file MasterProfile.hxx.

Referenced by validateAcceptEnabled().

Definition at line 165 of file MasterProfile.hxx.

Referenced by validateContentEnabled().

Definition at line 166 of file MasterProfile.hxx.

Referenced by validateContentLanguageEnabled().


The documentation for this class was generated from the following files: