OPAL  Version 3.18.8
SIPConnection Class Reference

#include <sipcon.h>

Inheritance diagram for SIPConnection:
Collaboration diagram for SIPConnection:

Data Structures

struct  Init
 

Public Types

enum  PRACKMode { e_prackDisabled, e_prackSupported, e_prackRequired }
 Mode for reliable provisional responses. More...
 

Public Member Functions

OpalTransportAddress GetDefaultSDPConnectAddress (WORD port=0) const
 
SIPEndPointGetEndPoint () const
 
SIPAuthenticationGetAuthenticator () const
 
PRACKMode GetPRACKMode () const
 
virtual unsigned GetAllowedMethods () const
 
bool DoesRemoteAllowMethod (SIP_PDU::Methods method) const
 
virtual PBoolean OnMediaControlXML (SIP_PDU &pdu)
 
virtual bool OnMediaCommand (OpalMediaStream &stream, const OpalMediaCommand &command)
 
virtual PString GetAuthID () const
 
virtual void OnStartTransaction (SIPTransaction &transaction)
 
virtual void OnReceivedMESSAGE (SIP_PDU &pdu)
 
virtual void OnReceivedSUBSCRIBE (SIP_PDU &pdu)
 
virtual PString GetMediaInterface ()
 
virtual OpalTransportAddress GetRemoteMediaAddress ()
 
Construction
 SIPConnection (const Init &init)
 
 ~SIPConnection ()
 
Overrides from OpalConnection
virtual PString GetPrefixName () const
 
virtual PString GetIdentifier () const
 
virtual void OnApplyStringOptions ()
 Call back for connection to act on changed string options. More...
 
virtual PBoolean SetUpConnection ()
 
virtual OpalTransportAddress GetRemoteAddress () const
 
virtual PString GetRemoteIdentity () const
 
virtual PString GetDestinationAddress ()
 
virtual PString GetCalledPartyURL ()
 
virtual PMultiPartList GetExtraCallInfo () const
 
virtual PString GetLocalPartyURL () const
 
virtual PString GetAlertingType () const
 
virtual bool SetAlertingType (const PString &info)
 
virtual PString GetCallInfo () const
 
virtual PString GetSupportedFeatures () const
 
virtual bool TransferConnection (const PString &remoteParty)
 
virtual PBoolean SetAlerting (const PString &calleeName, PBoolean withMedia)
 
virtual PBoolean SetConnected ()
 
virtual OpalMediaFormatList GetMediaFormats () const
 
virtual bool RequireSymmetricMediaStreams () const
 
virtual
OpalMediaCryptoSuite::KeyExchangeModes 
GetMediaCryptoKeyExchangeModes () const
 
virtual OpalMediaStreamCreateMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, PBoolean isSource)
 
virtual OpalMediaStreamPtr OpenMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource)
 
virtual void OnClosedMediaStream (const OpalMediaStream &stream)
 
virtual bool GetMediaTransportAddresses (OpalConnection &otherConnection, unsigned sessionId, const OpalMediaType &mediaType, OpalTransportAddressArray &transports) const
 
virtual void OnPatchMediaStream (PBoolean isSource, OpalMediaPatch &patch)
 
virtual void OnPauseMediaStream (OpalMediaStream &strm, bool paused)
 
virtual void OnReleased ()
 
virtual PBoolean ForwardCall (const PString &forwardParty)
 
virtual SendUserInputModes GetRealSendUserInputMode () const
 
virtual PBoolean SendUserInputString (const PString &value)
 
PBoolean SendUserInputTone (char tone, unsigned duration)
 
- Public Member Functions inherited from SIPTransactionOwner
 SIPTransactionOwner (PSafeObject &object, SIPEndPoint &endpoint)
 
virtual ~SIPTransactionOwner ()
 
virtual PString GetPassword () const
 
void FinaliseForking (SIPTransaction &transaction, SIP_PDU &response)
 
bool CleanPendingTransactions ()
 
void AbortPendingTransactions (bool all=true)
 
virtual SIP_PDU::StatusCodes StartTransaction (const OpalTransport::WriteConnectCallback &function)
 
SIP_PDU::StatusCodes SwitchTransportProto (const char *proto, SIP_PDU *pdu)
 
SIP_PDU::StatusCodes HandleAuthentication (const SIP_PDU &response)
 
SIPEndPointGetEndPoint () const
 
OpalTransportAddress GetRemoteTransportAddress () const
 
const SIPURLGetRequestURI () const
 
const SIPURLGetRemoteURI () const
 
const SIPURLGetProxy () const
 
const PString & GetInterface () const
 
