OPAL  Version 3.10.10
SIPConnection Class Reference

#include <sipcon.h>

Inheritance diagram for SIPConnection:
OpalRTPConnection OpalConnection

Public Types

enum  PRACKMode { e_prackDisabled, e_prackSupported, e_prackRequired }
 Mode for reliable provisional responses. More...
 
- Public Types inherited from OpalConnection
enum  CallEndReasonCodes {
  EndedByLocalUser, EndedByNoAccept, EndedByAnswerDenied, EndedByRemoteUser,
  EndedByRefusal, EndedByNoAnswer, EndedByCallerAbort, EndedByTransportFail,
  EndedByConnectFail, EndedByGatekeeper, EndedByNoUser, EndedByNoBandwidth,
  EndedByCapabilityExchange, EndedByCallForwarded, EndedBySecurityDenial, EndedByLocalBusy,
  EndedByLocalCongestion, EndedByRemoteBusy, EndedByRemoteCongestion, EndedByUnreachable,
  EndedByNoEndPoint, EndedByHostOffline, EndedByTemporaryFailure, EndedByQ931Cause,
  EndedByDurationLimit, EndedByInvalidConferenceID, EndedByNoDialTone, EndedByNoRingBackTone,
  EndedByOutOfService, EndedByAcceptingCallWaiting, EndedByGkAdmissionFailed, NumCallEndReasons
}
 
enum  AnswerCallResponse {
  AnswerCallNow, AnswerCallDenied, AnswerCallPending, AnswerCallDeferred,
  AnswerCallAlertWithMedia, AnswerCallDeferredWithMedia, AnswerCallProgress, AnswerCallNowAndReleaseCurrent,
  NumAnswerCallResponses
}
 
enum  Options {
  FastStartOptionDisable = 0x0001, FastStartOptionEnable = 0x0002, FastStartOptionMask = 0x0003, H245TunnelingOptionDisable = 0x0004,
  H245TunnelingOptionEnable = 0x0008, H245TunnelingOptionMask = 0x000c, H245inSetupOptionDisable = 0x0010, H245inSetupOptionEnable = 0x0020,
  H245inSetupOptionMask = 0x0030, DetectInBandDTMFOptionDisable = 0x0040, DetectInBandDTMFOptionEnable = 0x0080, DetectInBandDTMFOptionMask = 0x00c0,
  RTPAggregationDisable = 0x0100, RTPAggregationEnable = 0x0200, RTPAggregationMask = 0x0300, SendDTMFAsDefault = 0x0000,
  SendDTMFAsString = 0x0400, SendDTMFAsTone = 0x0800, SendDTMFAsRFC2833 = 0x0c00, SendDTMFMask = 0x0c00
}
 
enum  Phases {
  UninitialisedPhase, SetUpPhase, ProceedingPhase, AlertingPhase,
  ConnectedPhase, EstablishedPhase, ForwardingPhase, ReleasingPhase,
  ReleasedPhase, NumPhases
}
 
enum  SendUserInputModes {
  SendUserInputAsQ931, SendUserInputAsString, SendUserInputAsTone, SendUserInputAsRFC2833,
  SendUserInputInBand, SendUserInputAsProtocolDefault, NumSendUserInputModes, SendUserInputAsInlineRFC2833 = SendUserInputAsRFC2833
}
 

Public Member Functions

OpalTransportAddress GetDefaultSDPConnectAddress (WORD port=0) const
 
OpalTransportGetTransport () const
 
bool SetTransport (const SIPURL &destination)
 
SIPEndPointGetEndPoint () const
 
SIPDialogContextGetDialog ()
 
const SIPDialogContextGetDialog () const
 
SIPAuthenticationGetAuthenticator () const
 
PRACKMode GetPRACKMode () const
 
virtual unsigned GetAllowedMethods () const
 
virtual PBoolean OnMediaControlXML (SIP_PDU &pdu)
 
virtual bool OnMediaCommand (OpalMediaStream &stream, const OpalMediaCommand &command)
 
virtual void OnStartTransaction (SIPTransaction &transaction)
 
virtual void OnReceivedMESSAGE (SIP_PDU &pdu)
 
 P_REMOVE_VIRTUAL_VOID (OnMessageReceived(const SIPURL &, const SIP_PDU &))
 
 P_REMOVE_VIRTUAL_VOID (OnMessageReceived(const SIP_PDU &))
 
PString GetLocalPartyURL () const
 
Construction
 SIPConnection (OpalCall &call, SIPEndPoint &endpoint, const PString &token, const SIPURL &address, OpalTransport *transport, unsigned int options=0, OpalConnection::StringOptions *stringOptions=NULL)
 
 ~SIPConnection ()
 
Overrides from OpalConnection
virtual bool IsNetworkConnection () const
 
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 PString GetDestinationAddress ()
 
virtual PString GetCalledPartyURL ()
 
virtual PString GetAlertingType () const
 
virtual bool SetAlertingType (const PString &info)
 
virtual PString GetCallInfo () const
 
virtual bool TransferConnection (const PString &remoteParty)
 
virtual bool Hold (bool fromRemote, bool placeOnHold)
 
virtual bool IsOnHold (bool fromRemote)
 
virtual PBoolean SetAlerting (const PString &calleeName, PBoolean withMedia)
 
virtual PBoolean SetConnected ()
 
virtual OpalMediaFormatList GetMediaFormats () const
 
virtual OpalMediaStreamPtr OpenMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource)
 
