# SIPMIMEInfo Class Reference

`#include <sippdu.h>`

## Public Member Functions

| SIPMIMEInfo (bool compactForm=false)
virtual void | PrintOn (ostream &strm) const
virtual bool | InternalAddMIME (const PString &fieldName, const PString &fieldValue)
void | SetCompactForm (bool form)
PCaselessString | GetContentType (bool includeParameters=false) const
void | SetContentType (const PString &v)
PCaselessString | GetContentEncoding () const
void | SetContentEncoding (const PString &v)
SIPURL | GetFrom () const
void | SetFrom (const SIPURL &v)
SIPURL | GetPAssertedIdentity () const
void | SetPAssertedIdentity (const PString &v)
SIPURL | GetPPreferredIdentity () const
void | SetPPreferredIdentity (const PString &v)
PString | GetAccept () const
void | SetAccept (const PString &v)
PString | GetAcceptEncoding () const
void | SetAcceptEncoding (const PString &v)
PString | GetAcceptLanguage () const
void | SetAcceptLanguage (const PString &v)
PString | GetAllow () const
unsigned | GetAllowBitMask () const
void | SetAllow (const PString &v)
PString | GetCallID () const
void | SetCallID (const PString &v)
SIPURL | GetContact () const
bool | GetContacts (SIPURLList &contacts) const
void | SetContact (const PString &v)
PString | GetSubject () const
void | SetSubject (const PString &v)
SIPURL | GetTo () const
void | SetTo (const SIPURL &v)
PString | GetVia () const
void | SetVia (const PString &v)
bool | GetViaList (PStringList &v) const
void | SetViaList (const PStringList &v)
PString | GetFirstVia () const
OpalTransportAddress | GetViaReceivedAddress () const
SIPURL | GetReferTo () const
void | SetReferTo (const PString &r)
SIPURL | GetReferredBy () const
void | SetReferredBy (const PString &r)
PINDEX | GetContentLength () const
void | SetContentLength (PINDEX v)
PBoolean | IsContentLengthPresent () const
PString | GetCSeq () const
void | SetCSeq (const PString &v)
PString | GetDate () const
void | SetDate (const PString &v)
void | SetDate (const PTime &t)
void | SetDate (void)
unsigned | GetExpires (unsigned dflt=UINT_MAX) const
void | SetExpires (unsigned v)
unsigned | GetMaxForwards () const
void | SetMaxForwards (PINDEX v)
unsigned | GetMinExpires () const
void | SetMinExpires (PINDEX v)
PString | GetProxyAuthenticate () const
void | SetProxyAuthenticate (const PString &v)
PString | GetRoute () const
bool | GetRoute (SIPURLList &proxies) const
void | SetRoute (const PString &v)
void | SetRoute (const SIPURLList &proxies)
PString | GetRecordRoute () const
bool | GetRecordRoute (SIPURLList &proxies, bool reversed) const
void | SetRecordRoute (const PString &v)
void | SetRecordRoute (const SIPURLList &proxies)
unsigned | GetCSeqIndex () const
PStringSet | GetRequire () const
void | SetRequire (const PStringSet &v)
void | AddRequire (const PString &v)
PStringSet | GetSupported () const
void | SetSupported (const PStringSet &v)
void | AddSupported (const PString &v)
PStringSet | GetUnsupported () const
void | SetUnsupported (const PStringSet &v)
void | AddUnsupported (const PString &v)
PString | GetEvent () const
void | SetEvent (const PString &v)
PCaselessString | GetSubscriptionState (PStringToString &info) const
void | SetSubscriptionState (const PString &v)
PString | GetUserAgent () const
void | SetUserAgent (const PString &v)
PString | GetOrganization () const
void | SetOrganization (const PString &v)
void | GetProductInfo (OpalProductInfo &info) const
void | SetProductInfo (const PString &ua, const OpalProductInfo &info)
PString | GetWWWAuthenticate () const
void | SetWWWAuthenticate (const PString &v)
PString | GetSIPIfMatch () const
void | SetSIPIfMatch (const PString &v)
PString | GetSIPETag () const
void | SetSIPETag (const PString &v)
void | GetAlertInfo (PString &info, int &appearance) const
void | SetAlertInfo (const PString &info, int appearance)
PString | GetCallInfo () const
PString | GetAllowEvents () const
void | SetAllowEvents (const PString &v)
void | SetAllowEvents (const PStringSet &list)
PString | GetFieldParameter (const PString &fieldName, const PString &paramName, const PString &defaultValue=PString::Empty()) const
void | SetFieldParameter (const PString &fieldName, const PString &paramName, const PString &newValue)