PINDEX GetDNSEntry () const
 
SIPAuthenticationGetAuthenticator () const
 
SIPDialogContextGetDialog ()
 
const SIPDialogContextGetDialog () const
 

Protected Types

enum  { ReleaseWithBYE, ReleaseWithCANCEL, ReleaseWithResponse, ReleaseWithNothing }
 
enum  { eNoRemoteRefer, eReferStarted, eReferNotifyConfirmed }
 
enum  { UserInputMethodUnknown, ReceivedRFC2833, ReceivedINFO }
 
typedef SIPPoolTimer
< SIPConnection
PoolTimer
 

Protected Member Functions

virtual bool GarbageCollection ()
 
void OnSessionTimeout ()
 
void OnInviteResponseRetry ()
 
void OnInviteResponseTimeout ()
 
void OnInviteCollision ()
 
void OnDelayedRefer ()
 
virtual bool AllowMusicOnHold () const
 
virtual bool OnHoldStateChanged (bool placeOnHold)
 
virtual void OnMediaStreamOpenFailed (bool rx)
 
void OnReceivedAlertingResponse (SIPTransaction &transaction, SIP_PDU &response)
 
bool InternalSetConnected (bool transfer)
 
virtual bool OnSendAnswer (SIP_PDU::StatusCodes response, bool transfer)
 
virtual bool OnReceivedAnswer (SIP_PDU &response, SIPTransaction *transaction)
 
bool SendReINVITE (PTRACE_PARAM(const char *msg,) int operation=0)
 
bool StartPendingReINVITE ()
 
 PDECLARE_WriteConnectCallback (SIPConnection, WriteINVITE)
 
virtual bool SendDelayedACK (bool force)
 
void OnDelayedAckTimeout ()
 
virtual PBoolean SendInviteResponse (SIP_PDU::StatusCodes code, const SDPSessionDescription *sdp=NULL)
 
virtual void AdjustInviteResponse (SIP_PDU &response)
 
void UpdateRemoteAddresses ()
 
void NotifyDialogState (SIPDialogNotification::States state, SIPDialogNotification::Events eventType=SIPDialogNotification::NoEvent, unsigned eventCode=0)
 
virtual bool InviteConferenceParticipant (const PString &conf, const PString &dest)
 
PSafePtr< SIPConnectionGetB2BUA ()
 
bool ConsultationTransfer (SIPConnection &referee, SIPRefer::ReferSubMode referSubMode, bool useIdentity)
 
int SetRemoteMediaFormatsFromPDU (SIP_PDU &pdu)
 
void OnUserInputInlineRFC2833 (OpalRFC2833Info &info, OpalRFC2833Proto::NotifyState state)
 
- Protected Member Functions inherited from SIPTransactionOwner
 PDECLARE_MUTEX (m_forkMutex)
 

Protected Attributes

unsigned m_allowedMethods
 
PStringSet m_allowedEvents
 
PString m_forwardParty
 
OpalTransportAddress m_remoteAddress
 
SIPURL m_assertedIdentity
 
SIPURL m_remoteIdentity
 
SIPURL m_contactAddress
 
SIPURL m_ciscoRemotePartyID
 
PMultiPartList m_multiPartMIME
 
SIP_PDUm_lastReceivedINVITE
 
SIP_PDUm_delayedAckInviteResponse
 
PoolTimer m_delayedAckTimer
 
PTimeInterval m_delayedAckTimeout1
 
PTimeInterval m_delayedAckTimeout2
 
SIP_PDUm_delayedAckPDU
 
bool m_needReINVITE
 
bool m_handlingINVITE
 
bool m_resolveMultipleFormatReINVITE
 
bool m_symmetricOpenStream
 
OpalGloballyUniqueID m_dialogNotifyId
 
int m_appearanceCode
 
PString m_alertInfo
 
bool m_canDoVideoFastUpdateINFO
 
PoolTimer m_sessionTimer
 
PRACKMode m_prackMode
 
bool m_prackEnabled
 
unsigned m_prackSequenceNumber
 
std::queue< SIP_PDUm_responsePackets
 
PoolTimer m_responseFailTimer
 
PoolTimer m_responseRetryTimer
 
unsigned m_responseRetryCount
 
PoolTimer m_inviteCollisionTimer
 
PoolTimer m_delayedReferTimer
 
SIPURL m_delayedReferTo
 
SIPURL m_sentReferTo
 
PSafeArray< SIPTransactionm_forkedInvitations
 
PSafeArray< SIPTransactionm_pendingInvitations
 
enum SIPConnection:: { ... }  m_releaseMethod
 
enum SIPConnection:: { ... }  m_referOfRemoteState
 