virtual bool CloseMediaStream (OpalMediaStream &stream)
 
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)
 
virtual void OnRTPStatistics (const RTP_Session &session) const
 
- Public Member Functions inherited from OpalRTPConnection
virtual void AttachRFC2833HandlerToPatch (PBoolean isSource, OpalMediaPatch &patch)
 
virtual void SessionFailing (RTP_Session &session)
 
 OpalRTPConnection (OpalCall &call, OpalRTPEndPoint &endpoint, const PString &token, unsigned options=0, OpalConnection::StringOptions *stringOptions=NULL)
 
 ~OpalRTPConnection ()
 
virtual unsigned GetNextSessionID (const OpalMediaType &mediaType, bool isSource)
 
virtual RTP_SessionGetSession (unsigned sessionID) const
 
virtual OpalMediaSessionGetMediaSession (unsigned sessionID) const
 
virtual RTP_SessionUseSession (const OpalTransport &transport, unsigned sessionID, const OpalMediaType &mediatype, RTP_QOS *rtpqos=NULL)
 
virtual void CloseSession (unsigned sessionID)
 
virtual RTP_SessionCreateSession (const OpalTransport &transport, unsigned sessionID, const OpalMediaType &mediaType, RTP_QOS *rtpqos)
 
virtual RTP_UDPCreateRTPSession (unsigned sessionId, const OpalMediaType &mediaType, bool remoteIsNat)
 
virtual bool ChangeSessionID (unsigned fromSessionID, unsigned toSessionID)
 
virtual PBoolean RemoteIsNAT () const
 
virtual PBoolean IsRTPNATEnabled (const PIPSocket::Address &localAddr, const PIPSocket::Address &peerAddr, const PIPSocket::Address &signalAddr, PBoolean incoming)
 
virtual PBoolean GetMediaInformation (unsigned sessionID, MediaInformation &info) const
 
virtual PBoolean IsMediaBypassPossible (unsigned sessionID) const
 
virtual OpalMediaStreamCreateMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, PBoolean isSource)
 
virtual void AdjustMediaFormats (bool local, const OpalConnection *otherConnection, OpalMediaFormatList &mediaFormats) const
 
virtual void OnPatchMediaStream (PBoolean isSource, OpalMediaPatch &patch)
 
- Public Member Functions inherited from OpalConnection
const StringOptionsGetStringOptions () const
 Get the string options associated with this connection. More...
 
void SetStringOptions (const StringOptions &options, bool overwrite)
 Set the string options associated with this connection. More...
 
virtual void EnableRecording ()
 
virtual void DisableRecording ()
 
 OpalConnection (OpalCall &call, OpalEndPoint &endpoint, const PString &token, unsigned options=0, OpalConnection::StringOptions *stringOptions=NULL)
 
 ~OpalConnection ()
 
void PrintOn (ostream &strm) const
 
virtual PBoolean OnIncomingConnection (unsigned int options, OpalConnection::StringOptions *stringOptions)
 
virtual PBoolean OnSetUpConnection ()
 
virtual void OnProceeding ()
 
virtual void OnAlerting ()
 
virtual AnswerCallResponse OnAnswerCall (const PString &callerName)
 
virtual void AnsweringCall (AnswerCallResponse response)
 
virtual void OnConnected ()
 
virtual void OnEstablished ()
 
virtual bool OnTransferNotify (const PStringToString &info, const OpalConnection *transferringConnection)
 
virtual void Release (CallEndReason reason=EndedByLocalUser, bool synchronous=false)
 
PSafePtr< OpalConnectionGetOtherPartyConnection () const
 
template<class cls >
PSafePtr< cls > GetOtherPartyConnectionAs () const
 
virtual OpalMediaFormatList GetLocalMediaFormats ()
 
virtual OpalMediaType::AutoStartMode GetAutoStart (const OpalMediaType &mediaType) const
 
virtual void AutoStartMediaStreams (bool force=false)
 
virtual bool SwitchFaxMediaStreams (bool toT38)
 
virtual void OnSwitchedFaxMediaStreams (bool toT38, bool success)
 
virtual bool OnSwitchingFaxMediaStreams (bool toT38)
 
virtual bool CloseMediaStream (unsigned sessionId, bool source)
 
bool RemoveMediaStream (OpalMediaStream &strm)
 
virtual void StartMediaStreams ()
 
virtual void CloseMediaStreams ()
 
virtual void PauseMediaStreams (bool paused)
 
OpalMediaStreamPtr GetMediaStream (const PString &streamID, bool source) const
 
OpalMediaStreamPtr GetMediaStream (unsigned sessionId, bool source) const
 
OpalMediaStreamPtr GetMediaStream (const OpalMediaType &mediaType, bool source, OpalMediaStreamPtr previous=NULL) const
 
virtual PBoolean OnOpenMediaStream (OpalMediaStream &stream)
 
virtual void OnClosedMediaStream (const OpalMediaStream &stream)
 
virtual void OnStartMediaPatch (OpalMediaPatch &patch)
 
virtual void OnStopMediaPatch (OpalMediaPatch &patch)
 
virtual PBoolean CreateVideoInputDevice (const OpalMediaFormat &mediaFormat, PVideoInputDevice *&device, PBoolean &autoDelete)
 
virtual PBoolean CreateVideoOutputDevice (const OpalMediaFormat &mediaFormat, PBoolean preview, PVideoOutputDevice *&device, PBoolean &autoDelete)
 