## Static Public Member Functions

static PString | ExtractFieldParameter (const PString &fieldValue, const PString &paramName, const PString &defaultValue=PString::Empty())
static PString | InsertFieldParameter (const PString &fieldValue, const PString &paramName, const PString &newValue)

## Protected Member Functions

PStringSet | GetTokenSet (const char *field) const
void | AddTokenSet (const char *field, const PString &token)
void | SetTokenSet (const char *field, const PStringSet &tokens)

## Protected Attributes

bool | compactForm
| Encode using compact form.

## Detailed Description

Session Initiation Protocol MIME info container This is a string dictionary: for each item mime header is key, value is value. Headers may be full ("From") or compact ("f"). Colons not included. PMIMEInfo::ReadFrom (>>) parses from stream. That adds a header-value element for each mime line. If a mime header is duplicated in the stream then the additional value is appended to the existing, separated by "/n". PMIMEInfo::ReadFrom supports multi-line values if the next line starts with a space - it just appends the next line to the existing string with the separating space. There is no checking of header names or values. compactForm decides whether 'Set' methods store full or compact headers. 'Set' methods replace values, there is no method for appending except ReadFrom. 'Get' methods work whether stored headers are full or compact.

to do to satisfy RFC3261 (mandatory(*) & should): Accept Accept-Encoding Accept-Language Allow Max-Forwards Min-Expires Proxy-Authenticate Supported Unsupported WWW-Authenticate

## Constructor & Destructor Documentation

SIPMIMEInfo::SIPMIMEInfo | ( | bool | compactForm = `false` | ) |

## Member Function Documentation

void SIPMIMEInfo::AddRequire | ( | const PString & | v | ) |

void SIPMIMEInfo::AddSupported | ( | const PString & | v | ) |

void SIPMIMEInfo::AddTokenSet | ( | const char * | field,
|  | const PString & | token |
| ) |  |  | `[protected]`

void SIPMIMEInfo::AddUnsupported | ( | const PString & | v | ) |

static PString SIPMIMEInfo::ExtractFieldParameter | ( | const PString & | fieldValue,
|  | const PString & | paramName,
|  | const PString & | defaultValue = `PString::Empty()` |
| ) |  |  | `[static]`

return the value of a header field parameter, empty if none

Parameters:

  fieldValue | Value of field string
  paramName | Field parameter name
  defaultValue | Default value for parameter

PString SIPMIMEInfo::GetAccept | ( |  | ) | const

PString SIPMIMEInfo::GetAcceptEncoding | ( |  | ) | const

PString SIPMIMEInfo::GetAcceptLanguage | ( |  | ) | const

void SIPMIMEInfo::GetAlertInfo | ( | PString & | info,
|  | int & | appearance |
| ) |  |  | const

PString SIPMIMEInfo::GetAllow | ( |  | ) | const

unsigned SIPMIMEInfo::GetAllowBitMask | ( |  | ) | const

PString SIPMIMEInfo::GetAllowEvents | ( |  | ) | const

PString SIPMIMEInfo::GetCallID | ( |  | ) | const

PString SIPMIMEInfo::GetCallInfo | ( |  | ) | const

SIPURL SIPMIMEInfo::GetContact | ( |  | ) | const

bool SIPMIMEInfo::GetContacts | ( | SIPURLList & | contacts | ) | const

PCaselessString SIPMIMEInfo::GetContentEncoding | ( |  | ) | const

PINDEX SIPMIMEInfo::GetContentLength | ( |  | ) | const

PCaselessString SIPMIMEInfo::GetContentType | ( | bool | includeParameters = `false` | ) | const

PString SIPMIMEInfo::GetCSeq | ( |  | ) | const

unsigned SIPMIMEInfo::GetCSeqIndex | ( |  | ) | const`[inline]`

PString SIPMIMEInfo::GetDate | ( |  | ) | const

PString SIPMIMEInfo::GetEvent | ( |  | ) | const

