OPAL  Version 3.18.8
OpalSIPIMContext Class Reference

#include <sipim.h>

Inheritance diagram for OpalSIPIMContext:
Collaboration diagram for OpalSIPIMContext:

Public Member Functions

 OpalSIPIMContext ()
 
virtual bool Open (bool byRemote)
 
virtual bool SendCompositionIndication (const CompositionInfo &info)
 
- Public Member Functions inherited from OpalIMContext
const PString & GetID () const
 Get conversation ID. More...
 
const PString & GetKey () const
 Get key for context based on to/from addresses. More...
 
const PURL & GetRemoteURL () const
 Get remote URL for conversation. More...
 
const PString & GetRemoteName () const
 Get remote display name for conversation. More...
 
const PURL & GetLocalURL () const
 Get local URL for conversation. More...
 
const PString & GetLocalName () const
 Get local display for conversation. More...
 
void SetLocalName (const PString &name)
 Set local display for conversation. More...
 
PStringOptions & GetAttributes ()
 Get the attributes for this presentity. More...
 
const PStringOptions & GetAttributes () const
 
 ~OpalIMContext ()
 Destroy context. More...
 
virtual void Close ()
 
 P_DECLARE_STREAMABLE_ENUM (MessageDisposition, DispositionPending, DispositionAccepted, DeliveryOK, DisplayConfirmed, ProcessedNotification, StorageNotification, DispositionErrors, GenericError, UnacceptableContent, InvalidContent, DestinationUnknown, DestinationUnavailable, TransmissionTimeout, TransportFailure, ConversationClosed, UnsupportedFeature, DeliveryFailed)
 
virtual MessageDisposition Send (OpalIM *message)
 
virtual void OnMessageDisposition (const DispositionInfo &info)
 
void SetMessageDispositionNotifier (const MessageDispositionNotifier &notifier)
 Set the notifier for the OnMessageDisposition() function. More...
 
void SetMessageReceivedNotifier (const MessageReceivedNotifier &notifier)
 Set the notifier for the OnMessageReceived() function. More...
 
virtual void OnCompositionIndication (const CompositionInfo &info)
 
void SetCompositionIndicationNotifier (const CompositionIndicationNotifier &notifier)
 Set the notifier for the OnCompositionIndication() function. More...
 
virtual bool CheckContentType (const PString &contentType) const
 Check that the context type is valid for protocol. More...
 
virtual PStringArray GetContentTypes () const
 Return array of all valid content types. More...
 

Static Public Member Functions

static void OnMESSAGECompleted (SIPEndPoint &endpoint, const SIPMessage::Params &params, SIP_PDU::StatusCodes reason)
 
static void OnReceivedMESSAGE (SIPEndPoint &endpoint, SIPConnection *connection, SIP_PDU &pdu)
 
- Static Public Member Functions inherited from OpalIMContext
static const PCaselessString & CompositionIndicationActive ()
 CompositionIndication active status. More...
 
static const PCaselessString & CompositionIndicationIdle ()
 CompositionIndication idle status. More...
 
static PString CreateKey (const PURL &from, const PURL &to)
 Calculate a key based on the from an to addresses. More...
 

Protected Member Functions

virtual MessageDisposition InternalSendOutsideCall (OpalIM &message)
 
virtual MessageDisposition InternalSendInsideCall (OpalIM &message)
 
virtual MessageDisposition OnMessageReceived (const OpalIM &message)
 
virtual MessageDisposition InternalOnCompositionIndication (const OpalIM &message)
 
virtual MessageDisposition InternalOnDisposition (const OpalIM &message)
 
void PopulateParams (SIPMessage::Params &params, const OpalIM &message)
 
 PDECLARE_NOTIFIER (PTimer, OpalSIPIMContext, OnRxCompositionIdleTimer)
 
 PDECLARE_NOTIFIER (PTimer, OpalSIPIMContext, OnTxCompositionIdleTimer)
 
- Protected Member Functions inherited from OpalIMContext
void ResetLastUsed ()
 
virtual MessageDisposition InternalSend ()
 
virtual void InternalOnMessageSent (const DispositionInfo &info)
 
 PDECLARE_MUTEX (m_notificationMutex)
 
 PDECLARE_MUTEX (m_outgoingMessagesMutex)
 
 PDECLARE_MUTEX (m_lastUsedMutex)
 
 OpalIMContext ()
 Construct base for context. More...
 

Protected Attributes

PString m_rxCompositionState
 
PTimer m_rxCompositionIdleTimeout
 