virtual bool SendVideoUpdatePicture (unsigned sessionID=0, bool force=false) const
 
virtual PBoolean SetAudioVolume (PBoolean source, unsigned percentage)
 
virtual PBoolean GetAudioVolume (PBoolean source, unsigned &percentage)
 
virtual bool SetAudioMute (bool source, bool mute)
 
virtual bool GetAudioMute (bool source, bool &mute)
 
virtual unsigned GetAudioSignalLevel (PBoolean source)
 
unsigned GetBandwidthAvailable () const
 
virtual PBoolean SetBandwidthAvailable (unsigned newBandwidth, PBoolean force=false)
 
virtual unsigned GetBandwidthUsed () const
 
virtual PBoolean SetBandwidthUsed (unsigned releasedBandwidth, unsigned requiredBandwidth)
 
OpalEndPointGetEndPoint () const
 
OpalCallGetCall () const
 
const PString & GetToken () const
 
PBoolean IsOriginating () const
 
const PTime & GetPhaseTime (Phases phase) const
 
const PTime & GetSetupUpTime () const
 
const PTime & GetAlertingTime () const
 
const PTime & GetConnectionStartTime () const
 
const PTime & GetConnectionEndTime () const
 
const OpalProductInfoGetProductInfo () const
 
void SetProductInfo (const OpalProductInfo &info)
 
const PString & GetLocalPartyName () const
 
virtual void SetLocalPartyName (const PString &name)
 
const PString & GetDisplayName () const
 
void SetDisplayName (const PString &name)
 
virtual bool IsPresentationBlocked () const
 
const PString & GetRemotePartyName () const
 
void SetRemotePartyName (const PString &name)
 
const PString & GetRemotePartyNumber () const
 
const PString & GetRemotePartyAddress () const
 
void SetRemotePartyAddress (const PString &addr)
 
virtual PString GetRemotePartyURL () const
 
const PString & GetRedirectingParty () const
 
void SetRedirectingParty (const PString &party)
 
const PString GetRemotePartyCallbackURL () const
 
PCaselessString GetRemoteApplication () const
 
const OpalProductInfoGetRemoteProductInfo () const
 
const PString & GetCalledPartyName () const
 
const PString & GetCalledPartyNumber () const
 
void CopyPartyNames (const OpalConnection &other)
 
unsigned GetMinAudioJitterDelay () const
 
unsigned GetMaxAudioJitterDelay () const
 
void SetAudioJitterDelay (unsigned minDelay, unsigned maxDelay)
 
OpalSilenceDetectorGetSilenceDetector () const
 
virtual PINDEX GetMaxRtpPayloadSize () const
 
 PDICTIONARY (MediaAddressesDict, POrdinalKey, OpalTransportAddress)
 
MediaAddressesDict & GetMediaTransportAddresses ()
 
unsigned GetVideoUpdateRequestsSent () const
 
__inline Phases GetPhase () const
 
__inline bool IsEstablished () const
 Return true if connection is in the established phase. More...
 
__inline bool IsReleased () const
 Return true if connection is in the established phase. More...
 
void SetPhase (Phases phaseToSet)
 
CallEndReason GetCallEndReason () const
 
PString GetCallEndReasonText () const
 
virtual void SetCallEndReason (CallEndReason reason)
 
void ClearCall (CallEndReason reason=EndedByLocalUser, PSyncPoint *sync=NULL)
 
virtual void ClearCallSynchronous (PSyncPoint *sync, CallEndReason reason=EndedByLocalUser)
 
unsigned GetQ931Cause () const
 
void SetQ931Cause (unsigned v)
 
virtual void OnHold (bool fromRemote, bool onHold)
 
virtual void SetSendUserInputMode (SendUserInputModes mode)
 
virtual SendUserInputModes GetSendUserInputMode () const
 
virtual void OnUserInputString (const PString &value)
 
virtual void OnUserInputTone (char tone, unsigned duration)
 
void SendUserInputHookFlash (unsigned duration=500)
 
virtual PString GetUserInput (unsigned timeout=30)
 
virtual void SetUserInput (const PString &input)
 
virtual PString ReadUserInput (const char *terminators="#\", unsigned lastDigitTimeout=4, unsigned firstDigitTimeout=30)
 
virtual PBoolean PromptUserInput (PBoolean play)
 

Protected Types

enum  HoldState { eHoldOff, eRetrieveInProgress, eHoldOn, eHoldInProgress }
 
enum  { ReleaseWithBYE, ReleaseWithCANCEL, ReleaseWithResponse, ReleaseWithNothing }
 
enum  { UserInputMethodUnknown, ReceivedRFC2833, ReceivedINFO }
 
- Protected Types inherited from OpalConnection
enum  { e_NotSwitchingFaxMediaStreams, e_SwitchingToFaxMediaStreams, e_SwitchingFromFaxMediaStreams }
 

Protected Member Functions

virtual bool GarbageCollection ()
 
void OnUserInputInlineRFC2833 (OpalRFC2833Info &info, INT type)
 
 PDECLARE_NOTIFIER (PTimer, SIPConnection, OnSessionTimeout)
 
 PDECLARE_NOTIFIER (PTimer, SIPConnection, OnInviteResponseRetry)
 
 PDECLARE_NOTIFIER (PTimer, SIPConnection, OnInviteResponseTimeout)
 
virtual bool OnSendOfferSDP (OpalRTPSessionManager &rtpSessions, SDPSessionDescription &sdpOut, bool offerCurrentOnly)
 
virtual bool OnSendOfferSDPSession (const OpalMediaType &mediaType, unsigned sessionID, OpalRTPSessionManager &rtpSessions, SDPSessionDescription &sdpOut, bool offerOpenMediaStreamOnly)
 
virtual bool OnSendAnswerSDP (OpalRTPSessionManager &rtpSessions, SDPSessionDescription &sdpOut)
 
virtual bool OnSendAnswerSDPSession (const SDPSessionDescription &sdpIn, unsigned sessionIndex, SDPSessionDescription &sdpOut)
 
virtual void OnReceivedAnswerSDP (SIP_PDU &pdu)
 
virtual bool OnReceivedAnswerSDPSession (SDPSessionDescription &sdp, unsigned sessionId, bool &multipleFormats)
 
virtual OpalMediaSessionSetUpMediaSession (const unsigned rtpSessionId, const OpalMediaType &mediaType, const SDPMediaDescription &mediaDescription, OpalTransportAddress &localAddress, bool &remoteChanged)
 
bool SendReINVITE (PTRACE_PARAM(const char *msg))
 
bool StartPendingReINVITE ()
 
bool WriteINVITE ()
 
virtual bool SendInviteOK ()
 
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)
 
