handlers.h
Go to the documentation of this file.
/*
* handlers.h
*
* Session Initiation Protocol endpoint.
*
* Open Phone Abstraction Library (OPAL)
*
* Copyright (c) 2000 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Open Phone Abstraction Library.
*
* The Initial Developer of the Original Code is Damien Sandras.
*
* Contributor(s): ______________________________________.
*
* $Revision: 28428 $
* $Author: rjongbloed $
* $Date: 2012-10-01 03:38:50 -0500 (Mon, 01 Oct 2012) $
*/
#ifndef OPAL_SIP_HANDLERS_H
#define OPAL_SIP_HANDLERS_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#ifndef _PTLIB_H
#include <ptlib.h>
#endif
#include <opal/buildopts.h>
#if OPAL_SIP
#include <opal/pres_ent.h>
#include <opal/connection.h>
#include <sip/sippdu.h>
/* Class to handle SIP REGISTER, SUBSCRIBE, MESSAGE, and renew
* the 'bindings' before they expire.
*/
class SIPHandler : public PSafeObject
{
PCLASSINFO(SIPHandler, PSafeObject);
protected:
SIPHandler(
SIP_PDU::Methods method,
SIPEndPoint & ep,
const SIPParameters & params
);
public:
~SIPHandler();
virtual Comparison Compare(const PObject & other) const;
virtual bool ShutDown();
enum State {
Subscribed, // The registration is active
Subscribing, // The registration is in process
Unavailable, // The registration is offline and still being attempted
Refreshing, // The registration is being refreshed
Restoring, // The registration is trying to be restored after being offline
Unsubscribing, // The unregistration is in process
Unsubscribed, // The registrating is inactive
NumStates
};
void SetState (SIPHandler::State s);
inline SIPHandler::State GetState ()
{ return m_state; }
virtual OpalTransport * GetTransport();
virtual SIPAuthentication * GetAuthentication()
{ return m_authentication; }
virtual const SIPURL & GetAddressOfRecord()
{ return m_addressOfRecord; }
virtual PBoolean OnReceivedNOTIFY(SIP_PDU & response);
virtual void SetExpire(int e);
virtual int GetExpire()
{ return m_currentExpireTime; }
virtual const PString & GetCallID() const
{ return m_callID; }
virtual void SetBody(const PString & /*body*/) { }
virtual bool IsDuplicateCSeq(unsigned ) { return false; }
virtual SIPTransaction * CreateTransaction(OpalTransport & t) = 0;
SIP_PDU::Methods GetMethod() const { return m_method; }
virtual SIPSubscribe::EventPackage GetEventPackage() const { return SIPEventPackage(); }
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(const SIP_PDU & response);
virtual void OnFailed(SIP_PDU::StatusCodes);
bool ActivateState(SIPHandler::State state);
virtual bool SendNotify(const PObject * /*body*/) { return false; }
SIPEndPoint & GetEndPoint() const { return endpoint; }
const OpalProductInfo & GetProductInfo() const { return m_productInfo; }
const PString & GetUsername() const { return m_username; }
const PString & GetPassword() const { return m_password; }
const PString & GetRealm() const { return m_realm; }
const SIPURL & GetRemoteAddress() const { return m_remoteAddress; }
const SIPURL & GetProxy() const { return m_proxy; }
SIPMIMEInfo m_mime;
protected:
virtual PBoolean SendRequest(SIPHandler::State state);
void RetryLater(unsigned after);
PDECLARE_NOTIFIER(PTimer, SIPHandler, OnExpireTimeout);
static PBoolean WriteSIPHandler(OpalTransport & transport, void * info);
virtual bool WriteSIPHandler(OpalTransport & transport, bool forked);
SIPEndPoint & endpoint;
SIPAuthentication * m_authentication;
unsigned m_authenticateErrors;
PString m_username;
PString m_password;
PString m_realm;
PSafeList<SIPTransaction> m_transactions;
OpalTransport * m_transport;
SIP_PDU::Methods m_method;
SIPURL m_addressOfRecord;
SIPURL m_remoteAddress;
PString m_callID;
unsigned m_lastCseq;
int m_currentExpireTime;
int m_originalExpireTime;
int m_offlineExpireTime;
State m_state;
queue<State> m_stateQueue;
bool m_receivedResponse;
PTimer m_expireTimer;
SIPURL m_proxy;
OpalProductInfo m_productInfo;
// Keep a copy of the keys used for easy removal on destruction
typedef std::map<PString, PSafePtr<SIPHandler> > IndexMap;
std::pair<IndexMap::iterator, bool> m_byCallID;
std::pair<IndexMap::iterator, bool> m_byAorAndPackage;
std::pair<IndexMap::iterator, bool> m_byAuthIdAndRealm;
std::pair<IndexMap::iterator, bool> m_byAorUserAndRealm;
friend class SIPHandlersList;
};
#if PTRACING
ostream & operator<<(ostream & strm, SIPHandler::State state);
#endif
class SIPRegisterHandler : public SIPHandler
{
PCLASSINFO(SIPRegisterHandler, SIPHandler);
public:
SIPRegisterHandler(
SIPEndPoint & ep,
const SIPRegister::Params & params
);
virtual SIPTransaction * CreateTransaction(OpalTransport &);
virtual void OnReceivedOK(SIPTransaction & transaction, SIP_PDU & response);
virtual void OnFailed(SIP_PDU::StatusCodes r);
void UpdateParameters(const SIPRegister::Params & params);
const SIPRegister::Params & GetParams() const { return m_parameters; }
const SIPURLList & GetContacts() const { return m_contactAddresses; }
const SIPURLList & GetServiceRoute() const { return m_serviceRoute; }
protected:
virtual PBoolean SendRequest(SIPHandler::State state);
void SendStatus(SIP_PDU::StatusCodes code, State state);
SIPRegister::Params m_parameters;
unsigned m_sequenceNumber;
SIPURLList m_contactAddresses;
SIPURLList m_serviceRoute;
OpalTransportAddress m_externalAddress;
};
class SIPSubscribeHandler : public SIPHandler
{
PCLASSINFO(SIPSubscribeHandler, SIPHandler);
public:
SIPSubscribeHandler(SIPEndPoint & ep, const SIPSubscribe::Params & params);
~SIPSubscribeHandler();
virtual SIPTransaction * CreateTransaction (OpalTransport &);
virtual void OnReceivedOK(SIPTransaction & transaction, SIP_PDU & response);
virtual PBoolean OnReceivedNOTIFY(SIP_PDU & response);
virtual void OnFailed(const SIP_PDU & response);
virtual SIPEventPackage GetEventPackage() const
{ return m_parameters.m_eventPackage; }
void UpdateParameters(const SIPSubscribe::Params & params);
virtual bool IsDuplicateCSeq(unsigned sequenceNumber) { return m_dialog.IsDuplicateCSeq(sequenceNumber); }
const SIPSubscribe::Params & GetParams() const { return m_parameters; }
protected:
virtual PBoolean SendRequest(SIPHandler::State state);
virtual bool WriteSIPHandler(OpalTransport & transport, bool forked);
void SendStatus(SIP_PDU::StatusCodes code, State state);
bool DispatchNOTIFY(SIP_PDU & request, SIP_PDU & response);
SIPSubscribe::Params m_parameters;
SIPDialogContext m_dialog;
bool m_unconfirmed;
SIPEventPackageHandler * m_packageHandler;
SIP_PDU * m_previousResponse;
};
class SIPNotifyHandler : public SIPHandler
{
PCLASSINFO(SIPNotifyHandler, SIPHandler);
public:
SIPNotifyHandler(
SIPEndPoint & ep,
const PString & targetAddress,
const SIPEventPackage & eventPackage,
const SIPDialogContext & dialog
);
~SIPNotifyHandler();
virtual SIPTransaction * CreateTransaction(OpalTransport &);
virtual SIPEventPackage GetEventPackage() const
{ return m_eventPackage; }
virtual void SetBody(const PString & body) { m_body = body; }
virtual bool IsDuplicateCSeq(unsigned sequenceNumber) { return m_dialog.IsDuplicateCSeq(sequenceNumber); }
virtual bool SendNotify(const PObject * body);
enum Reasons {
Deactivated,
Probation,
Rejected,
Timeout,
GiveUp,
NoResource
};
protected:
virtual PBoolean SendRequest(SIPHandler::State state);
virtual bool WriteSIPHandler(OpalTransport & transport, bool forked);
SIPEventPackage m_eventPackage;
SIPDialogContext m_dialog;
Reasons m_reason;
SIPEventPackageHandler * m_packageHandler;
PString m_body;
};
class SIPPublishHandler : public SIPHandler
{
PCLASSINFO(SIPPublishHandler, SIPHandler);
public:
SIPPublishHandler(SIPEndPoint & ep,
const SIPSubscribe::Params & params,
const PString & body);
virtual void SetBody(const PString & body) { m_body = body; }
virtual SIPTransaction * CreateTransaction(OpalTransport &);
virtual void OnReceivedOK(SIPTransaction & transaction, SIP_PDU & response);
virtual SIPEventPackage GetEventPackage() const { return m_parameters.m_eventPackage; }
protected:
SIPSubscribe::Params m_parameters;
PString m_body;
PString m_sipETag;
};
class SIPMessageHandler : public SIPHandler
{
PCLASSINFO(SIPMessageHandler, SIPHandler);
public:
SIPMessageHandler(SIPEndPoint & ep, const SIPMessage::Params & params);
virtual SIPTransaction * CreateTransaction (OpalTransport &);
virtual void OnFailed(SIP_PDU::StatusCodes);
virtual void OnReceivedOK(SIPTransaction & transaction, SIP_PDU & response);
void UpdateParameters(const SIPMessage::Params & params);
protected:
SIPMessage::Params m_parameters;
};
class SIPOptionsHandler : public SIPHandler
{
PCLASSINFO(SIPOptionsHandler, SIPHandler);
public:
SIPOptionsHandler(SIPEndPoint & ep, const SIPOptions::Params & params);
virtual SIPTransaction * CreateTransaction (OpalTransport &);
virtual void OnFailed(SIP_PDU::StatusCodes);
virtual void OnFailed(const SIP_PDU & response);
virtual void OnReceivedOK(SIPTransaction & transaction, SIP_PDU & response);
protected:
SIPOptions::Params m_parameters;
};
class SIPPingHandler : public SIPHandler
{
PCLASSINFO(SIPPingHandler, SIPHandler);
public:
SIPPingHandler(SIPEndPoint & ep, const PURL & to);
virtual SIPTransaction * CreateTransaction (OpalTransport &);
};
class SIPHandlersList
{
public:
void Append(SIPHandler * handler);
void Remove(SIPHandler * handler);
void Update(SIPHandler * handler);
bool DeleteObjectsToBeRemoved()
{ return m_handlersList.DeleteObjectsToBeRemoved(); }
PSafePtr<SIPHandler> GetFirstHandler(PSafetyMode mode = PSafeReference) const
{ return PSafePtr<SIPHandler>(m_handlersList, mode); }
unsigned GetCount(SIP_PDU::Methods meth, const PString & eventPackage = PString::Empty()) const;
PStringList GetAddresses(bool includeOffline, SIP_PDU::Methods meth, const PString & eventPackage = PString::Empty()) const;
PSafePtr<SIPHandler> FindSIPHandlerByCallID(const PString & callID, PSafetyMode m);
PSafePtr<SIPHandler> FindSIPHandlerByAuthRealm(const PString & authRealm, PSafetyMode m);
PSafePtr<SIPHandler> FindSIPHandlerByAuthRealm(const PString & authRealm, const PString & userName, PSafetyMode m);
PSafePtr<SIPHandler> FindSIPHandlerByUrl(const PURL & url, SIP_PDU::Methods meth, PSafetyMode m);
PSafePtr<SIPHandler> FindSIPHandlerByUrl(const PURL & url, SIP_PDU::Methods meth, const PString & eventPackage, PSafetyMode m);
PSafePtr <SIPHandler> FindSIPHandlerByDomain(const PString & name, SIP_PDU::Methods meth, PSafetyMode m);
protected:
void RemoveIndexes(SIPHandler * handler);
PMutex m_extraMutex;
PSafeList<SIPHandler> m_handlersList;
typedef SIPHandler::IndexMap IndexMap;
PSafePtr<SIPHandler> FindBy(IndexMap & by, const PString & key, PSafetyMode m);
IndexMap m_byCallID;
IndexMap m_byAorAndPackage;
IndexMap m_byAuthIdAndRealm;
IndexMap m_byAorUserAndRealm;
};
class SIPPresenceInfo : public OpalPresenceInfo
{
public:
SIPPresenceInfo(
State state = Unchanged
);
// basic presence defined by RFC 3863
PString m_tupleId;
PString m_contact;
// presence extensions defined by RFC 4480
PStringArray m_activities; // list of activities, seperated by newline
// presence agent
PString m_presenceAgent;
PString AsXML() const;
#if P_EXPAT
static bool ParseXML(
const PString & body,
list<SIPPresenceInfo> & info,
PString & error
);
#endif
void PrintOn(ostream & strm) const;
friend ostream & operator<<(ostream & strm, const SIPPresenceInfo & info) { info.PrintOn(strm); return strm; }
static State FromSIPActivityString(const PString & str);
static bool AsSIPActivityString(State state, PString & str);
bool AsSIPActivityString(PString & str) const;
PString m_personId;
};
struct SIPDialogNotification : public PObject
{
PCLASSINFO(SIPDialogNotification, PObject);
enum States {
Terminated,
Trying,
Proceeding,
Early,
Confirmed,
FirstState = Terminated,
LastState = Confirmed
};
friend States operator++(States & state) { return (state = (States)(state+1)); }
friend States operator--(States & state) { return (state = (States)(state-1)); }
static PString GetStateName(States state);
PString GetStateName() const { return GetStateName(m_state); }
enum Events {
NoEvent = -1,
Cancelled,
Rejected,
Replaced,
LocalBye,
RemoteBye,
Error,
Timeout,
FirstEvent = Cancelled,
LastEvent = Timeout
};
friend Events operator++(Events & evt) { return (evt = (Events)(evt+1)); }
friend Events operator--(Events & evt) { return (evt = (Events)(evt-1)); }
static PString GetEventName(Events state);
PString GetEventName() const { return GetEventName(m_eventType); }
enum Rendering {
RenderingUnknown = -1,
NotRenderingMedia,
RenderingMedia
};
PString m_entity;
PString m_dialogId;
PString m_callId;
bool m_initiator;
States m_state;
Events m_eventType;
unsigned m_eventCode;
struct Participant {
Participant() : m_appearance(-1), m_byeless(false), m_rendering(RenderingUnknown) { }
PString m_URI;
PString m_dialogTag;
PString m_identity;
PString m_display;
int m_appearance;
bool m_byeless;
Rendering m_rendering;
} m_local, m_remote;
SIPDialogNotification(const PString & entity = PString::Empty());
void PrintOn(ostream & strm) const;
};
#endif // OPAL_SIP
#endif // OPAL_SIP_HANDLERS_H
SIPHandler::m_stateQueue
queue< State > m_stateQueue
Definition: handlers.h:167
SIPDialogNotification::FirstState
Definition: handlers.h:506
SIPRegisterHandler::SendStatus
void SendStatus(SIP_PDU::StatusCodes code, State state)
SIPSubscribe::EventPackage
Definition: sippdu.h:1118
SIPURL
Definition: sippdu.h:70
SIPPublishHandler::SetBody
virtual void SetBody(const PString &body)
Definition: handlers.h:308
SIPHandler::m_callID
PString m_callID
Definition: handlers.h:161
OpalPresenceInfo::Unchanged
Definition: pres_ent.h:66
SIPPublishHandler::GetEventPackage
virtual SIPEventPackage GetEventPackage() const
Definition: handlers.h:312
SIPHandler::OnTransactionFailed
virtual void OnTransactionFailed(SIPTransaction &transaction)
SIPOptionsHandler
Definition: handlers.h:338
SIPHandler::m_lastCseq
unsigned m_lastCseq
Definition: handlers.h:162
SIPDialogNotification::Participant
Definition: handlers.h:545
SIPRegisterHandler::OnFailed
virtual void OnFailed(SIP_PDU::StatusCodes r)
SIPDialogNotification::Rendering
Rendering
Definition: handlers.h:532
SIPHandler::IsDuplicateCSeq
virtual bool IsDuplicateCSeq(unsigned)
Definition: handlers.h:108
SIPDialogNotification
Definition: handlers.h:495
SIPDialogNotification::SIPDialogNotification
SIPDialogNotification(const PString &entity=PString::Empty())
SIPTransaction
Definition: sippdu.h:854
SIPHandlersList::m_byAorUserAndRealm
IndexMap m_byAorUserAndRealm
Definition: handlers.h:448
SIPDialogNotification::operator++
friend States operator++(States &state)
Definition: handlers.h:509
SIPHandler::GetEventPackage
virtual SIPSubscribe::EventPackage GetEventPackage() const
Definition: handlers.h:113
SIPPublishHandler::m_sipETag
PString m_sipETag
Definition: handlers.h:317
SIPDialogNotification::Terminated
Definition: handlers.h:500
SIPMIMEInfo
Definition: sippdu.h:275
SIPMessage::Params
Definition: sippdu.h:1314
SIPNotifyHandler::Deactivated
Definition: handlers.h:279
SIPHandler::SetBody
virtual void SetBody(const PString &)
Definition: handlers.h:106
SIPHandler::SendRequest
virtual PBoolean SendRequest(SIPHandler::State state)
SIPPresenceInfo::PrintOn
void PrintOn(ostream &strm) const
pres_ent.h
connection.h
SIPMessageHandler
Definition: handlers.h:321
buildopts.h
SIPHandler::GetRealm
const PString & GetRealm() const
Definition: handlers.h:134
SIPSubscribeHandler::SIPSubscribeHandler
SIPSubscribeHandler(SIPEndPoint &ep, const SIPSubscribe::Params &params)
SIPHandler::GetAddressOfRecord
virtual const SIPURL & GetAddressOfRecord()
Definition: handlers.h:93
SIPPresenceInfo::m_personId
PString m_personId
Definition: handlers.h:489
SIPDialogNotification::Participant::m_display
PString m_display
Definition: handlers.h:550
SIPNotifyHandler::IsDuplicateCSeq
virtual bool IsDuplicateCSeq(unsigned sequenceNumber)
Definition: handlers.h:275
SIPHandlersList::FindSIPHandlerByDomain
PSafePtr< SIPHandler > FindSIPHandlerByDomain(const PString &name, SIP_PDU::Methods meth, PSafetyMode m)
SIPDialogNotification::m_initiator
bool m_initiator
Definition: handlers.h:541
SIPRegisterHandler::m_parameters
SIPRegister::Params m_parameters
Definition: handlers.h:214
SIPDialogNotification::m_eventCode
unsigned m_eventCode
Definition: handlers.h:544
SIPHandlersList::GetCount
unsigned GetCount(SIP_PDU::Methods meth, const PString &eventPackage=PString::Empty()) const
SIPHandlersList::RemoveIndexes
void RemoveIndexes(SIPHandler *handler)
SIPHandler::GetAuthentication
virtual SIPAuthentication * GetAuthentication()
Definition: handlers.h:90
OpalTransport
Definition: transports.h:703
SIPSubscribeHandler::OnFailed
virtual void OnFailed(const SIP_PDU &response)
SIPSubscribe::Params
Definition: sippdu.h:1169
SIPNotifyHandler::m_body
PString m_body
Definition: handlers.h:295
SIPEndPoint
Definition: sipep.h:86
SIPPingHandler::CreateTransaction
virtual SIPTransaction * CreateTransaction(OpalTransport &)
SIPDialogNotification::GetEventName
PString GetEventName() const
Definition: handlers.h:530
SIPHandler::m_username
PString m_username
Definition: handlers.h:151
SIPSubscribeHandler::GetParams
const SIPSubscribe::Params & GetParams() const
Definition: handlers.h:240
SIPHandler::m_addressOfRecord
SIPURL m_addressOfRecord
Definition: handlers.h:159
SIPHandler::Subscribing
Definition: handlers.h:74
SIPHandler::CreateTransaction
virtual SIPTransaction * CreateTransaction(OpalTransport &t)=0
SIPHandler::m_byAuthIdAndRealm
std::pair< IndexMap::iterator, bool > m_byAuthIdAndRealm
Definition: handlers.h:177
SIPHandler::m_password
PString m_password
Definition: handlers.h:152
SIPHandler::m_method
SIP_PDU::Methods m_method
Definition: handlers.h:158
SIPDialogNotification::RenderingMedia
Definition: handlers.h:535
SIPDialogNotification::Participant::m_rendering
Rendering m_rendering
Definition: handlers.h:553
SIPHandlersList::Update
void Update(SIPHandler *handler)
SIPHandler::WriteSIPHandler
static PBoolean WriteSIPHandler(OpalTransport &transport, void *info)
SIPHandler::IndexMap
std::map< PString, PSafePtr< SIPHandler > > IndexMap
Definition: handlers.h:174
SIPDialogNotification::Participant::m_identity
PString m_identity
Definition: handlers.h:549
SIPNotifyHandler::~SIPNotifyHandler
~SIPNotifyHandler()
SIPHandler::OnReceivedResponse
virtual void OnReceivedResponse(SIPTransaction &transaction, SIP_PDU &response)
SIP_PDU::StatusCodes
StatusCodes
Definition: sippdu.h:518
SIPRegisterHandler::GetContacts
const SIPURLList & GetContacts() const
Definition: handlers.h:207
SIPDialogNotification::Cancelled
Definition: handlers.h:516
SIP_PDU
Definition: sippdu.h:496
SIPNotifyHandler
Definition: handlers.h:257
SIPSubscribeHandler::m_dialog
SIPDialogContext m_dialog
Definition: handlers.h:249
SIPOptionsHandler::m_parameters
SIPOptions::Params m_parameters
Definition: handlers.h:350
SIPHandler::m_byAorUserAndRealm
std::pair< IndexMap::iterator, bool > m_byAorUserAndRealm
Definition: handlers.h:178
SIPRegisterHandler::SIPRegisterHandler
SIPRegisterHandler(SIPEndPoint &ep, const SIPRegister::Params &params)
SIPHandler::Compare
virtual Comparison Compare(const PObject &other) const
SIPHandler::m_state
State m_state
Definition: handlers.h:166
SIPNotifyHandler::Probation
Definition: handlers.h:280
SIPHandler::State
State
Definition: handlers.h:72
SIPHandlersList::Append
void Append(SIPHandler *handler)
SIPPresenceInfo::AsXML
PString AsXML() const
SIPNotifyHandler::SendRequest
virtual PBoolean SendRequest(SIPHandler::State state)
SIPRegisterHandler::UpdateParameters
void UpdateParameters(const SIPRegister::Params &params)
SIPSubscribeHandler::SendStatus
void SendStatus(SIP_PDU::StatusCodes code, State state)
SIPHandler::m_realm
PString m_realm
Definition: handlers.h:153
SIPDialogNotification::m_eventType
Events m_eventType
Definition: handlers.h:543
SIPSubscribeHandler::~SIPSubscribeHandler
~SIPSubscribeHandler()
SIPHandler::OnFailed
virtual void OnFailed(const SIP_PDU &response)
SIPNotifyHandler::GetEventPackage
virtual SIPEventPackage GetEventPackage() const
Definition: handlers.h:270
SIPDialogNotification::Early
Definition: handlers.h:503
SIPHandlersList::DeleteObjectsToBeRemoved
bool DeleteObjectsToBeRemoved()
Definition: handlers.h:385
SIPDialogNotification::Participant::m_byeless
bool m_byeless
Definition: handlers.h:552
SIPHandler::GetExpire
virtual int GetExpire()
Definition: handlers.h:100
SIPEventPackage
SIPSubscribe::EventPackage SIPEventPackage
Definition: sippdu.h:1212
SIPHandlersList::FindBy
PSafePtr< SIPHandler > FindBy(IndexMap &by, const PString &key, PSafetyMode m)
SIPHandler::GetTransport
virtual OpalTransport * GetTransport()
SIPDialogNotification::States
States
Definition: handlers.h:499
SIPOptionsHandler::CreateTransaction
virtual SIPTransaction * CreateTransaction(OpalTransport &)
SIPHandler::OnReceivedNOTIFY
virtual PBoolean OnReceivedNOTIFY(SIP_PDU &response)
SIPHandlersList::m_byAuthIdAndRealm
IndexMap m_byAuthIdAndRealm
Definition: handlers.h:447
SIPDialogNotification::Participant::m_appearance
int m_appearance
Definition: handlers.h:551
SIPDialogNotification::operator--
friend States operator--(States &state)
Definition: handlers.h:510
SIPHandlersList::m_handlersList
PSafeList< SIPHandler > m_handlersList
Definition: handlers.h:440
SIPDialogNotification::LastEvent
Definition: handlers.h:525
SIPHandler::m_byCallID
std::pair< IndexMap::iterator, bool > m_byCallID
Definition: handlers.h:175
SIPHandler::m_currentExpireTime
int m_currentExpireTime
Definition: handlers.h:163
SIPDialogNotification::m_dialogId
PString m_dialogId
Definition: handlers.h:539
SIPHandlersList
Definition: handlers.h:366
SIPDialogNotification::m_remote
struct SIPDialogNotification::Participant m_remote
SIPHandler::PDECLARE_NOTIFIER
PDECLARE_NOTIFIER(PTimer, SIPHandler, OnExpireTimeout)
SIPDialogNotification::RenderingUnknown
Definition: handlers.h:533
SIPHandler::Restoring
Definition: handlers.h:77
SIPDialogNotification::Timeout
Definition: handlers.h:522
SIPDialogNotification::FirstEvent
Definition: handlers.h:524
SIPHandler::m_authenticateErrors
unsigned m_authenticateErrors
Definition: handlers.h:150
SIPOptions::Params
Definition: sippdu.h:1358
SIPPresenceInfo::SIPPresenceInfo
SIPPresenceInfo(State state=Unchanged)
SIPMessageHandler::OnReceivedOK
virtual void OnReceivedOK(SIPTransaction &transaction, SIP_PDU &response)
SIPDialogNotification::RemoteBye
Definition: handlers.h:520
SIPDialogNotification::m_entity
PString m_entity
Definition: handlers.h:538
SIPHandler::Unsubscribed
Definition: handlers.h:79
SIPHandler::OnReceivedIntervalTooBrief
virtual void OnReceivedIntervalTooBrief(SIPTransaction &transaction, SIP_PDU &response)
SIPNotifyHandler::m_dialog
SIPDialogContext m_dialog
Definition: handlers.h:292
SIPDialogNotification::LocalBye
Definition: handlers.h:519
SIPHandlersList::FindSIPHandlerByAuthRealm
PSafePtr< SIPHandler > FindSIPHandlerByAuthRealm(const PString &authRealm, PSafetyMode m)
SIPNotifyHandler::WriteSIPHandler
virtual bool WriteSIPHandler(OpalTransport &transport, bool forked)
SIPMessageHandler::m_parameters
SIPMessage::Params m_parameters
Definition: handlers.h:334
SIPPublishHandler::SIPPublishHandler
SIPPublishHandler(SIPEndPoint &ep, const SIPSubscribe::Params &params, const PString &body)
SIPHandler
Definition: handlers.h:54
SIPHandler::NumStates
Definition: handlers.h:80
SIPRegisterHandler::OnReceivedOK
virtual void OnReceivedOK(SIPTransaction &transaction, SIP_PDU &response)
SIPDialogNotification::NotRenderingMedia
Definition: handlers.h:534
SIPHandlersList::m_extraMutex
PMutex m_extraMutex
Definition: handlers.h:439
SIPParameters
Definition: sippdu.h:806
SIPHandler::GetPassword
const PString & GetPassword() const
Definition: handlers.h:133
SIPHandlersList::FindSIPHandlerByCallID
PSafePtr< SIPHandler > FindSIPHandlerByCallID(const PString &callID, PSafetyMode m)
SIPDialogNotification::PCLASSINFO
PCLASSINFO(SIPDialogNotification, PObject)
SIPDialogNotification::Trying
Definition: handlers.h:501
SIPHandler::Unsubscribing
Definition: handlers.h:78
SIPRegisterHandler::m_serviceRoute
SIPURLList m_serviceRoute
Definition: handlers.h:217
SIPOptionsHandler::OnFailed
virtual void OnFailed(SIP_PDU::StatusCodes)
SIPDialogNotification::PrintOn
void PrintOn(ostream &strm) const
SIPDialogNotification::GetStateName
PString GetStateName() const
Definition: handlers.h:512
SIPDialogContext
Definition: sippdu.h:734
SIPNotifyHandler::NoResource
Definition: handlers.h:284
SIPAuthentication
PHTTPClientAuthentication SIPAuthentication
Definition: sippdu.h:471
SIPHandlersList::m_byCallID
IndexMap m_byCallID
Definition: handlers.h:445
SIPHandler::m_remoteAddress
SIPURL m_remoteAddress
Definition: handlers.h:160
SIPHandler::Refreshing
Definition: handlers.h:76
OpalPresenceInfo::State
State
Presence states.
Definition: pres_ent.h:60
SIPEventPackageHandler
Definition: sippdu.h:1219
SIPSubscribeHandler::OnReceivedOK
virtual void OnReceivedOK(SIPTransaction &transaction, SIP_PDU &response)
SIPHandler::OnReceivedAuthenticationRequired
virtual void OnReceivedAuthenticationRequired(SIPTransaction &transaction, SIP_PDU &response)
SIPNotifyHandler::SetBody
virtual void SetBody(const PString &body)
Definition: handlers.h:273
SIPHandler::Unavailable
Definition: handlers.h:75
SIPHandler::m_productInfo
OpalProductInfo m_productInfo
Definition: handlers.h:171
SIPHandler::GetEndPoint
SIPEndPoint & GetEndPoint() const
Definition: handlers.h:128
SIPSubscribeHandler::m_unconfirmed
bool m_unconfirmed
Definition: handlers.h:250
SIPHandler::SIPHandler
SIPHandler(SIP_PDU::Methods method, SIPEndPoint &ep, const SIPParameters &params)
SIPDialogNotification::Replaced
Definition: handlers.h:518
operator<<
ostream & operator<<(ostream &strm, OpalSilenceDetector::Mode mode)
SIPHandler::Subscribed
Definition: handlers.h:73
SIPNotifyHandler::Rejected
Definition: handlers.h:281
SIPHandler::endpoint
SIPEndPoint & endpoint
Definition: handlers.h:147
SIPDialogNotification::operator--
friend Events operator--(Events &evt)
Definition: handlers.h:528
SIPNotifyHandler::m_packageHandler
SIPEventPackageHandler * m_packageHandler
Definition: handlers.h:294
SIPHandler::RetryLater
void RetryLater(unsigned after)
SIPDialogNotification::Rejected
Definition: handlers.h:517
SIPNotifyHandler::Reasons
Reasons
Definition: handlers.h:278
SIPPublishHandler::CreateTransaction
virtual SIPTransaction * CreateTransaction(OpalTransport &)
SIPMessageHandler::CreateTransaction
virtual SIPTransaction * CreateTransaction(OpalTransport &)
SIPNotifyHandler::SendNotify
virtual bool SendNotify(const PObject *body)
SIPHandler::m_offlineExpireTime
int m_offlineExpireTime
Definition: handlers.h:165
SIPRegisterHandler::m_sequenceNumber
unsigned m_sequenceNumber
Definition: handlers.h:215
SIPRegisterHandler::m_externalAddress
OpalTransportAddress m_externalAddress
Definition: handlers.h:218
SIPHandler::m_transactions
PSafeList< SIPTransaction > m_transactions
Definition: handlers.h:155
SIPSubscribeHandler::UpdateParameters
void UpdateParameters(const SIPSubscribe::Params &params)
SIPHandler::GetProxy
const SIPURL & GetProxy() const
Definition: handlers.h:136
SIPDialogNotification::m_local
struct SIPDialogNotification::Participant m_local
SIPRegisterHandler::GetServiceRoute
const SIPURLList & GetServiceRoute() const
Definition: handlers.h:208
SIPPublishHandler
Definition: handlers.h:299
SIPPresenceInfo::m_activities
PStringArray m_activities
Definition: handlers.h:466
SIPHandlersList::FindSIPHandlerByUrl
PSafePtr< SIPHandler > FindSIPHandlerByUrl(const PURL &url, SIP_PDU::Methods meth, PSafetyMode m)
SIPHandler::SendNotify
virtual bool SendNotify(const PObject *)
Definition: handlers.h:126
SIPHandler::SetState
void SetState(SIPHandler::State s)
SIPHandler::GetCallID
virtual const PString & GetCallID() const
Definition: handlers.h:103
SIPSubscribeHandler
Definition: handlers.h:222
SIPHandler::OnReceivedTemporarilyUnavailable
virtual void OnReceivedTemporarilyUnavailable(SIPTransaction &transaction, SIP_PDU &response)
sippdu.h
SIPRegister::Params
Registrar parameters.
Definition: sippdu.h:1059
SIPPingHandler
Definition: handlers.h:354
SIPHandler::m_proxy
SIPURL m_proxy
Definition: handlers.h:170
SIPPresenceInfo::m_tupleId
PString m_tupleId
Definition: handlers.h:462
SIPHandler::m_originalExpireTime
int m_originalExpireTime
Definition: handlers.h:164
SIPHandler::GetProductInfo
const OpalProductInfo & GetProductInfo() const
Definition: handlers.h:130
SIPMessageHandler::SIPMessageHandler
SIPMessageHandler(SIPEndPoint &ep, const SIPMessage::Params &params)
SIPSubscribeHandler::m_packageHandler
SIPEventPackageHandler * m_packageHandler
Definition: handlers.h:251
SIPDialogNotification::Participant::Participant
Participant()
Definition: handlers.h:546
SIPURLList
Definition: sippdu.h:228
SIPRegisterHandler::GetParams
const SIPRegister::Params & GetParams() const
Definition: handlers.h:205
SIPHandler::GetRemoteAddress
const SIPURL & GetRemoteAddress() const
Definition: handlers.h:135
SIPNotifyHandler::CreateTransaction
virtual SIPTransaction * CreateTransaction(OpalTransport &)
SIPPublishHandler::m_parameters
SIPSubscribe::Params m_parameters
Definition: handlers.h:315
SIPHandler::m_transport
OpalTransport * m_transport
Definition: handlers.h:156
SIPSubscribeHandler::m_parameters
SIPSubscribe::Params m_parameters
Definition: handlers.h:248
SIPRegisterHandler::CreateTransaction
virtual SIPTransaction * CreateTransaction(OpalTransport &)
SIP_PDU::Methods
Methods
Definition: sippdu.h:500
SIPSubscribeHandler::IsDuplicateCSeq
virtual bool IsDuplicateCSeq(unsigned sequenceNumber)
Definition: handlers.h:238
SIPDialogNotification::m_callId
PString m_callId
Definition: handlers.h:540
SIPHandler::m_mime
SIPMIMEInfo m_mime
Definition: handlers.h:138
SIPHandler::m_byAorAndPackage
std::pair< IndexMap::iterator, bool > m_byAorAndPackage
Definition: handlers.h:176
SIPNotifyHandler::m_reason
Reasons m_reason
Definition: handlers.h:293
SIPRegisterHandler
Definition: handlers.h:188
SIPHandler::~SIPHandler
~SIPHandler()
SIPNotifyHandler::SIPNotifyHandler
SIPNotifyHandler(SIPEndPoint &ep, const PString &targetAddress, const SIPEventPackage &eventPackage, const SIPDialogContext &dialog)
SIPDialogNotification::LastState
Definition: handlers.h:507
SIPHandler::GetMethod
SIP_PDU::Methods GetMethod() const
Definition: handlers.h:112
SIPHandler::SetExpire
virtual void SetExpire(int e)
SIPPresenceInfo::FromSIPActivityString
static State FromSIPActivityString(const PString &str)
SIPDialogNotification::Proceeding
Definition: handlers.h:502
SIPHandlersList::m_byAorAndPackage
IndexMap m_byAorAndPackage
Definition: handlers.h:446
SIPNotifyHandler::Timeout
Definition: handlers.h:282
SIPSubscribeHandler::DispatchNOTIFY
bool DispatchNOTIFY(SIP_PDU &request, SIP_PDU &response)
SIPDialogNotification::Error
Definition: handlers.h:521
SIPPingHandler::SIPPingHandler
SIPPingHandler(SIPEndPoint &ep, const PURL &to)
SIPDialogNotification::Participant::m_URI
PString m_URI
Definition: handlers.h:547
OpalTransportAddress
Definition: transports.h:149
SIPRegisterHandler::SendRequest
virtual PBoolean SendRequest(SIPHandler::State state)
SIPSubscribe::Params::m_eventPackage
EventPackage m_eventPackage
Definition: sippdu.h:1188
SIPDialogContext::IsDuplicateCSeq
bool IsDuplicateCSeq(unsigned sequenceNumber)
OpalPresenceInfo
Definition: pres_ent.h:56
SIPDialogNotification::NoEvent
Definition: handlers.h:515
SIPPresenceInfo
Definition: handlers.h:454
SIPHandlersList::GetAddresses
PStringList GetAddresses(bool includeOffline, SIP_PDU::Methods meth, const PString &eventPackage=PString::Empty()) const
SIPHandler::GetUsername
const PString & GetUsername() const
Definition: handlers.h:132
SIPHandler::m_authentication
SIPAuthentication * m_authentication
Definition: handlers.h:149
SIPMessageHandler::OnFailed
virtual void OnFailed(SIP_PDU::StatusCodes)
SIPDialogNotification::operator++
friend Events operator++(Events &evt)
Definition: handlers.h:527
SIPPresenceInfo::AsSIPActivityString
static bool AsSIPActivityString(State state, PString &str)
SIPSubscribeHandler::OnReceivedNOTIFY
virtual PBoolean OnReceivedNOTIFY(SIP_PDU &response)
SIPRegisterHandler::m_contactAddresses
SIPURLList m_contactAddresses
Definition: handlers.h:216
SIPMessageHandler::UpdateParameters
void UpdateParameters(const SIPMessage::Params &params)
SIPDialogNotification::Confirmed
Definition: handlers.h:504
SIPPresenceInfo::operator<<
friend ostream & operator<<(ostream &strm, const SIPPresenceInfo &info)
Definition: handlers.h:482
SIPHandler::ShutDown
virtual bool ShutDown()
SIPPublishHandler::OnReceivedOK
virtual void OnReceivedOK(SIPTransaction &transaction, SIP_PDU &response)
SIPSubscribeHandler::SendRequest
virtual PBoolean SendRequest(SIPHandler::State state)
SIPHandler::ActivateState
bool ActivateState(SIPHandler::State state)
SIPPresenceInfo::m_contact
PString m_contact
Definition: handlers.h:463
SIPSubscribeHandler::m_previousResponse
SIP_PDU * m_previousResponse
Definition: handlers.h:253
OpalProductInfo
Definition: connection.h:312
SIPHandler::m_expireTimer
PTimer m_expireTimer
Definition: handlers.h:169
SIPSubscribeHandler::CreateTransaction
virtual SIPTransaction * CreateTransaction(OpalTransport &)
SIPPublishHandler::m_body
PString m_body
Definition: handlers.h:316
SIPDialogNotification::Participant::m_dialogTag
PString m_dialogTag
Definition: handlers.h:548
SIPHandler::GetState
SIPHandler::State GetState()
Definition: handlers.h:85
SIPSubscribeHandler::GetEventPackage
virtual SIPEventPackage GetEventPackage() const
Definition: handlers.h:233
SIPHandlersList::GetFirstHandler
PSafePtr< SIPHandler > GetFirstHandler(PSafetyMode mode=PSafeReference) const
Definition: handlers.h:391
SIPSubscribeHandler::WriteSIPHandler
virtual bool WriteSIPHandler(OpalTransport &transport, bool forked)
SIPHandlersList::Remove
void Remove(SIPHandler *handler)
SIPHandlersList::IndexMap
SIPHandler::IndexMap IndexMap
Definition: handlers.h:442
SIPHandler::OnReceivedOK
virtual void OnReceivedOK(SIPTransaction &transaction, SIP_PDU &response)
SIPOptionsHandler::SIPOptionsHandler
SIPOptionsHandler(SIPEndPoint &ep, const SIPOptions::Params &params)
SIPNotifyHandler::GiveUp
Definition: handlers.h:283
SIPOptionsHandler::OnReceivedOK
virtual void OnReceivedOK(SIPTransaction &transaction, SIP_PDU &response)
SIPDialogNotification::m_state
States m_state
Definition: handlers.h:542
SIPPresenceInfo::m_presenceAgent
PString m_presenceAgent
Definition: handlers.h:469
SIPHandler::m_receivedResponse
bool m_receivedResponse
Definition: handlers.h:168
SIPNotifyHandler::m_eventPackage
SIPEventPackage m_eventPackage
Definition: handlers.h:291
SIPDialogNotification::Events
Events
Definition: handlers.h:514