# SIP_PDU Class Reference

`#include <sippdu.h>`

Inheritance diagram for SIP_PDU:

List of all members.

## Public Types

enum | Methods { Method_INVITE, Method_ACK, Method_OPTIONS, Method_BYE, Method_CANCEL, Method_REGISTER, Method_SUBSCRIBE, Method_NOTIFY, Method_REFER, Method_MESSAGE, Method_INFO, Method_PING, Method_PUBLISH, NumMethods }

enum

StatusCodes {
IllegalStatusCode, Local_TransportError, Local_BadTransportAddress, Information_Trying = 100,
Information_Ringing = 180, Information_CallForwarded = 181, Information_Queued = 182, Information_Session_Progress = 183,
Successful_OK = 200, Successful_Accepted = 202, Redirection_MultipleChoices = 300, Redirection_MovedPermanently = 301,
Redirection_MovedTemporarily = 302, Redirection_UseProxy = 305, Redirection_AlternativeService = 380, Failure_BadRequest = 400,
Failure_UnAuthorised = 401, Failure_PaymentRequired = 402, Failure_Forbidden = 403, Failure_NotFound = 404,
Failure_MethodNotAllowed = 405, Failure_NotAcceptable = 406, Failure_ProxyAuthenticationRequired = 407, Failure_RequestTimeout = 408,
Failure_Conflict = 409, Failure_Gone = 410, Failure_LengthRequired = 411, Failure_RequestEntityTooLarge = 413,
Failure_RequestURITooLong = 414, Failure_UnsupportedMediaType = 415, Failure_UnsupportedURIScheme = 416, Failure_BadExtension = 420,
Failure_ExtensionRequired = 421, Failure_IntervalTooBrief = 423, Failure_TemporarilyUnavailable = 480, Failure_TransactionDoesNotExist = 481,
Failure_LoopDetected = 482, Failure_TooManyHops = 483, Failure_AddressIncomplete = 484, Failure_Ambiguous = 485,
Failure_BusyHere = 486, Failure_RequestTerminated = 487, Failure_NotAcceptableHere = 488, Failure_BadEvent = 489,
Failure_RequestPending = 491, Failure_Undecipherable = 493, Failure_InternalServerError = 500, Failure_NotImplemented = 501,
Failure_BadGateway = 502, Failure_ServiceUnavailable = 503, Failure_ServerTimeout = 504, Failure_SIPVersionNotSupported = 505,
Failure_MessageTooLarge = 513, GlobalFailure_BusyEverywhere = 600, GlobalFailure_Decline = 603, GlobalFailure_DoesNotExistAnywhere = 604,
GlobalFailure_NotAcceptable = 606, MaxStatusCode = 699
}

enum | { MaxSize = 65535 }

## Public Member Functions

| SIP_PDU ()
| SIP_PDU (Methods method, const SIPURL &dest, const PString &to, const PString &from, const PString &callID, unsigned cseq, const OpalTransportAddress &via)
| SIP_PDU (Methods method, SIPConnection &connection, const OpalTransport &transport)
| SIP_PDU (const SIP_PDU &request, StatusCodes code, const char *contact=NULL, const char *extra=NULL, const SDPSessionDescription *sdp=NULL)
| SIP_PDU (const SIP_PDU &)
SIP_PDU & | operator= (const SIP_PDU &)
| ~SIP_PDU ()
void | PrintOn (ostream &strm) const
void | Construct (Methods method)
void | Construct (Methods method, const SIPURL &dest, const PString &to, const PString &from, const PString &callID, unsigned cseq, const OpalTransportAddress &via)
void | Construct (Methods method, SIPConnection &connection, const OpalTransport &transport)
PBoolean | SetRoute (const PStringList &routeSet)
void | SetAllow (unsigned bitmask)
void | AdjustVia (OpalTransport &transport)
PBoolean | Read (OpalTransport &transport)
PBoolean | Write (OpalTransport &transport, const OpalTransportAddress &remoteAddress=OpalTransportAddress())
bool | SendResponse (OpalTransport &transport, StatusCodes code, const char *contact=NULL, const char *extra=NULL)
bool | SendResponse (OpalTransport &transport, SIP_PDU &response)
PString | Build ()
PString | GetTransactionID () const
Methods | GetMethod () const
StatusCodes | GetStatusCode () const
const SIPURL & | GetURI () const
unsigned | GetVersionMajor () const
unsigned | GetVersionMinor () const
const PString & | GetEntityBody () const
PString & | GetEntityBody ()
const PString & | GetInfo () const
const SIPMIMEInfo & | GetMIME () const
SIPMIMEInfo & | GetMIME ()
void | SetURI (const SIPURL &newuri)
SDPSessionDescription * | GetSDP ()