unsigned SIPMIMEInfo::GetExpires | ( | unsigned | dflt = `UINT_MAX` | ) | const

PString SIPMIMEInfo::GetFieldParameter | ( | const PString & | fieldName,
|  | const PString & | paramName,
|  | const PString & | defaultValue = `PString::Empty()` |
| ) |  |  | const`[inline]`

return the value of a header field parameter, empty if none

Parameters:

  fieldName | Field name in dictionary
  paramName | Field parameter name
  defaultValue | Default value for parameter

PString SIPMIMEInfo::GetFirstVia | ( |  | ) | const

SIPURL SIPMIMEInfo::GetFrom | ( |  | ) | const

unsigned SIPMIMEInfo::GetMaxForwards | ( |  | ) | const

unsigned SIPMIMEInfo::GetMinExpires | ( |  | ) | const

PString SIPMIMEInfo::GetOrganization | ( |  | ) | const

SIPURL SIPMIMEInfo::GetPAssertedIdentity | ( |  | ) | const

SIPURL SIPMIMEInfo::GetPPreferredIdentity | ( |  | ) | const

void SIPMIMEInfo::GetProductInfo | ( | OpalProductInfo & | info | ) | const

PString SIPMIMEInfo::GetProxyAuthenticate | ( |  | ) | const

bool SIPMIMEInfo::GetRecordRoute | ( | SIPURLList & | proxies,
|  | bool | reversed |
| ) |  |  | const

PString SIPMIMEInfo::GetRecordRoute | ( |  | ) | const

SIPURL SIPMIMEInfo::GetReferredBy | ( |  | ) | const

SIPURL SIPMIMEInfo::GetReferTo | ( |  | ) | const

PStringSet SIPMIMEInfo::GetRequire | ( |  | ) | const

bool SIPMIMEInfo::GetRoute | ( | SIPURLList & | proxies | ) | const

PString SIPMIMEInfo::GetRoute | ( |  | ) | const

PString SIPMIMEInfo::GetSIPETag | ( |  | ) | const

PString SIPMIMEInfo::GetSIPIfMatch | ( |  | ) | const

PString SIPMIMEInfo::GetSubject | ( |  | ) | const

PCaselessString SIPMIMEInfo::GetSubscriptionState | ( | PStringToString & | info | ) | const

PStringSet SIPMIMEInfo::GetSupported | ( |  | ) | const

SIPURL SIPMIMEInfo::GetTo | ( |  | ) | const

PStringSet SIPMIMEInfo::GetTokenSet | ( | const char * | field | ) | const`[protected]`

PStringSet SIPMIMEInfo::GetUnsupported | ( |  | ) | const

PString SIPMIMEInfo::GetUserAgent | ( |  | ) | const

PString SIPMIMEInfo::GetVia | ( |  | ) | const

bool SIPMIMEInfo::GetViaList | ( | PStringList & | v | ) | const

OpalTransportAddress SIPMIMEInfo::GetViaReceivedAddress | ( |  | ) | const

PString SIPMIMEInfo::GetWWWAuthenticate | ( |  | ) | const

static PString SIPMIMEInfo::InsertFieldParameter | ( | const PString & | fieldValue,
|  | const PString & | paramName,
|  | const PString & | newValue |
| ) |  |  | `[static]`

set the value for a header field parameter, replace the current value, or add the parameter and its value if not already present.

Parameters:

  fieldValue | Value of field string
  paramName | Field parameter name
  newValue | New value for parameter

virtual bool SIPMIMEInfo::InternalAddMIME | ( | const PString & | fieldName,
|  | const PString & | fieldValue |
| ) |  |  | `[virtual]`

PBoolean SIPMIMEInfo::IsContentLengthPresent | ( |  | ) | const

virtual void SIPMIMEInfo::PrintOn | ( | ostream & | strm | ) | const`[virtual]`

void SIPMIMEInfo::SetAccept | ( | const PString & | v | ) |

void SIPMIMEInfo::SetAcceptEncoding | ( | const PString & | v | ) |

void SIPMIMEInfo::SetAcceptLanguage | ( | const PString & | v | ) |

void SIPMIMEInfo::SetAlertInfo | ( | const PString & | info,
|  | int | appearance |
| ) |  |  |