PString m_consultationTransferToken
 
std::map< std::string, SIP_PDU * > m_responses
 
PSafePtr< OpalSIPIMContextm_imContext
 
enum SIPConnection:: { ... }  m_receivedUserInputMethod
 
- Protected Attributes inherited from SIPTransactionOwner
PSafeObject & m_object
 
SIPEndPointm_sipEndpoint
 
SIPDialogContext m_dialog
 
PINDEX m_dnsEntry
 
SIPAuthenticationm_authentication
 
unsigned m_authenticateErrors
 
PSafeArray< SIPTransactionm_transactions
 

Friends

class SIPInvite
 
class SIPTransaction
 
class SIP_RTP_Session
 

Protocol handling functions

enum  TypeOfINVITE { IsNewINVITE, IsDuplicateINVITE, IsReINVITE, IsLoopedINVITE }
 
virtual void OnTransactionFailed (SIPTransaction &transaction)
 
virtual void OnReceivedPDU (SIP_PDU &pdu)
 
virtual void OnReceivedINVITE (SIP_PDU &pdu)
 
virtual void OnReceivedReINVITE (SIP_PDU &pdu)
 
virtual void OnReceivedACK (SIP_PDU &pdu)
 
virtual void OnReceivedOPTIONS (SIP_PDU &pdu)
 
virtual void OnReceivedNOTIFY (SIP_PDU &pdu)
 
virtual void OnAllowedEventNotify (const PString &eventName)
 
virtual void OnReceivedREFER (SIP_PDU &pdu)
 
virtual void OnReceivedINFO (SIP_PDU &pdu)
 
virtual void OnReceivedPING (SIP_PDU &pdu)
 
virtual void OnReceivedPRACK (SIP_PDU &pdu)
 
virtual void OnReceivedBYE (SIP_PDU &pdu)
 
virtual void OnReceivedCANCEL (SIP_PDU &pdu)
 
virtual bool OnReceivedResponseToINVITE (SIPTransaction &transaction, SIP_PDU &response)
 
virtual void OnReceivedResponse (SIPTransaction &transaction, SIP_PDU &response)
 
virtual void OnReceivedTrying (SIPTransaction &transaction, SIP_PDU &response)
 
virtual void OnReceivedRinging (SIPTransaction &transaction, SIP_PDU &pdu)
 
virtual void OnReceivedSessionProgress (SIPTransaction &transaction, SIP_PDU &pdu)
 
virtual PBoolean OnReceivedAuthenticationRequired (SIPTransaction &transaction, SIP_PDU &response)
 
virtual void OnReceivedRedirection (SIP_PDU &pdu)
 
virtual void OnReceivedOK (SIPTransaction &transaction, SIP_PDU &response)
 
virtual void OnCreatingINVITE (SIPInvite &pdu)
 
TypeOfINVITE CheckINVITE (const SIP_PDU &pdu) const
 Indicate if this is a duplicate or multi-path INVITE. More...
 
bool SendOPTIONS (const SIPOptions::Params &params, SIP_PDU *reply=NULL)
 
bool SendINFO (const SIPInfo::Params &params, SIP_PDU *reply=NULL)
 
virtual bool OnReceivedInfoPackage (const PString &package, const PMultiPartList &content)
 

Detailed Description

Session Initiation Protocol connection.

Member Typedef Documentation

Member Enumeration Documentation

anonymous enum
protected
Enumerator
ReleaseWithBYE 
ReleaseWithCANCEL 
ReleaseWithResponse 
ReleaseWithNothing 
anonymous enum
protected
Enumerator
eNoRemoteRefer 
eReferStarted 
eReferNotifyConfirmed 
anonymous enum
protected
Enumerator
UserInputMethodUnknown 
ReceivedRFC2833 
ReceivedINFO 

Mode for reliable provisional responses.

Enumerator
e_prackDisabled 

Do not use PRACK if remote asks for 100rel in Supported field, refuse call with 420 Bad Extension if 100rel is in Require header field.

e_prackSupported 
e_prackRequired 

Add 100rel to Supported header in outgoing INVITE. For incoming INVITE enable PRACK is either Supported or Require headers include 100rel. Add 100rel to Require header in outgoing INVITE. For incoming INVITE enable PRACK is either Supported or Require headers include 100rel, fail the call with a 421 Extension Required if missing.

Enumerator
IsNewINVITE 
IsDuplicateINVITE 
IsReINVITE 
IsLoopedINVITE 

Constructor & Destructor Documentation

SIPConnection::SIPConnection ( const Init init)

Create a new connection.

Parameters
initInitialisation parameters
SIPConnection::~SIPConnection ( )