## Static Public Member Functions

static const char * | GetStatusCodeDescription (int code)

## Protected Attributes

Methods | method
StatusCodes | statusCode
SIPURL | uri
unsigned | versionMajor
unsigned | versionMinor
PString | info
SIPMIMEInfo | mime
PString | entityBody
SDPSessionDescription * | m_SDP
PString | transactionID

## Friends

ostream & | operator<< (ostream &strm, StatusCodes status)

## Detailed Description

Session Initiation Protocol message. Each message contains a header, MIME lines and possibly SDP. Class provides methods for reading from and writing to transport.

## Member Enumeration Documentation

enum SIP_PDU::Methods

Enumerator:

  Method_INVITE |
  Method_ACK |
  Method_OPTIONS |
  Method_BYE |
  Method_CANCEL |
  Method_REGISTER |
  Method_SUBSCRIBE |
  Method_NOTIFY |
  Method_REFER |
  Method_MESSAGE |
  Method_INFO |
  Method_PING |
  Method_PUBLISH |
  NumMethods |

enum SIP_PDU::StatusCodes

Enumerator:

  IllegalStatusCode |
  Local_TransportError |
  Local_BadTransportAddress |
  Information_Trying |
  Information_Ringing |
  Information_CallForwarded |
  Information_Queued |
  Information_Session_Progress |
  Successful_OK |
  Successful_Accepted |
  Redirection_MultipleChoices |
  Redirection_MovedPermanently |
  Redirection_MovedTemporarily |
  Redirection_UseProxy |
  Redirection_AlternativeService |
  Failure_BadRequest |
  Failure_UnAuthorised |
  Failure_PaymentRequired |
  Failure_Forbidden |
  Failure_NotFound |
  Failure_MethodNotAllowed |
  Failure_NotAcceptable |
  Failure_ProxyAuthenticationRequired |
  Failure_RequestTimeout |
  Failure_Conflict |
  Failure_Gone |
  Failure_LengthRequired |
  Failure_RequestEntityTooLarge |
  Failure_RequestURITooLong |
  Failure_UnsupportedMediaType |
  Failure_UnsupportedURIScheme |
  Failure_BadExtension |
  Failure_ExtensionRequired |
  Failure_IntervalTooBrief |
  Failure_TemporarilyUnavailable |
  Failure_TransactionDoesNotExist |
  Failure_LoopDetected |
  Failure_TooManyHops |
  Failure_AddressIncomplete |
  Failure_Ambiguous |
  Failure_BusyHere |
  Failure_RequestTerminated |
  Failure_NotAcceptableHere |
  Failure_BadEvent |
  Failure_RequestPending |
  Failure_Undecipherable |
  Failure_InternalServerError |
  Failure_NotImplemented |
  Failure_BadGateway |
  Failure_ServiceUnavailable |
  Failure_ServerTimeout |
  Failure_SIPVersionNotSupported |
  Failure_MessageTooLarge |
  GlobalFailure_BusyEverywhere |
  GlobalFailure_Decline |
  GlobalFailure_DoesNotExistAnywhere |
  GlobalFailure_NotAcceptable |
  MaxStatusCode |

anonymous enum

Enumerator:

  MaxSize |

## Constructor & Destructor Documentation

SIP_PDU::SIP_PDU | ( |  | ) |

SIP_PDU::SIP_PDU | ( | Methods | method,
|  | const SIPURL & | dest,
|  | const PString & | to,
|  | const PString & | from,
|  | const PString & | callID,
|  | unsigned | cseq,
|  | const OpalTransportAddress & | via |
| ) |  |  |

Construct a Request message

SIP_PDU::SIP_PDU | ( | Methods | method,
|  | SIPConnection & | connection,
|  | const OpalTransport & | transport |
| ) |  |  |

Construct a Request message for requests in a dialog

SIP_PDU::SIP_PDU | ( | const SIP_PDU & | request,
|  | StatusCodes | code,
|  | const char * | contact = `NULL`,
|  | const char * | extra = `NULL`,
|  | const SDPSessionDescription * | sdp = `NULL` |
| ) |  |  |