void SIPMIMEInfo::SetAllow | ( | const PString & | v | ) |

void SIPMIMEInfo::SetAllowEvents | ( | const PStringSet & | list | ) |

void SIPMIMEInfo::SetAllowEvents | ( | const PString & | v | ) |

void SIPMIMEInfo::SetCallID | ( | const PString & | v | ) |

void SIPMIMEInfo::SetCompactForm | ( | bool | form | ) | `[inline]`

void SIPMIMEInfo::SetContact | ( | const PString & | v | ) |

void SIPMIMEInfo::SetContentEncoding | ( | const PString & | v | ) |

void SIPMIMEInfo::SetContentLength | ( | PINDEX | v | ) |

void SIPMIMEInfo::SetContentType | ( | const PString & | v | ) |

void SIPMIMEInfo::SetCSeq | ( | const PString & | v | ) |

void SIPMIMEInfo::SetDate | ( | void |  | ) |

void SIPMIMEInfo::SetDate | ( | const PTime & | t | ) |

void SIPMIMEInfo::SetDate | ( | const PString & | v | ) |

void SIPMIMEInfo::SetEvent | ( | const PString & | v | ) |

void SIPMIMEInfo::SetExpires | ( | unsigned | v | ) |

void SIPMIMEInfo::SetFieldParameter | ( | const PString & | fieldName,
|  | const PString & | paramName,
|  | const PString & | newValue |
| ) |  |  | `[inline]`

set the value for a header field parameter, replace the current value, or add the parameter and its value if not already present.

Parameters:

  fieldName | Field name in dictionary
  paramName | Field parameter name
  newValue | New value for parameter

void SIPMIMEInfo::SetFrom | ( | const SIPURL & | v | ) |

void SIPMIMEInfo::SetMaxForwards | ( | PINDEX | v | ) |

void SIPMIMEInfo::SetMinExpires | ( | PINDEX | v | ) |

void SIPMIMEInfo::SetOrganization | ( | const PString & | v | ) |

void SIPMIMEInfo::SetPAssertedIdentity | ( | const PString & | v | ) |

void SIPMIMEInfo::SetPPreferredIdentity | ( | const PString & | v | ) |

void SIPMIMEInfo::SetProductInfo | ( | const PString & | ua,
|  | const OpalProductInfo & | info |
| ) |  |  |

void SIPMIMEInfo::SetProxyAuthenticate | ( | const PString & | v | ) |

void SIPMIMEInfo::SetRecordRoute | ( | const SIPURLList & | proxies | ) |

void SIPMIMEInfo::SetRecordRoute | ( | const PString & | v | ) |

void SIPMIMEInfo::SetReferredBy | ( | const PString & | r | ) |

void SIPMIMEInfo::SetReferTo | ( | const PString & | r | ) |

void SIPMIMEInfo::SetRequire | ( | const PStringSet & | v | ) |

void SIPMIMEInfo::SetRoute | ( | const SIPURLList & | proxies | ) |

void SIPMIMEInfo::SetRoute | ( | const PString & | v | ) |

void SIPMIMEInfo::SetSIPETag | ( | const PString & | v | ) |

void SIPMIMEInfo::SetSIPIfMatch | ( | const PString & | v | ) |

void SIPMIMEInfo::SetSubject | ( | const PString & | v | ) |

void SIPMIMEInfo::SetSubscriptionState | ( | const PString & | v | ) |

void SIPMIMEInfo::SetSupported | ( | const PStringSet & | v | ) |

void SIPMIMEInfo::SetTo | ( | const SIPURL & | v | ) |

void SIPMIMEInfo::SetTokenSet | ( | const char * | field,
|  | const PStringSet & | tokens |
| ) |  |  | `[protected]`

void SIPMIMEInfo::SetUnsupported | ( | const PStringSet & | v | ) |

void SIPMIMEInfo::SetUserAgent | ( | const PString & | v | ) |

void SIPMIMEInfo::SetVia | ( | const PString & | v | ) |

void SIPMIMEInfo::SetViaList | ( | const PStringList & | v | ) |

void SIPMIMEInfo::SetWWWAuthenticate | ( | const PString & | v | ) |

## Field Documentation

bool SIPMIMEInfo::compactForm `[protected]`

Encode using compact form.

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

- sippdu.h