Destroy connection.

Member Function Documentation

virtual void SIPConnection::AdjustInviteResponse ( SIP_PDU response)
protectedvirtual
virtual bool SIPConnection::AllowMusicOnHold ( ) const
protectedvirtual
TypeOfINVITE SIPConnection::CheckINVITE ( const SIP_PDU pdu) const

Indicate if this is a duplicate or multi-path INVITE.

bool SIPConnection::ConsultationTransfer ( SIPConnection referee,
SIPRefer::ReferSubMode  referSubMode,
bool  useIdentity 
)
protected
virtual OpalMediaStream* SIPConnection::CreateMediaStream ( const OpalMediaFormat mediaFormat,
unsigned  sessionID,
PBoolean  isSource 
)
virtual

Create a new media stream.

Parameters
mediaFormatMedia format for stream
sessionIDSession number for stream
isSourceIs a source stream
bool SIPConnection::DoesRemoteAllowMethod ( SIP_PDU::Methods  method) const
inline

REturn true if remote allows the method.

References m_allowedMethods.

virtual PBoolean SIPConnection::ForwardCall ( const PString &  forwardParty)
virtual

Forward incoming connection to the specified address. This would typically be called from within the OnIncomingConnection() function when an application wishes to redirect an unwanted incoming call.

The return value is true if the call is to be forwarded, false otherwise. Note that if the call is forwarded, the current connection is cleared with the ended call code set to EndedByCallForwarded.

Parameters
forwardPartyParty to forward call to.
virtual bool SIPConnection::GarbageCollection ( )
protectedvirtual
virtual PString SIPConnection::GetAlertingType ( ) const
virtual

Get alerting type information of an incoming call. The type of "distinctive ringing" for the call. The string is protocol dependent, so the caller would need to be aware of the type of call being made. Some protocols may ignore the field completely.

For SIP this corresponds to the string contained in the "Alert-Info" header field of the INVITE. This is typically a URI for the ring file.

For H.323 this must be a string representation of an integer from 0 to 7 which will be contained in the Q.931 SIGNAL (0x34) Information Element.

Default behaviour returns an empty string.

virtual unsigned SIPConnection::GetAllowedMethods ( ) const
virtual

Return a bit mask of the allowed local SIP methods.

Reimplemented from SIPTransactionOwner.

SIPAuthentication* SIPConnection::GetAuthenticator ( ) const
inline
virtual PString SIPConnection::GetAuthID ( ) const
virtual

Implements SIPTransactionOwner.

PSafePtr<SIPConnection> SIPConnection::GetB2BUA ( )
protected
virtual PString SIPConnection::GetCalledPartyURL ( )
virtual

Get the fulll URL being indicated by the remote for incoming calls. This may not have any relation to the local name of the endpoint.

The default behaviour returns GetDestinationAddress() normalised to a URL. The remote may provide a full URL, if it does not then the prefix for the endpoint is prepended to the destination address.

virtual PString SIPConnection::GetCallInfo ( ) const
virtual

Get call information of an incoming call. This is protocol dependent information provided about the call. The details are outside the scope of this help.

For SIP this corresponds to the string contained in the "Call-Info" header field of the INVITE.

OpalTransportAddress SIPConnection::GetDefaultSDPConnectAddress ( WORD  port = 0) const
virtual PString SIPConnection::GetDestinationAddress ( )
virtual

Get the destination address of an incoming connection. This will, for example, collect a phone number from a POTS line, or get the fields from the H.225 SETUP pdu in a H.323 connection.

The default behaviour for sip returns the request URI in the INVITE.

SIPEndPoint& SIPConnection::GetEndPoint ( ) const
inline
virtual PMultiPartList SIPConnection::GetExtraCallInfo ( ) const
inlinevirtual

Get any extra call information.

References m_multiPartMIME.

virtual PString SIPConnection::GetIdentifier ( ) const
virtual

Get the protocol-specific unique identifier for this connection.

virtual PString SIPConnection::GetLocalPartyURL ( ) const
virtual

Get the local name/alias.

virtual OpalMediaCryptoSuite::KeyExchangeModes SIPConnection::GetMediaCryptoKeyExchangeModes ( ) const
virtual

Indicate security modes available in media negotiation.

virtual OpalMediaFormatList SIPConnection::GetMediaFormats ( ) const
virtual

Get the data formats this endpoint is capable of operating in.

virtual PString SIPConnection::GetMediaInterface ( )
virtual
virtual bool SIPConnection::GetMediaTransportAddresses ( OpalConnection otherConnection,
unsigned  sessionId,
const OpalMediaType mediaType,
OpalTransportAddressArray transports 
) const
virtual