PString m_txCompositionState
 
PTimer m_txCompositionIdleTimeout
 
PSimpleTimer m_txCompositionRefreshTimeout
 
PTime m_lastActive
 
- Protected Attributes inherited from OpalIMContext
OpalIMEndPointm_endpoint
 
PStringOptions m_attributes
 
PSafePtr< OpalCallm_call
 
bool m_weStartedCall
 
MessageDispositionNotifier m_messageDispositionNotifier
 
MessageReceivedNotifier m_messageReceivedNotifier
 
CompositionIndicationNotifier m_compositionIndicationNotifier
 
OpalIMm_currentOutgoingMessage
 
PQueue< OpalIMm_outgoingMessages
 
PTime m_lastUsed
 
PString m_conversationId
 
PURL m_localURL
 
PString m_localName
 
PURL m_remoteURL
 
PString m_remoteName
 
PString m_key
 

Detailed Description

Class representing a SIP Instant Messaging "conversation". This keeps the context for Instant Messages between two SIP entities. As there are, at least, three (and a half) different mechanisms for doing IM between two SIP endpoints these are chose via capabilities selected before calling OpalIMContext::Create()

SIP-IM Indicates RFC 3428 compliant messaging, using the SIP MESSAGE command. This may be done in call or out of call, the latter is the default. The in call mode is used if OpalIMEndPoint::Create() is given an existing SIPConnection in which to exchange messages. T.140 Indicates RFC 4103 compliant messaging, which is T.140 compliant text sent via RTP. This always requires an active connection, so one will be created if needed. MSRP Indicates RFC 4975 compliant messaging.

The selection on the method that is used is dependent on the applications active media formats.

Constructor & Destructor Documentation

OpalSIPIMContext::OpalSIPIMContext ( )

Member Function Documentation

virtual MessageDisposition OpalSIPIMContext::InternalOnCompositionIndication ( const OpalIM message)
protectedvirtual
virtual MessageDisposition OpalSIPIMContext::InternalOnDisposition ( const OpalIM message)
protectedvirtual
virtual MessageDisposition OpalSIPIMContext::InternalSendInsideCall ( OpalIM message)
protectedvirtual

Reimplemented from OpalIMContext.

virtual MessageDisposition OpalSIPIMContext::InternalSendOutsideCall ( OpalIM message)
protectedvirtual

Reimplemented from OpalIMContext.

static void OpalSIPIMContext::OnMESSAGECompleted ( SIPEndPoint endpoint,
const SIPMessage::Params params,
SIP_PDU::StatusCodes  reason 
)
static
virtual MessageDisposition OpalSIPIMContext::OnMessageReceived ( const OpalIM message)
protectedvirtual

Called when an incoming message arrives for this context. Default implementation checks for valid MIME content and then calls the notifier, if set. If no notifier is set, then the OpalManager::OnMessageReceived() function is called.

Reimplemented from OpalIMContext.

static void OpalSIPIMContext::OnReceivedMESSAGE ( SIPEndPoint endpoint,
SIPConnection connection,
SIP_PDU pdu 
)
static
virtual bool OpalSIPIMContext::Open ( bool  byRemote)
virtual

Open the context (conversation) Default behaviour simply returns true.

Reimplemented from OpalIMContext.

OpalSIPIMContext::PDECLARE_NOTIFIER ( PTimer  ,
OpalSIPIMContext  ,
OnRxCompositionIdleTimer   
)
protected
OpalSIPIMContext::PDECLARE_NOTIFIER ( PTimer  ,
OpalSIPIMContext  ,
OnTxCompositionIdleTimer   
)
protected
void OpalSIPIMContext::PopulateParams ( SIPMessage::Params params,
const OpalIM message 
)
protected
virtual bool OpalSIPIMContext::SendCompositionIndication ( const CompositionInfo info)
virtual

Send a composition indication to remote. The text is usually either CompositionIndicationActive() or CompositionIndicationIdle(), howver other extension values may be possible.

Reimplemented from OpalIMContext.

Field Documentation

PTime OpalSIPIMContext::m_lastActive
protected
PTimer OpalSIPIMContext::m_rxCompositionIdleTimeout
protected
PString OpalSIPIMContext::m_rxCompositionState
protected
PTimer OpalSIPIMContext::m_txCompositionIdleTimeout
protected
PSimpleTimer OpalSIPIMContext::m_txCompositionRefreshTimeout
protected
PString OpalSIPIMContext::m_txCompositionState
protected

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