bool SetRemoteMediaFormats (SDPSessionDescription *sdp)
 
- Protected Member Functions inherited from OpalRTPConnection
 PDECLARE_NOTIFIER (OpalRFC2833Info, OpalRTPConnection, OnUserInputInlineRFC2833)
 
 PDECLARE_NOTIFIER (OpalRFC2833Info, OpalRTPConnection, OnUserInputInlineCiscoNSE)
 
- Protected Member Functions inherited from OpalConnection
void OnConnectedInternal ()
 
 PDECLARE_NOTIFIER (PThread, OpalConnection, OnReleaseThreadMain)
 
 PDECLARE_NOTIFIER (RTP_DataFrame, OpalConnection, OnRecordAudio)
 
 PDECLARE_NOTIFIER (RTP_DataFrame, OpalConnection, OnRecordVideo)
 
void OnStartRecording (OpalMediaPatch *patch)
 
void OnStopRecording (OpalMediaPatch *patch)
 

Static Protected Member Functions

static PBoolean WriteINVITE (OpalTransport &transport, void *param)
 

Protected Attributes

SIPEndPointendpoint
 
OpalTransporttransport
 
bool deleteTransport
 
unsigned m_allowedMethods
 
PStringList m_allowedEvents
 
HoldState m_holdToRemote
 
bool m_holdFromRemote
 
PString m_forwardParty
 
SIPURL m_contactAddress
 
SIPURL m_ciscoRemotePartyID
 
SIP_PDUoriginalInvite
 
PTime originalInviteTime
 
time_t m_sdpSessionId
 
unsigned m_sdpVersion
 
bool m_needReINVITE
 
bool m_handlingINVITE
 
bool m_resolveMultipleFormatReINVITE
 
bool m_symmetricOpenStream
 
SIPDialogContext m_dialog
 
OpalGloballyUniqueID m_dialogNotifyId
 
int m_appearanceCode
 
PString m_alertInfo
 
SIPAuthenticationm_authentication
 
unsigned m_authenticateErrors
 
PTimer sessionTimer
 
std::map< SIP_PDU::Methods, unsigned > m_lastRxCSeq
 
PRACKMode m_prackMode
 
bool m_prackEnabled
 
unsigned m_prackSequenceNumber
 
queue< SIP_PDUm_responsePackets
 
PTimer m_responseFailTimer
 
PTimer m_responseRetryTimer
 
unsigned m_responseRetryCount
 
bool m_referInProgress
 
PSafeList< SIPTransactionforkedInvitations
 
PSafeList< SIPTransactionpendingInvitations
 
PSafeList< SIPTransactionm_pendingTransactions
 
bool m_switchedToT38
 
enum SIPConnection:: { ... }  releaseMethod
 
OpalMediaFormatList m_remoteFormatList
 
OpalMediaFormatList m_answerFormatList
 
std::map< std::string, SIP_PDU * > m_responses
 
PSafePtr< OpalSIPIMContextm_imContext
 
enum SIPConnection:: { ... }  m_receivedUserInputMethod
 
- Protected Attributes inherited from OpalRTPConnection
OpalRTPSessionManager m_rtpSessions
 
OpalRFC2833Protorfc2833Handler
 
PBoolean remoteIsNAT
 
PBoolean useRTPAggregation
 
- Protected Attributes inherited from OpalConnection
OpalCallownerCall
 
OpalEndPointendpoint
 
PString callToken
 
PBoolean originating
 
OpalProductInfo productInfo
 
PString localPartyName
 
PString displayName
 
PString remotePartyName
 
PString remotePartyURL
 
OpalProductInfo remoteProductInfo
 
PString remotePartyNumber
 
PString remotePartyAddress
 
PString m_redirectingParty
 
CallEndReason callEndReason
 
PString m_calledPartyNumber
 
PString m_calledPartyName
 
SendUserInputModes sendUserInputMode
 
PString userInputString
 
PSyncPoint userInputAvailable
 
OpalSilenceDetectorsilenceDetector
 
OpalMediaFormat m_filterMediaFormat
 
OpalMediaFormatList m_localMediaFormats
 
MediaAddressesDict mediaTransportAddresses
 
