# SIPHandler Class Reference

`#include <handlers.h>`

Inheritance diagram for SIPHandler:

[legend]
Collaboration diagram for SIPHandler:
[legend]

## Public Types

| Subscribed
| Subscribing
| Unavailable
| Refreshing
| Restoring
| Unsubscribing
| Unsubscribed
| NumStates
enum | State { Subscribed, Subscribing, Unavailable, Refreshing, Restoring, Unsubscribing, Unsubscribed, NumStates }

## Public Member Functions

| ~SIPHandler ()
virtual Comparison | Compare (const PObject &other) const
virtual PString | GetAuthID () const
virtual PString | GetPassword () const
void | SetState (SIPHandler::State s)
SIPHandler::State | GetState () const
virtual const SIPURL & | GetAddressOfRecord () const
virtual PBoolean | OnReceivedNOTIFY (SIP_PDU &response)
virtual void | SetExpire (int e)
virtual int | GetExpire () const
virtual void | SetBody (const PString &)
virtual bool | IsDuplicateCSeq (unsigned)
virtual SIPTransaction * | CreateTransaction (OpalTransport &)
SIP_PDU::Methods | GetMethod () const
virtual SIPSubscribe::EventPackage | GetEventPackage () const
virtual void | OnReceivedResponse (SIPTransaction &transaction, SIP_PDU &response)
virtual void | OnReceivedIntervalTooBrief (SIPTransaction &transaction, SIP_PDU &response)
virtual void | OnReceivedTemporarilyUnavailable (SIPTransaction &transaction, SIP_PDU &response)
virtual void | OnReceivedAuthenticationRequired (SIPTransaction &transaction, SIP_PDU &response)
virtual void | OnReceivedOK (SIPTransaction &transaction, SIP_PDU &response)
virtual void | OnTransactionFailed (SIPTransaction &transaction)
virtual void | OnFailed (SIP_PDU::StatusCodes)
virtual void | SendStatus (SIP_PDU::StatusCodes code, State state)
bool | ActivateState (SIPHandler::State state)
virtual bool | SendNotify (const PObject *)
SIP_PDU::StatusCodes | GetLastResponseStatus () const
const OpalProductInfo & | GetProductInfo () const
const PString & | GetRealm () const
virtual bool | ShutDown ()

## Protected Member Functions

| SIPHandler (SIP_PDU::Methods method, SIPEndPoint &ep, const SIPParameters &params, const PString &callID=SIPTransaction::GenerateCallID())
virtual PBoolean | SendRequest (SIPHandler::State state)
void | RetryLater (unsigned after)
void | OnExpireTimeout ()
| PDECLARE_WriteConnectCallback (SIPHandler, WriteTransaction)

## Protected Attributes

PString | m_username
PString | m_password
PString | m_realm
const SIP_PDU::Methods | m_method
const SIPURL | m_addressOfRecord
SIPMIMEInfo | m_mime
unsigned | m_lastCseq
SIP_PDU::StatusCodes | m_lastResponseStatus
int | m_currentExpireTime
int | m_originalExpireTime
int | m_offlineExpireTime
State | m_state
std::queue< State > | m_stateQueue
bool | m_receivedResponse
SIPPoolTimer< SIPHandler > | m_expireTimer
OpalProductInfo | m_productInfo

## Member Enumeration Documentation

enum SIPHandler::State

Enumerator:

  Subscribed |
  Subscribing |
  Unavailable |
  Refreshing |
  Restoring |
  Unsubscribing |
  Unsubscribed |
  NumStates |

## Constructor & Destructor Documentation

SIPHandler::SIPHandler | ( | SIP_PDU::Methods | method,
|  | SIPEndPoint & | ep,
|  | const SIPParameters & | params,
|  | const PString & | callID = `SIPTransaction::GenerateCallID()` |
| ) |  |  | `[protected]`

SIPHandler::~SIPHandler | ( |  | ) |

## Member Function Documentation

bool SIPHandler::ActivateState | ( | SIPHandler::State | state | ) |

virtual Comparison SIPHandler::Compare | ( | const PObject & | other | ) | const`[virtual]`

virtual SIPTransaction* SIPHandler::CreateTransaction | ( | OpalTransport & |  | ) | `[inline, virtual]`

Reimplemented in SIPRegisterHandler, SIPSubscribeHandler, SIPNotifyHandler, SIPPublishHandler, SIPMessageHandler, and SIPPingHandler.

virtual const SIPURL& SIPHandler::GetAddressOfRecord | ( |  | ) | const`[inline, virtual]`

virtual PString SIPHandler::GetAuthID | ( |  | ) | const`[inline, virtual]`

Implements SIPTransactionOwner.

virtual SIPSubscribe::EventPackage SIPHandler::GetEventPackage | ( |  | ) | const`[inline, virtual]`

