SIP_PDU Class Reference

`#include <sippdu.h>`

Inheritance diagram for SIP_PDU:

## 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, Method_PRACK, NumMethods }

enum

StatusCodes {
IllegalStatusCode, Local_TransportError, Local_BadTransportAddress, Local_Timeout,
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
}

## Public Member Functions

| SIP_PDU (Methods method=SIP_PDU::NumMethods)
| SIP_PDU (const SIP_PDU &request, StatusCodes code, const SDPSessionDescription *sdp=NULL)
| SIP_PDU (const SIP_PDU &)
SIP_PDU & | operator= (const SIP_PDU &)
| ~SIP_PDU ()
void | PrintOn (ostream &strm) const
void | InitialiseHeaders (const SIPURL &dest, const SIPURL &to, const SIPURL &from, const PString &callID, unsigned cseq, const PString &via)
void | InitialiseHeaders (SIPDialogContext &dialog, const PString &via=PString::Empty(), unsigned cseq=0)
void | InitialiseHeaders (SIPConnection &connection, const OpalTransport &transport, unsigned cseq=0)
void | InitialiseHeaders (const SIP_PDU &request)
bool | SetRoute (const SIPURLList &routeSet)
bool | SetRoute (const SIPURL &proxy)
void | SetAllow (unsigned bitmask)
void | AdjustVia (OpalTransport &transport)
PString | CreateVia (SIPEndPoint &endpoint, const OpalTransport &transport)
SIP_PDU::StatusCodes | Read (OpalTransport &transport)
PBoolean | Write (OpalTransport &transport, const OpalTransportAddress &remoteAddress=OpalTransportAddress(), const PString &localInterface=PString::Empty())
bool | SendResponse (OpalTransport &transport, StatusCodes code, SIPEndPoint *endpoint=NULL) const
bool | SendResponse (OpalTransport &transport, SIP_PDU &response, SIPEndPoint *endpoint=NULL) const
PString | Build ()
PString | GetTransactionID () const
Methods | GetMethod () const
StatusCodes | GetStatusCode () const
void | SetStatusCode (StatusCodes c)
const SIPURL & | GetURI () const
void | SetURI (const SIPURL &newuri)
unsigned | GetVersionMajor () const
unsigned | GetVersionMinor () const
void | SetCSeq (unsigned cseq)
const PString & | GetEntityBody () const
void | SetEntityBody (const PString &body)
void | SetEntityBody ()
const PString & | GetInfo () const
void | SetInfo (const PString &info)
const SIPMIMEInfo & | GetMIME () const
SIPMIMEInfo & | GetMIME ()
SDPSessionDescription * | GetSDP (const OpalMediaFormatList &masterList)
void | SetSDP (SDPSessionDescription *sdp)

## Static Public Member Functions

static const char * | GetStatusCodeDescription (int code)

## Protected Attributes

Methods | m_method
StatusCodes | m_statusCode
SIPURL | m_uri
unsigned | m_versionMajor
unsigned | m_versionMinor
PString | m_info
SIPMIMEInfo | m_mime
PString | m_entityBody
SDPSessionDescription * | m_SDP
PString | m_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 |
Method_PRACK |
NumMethods |

enum SIP_PDU::StatusCodes

Enumerator
IllegalStatusCode |
Local_TransportError |
Local_BadTransportAddress |
Local_Timeout |
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 |

## Constructor & Destructor Documentation

SIP_PDU::SIP_PDU | ( | Methods | method = `SIP_PDU::NumMethods` | ) |