PSafeList< OpalMediaStreammediaStreams
 
unsigned minAudioJitterDelay
 
unsigned maxAudioJitterDelay
 
unsigned bandwidthAvailable
 
StringOptions m_stringOptions
 
PString m_recordingFilename
 
PNotifier m_recordAudioNotifier
 
PNotifier m_recordVideoNotifier
 
unsigned m_VideoUpdateRequestsSent
 
AutoStartMap m_autoStartInfo
 
enum OpalConnection:: { ... }  m_faxMediaStreamsSwitchState
 
ZeroTime m_phaseTime [NumPhases]
 

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 void 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 (SIP_PDU &pdu)
 
virtual void OnReceivedSessionProgress (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)
 

Additional Inherited Members

- Static Public Member Functions inherited from OpalConnection
static PString GetCallEndReasonText (CallEndReason reason)
 
static void SetCallEndReasonText (CallEndReasonCodes reasonCode, const PString &newText)
 

Detailed Description

Session Initiation Protocol connection.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
ReleaseWithBYE 
ReleaseWithCANCEL 
ReleaseWithResponse 
ReleaseWithNothing 

◆ anonymous enum

anonymous enum
protected
Enumerator
UserInputMethodUnknown 
ReceivedRFC2833 
ReceivedINFO 

◆ HoldState

enum SIPConnection::HoldState
protected
Enumerator
eHoldOff 
eRetrieveInProgress 
eHoldOn 
eHoldInProgress 

◆ PRACKMode

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.

◆ TypeOfINVITE

Enumerator
IsNewINVITE 
IsDuplicateINVITE 
IsReINVITE 
IsLoopedINVITE 

Constructor & Destructor Documentation

◆ SIPConnection()

SIPConnection::SIPConnection ( OpalCall call,
SIPEndPoint endpoint,
const PString &  token,
const SIPURL address,
OpalTransport transport,
unsigned int  options = 0,
OpalConnection::StringOptions stringOptions = NULL 
)

Create a new connection.

Parameters
callOwner call for connection
endpointOwner endpoint for connection
tokentoken to identify the connection
addressDestination address for outgoing call
transportTransport INVITE came in on
optionsConnection options
stringOptionscomplex string options

◆ ~SIPConnection()

SIPConnection::~SIPConnection ( )

Destroy connection.

Member Function Documentation

◆ AdjustInviteResponse()

virtual void SIPConnection::AdjustInviteResponse ( SIP_PDU response)
protectedvirtual

◆ CheckINVITE()

TypeOfINVITE SIPConnection::CheckINVITE ( const SIP_PDU pdu) const

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

◆ CloseMediaStream()

virtual bool SIPConnection::CloseMediaStream ( OpalMediaStream stream)
virtual

Request close of a specific media stream. Note that this is usually asymchronous, the OnClosedMediaStream() function is called when the stream is really closed.

Parameters
streamStream to close

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ ForwardCall()

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.

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ GarbageCollection()

virtual bool SIPConnection::GarbageCollection ( )
protectedvirtual

Execute garbage collection for endpoint. Returns true if all garbage has been collected. Default behaviour deletes the objects in the connectionsActive list.

Reimplemented from OpalConnection.

Referenced by GetPRACKMode().

◆ GetAlertingType()

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.

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ GetAllowedMethods()

virtual unsigned SIPConnection::GetAllowedMethods ( ) const
virtual

Return a bit mask of the allowed SIP methods.

Referenced by GetPRACKMode().

◆ GetAuthenticator()

SIPAuthentication* SIPConnection::GetAuthenticator ( ) const
inline

References m_authentication.

◆ GetCalledPartyURL()

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.

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ GetCallInfo()

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.

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ GetDefaultSDPConnectAddress()

OpalTransportAddress SIPConnection::GetDefaultSDPConnectAddress ( WORD  port = 0) const

◆ GetDestinationAddress()

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.

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ GetDialog() [1/2]

SIPDialogContext& SIPConnection::GetDialog ( )
inline

References m_dialog.

◆ GetDialog() [2/2]

const SIPDialogContext& SIPConnection::GetDialog ( ) const
inline

References m_dialog.

◆ GetEndPoint()

SIPEndPoint& SIPConnection::GetEndPoint ( ) const
inline

References endpoint.

◆ GetIdentifier()

virtual PString SIPConnection::GetIdentifier ( ) const
virtual

Get the protocol-specific unique identifier for this connection.

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ GetLocalPartyURL()

PString SIPConnection::GetLocalPartyURL ( ) const
virtual

Get the local name/alias.

Reimplemented from OpalConnection.

Referenced by GetPRACKMode().

◆ GetMediaFormats()

virtual OpalMediaFormatList SIPConnection::GetMediaFormats ( ) const
virtual

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

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ GetPRACKMode()

◆ GetPrefixName()

virtual PString SIPConnection::GetPrefixName ( ) const
virtual

Get this connections protocol prefix for URLs.

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ GetRealSendUserInputMode()

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.

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ GetTransport()

OpalTransport& SIPConnection::GetTransport ( ) const
inlinevirtual

Reimplemented from OpalConnection.

References SetTransport(), and transport.

◆ Hold()

virtual bool SIPConnection::Hold ( bool  fromRemote,
bool  placeOnHold 
)
virtual

Put the current connection on hold, suspending all media streams. The fromRemote parameter indicates if we a putting the remote on hold (false) or it is a request for the remote to put us on hold (true).