Reimplemented in SIPSubscribeHandler, SIPNotifyHandler, and SIPPublishHandler.

virtual int SIPHandler::GetExpire | ( |  | ) | const`[inline, virtual]`

SIP_PDU::StatusCodes SIPHandler::GetLastResponseStatus | ( |  | ) | const`[inline]`

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

virtual PString SIPHandler::GetPassword | ( |  | ) | const`[inline, virtual]`

Reimplemented from SIPTransactionOwner.

const OpalProductInfo& SIPHandler::GetProductInfo | ( |  | ) | const`[inline]`

const PString& SIPHandler::GetRealm | ( |  | ) | const`[inline]`

SIPHandler::State SIPHandler::GetState | ( |  | ) | const`[inline]`

virtual bool SIPHandler::IsDuplicateCSeq | ( | unsigned |  | ) | `[inline, virtual]`

void SIPHandler::OnExpireTimeout | ( |  | ) | `[protected]`

virtual void SIPHandler::OnFailed | ( | SIP_PDU::StatusCodes |  | ) | `[virtual]`

Reimplemented in SIPSubscribeHandler, and SIPMessageHandler.

virtual void SIPHandler::OnReceivedAuthenticationRequired | ( | SIPTransaction & | transaction,
|  | SIP_PDU & | response |
| ) |  |  | `[virtual]`

virtual void SIPHandler::OnReceivedIntervalTooBrief | ( | SIPTransaction & | transaction,
|  | SIP_PDU & | response |
| ) |  |  | `[virtual]`

virtual PBoolean SIPHandler::OnReceivedNOTIFY | ( | SIP_PDU & | response | ) | `[virtual]`

Reimplemented in SIPSubscribeHandler.

virtual void SIPHandler::OnReceivedOK | ( | SIPTransaction & | transaction,
|  | SIP_PDU & | response |
| ) |  |  | `[virtual]`

Reimplemented in SIPRegisterHandler, SIPSubscribeHandler, SIPPublishHandler, and SIPMessageHandler.

virtual void SIPHandler::OnReceivedResponse | ( | SIPTransaction & | transaction,
|  | SIP_PDU & | response |
| ) |  |  | `[virtual]`

Reimplemented from SIPTransactionOwner.

virtual void SIPHandler::OnReceivedTemporarilyUnavailable | ( | SIPTransaction & | transaction,
|  | SIP_PDU & | response |
| ) |  |  | `[virtual]`

virtual void SIPHandler::OnTransactionFailed | ( | SIPTransaction & | transaction | ) | `[virtual]`

Reimplemented from SIPTransactionOwner.

SIPHandler::PDECLARE_WriteConnectCallback | ( | SIPHandler | ,
|  | WriteTransaction |  |
| ) |  |  | `[protected]`

void SIPHandler::RetryLater | ( | unsigned | after | ) | `[protected]`

virtual bool SIPHandler::SendNotify | ( | const PObject * |  | ) | `[inline, virtual]`

Reimplemented in SIPNotifyHandler.

virtual PBoolean SIPHandler::SendRequest | ( | SIPHandler::State | state | ) | `[protected, virtual]`

Reimplemented in SIPRegisterHandler, and SIPNotifyHandler.

virtual void SIPHandler::SendStatus | ( | SIP_PDU::StatusCodes | code,
|  | State | state |
| ) |  |  | `[virtual]`

virtual void SIPHandler::SetBody | ( | const PString & |  | ) | `[inline, virtual]`

Reimplemented in SIPNotifyHandler, and SIPPublishHandler.

virtual void SIPHandler::SetExpire | ( | int | e | ) | `[virtual]`

void SIPHandler::SetState | ( | SIPHandler::State | s | ) |

virtual bool SIPHandler::ShutDown | ( |  | ) | `[virtual]`

## Field Documentation

const SIPURL SIPHandler::m_addressOfRecord `[protected]`

int SIPHandler::m_currentExpireTime `[protected]`

SIPPoolTimer<SIPHandler> SIPHandler::m_expireTimer `[protected]`

unsigned SIPHandler::m_lastCseq `[protected]`

SIP_PDU::StatusCodes SIPHandler::m_lastResponseStatus `[protected]`

const SIP_PDU::Methods SIPHandler::m_method `[protected]`

SIPMIMEInfo SIPHandler::m_mime `[protected]`

int SIPHandler::m_offlineExpireTime `[protected]`

int SIPHandler::m_originalExpireTime `[protected]`

PString SIPHandler::m_password `[protected]`

OpalProductInfo SIPHandler::m_productInfo `[protected]`

PString SIPHandler::m_realm `[protected]`

bool SIPHandler::m_receivedResponse `[protected]`

State SIPHandler::m_state `[protected]`

std::queue<State> SIPHandler::m_stateQueue `[protected]`

PString SIPHandler::m_username `[protected]`

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

- handlers.h