Get transports for the media session on the connection. This is primarily used by the media bypass feature controlled by the OpalManager::GetMediaTransferMode() function. It allows one side of the call to get the transport address of the media on the other side, so it can pass it on, bypassing the local host.

Returns
true if a transport address is available and may be used to pass on to a remote system for direct access.
Parameters
otherConnectionOther half of call needing media transport addresses
sessionIdSession identifier
mediaTypeMedia type for session to return information
transportsInformation on media session
PRACKMode SIPConnection::GetPRACKMode ( ) const
inline

Get active PRACK mode. See PRACKMode enum for details.

References m_prackMode.

virtual PString SIPConnection::GetPrefixName ( ) const
virtual

Get this connections protocol prefix for URLs.

virtual SendUserInputModes SIPConnection::GetRealSendUserInputMode ( ) const
virtual

Get the real user input indication transmission mode. This will return the user input mode that will actually be used for transmissions. It will be the value of GetSendUserInputMode() provided the remote endpoint is capable of that mode.

virtual OpalTransportAddress SIPConnection::GetRemoteAddress ( ) const
inlinevirtual

Get the remote transport address

References m_remoteAddress.

virtual PString SIPConnection::GetRemoteIdentity ( ) const
virtual

Get the remote identity. Under some circumstances the "identity" of the remote party, may be different from the name, number or URL for that user. For example, this would be the P-Asserted-Identity field in SIP.

virtual OpalTransportAddress SIPConnection::GetRemoteMediaAddress ( )
virtual
virtual PString SIPConnection::GetSupportedFeatures ( ) const
virtual

Get supported features for an incoming call. A '
' separated list of protocol dependent names about the supported features of the remote endpoint. The details are outside the scope of this help.

For SIP this corresponds to the contents of the "Supported" header field of the INVITE.

bool SIPConnection::InternalSetConnected ( bool  transfer)
protected
virtual bool SIPConnection::InviteConferenceParticipant ( const PString &  conf,
const PString &  dest 
)
protectedvirtual
void SIPConnection::NotifyDialogState ( SIPDialogNotification::States  state,
SIPDialogNotification::Events  eventType = SIPDialogNotification::NoEvent,
unsigned  eventCode = 0 
)
protected
virtual void SIPConnection::OnAllowedEventNotify ( const PString &  eventName)
virtual

Callback function on receipt of an allowed NOTIFY message. Allowed events are determined by the m_allowedEvents member variable.

Parameters
eventNameName of event
virtual void SIPConnection::OnApplyStringOptions ( )
virtual

Call back for connection to act on changed string options.

virtual void SIPConnection::OnClosedMediaStream ( const OpalMediaStream stream)
virtual

Call back for closed a media stream.

The default behaviour calls the OpalEndPoint function of the same name.

Parameters
streamMedia stream being closed
virtual void SIPConnection::OnCreatingINVITE ( SIPInvite pdu)
virtual

Handle a sending INVITE request

void SIPConnection::OnDelayedAckTimeout ( )
protected
void SIPConnection::OnDelayedRefer ( )
protected
virtual bool SIPConnection::OnHoldStateChanged ( bool  placeOnHold)
protectedvirtual
void SIPConnection::OnInviteCollision ( )
protected
void SIPConnection::OnInviteResponseRetry ( )
protected
void SIPConnection::OnInviteResponseTimeout ( )
protected
virtual bool SIPConnection::OnMediaCommand ( OpalMediaStream stream,
const OpalMediaCommand command 
)
virtual

Callback for media commands. Calls the SendIntraFrameRequest on the rtp session

Returns
true if command is handled.
Parameters
streamStream command executed on
commandMedia command being executed
virtual PBoolean SIPConnection::OnMediaControlXML ( SIP_PDU pdu)
virtual

Call when SIP INFO of type application/media_control+xml is received.

Return false if default reponse of Failure_UnsupportedMediaType is to be returned

virtual void SIPConnection::OnMediaStreamOpenFailed ( bool  rx)
protectedvirtual
virtual void SIPConnection::OnPatchMediaStream ( PBoolean  isSource,
OpalMediaPatch patch 
)
virtual

Call back when patching a media stream. This function is called when a connection has created a new media patch between two streams. This is usually called twice per media patch, once for the source stream and once for the sink stream.

Note this is not called within the context of the patch thread and is called before that thread has started.

Parameters
isSourceIs source/sink call
patchNew patch
virtual void SIPConnection::OnPauseMediaStream ( OpalMediaStream strm,
bool  paused 
)
virtual

Pause media streams for connection.