The /p placeOnHold parameter indicates of teh command/request is for going on hold or retrieving from hold.

Parameters
fromRemoteFlag for if remote has us on hold, or we have them
placeOnHoldFlag for setting on or off hold

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ IsNetworkConnection()

virtual bool SIPConnection::IsNetworkConnection ( ) const
inlinevirtual

◆ IsOnHold()

virtual bool SIPConnection::IsOnHold ( bool  fromRemote)
virtual

Return true if the current connection is on hold. The fromRemote parameter indicates if we are testing if the remote system has us on hold, or we have them on hold.

Parameters
fromRemoteFlag for if remote has us on hold, or we have them

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ NotifyDialogState()

void SIPConnection::NotifyDialogState ( SIPDialogNotification::States  state,
SIPDialogNotification::Events  eventType = SIPDialogNotification::NoEvent,
unsigned  eventCode = 0 
)
protected

◆ OnAllowedEventNotify()

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

Referenced by IsNetworkConnection().

◆ OnApplyStringOptions()

virtual void SIPConnection::OnApplyStringOptions ( )
virtual

Call back for connection to act on changed string options.

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ OnCreatingINVITE()

virtual void SIPConnection::OnCreatingINVITE ( SIPInvite pdu)
virtual

Handle a sending INVITE request

Referenced by IsNetworkConnection().

◆ OnMediaCommand()

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

Reimplemented from OpalRTPConnection.

Referenced by GetPRACKMode().

◆ OnMediaControlXML()

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

Referenced by GetPRACKMode().

◆ OnPauseMediaStream()

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

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ OnReceivedACK()

virtual void SIPConnection::OnReceivedACK ( SIP_PDU pdu)
virtual

Handle an incoming ACK PDU

Referenced by IsNetworkConnection().

◆ OnReceivedAnswerSDP()

virtual void SIPConnection::OnReceivedAnswerSDP ( SIP_PDU pdu)
protectedvirtual

Referenced by GetPRACKMode().

◆ OnReceivedAnswerSDPSession()

virtual bool SIPConnection::OnReceivedAnswerSDPSession ( SDPSessionDescription sdp,
unsigned  sessionId,
bool &  multipleFormats 
)
protectedvirtual

Referenced by GetPRACKMode().

◆ OnReceivedAuthenticationRequired()

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.

Referenced by IsNetworkConnection().

◆ OnReceivedBYE()

virtual void SIPConnection::OnReceivedBYE ( SIP_PDU pdu)
virtual

Handle an incoming BYE PDU

Referenced by IsNetworkConnection().

◆ OnReceivedCANCEL()

virtual void SIPConnection::OnReceivedCANCEL ( SIP_PDU pdu)
virtual

Handle an incoming CANCEL PDU

Referenced by IsNetworkConnection().

◆ OnReceivedINFO()

virtual void SIPConnection::OnReceivedINFO ( SIP_PDU pdu)
virtual

Handle an incoming INFO PDU

Referenced by IsNetworkConnection().

◆ OnReceivedINVITE()

virtual void SIPConnection::OnReceivedINVITE ( SIP_PDU pdu)
virtual

Handle an incoming INVITE request

Referenced by IsNetworkConnection().

◆ OnReceivedMESSAGE()

virtual void SIPConnection::OnReceivedMESSAGE ( SIP_PDU pdu)
virtual

Referenced by GetPRACKMode().

◆ OnReceivedNOTIFY()

virtual void SIPConnection::OnReceivedNOTIFY ( SIP_PDU pdu)
virtual

Handle an incoming NOTIFY PDU

Referenced by IsNetworkConnection().

◆ OnReceivedOK()

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.

Referenced by IsNetworkConnection().

◆ OnReceivedOPTIONS()

virtual void SIPConnection::OnReceivedOPTIONS ( SIP_PDU pdu)
virtual

Handle an incoming OPTIONS PDU

Referenced by IsNetworkConnection().

◆ OnReceivedPDU()

virtual void SIPConnection::OnReceivedPDU ( SIP_PDU pdu)
virtual

Handle an incoming SIP PDU that has been full decoded

Referenced by IsNetworkConnection().

◆ OnReceivedPING()

virtual void SIPConnection::OnReceivedPING ( SIP_PDU pdu)
virtual

Handle an incoming PING PDU

Referenced by IsNetworkConnection().

◆ OnReceivedPRACK()

virtual void SIPConnection::OnReceivedPRACK ( SIP_PDU pdu)
virtual

Handle an incoming PRACK PDU

Referenced by IsNetworkConnection().

◆ OnReceivedRedirection()

virtual void SIPConnection::OnReceivedRedirection ( SIP_PDU pdu)
virtual

Handle an incoming redirect response PDU

Referenced by IsNetworkConnection().

◆ OnReceivedREFER()

virtual void SIPConnection::OnReceivedREFER ( SIP_PDU pdu)
virtual

Handle an incoming REFER PDU

Referenced by IsNetworkConnection().

◆ OnReceivedReINVITE()

virtual void SIPConnection::OnReceivedReINVITE ( SIP_PDU pdu)
virtual

Handle an incoming Re-INVITE request

Referenced by IsNetworkConnection().

◆ OnReceivedResponse()

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

Handle an incoming response PDU.

Referenced by IsNetworkConnection().

◆ OnReceivedResponseToINVITE()

virtual void 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().

Referenced by IsNetworkConnection().

◆ OnReceivedRinging()