Construct a Response message extra is passed as message body

SIP_PDU::SIP_PDU | ( | const SIP_PDU & |  | ) |

SIP_PDU::~SIP_PDU | ( |  | ) |

## Member Function Documentation

static const char* SIP_PDU::GetStatusCodeDescription | ( | int | code | ) | `[static]`

SIP_PDU& SIP_PDU::operator= | ( | const SIP_PDU & |  | ) |

void SIP_PDU::PrintOn | ( | ostream & | strm | ) | const

void SIP_PDU::Construct | ( | Methods | method | ) |

void SIP_PDU::Construct | ( | Methods | method,
|  | const SIPURL & | dest,
|  | const PString & | to,
|  | const PString & | from,
|  | const PString & | callID,
|  | unsigned | cseq,
|  | const OpalTransportAddress & | via |
| ) |  |  |

void SIP_PDU::Construct | ( | Methods | method,
|  | SIPConnection & | connection,
|  | const OpalTransport & | transport |
| ) |  |  |

PBoolean SIP_PDU::SetRoute | ( | const PStringList & | routeSet | ) |

Add and populate Route header following the given routeSet. If first route is strict, exchange with URI. Returns PTrue if routeSet.

void SIP_PDU::SetAllow | ( | unsigned | bitmask | ) |

Set mime allow field to all supported methods.

void SIP_PDU::AdjustVia | ( | OpalTransport & | transport | ) |

Update the VIA field following RFC3261, 18.2.1 and RFC3581.

PBoolean SIP_PDU::Read | ( | OpalTransport & | transport | ) |

Read PDU from the specified transport.

PBoolean SIP_PDU::Write | ( | OpalTransport & | transport,
|  | const OpalTransportAddress & | remoteAddress = `OpalTransportAddress()` |
| ) |  |  |

Write the PDU to the transport.

bool SIP_PDU::SendResponse | ( | OpalTransport & | transport,
|  | StatusCodes | code,
|  | const char * | contact = `NULL`,
|  | const char * | extra = `NULL` |
| ) |  |  |

Write PDU as a response to a request.

bool SIP_PDU::SendResponse | ( | OpalTransport & | transport,
|  | SIP_PDU & | response |
| ) |  |  |

PString SIP_PDU::Build | ( |  | ) |

Construct the PDU string to output. Returns the total length of the PDU.

PString SIP_PDU::GetTransactionID | ( |  | ) | const

Methods SIP_PDU::GetMethod | ( |  | ) | const`[inline]`

StatusCodes SIP_PDU::GetStatusCode | ( |  | ) | const`[inline]`

const SIPURL& SIP_PDU::GetURI | ( |  | ) | const`[inline]`

unsigned SIP_PDU::GetVersionMajor | ( |  | ) | const`[inline]`

unsigned SIP_PDU::GetVersionMinor | ( |  | ) | const`[inline]`

const PString& SIP_PDU::GetEntityBody | ( |  | ) | const`[inline]`

PString& SIP_PDU::GetEntityBody | ( |  | ) | `[inline]`

const PString& SIP_PDU::GetInfo | ( |  | ) | const`[inline]`

const SIPMIMEInfo& SIP_PDU::GetMIME | ( |  | ) | const`[inline]`

SIPMIMEInfo& SIP_PDU::GetMIME | ( |  | ) | `[inline]`

void SIP_PDU::SetURI | ( | const SIPURL & | newuri | ) | `[inline]`

SDPSessionDescription* SIP_PDU::GetSDP | ( |  | ) |

## Friends And Related Function Documentation

ostream& operator<< | ( | ostream & | strm,
|  | StatusCodes | status |
| ) |  |  | `[friend]`

## Member Data Documentation

Methods SIP_PDU::method `[protected]`

StatusCodes SIP_PDU::statusCode `[protected]`

SIPURL SIP_PDU::uri `[protected]`

unsigned SIP_PDU::versionMajor `[protected]`

unsigned SIP_PDU::versionMinor `[protected]`

PString SIP_PDU::info `[protected]`

SIPMIMEInfo SIP_PDU::mime `[protected]`

PString SIP_PDU::entityBody `[protected]`

SDPSessionDescription* SIP_PDU::m_SDP `[protected]`

PString SIP_PDU::transactionID `[mutable, protected]`

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

- sippdu.h