Parameters
strmMedia stream paused/un-paused
pausedFlag for pausing/un-pausing
virtual void SIPConnection::OnReceivedACK ( SIP_PDU pdu)
virtual

Handle an incoming ACK PDU

void SIPConnection::OnReceivedAlertingResponse ( SIPTransaction transaction,
SIP_PDU response 
)
protected
virtual bool SIPConnection::OnReceivedAnswer ( SIP_PDU response,
SIPTransaction transaction 
)
protectedvirtual
virtual PBoolean SIPConnection::OnReceivedAuthenticationRequired ( SIPTransaction transaction,
SIP_PDU response 
)
virtual

Handle an incoming Proxy Authentication Required response PDU Returns: true if handled, if false is returned connection is released.

virtual void SIPConnection::OnReceivedBYE ( SIP_PDU pdu)
virtual

Handle an incoming BYE PDU

virtual void SIPConnection::OnReceivedCANCEL ( SIP_PDU pdu)
virtual

Handle an incoming CANCEL PDU

virtual void SIPConnection::OnReceivedINFO ( SIP_PDU pdu)
virtual

Handle an incoming INFO PDU

virtual bool SIPConnection::OnReceivedInfoPackage ( const PString &  package,
const PMultiPartList &  content 
)
virtual

Call back for received an INFO message with a package.

Parameters
packageInfo Package header value
contentContent data (PDU body)
virtual void SIPConnection::OnReceivedINVITE ( SIP_PDU pdu)
virtual

Handle an incoming INVITE request

virtual void SIPConnection::OnReceivedMESSAGE ( SIP_PDU pdu)
virtual
virtual void SIPConnection::OnReceivedNOTIFY ( SIP_PDU pdu)
virtual

Handle an incoming NOTIFY PDU

virtual void SIPConnection::OnReceivedOK ( SIPTransaction transaction,
SIP_PDU response 
)
virtual

Handle an incoming OK response PDU. This actually gets any PDU of the class 2xx not just 200.

virtual void SIPConnection::OnReceivedOPTIONS ( SIP_PDU pdu)
virtual

Handle an incoming OPTIONS PDU

virtual void SIPConnection::OnReceivedPDU ( SIP_PDU pdu)
virtual

Handle an incoming SIP PDU that has been full decoded

virtual void SIPConnection::OnReceivedPING ( SIP_PDU pdu)
virtual

Handle an incoming PING PDU

virtual void SIPConnection::OnReceivedPRACK ( SIP_PDU pdu)
virtual

Handle an incoming PRACK PDU

virtual void SIPConnection::OnReceivedRedirection ( SIP_PDU pdu)
virtual

Handle an incoming redirect response PDU

virtual void SIPConnection::OnReceivedREFER ( SIP_PDU pdu)
virtual

Handle an incoming REFER PDU

virtual void SIPConnection::OnReceivedReINVITE ( SIP_PDU pdu)
virtual

Handle an incoming Re-INVITE request

virtual void SIPConnection::OnReceivedResponse ( SIPTransaction transaction,
SIP_PDU response 
)
virtual

Handle an incoming response PDU.

Reimplemented from SIPTransactionOwner.

virtual bool SIPConnection::OnReceivedResponseToINVITE ( SIPTransaction transaction,
SIP_PDU response 
)
virtual

Handle an incoming response PDU to our INVITE. Note this is called before th ACK is sent and thus should do as little as possible. All the hard work (SDP processing etc) should be in the usual OnReceivedResponse().

virtual void SIPConnection::OnReceivedRinging ( SIPTransaction transaction,
SIP_PDU pdu 
)
virtual

Handle an incoming Ringing response PDU

virtual void SIPConnection::OnReceivedSessionProgress ( SIPTransaction transaction,
SIP_PDU pdu 
)
virtual

Handle an incoming Session Progress response PDU

virtual void SIPConnection::OnReceivedSUBSCRIBE ( SIP_PDU pdu)
virtual
virtual void SIPConnection::OnReceivedTrying ( SIPTransaction transaction,
SIP_PDU response 
)
virtual

Handle an incoming Trying response PDU

virtual void SIPConnection::OnReleased ( )
virtual

Clean up the termination of the connection. This function can do any internal cleaning up and waiting on background threads that may be using the connection object.

Note that there is not a one to one relationship with the OnEstablishedConnection() function. This function may be called without that function being called. For example if SetUpConnection() was used but the call never completed.

Classes that override this function should make sure they call the ancestor version for correct operation.

An application will not typically call this function as it is used by the OpalManager during a release of the connection.

The default behaviour calls the OpalEndPoint function of the same name.