virtual void SIPConnection::OnReceivedRinging ( SIP_PDU pdu)
virtual

Handle an incoming Ringing response PDU

Referenced by IsNetworkConnection().

◆ OnReceivedSessionProgress()

virtual void SIPConnection::OnReceivedSessionProgress ( SIP_PDU pdu)
virtual

Handle an incoming Session Progress response PDU

Referenced by IsNetworkConnection().

◆ OnReceivedTrying()

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

Handle an incoming Trying response PDU

Referenced by IsNetworkConnection().

◆ OnReleased()

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.

Reimplemented from OpalRTPConnection.

Referenced by IsNetworkConnection().

◆ OnRTPStatistics()

virtual void SIPConnection::OnRTPStatistics ( const RTP_Session session) const
virtual

Callback from the RTP session for statistics monitoring. This is called every so many packets on the transmitter and receiver threads of the RTP session indicating that the statistics have been updated.

The default behaviour does nothing.

Parameters
sessionSession with statistics

Referenced by IsNetworkConnection().

◆ OnSendAnswerSDP()

virtual bool SIPConnection::OnSendAnswerSDP ( OpalRTPSessionManager rtpSessions,
SDPSessionDescription sdpOut 
)
protectedvirtual

Referenced by GetPRACKMode().

◆ OnSendAnswerSDPSession()

virtual bool SIPConnection::OnSendAnswerSDPSession ( const SDPSessionDescription sdpIn,
unsigned  sessionIndex,
SDPSessionDescription sdpOut 
)
protectedvirtual

Referenced by GetPRACKMode().

◆ OnSendOfferSDP()

virtual bool SIPConnection::OnSendOfferSDP ( OpalRTPSessionManager rtpSessions,
SDPSessionDescription sdpOut,
bool  offerCurrentOnly 
)
protectedvirtual

Referenced by GetPRACKMode().

◆ OnSendOfferSDPSession()

virtual bool SIPConnection::OnSendOfferSDPSession ( const OpalMediaType mediaType,
unsigned  sessionID,
OpalRTPSessionManager rtpSessions,
SDPSessionDescription sdpOut,
bool  offerOpenMediaStreamOnly 
)
protectedvirtual

Referenced by GetPRACKMode().

◆ OnStartTransaction()

virtual void SIPConnection::OnStartTransaction ( SIPTransaction transaction)
virtual

Referenced by GetPRACKMode().

◆ OnTransactionFailed()

virtual void SIPConnection::OnTransactionFailed ( SIPTransaction transaction)
virtual

Handle the fail of a transaction we initiated.

Referenced by IsNetworkConnection().

◆ OnUserInputInlineRFC2833()

void SIPConnection::OnUserInputInlineRFC2833 ( OpalRFC2833Info info,
INT  type 
)
protected

Referenced by GetPRACKMode().

◆ OpenMediaStream()

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

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ P_REMOVE_VIRTUAL_VOID() [1/2]

SIPConnection::P_REMOVE_VIRTUAL_VOID ( OnMessageReceived(const SIPURL &, const SIP_PDU &)  )

Referenced by GetPRACKMode().

◆ P_REMOVE_VIRTUAL_VOID() [2/2]

SIPConnection::P_REMOVE_VIRTUAL_VOID ( OnMessageReceived(const SIP_PDU &)  )

◆ PDECLARE_NOTIFIER() [1/3]

SIPConnection::PDECLARE_NOTIFIER ( PTimer  ,
SIPConnection  ,
OnSessionTimeout   
)
protected

Referenced by GetPRACKMode().

◆ PDECLARE_NOTIFIER() [2/3]

SIPConnection::PDECLARE_NOTIFIER ( PTimer  ,
SIPConnection  ,
OnInviteResponseRetry   
)
protected

◆ PDECLARE_NOTIFIER() [3/3]

SIPConnection::PDECLARE_NOTIFIER ( PTimer  ,
SIPConnection  ,
OnInviteResponseTimeout   
)
protected

◆ SendINFO()

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

◆ SendInviteOK()

virtual bool SIPConnection::SendInviteOK ( )
protectedvirtual

◆ SendInviteResponse()

virtual PBoolean SIPConnection::SendInviteResponse ( SIP_PDU::StatusCodes  code,
const SDPSessionDescription sdp = NULL 
)
protectedvirtual

◆ SendOPTIONS()

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

◆ SendReINVITE()

bool SIPConnection::SendReINVITE ( PTRACE_PARAM(const char *msg)  )
protected

Referenced by GetPRACKMode().

◆ SendUserInputString()

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

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ SendUserInputTone()

PBoolean SIPConnection::SendUserInputTone ( char  tone,
unsigned  duration 
)
virtual

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.

Reimplemented from OpalRTPConnection.

Referenced by IsNetworkConnection().

◆ SetAlerting()

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

Implements OpalConnection.

Referenced by IsNetworkConnection().

◆ SetAlertingType()

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.

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ SetConnected()

virtual PBoolean SIPConnection::SetConnected ( )
virtual

Indicate to remote endpoint we are connected.

The default behaviour does nothing.

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ SetRemoteMediaFormats()

bool SIPConnection::SetRemoteMediaFormats ( SDPSessionDescription sdp)
protected

◆ SetTransport()

bool SIPConnection::SetTransport ( const SIPURL destination)

Referenced by GetTransport().

◆ SetUpConnection()

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 .

Implements OpalConnection.

Referenced by IsNetworkConnection().

◆ SetUpMediaSession()