SIP_PDU::SIP_PDU | ( | const SIP_PDU & | request,
|  | StatusCodes | code,
|  | 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

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

Update the VIA field following RFC3261, 18.2.1 and RFC3581.

PString SIP_PDU::Build | ( |  | ) |

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

PString SIP_PDU::CreateVia | ( | SIPEndPoint & | endpoint,
|  | const OpalTransport & | transport
| ) |  |

const PString& SIP_PDU::GetEntityBody | ( |  | ) | const

inline

References m_entityBody.

const PString& SIP_PDU::GetInfo | ( |  | ) | const

inline

References m_info.

Methods SIP_PDU::GetMethod | ( |  | ) | const

inline

References m_method.

const SIPMIMEInfo& SIP_PDU::GetMIME | ( |  | ) | const

inline

References m_mime.

SIPMIMEInfo& SIP_PDU::GetMIME | ( |  | ) |

inline

References m_mime.

SDPSessionDescription* SIP_PDU::GetSDP | ( | const OpalMediaFormatList & | masterList | ) |

StatusCodes SIP_PDU::GetStatusCode | ( |  | ) | const

inline

References m_statusCode.

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

static

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

Referenced by SIPEndPoint::AddTransaction().

const SIPURL& SIP_PDU::GetURI | ( |  | ) | const

inline

References m_uri.

unsigned SIP_PDU::GetVersionMajor | ( |  | ) | const

inline

References m_versionMajor.

unsigned SIP_PDU::GetVersionMinor | ( |  | ) | const

inline

References m_versionMinor.

void SIP_PDU::InitialiseHeaders | ( | const SIPURL & | dest,
|  | const SIPURL & | to,
|  | const SIPURL & | from,
|  | const PString & | callID,
|  | unsigned | cseq,
|  | const PString & | via
| ) |  |

void SIP_PDU::InitialiseHeaders | ( | SIPDialogContext & | dialog,
|  | const PString & | via = `PString::Empty()`,
|  | unsigned | cseq = `0`
| ) |  |

void SIP_PDU::InitialiseHeaders | ( | SIPConnection & | connection,
|  | const OpalTransport & | transport,
|  | unsigned | cseq = `0`
| ) |  |

void SIP_PDU::InitialiseHeaders | ( | const SIP_PDU & | request | ) |

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

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

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

Read PDU from the specified transport.

bool SIP_PDU::SendResponse | ( | OpalTransport & | transport,
|  | StatusCodes | code,
|  | SIPEndPoint * | endpoint = `NULL`
| ) |  | const

Write PDU as a response to a request.

bool SIP_PDU::SendResponse | ( | OpalTransport & | transport,
|  | SIP_PDU & | response,
|  | SIPEndPoint * | endpoint = `NULL`
| ) |  | const

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

Set mime allow field to all supported methods.

void SIP_PDU::SetCSeq | ( | unsigned | cseq | ) |

void SIP_PDU::SetEntityBody | ( | const PString & | body | ) |

inline

References m_entityBody.

void SIP_PDU::SetEntityBody | ( |  | ) |

void SIP_PDU::SetInfo | ( | const PString & | info | ) |

inline

References m_info.

bool SIP_PDU::SetRoute | ( | const SIPURLList & | routeSet | ) |

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

bool SIP_PDU::SetRoute | ( | const SIPURL & | proxy | ) |

void SIP_PDU::SetSDP | ( | SDPSessionDescription * | sdp | ) |

void SIP_PDU::SetStatusCode | ( | StatusCodes | c | ) |

inline

References m_statusCode.

void SIP_PDU::SetURI | ( | const SIPURL & | newuri | ) |

inline

References m_uri.

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

Write the PDU to the transport.

## Friends And Related Function Documentation

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

friend

## Field Documentation

PString SIP_PDU::m_entityBody

protected

Referenced by GetEntityBody(), and SetEntityBody().

PString SIP_PDU::m_info

protected

Referenced by GetInfo(), and SetInfo().

Methods SIP_PDU::m_method

protected

Referenced by GetMethod().

SIPMIMEInfo SIP_PDU::m_mime

protected

Referenced by GetMIME().

SDPSessionDescription* SIP_PDU::m_SDP

protected

StatusCodes SIP_PDU::m_statusCode

protected

Referenced by GetStatusCode(), and SetStatusCode().

PString SIP_PDU::m_transactionID

mutable protected

SIPURL SIP_PDU::m_uri

protected

Referenced by GetURI(), and SetURI().

unsigned SIP_PDU::m_versionMajor

protected

Referenced by GetVersionMajor().

unsigned SIP_PDU::m_versionMinor

protected

Referenced by GetVersionMinor().

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

- sippdu.h