virtual bool SIPConnection::OnSendAnswer ( SIP_PDU::StatusCodes  response,
bool  transfer 
)
protectedvirtual
void SIPConnection::OnSessionTimeout ( )
protected
virtual void SIPConnection::OnStartTransaction ( SIPTransaction transaction)
virtual

Reimplemented from SIPTransactionOwner.

virtual void SIPConnection::OnTransactionFailed ( SIPTransaction transaction)
virtual

Handle the fail of a transaction we initiated.

Reimplemented from SIPTransactionOwner.

void SIPConnection::OnUserInputInlineRFC2833 ( OpalRFC2833Info info,
OpalRFC2833Proto::NotifyState  state 
)
protected
virtual OpalMediaStreamPtr SIPConnection::OpenMediaStream ( const OpalMediaFormat mediaFormat,
unsigned  sessionID,
bool  isSource 
)
virtual

Open source or sink media stream for session.

Parameters
mediaFormatMedia format to open
sessionIDSession to start stream on
isSourceStream is a source/sink
SIPConnection::PDECLARE_WriteConnectCallback ( SIPConnection  ,
WriteINVITE   
)
protected
virtual bool SIPConnection::RequireSymmetricMediaStreams ( ) const
virtual

Indicate connection requires symmetric media. Default behaviour returns false.

virtual bool SIPConnection::SendDelayedACK ( bool  force)
protectedvirtual
bool SIPConnection::SendINFO ( const SIPInfo::Params params,
SIP_PDU reply = NULL 
)

Send an INFO command within this calls dialog. Note if reply is non-NULL, this function will block until the transaction completes. Care must be executed in this case that no deadlocks occur.

Parameters
paramsParameters for OPTIONS command
replyReply to message
virtual PBoolean SIPConnection::SendInviteResponse ( SIP_PDU::StatusCodes  code,
const SDPSessionDescription *  sdp = NULL 
)
protectedvirtual
bool SIPConnection::SendOPTIONS ( const SIPOptions::Params params,
SIP_PDU reply = NULL 
)

Send an OPTIONS command within this calls dialog. Note if reply is non-NULL, this function will block until the transaction completes. Care must be executed in this case that no deadlocks occur.

Parameters
paramsParameters for OPTIONS command
replyReply to message
bool SIPConnection::SendReINVITE ( PTRACE_PARAM(const char *msg,) int  operation = 0)
protected
virtual PBoolean SIPConnection::SendUserInputString ( const PString &  value)
virtual

Send a user input indication to the remote endpoint. This is for sending arbitrary strings as user indications.

The default behaviour is to call SendUserInputTone() for each character in the string.

Parameters
valueString value of indication
PBoolean SIPConnection::SendUserInputTone ( char  tone,
unsigned  duration 
)

Send a user input indication to the remote endpoint. This sends DTMF emulation user input. If something more sophisticated than the simple tones that can be sent using the SendUserInput() function.

A duration of zero indicates that no duration is to be indicated. A non-zero logical channel indicates that the tone is to be syncronised with the logical channel at the rtpTimestamp value specified.

The tone parameter must be one of "0123456789#*ABCD!" where '!' indicates a hook flash. If tone is a ' ' character then a signalUpdate PDU is sent that updates the last tone indication sent. See the H.245 specifcation for more details on this.

The default behaviour sends the tone using RFC2833.

virtual PBoolean SIPConnection::SetAlerting ( const PString &  calleeName,
PBoolean  withMedia 
)
virtual

Indicate to remote endpoint an alert is in progress. If this is an incoming connection and the AnswerCallResponse is in a AnswerCallDeferred or AnswerCallPending state, then this function is used to indicate to that endpoint that an alert is in progress. This is usually due to another connection which is in the call (the B party) has received an OnAlerting() indicating that its remote endpoint is "ringing".

The default behaviour does nothing.

Parameters
calleeNameName of endpoint being alerted.
withMediaFlag to alert with/without media
virtual bool SIPConnection::SetAlertingType ( const PString &  info)
virtual

Set alerting type information for outgoing call. The type of "distinctive ringing" for the call. The string is protocol dependent, so the caller would need to be aware of the type of call being made. Some protocols may ignore the field completely.

For SIP this corresponds to the string contained in the "Alert-Info" header field of the INVITE. This is typically a URI for the ring file.

For H.323 this must be a string representation of an integer from 0 to 7 which will be contained in the Q.931 SIGNAL (0x34) Information Element.

Default behaviour returns false.

virtual PBoolean SIPConnection::SetConnected ( )
virtual

Indicate to remote endpoint we are connected.

The default behaviour does nothing.