virtual OpalMediaSession* SIPConnection::SetUpMediaSession ( const unsigned  rtpSessionId,
const OpalMediaType mediaType,
const SDPMediaDescription mediaDescription,
OpalTransportAddress localAddress,
bool &  remoteChanged 
)
protectedvirtual

Referenced by GetPRACKMode().

◆ StartPendingReINVITE()

bool SIPConnection::StartPendingReINVITE ( )
protected

Referenced by GetPRACKMode().

◆ TransferConnection()

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

Reimplemented from OpalConnection.

Referenced by IsNetworkConnection().

◆ UpdateRemoteAddresses()

void SIPConnection::UpdateRemoteAddresses ( )
protected

◆ WriteINVITE() [1/2]

static PBoolean SIPConnection::WriteINVITE ( OpalTransport transport,
void *  param 
)
staticprotected

◆ WriteINVITE() [2/2]

bool SIPConnection::WriteINVITE ( )
protected

Friends And Related Function Documentation

◆ SIP_RTP_Session

friend class SIP_RTP_Session
friend

◆ SIPInvite

friend class SIPInvite
friend

◆ SIPTransaction

friend class SIPTransaction
friend

Field Documentation

◆ deleteTransport

bool SIPConnection::deleteTransport
protected

◆ endpoint

SIPEndPoint& SIPConnection::endpoint
protected

Referenced by GetEndPoint().

◆ forkedInvitations

PSafeList<SIPTransaction> SIPConnection::forkedInvitations
protected

◆ m_alertInfo

PString SIPConnection::m_alertInfo
protected

◆ m_allowedEvents

PStringList SIPConnection::m_allowedEvents
protected

◆ m_allowedMethods

unsigned SIPConnection::m_allowedMethods
protected

◆ m_answerFormatList

OpalMediaFormatList SIPConnection::m_answerFormatList
protected

◆ m_appearanceCode

int SIPConnection::m_appearanceCode
protected

◆ m_authenticateErrors

unsigned SIPConnection::m_authenticateErrors
protected

◆ m_authentication

SIPAuthentication* SIPConnection::m_authentication
protected

Referenced by GetAuthenticator().

◆ m_ciscoRemotePartyID

SIPURL SIPConnection::m_ciscoRemotePartyID
protected

◆ m_contactAddress

SIPURL SIPConnection::m_contactAddress
protected

◆ m_dialog

SIPDialogContext SIPConnection::m_dialog
protected

Referenced by GetDialog().

◆ m_dialogNotifyId

OpalGloballyUniqueID SIPConnection::m_dialogNotifyId
protected

◆ m_forwardParty

PString SIPConnection::m_forwardParty
protected

◆ m_handlingINVITE

bool SIPConnection::m_handlingINVITE
protected

◆ m_holdFromRemote

bool SIPConnection::m_holdFromRemote
protected

◆ m_holdToRemote

HoldState SIPConnection::m_holdToRemote
protected

◆ m_imContext

PSafePtr<OpalSIPIMContext> SIPConnection::m_imContext
protected

◆ m_lastRxCSeq

std::map<SIP_PDU::Methods, unsigned> SIPConnection::m_lastRxCSeq
protected

◆ m_needReINVITE

bool SIPConnection::m_needReINVITE
protected

◆ m_pendingTransactions

PSafeList<SIPTransaction> SIPConnection::m_pendingTransactions
protected

◆ m_prackEnabled

bool SIPConnection::m_prackEnabled
protected

◆ m_prackMode

PRACKMode SIPConnection::m_prackMode
protected

Referenced by GetPRACKMode().

◆ m_prackSequenceNumber

unsigned SIPConnection::m_prackSequenceNumber
protected

◆ m_receivedUserInputMethod

enum { ... } SIPConnection::m_receivedUserInputMethod

◆ m_referInProgress

bool SIPConnection::m_referInProgress
protected

◆ m_remoteFormatList

OpalMediaFormatList SIPConnection::m_remoteFormatList
protected

◆ m_resolveMultipleFormatReINVITE

bool SIPConnection::m_resolveMultipleFormatReINVITE
protected

◆ m_responseFailTimer

PTimer SIPConnection::m_responseFailTimer
protected

◆ m_responsePackets

queue<SIP_PDU> SIPConnection::m_responsePackets
protected

◆ m_responseRetryCount

unsigned SIPConnection::m_responseRetryCount
protected

◆ m_responseRetryTimer

PTimer SIPConnection::m_responseRetryTimer
protected

◆ m_responses

std::map<std::string, SIP_PDU *> SIPConnection::m_responses
protected

◆ m_sdpSessionId

time_t SIPConnection::m_sdpSessionId
protected

◆ m_sdpVersion

unsigned SIPConnection::m_sdpVersion
protected

◆ m_switchedToT38

bool SIPConnection::m_switchedToT38
protected

◆ m_symmetricOpenStream

bool SIPConnection::m_symmetricOpenStream
protected

◆ originalInvite

SIP_PDU* SIPConnection::originalInvite
protected

◆ originalInviteTime

PTime SIPConnection::originalInviteTime
protected

◆ pendingInvitations

PSafeList<SIPTransaction> SIPConnection::pendingInvitations
protected

◆ releaseMethod

enum { ... } SIPConnection::releaseMethod

◆ sessionTimer

PTimer SIPConnection::sessionTimer
protected

◆ transport

OpalTransport* SIPConnection::transport
protected

Referenced by GetTransport().


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