int SIPConnection::SetRemoteMediaFormatsFromPDU ( SIP_PDU pdu)
protected
virtual PBoolean SIPConnection::SetUpConnection ( )
virtual

Start an outgoing connection. This function will initiate the connection to the remote entity, for example in H.323 it sends a SETUP, in SIP it sends an INVITE etc.

The default behaviour is .

bool SIPConnection::StartPendingReINVITE ( )
protected
virtual bool SIPConnection::TransferConnection ( const PString &  remoteParty)
virtual

Initiate the transfer of an existing call (connection) to a new remote party.

A REFER command is sent to the remote endpoint to cause it to move the call it has with this endpoint to a new address. This call will, in the end, be cleared. The OnTransferNotify() function can be used to monitor the progress of the transfer in case it fails.

If remoteParty is a valid call token, then this is short hand for the REFER to the remote endpoint of this call to do an INVITE with Replaces header to the remote party of the supplied tokens call. This is used for consultation transfer where A calls B, B holds A, B calls C, B transfers A to C. The last step is a REFER to A with call details of C that are extracted from the B to C call leg. This short cut is possible because A nd C may be other endpoints but both B's are in this instance of OPAL.

In the end, both calls are cleared. The OnTransferNotify() function can be used to monitor the progress of the transfer in case it fails.

Parameters
remotePartyRemote party to transfer the existing call to
void SIPConnection::UpdateRemoteAddresses ( )
protected

Friends And Related Function Documentation

friend class SIP_RTP_Session
friend
friend class SIPInvite
friend
friend class SIPTransaction
friend

Field Documentation

PString SIPConnection::m_alertInfo
protected
PStringSet SIPConnection::m_allowedEvents
protected
unsigned SIPConnection::m_allowedMethods
protected

Referenced by DoesRemoteAllowMethod().

int SIPConnection::m_appearanceCode
protected
SIPURL SIPConnection::m_assertedIdentity
protected
bool SIPConnection::m_canDoVideoFastUpdateINFO
protected
SIPURL SIPConnection::m_ciscoRemotePartyID
protected
PString SIPConnection::m_consultationTransferToken
protected
SIPURL SIPConnection::m_contactAddress
protected
SIP_PDU* SIPConnection::m_delayedAckInviteResponse
protected
SIP_PDU* SIPConnection::m_delayedAckPDU
protected
PTimeInterval SIPConnection::m_delayedAckTimeout1
protected
PTimeInterval SIPConnection::m_delayedAckTimeout2
protected
PoolTimer SIPConnection::m_delayedAckTimer
protected
PoolTimer SIPConnection::m_delayedReferTimer
protected
SIPURL SIPConnection::m_delayedReferTo
protected
OpalGloballyUniqueID SIPConnection::m_dialogNotifyId
protected
PSafeArray<SIPTransaction> SIPConnection::m_forkedInvitations
protected
PString SIPConnection::m_forwardParty
protected
bool SIPConnection::m_handlingINVITE
protected
PSafePtr<OpalSIPIMContext> SIPConnection::m_imContext
protected
PoolTimer SIPConnection::m_inviteCollisionTimer
protected
SIP_PDU* SIPConnection::m_lastReceivedINVITE
protected
PMultiPartList SIPConnection::m_multiPartMIME
protected

Referenced by GetExtraCallInfo().

bool SIPConnection::m_needReINVITE
protected
PSafeArray<SIPTransaction> SIPConnection::m_pendingInvitations
protected
bool SIPConnection::m_prackEnabled
protected
PRACKMode SIPConnection::m_prackMode
protected

Referenced by GetPRACKMode().

unsigned SIPConnection::m_prackSequenceNumber
protected
enum { ... } SIPConnection::m_receivedUserInputMethod
enum { ... } SIPConnection::m_referOfRemoteState
enum { ... } SIPConnection::m_releaseMethod
OpalTransportAddress SIPConnection::m_remoteAddress
protected

Referenced by GetRemoteAddress().

SIPURL SIPConnection::m_remoteIdentity
protected
bool SIPConnection::m_resolveMultipleFormatReINVITE
protected
PoolTimer SIPConnection::m_responseFailTimer
protected
std::queue<SIP_PDU> SIPConnection::m_responsePackets
protected
unsigned SIPConnection::m_responseRetryCount
protected
PoolTimer SIPConnection::m_responseRetryTimer
protected
std::map<std::string, SIP_PDU *> SIPConnection::m_responses
protected
SIPURL SIPConnection::m_sentReferTo
protected
PoolTimer SIPConnection::m_sessionTimer
protected
bool SIPConnection::m_symmetricOpenStream
protected

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