OPAL  Version 3.18.8
OpalRTPConnection Class Reference

#include <rtpconn.h>

Inheritance diagram for OpalRTPConnection:
Collaboration diagram for OpalRTPConnection:

Public Types

typedef PSafeDictionary< PKey
< unsigned >, OpalMediaSession
SessionMap
 
- Public Types inherited from OpalConnection
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,
  SynchronousSetUp = 0x1000
}
 

Public Member Functions

Construction
 OpalRTPConnection (OpalCall &call, OpalRTPEndPoint &endpoint, const PString &token, unsigned options=0, OpalConnection::StringOptions *stringOptions=NULL)
 
 ~OpalRTPConnection ()
 
virtual void OnReleased ()
 
Overrides from OpalConnection
virtual OpalMediaStreamCreateMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, PBoolean isSource)
 
virtual bool GetMediaTransportAddresses (OpalConnection &otherConnection, unsigned sessionId, const OpalMediaType &mediaType, OpalTransportAddressArray &transports) const
 
virtual void AdjustMediaFormats (bool local, const OpalConnection *otherConnection, OpalMediaFormatList &mediaFormats) const
 
virtual void OnPatchMediaStream (PBoolean isSource, OpalMediaPatch &patch)
 
virtual bool OnMediaCommand (OpalMediaStream &stream, const OpalMediaCommand &command)
 
virtual PBoolean SendUserInputTone (char tone, unsigned duration=0)
 
RTP Session Management
virtual unsigned GetNextSessionID (const OpalMediaType &mediaType, bool isSource)
 
virtual
OpalMediaCryptoSuite::KeyExchangeModes 
GetMediaCryptoKeyExchangeModes () const
 
vector< bool > CreateAllMediaSessions ()
 
virtual OpalMediaSessionCreateMediaSession (unsigned sessionId, const OpalMediaType &mediaType, const PString &sessionType=PString::Empty())
 
virtual OpalMediaSessionGetMediaSession (unsigned sessionID) const
 
virtual OpalMediaSessionFindSessionByMediaType (const OpalMediaType &mediaType) const
 
virtual OpalMediaSessionFindSessionByLocalPort (WORD port) const
 
virtual OpalMediaSessionUseMediaSession (unsigned sessionId, const OpalMediaType &mediaType, const PString &sessionType=PString::Empty())
 
virtual void ReleaseMediaSession (unsigned sessionID)
 
virtual bool ChangeSessionID (unsigned fromSessionID, unsigned toSessionID)
 
virtual void ReplaceMediaSession (unsigned sessionId, OpalMediaSession *mediaSession)
 
virtual void AddAudioVideoGroup (const PString &id=OpalMediaSession::GetBundleGroupId())
 
virtual void SetAudioVideoMediaStreamIDs (OpalRTPSession::Direction direction)
 
virtual bool SetSessionQoS (OpalRTPSession *session)
 
NAT Management
virtual void DetermineRTPNAT (const OpalTransport &transport, const OpalTransportAddress &signalAddr)
 
- Public Member Functions inherited from OpalConnection
 P_DECLARE_TRACED_ENUM_EX (CallEndReasonCodes, NumCallEndReasons, EndedByLocalUser, 0, 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, EndedByMediaFailed, EndedByCallCompletedElsewhere, EndedByCertificateAuthority, EndedByIllegalAddress, EndedByCustomCode)
 
 P_DECLARE_TRACED_ENUM (AnswerCallResponse, AnswerCallNow, AnswerCallDenied, AnswerCallPending, AnswerCallDeferred, AnswerCallAlertWithMedia, AnswerCallDeferredWithMedia, AnswerCallProgress, AnswerCallNowAndReleaseCurrent)
 
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 OnApplyStringOptions ()
 Call back for connection to act on changed string options. More...
 
virtual void EnableRecording ()
 
virtual void DisableRecording ()
 
 PDECLARE_NOTIFIER (RTP_DataFrame, OpalConnection, OnRecordAudio)
 
void InternalOnRecordAudio (PString key, PAutoPtr< RTP_DataFrame > frame)
 
 PDECLARE_NOTIFIER (RTP_DataFrame, OpalConnection, OnRecordVideo)
 
void InternalOnRecordVideo (PString key, PAutoPtr< RTP_DataFrame > frame)
 
virtual void OnStartRecording (OpalMediaPatch *patch)
 
virtual void OnStopRecording (OpalMediaPatch *patch)
 
bool InternalOnConnected ()
 
bool InternalOnEstablished ()
 
void InternalSetAsOriginating ()
 
bool InternalRelease (CallEndReason reason)
 
void InternalOnReleased ()
 
void InternalExecuteMediaCommand (OpalMediaCommand *command)
 
void InternalCreatedMediaTransport (const OpalMediaTransportPtr &transport)
 
 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 SetUpConnection ()
 
virtual PBoolean OnSetUpConnection ()
 
virtual void OnProceeding ()
 
virtual void OnAlerting (bool withMedia)
 
virtual void OnAlerting ()
 
virtual PBoolean SetAlerting (const PString &calleeName, PBoolean withMedia)
 
virtual AnswerCallResponse OnAnswerCall (const PString &callerName)
 
virtual void AnsweringCall (AnswerCallResponse response)
 
virtual void OnConnected ()
 
virtual PBoolean SetConnected ()
 
virtual void OnEstablished ()
 
virtual bool OnTransferNotify (const PStringToString &info, const OpalConnection *transferringConnection)
 
virtual void Release (CallEndReason reason=EndedByLocalUser, bool synchronous=false)
 
virtual PString GetDestinationAddress ()
 
virtual PBoolean ForwardCall (const PString &forwardParty)
 
PSafePtr< OpalConnectionGetOtherPartyConnection () const
 
template<class cls >
PSafePtr< cls > GetOtherPartyConnectionAs () const
 
virtual OpalMediaFormatList GetMediaFormats () const
 
virtual OpalMediaFormatList GetLocalMediaFormats ()
 
virtual PStringArray GetMediaCryptoSuites () const
 
virtual bool RequireSymmetricMediaStreams () const
 
virtual
OpalMediaType::AutoStartMode 
GetAutoStart (const OpalMediaType &mediaType) const
 
virtual void AutoStartMediaStreams (bool transfer=false)
 
virtual OpalMediaStreamPtr OpenMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource)
 
bool CloseMediaStream (unsigned sessionId, bool source)
 
bool CloseMediaStream (OpalMediaStreamPtr stream)
 
bool RemoveMediaStream (OpalMediaStream &strm)
 
virtual void StartMediaStreams ()
 
virtual void CloseMediaStreams ()
 
virtual void PauseMediaStreams (bool paused)
 
virtual void OnPauseMediaStream (OpalMediaStream &strm, 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
 
bool GetStatistics (const OpalMediaType &mediaType, bool source, OpalMediaStatistics &statistics) const
 Get media statistics of the type, and of the specifed direction. More...
 
virtual PBoolean OnOpenMediaStream (OpalMediaStream &stream)
 
virtual void OnClosedMediaStream (const OpalMediaStream &stream)
 
virtual void OnFailedMediaStream (bool fromRemote, const PString &reason)
 
virtual void OnStartMediaPatch (OpalMediaPatch &patch)
 
virtual void OnStopMediaPatch (OpalMediaPatch &patch)
 
virtual bool OnMediaFailed (unsigned sessionId)
 
bool AllMediaFailed () const
 
virtual bool ExecuteMediaCommand (const OpalMediaCommand &command, bool aync=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)
 
OpalBandwidth GetBandwidthAvailable (OpalBandwidth::Direction dir) const
 
virtual bool SetBandwidthAvailable (OpalBandwidth::Direction dir, OpalBandwidth availableBandwidth)
 
virtual bool SetBandwidthAllocated (OpalBandwidth::Direction dir, OpalBandwidth newBandwidth)
 
virtual OpalBandwidth GetBandwidthUsed (OpalBandwidth::Direction dir) const
 
virtual bool SetBandwidthUsed (OpalBandwidth::Direction dir, OpalBandwidth releasedBandwidth, OpalBandwidth requiredBandwidth)
 
 P_DECLARE_TRACED_ENUM (SendUserInputModes, SendUserInputAsQ931, SendUserInputAsString, SendUserInputAsTone, SendUserInputAsRFC2833, SendUserInputAsInlineRFC2833=SendUserInputAsRFC2833, SendUserInputInBand, SendUserInputAsProtocolDefault)
 
virtual void SetSendUserInputMode (SendUserInputModes mode)
 
virtual SendUserInputModes GetSendUserInputMode () const
 
virtual SendUserInputModes GetRealSendUserInputMode () const
 
virtual PBoolean SendUserInputString (const PString &value)
 
virtual void OnUserInputString (const PString &value)
 
void OnUserInputStringCallback (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="YX#\r\n", unsigned lastDigitTimeout=4, unsigned firstDigitTimeout=30)
 
virtual PBoolean PromptUserInput (PBoolean play)
 
virtual bool GetConferenceState (OpalConferenceState *state) const
 
virtual bool RequestPresentationRole (bool release)
 
virtual bool OnChangedPresentationRole (const PString &newChairURI, bool request)
 
virtual bool HasPresentationRole () const
 
OpalEndPointGetEndPoint () const
 
OpalCallGetCall () const
 
const PString & GetToken () const
 
virtual void SetToken (const PString &newToken)
 
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)
 
virtual PString GetPrefixName () const
 
const PString & GetLocalPartyName () const
 
virtual void SetLocalPartyName (const PString &name)
 
virtual PString GetLocalPartyURL () const
 
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
 
virtual OpalTransportAddress GetRemoteAddress () const
 
virtual PString GetRemotePartyURL () const
 
virtual PString GetRemoteIdentity () const
 
P_DEPRECATED PString GetRemotePartyAddress () const
 
P_DEPRECATED const PString GetRemotePartyCallbackURL () const
 
PCaselessString GetRemoteApplication () const
 
const OpalProductInfoGetRemoteProductInfo () const
 
void SetRemoteProductInfo (const OpalProductInfo &info)
 
const PString & GetRedirectingParty () const
 
void SetRedirectingParty (const PString &party)
 
const PString & GetCalledPartyName () const
 
void SetCalledPartyName (const PString &name)
 
const PString & GetCalledPartyNumber () const
 
virtual PString GetCalledPartyURL ()
 
virtual PMultiPartList GetExtraCallInfo () const
 
void CopyPartyNames (const OpalConnection &other)
 
virtual PString GetAlertingType () const
 
virtual bool SetAlertingType (const PString &info)
 
virtual PString GetCallInfo () const
 
virtual PString GetSupportedFeatures () const
 
unsigned GetMinAudioJitterDelay () const
 
unsigned GetMaxAudioJitterDelay () const
 
void SetAudioJitterDelay (unsigned minDelay, unsigned maxDelay)
 
OpalSilenceDetectorGetSilenceDetector () const
 
virtual PString GetIdentifier () const
 
virtual PINDEX GetMaxRtpPayloadSize () const
 
virtual bool IsNetworkConnection () const =0
 
 P_DECLARE_STREAMABLE_ENUM (Phases, UninitialisedPhase, SetUpPhase, ProceedingPhase, AlertingPhase, ConnectedPhase, EstablishedPhase, ForwardingPhase, ReleasingPhase, ReleasedPhase)
 
__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 bool TransferConnection (const PString &remoteParty)
 
virtual bool HoldRemote (bool placeOnHold)
 
virtual bool IsOnHold (bool fromRemote) const
 
virtual void OnHold (bool fromRemote, bool onHold)
 

Protected Member Functions

virtual bool GarbageCollection ()
 
 PDECLARE_NOTIFIER2 (OpalRFC2833Info, OpalRTPConnection, OnUserInputInlineRFC2833, OpalRFC2833Proto::NotifyState)
 
 P_REMOVE_VIRTUAL (PBoolean, IsRTPNATEnabled(const PIPSocket::Address &, const PIPSocket::Address &, const PIPSocket::Address &, PBoolean), false)
 
- Protected Member Functions inherited from OpalConnection
 PDECLARE_MUTEX (m_mediaSessionFailedMutex)
 

Protected Attributes

SessionMap m_sessions
 
bool m_remoteBehindNAT
 
OpalRFC2833Protom_rfc2833Handler
 
- Protected Attributes inherited from OpalConnection
OpalCallm_ownerCall
 
OpalEndPointm_endpoint
 
PString m_callToken
 
PBoolean m_originating
 
OpalProductInfo m_productInfo
 
PString m_localPartyName
 
PString m_displayName
 
PString m_remotePartyName
 
PString m_remotePartyURL
 
OpalProductInfo m_remoteProductInfo
 
PString m_remotePartyNumber
 
PString m_redirectingParty
 
CallEndReason m_callEndReason
 
PString m_calledPartyNumber
 
PString m_calledPartyName
 
SendUserInputModes m_sendUserInputMode
 
PString m_userInputString
 
PSyncPoint m_userInputAvailable
 
OpalSilenceDetectorm_silenceDetector
 
OpalMediaFormat m_filterMediaFormat
 
OpalMediaFormatList m_localMediaFormats
 
StreamDict m_mediaStreams
 
PSafeList< OpalMediaTransportm_mediaTransports
 
OpalJitterBuffer::Params m_jitterParams
 
OpalBandwidth m_rxBandwidthAvailable
 
OpalBandwidth m_txBandwidthAvailable
 
StringOptions m_stringOptions
 
PString m_recordingFilename
 
PNotifier m_recordAudioNotifier
 
PNotifier m_recordVideoNotifier
 
OpalMediaType::AutoStartMap m_autoStartInfo
 
ZeroTime m_phaseTime [NumPhases]
 
std::set< unsigned > m_mediaSessionFailed
 

Additional Inherited Members

- Static Public Member Functions inherited from OpalConnection
static PString GetCallEndReasonText (CallEndReason reason)
 
static void SetCallEndReasonText (CallEndReasonCodes reasonCode, const PString &newText)
 
- Protected Types inherited from OpalConnection
typedef PSafeDictionary
< StreamKey, OpalMediaStream
StreamDict
 

Detailed Description

This is the base class for OpalConnections that use RTP sessions, such as H.323 and SIPconnections to an endpoint.

Member Typedef Documentation

typedef PSafeDictionary<PKey<unsigned>, OpalMediaSession> OpalRTPConnection::SessionMap

Constructor & Destructor Documentation

OpalRTPConnection::OpalRTPConnection ( OpalCall call,
OpalRTPEndPoint endpoint,
const PString &  token,
unsigned  options = 0,
OpalConnection::StringOptions stringOptions = NULL 
)

Create a new connection.

Parameters
callOwner calll for connection
endpointOwner endpoint for connection
tokenToken to identify the connection
optionsConnection options
stringOptionsmore complex options
OpalRTPConnection::~OpalRTPConnection ( )

Destroy connection.

Member Function Documentation

virtual void OpalRTPConnection::AddAudioVideoGroup ( const PString &  id = OpalMediaSession::GetBundleGroupId())
virtual

Set group id, typically BUNDLE, for all audio/video sessions.

virtual void OpalRTPConnection::AdjustMediaFormats ( bool  local,
const OpalConnection otherConnection,
OpalMediaFormatList mediaFormats 
) const
virtual

Adjust media formats available on a connection. This is called by a connection after it has called OpalCall::GetMediaFormats() to get all media formats that it can use so that an application may remove or reorder the media formats before they are used to open media streams.

This function may also be executed by other connections in the call. If this happens then the "otherConnection" parameter will be non-NULL. The "local" parameter sense is relative to the "otherConnection" parameter, if NULL then it is relative to "this".

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

Parameters
localMedia formats a local ones to be presented to remote
otherConnectionOther connection we are adjusting media for
mediaFormatsMedia formats to use

Reimplemented from OpalConnection.

virtual bool OpalRTPConnection::ChangeSessionID ( unsigned  fromSessionID,
unsigned  toSessionID 
)
virtual

Change the sessionID for an existing session. This will adjust the RTP session and media streams.

Return false if no such session exists.

Parameters
fromSessionIDSession ID to search for
toSessionIDSession ID to change to
vector<bool> OpalRTPConnection::CreateAllMediaSessions ( )

Create all media sessions for available media types. Note that the sessions are not opened, just created.

Sessions using media security will alsoe be created if secure is true. This indicates the media key exchange can be done securely, typically it means signaling channel is also secure.

Returns
a list of the media types for which sessions where created.
virtual OpalMediaSession* OpalRTPConnection::CreateMediaSession ( unsigned  sessionId,
const OpalMediaType mediaType,
const PString &  sessionType = PString::Empty() 
)
virtual

Create an RTP session for the specified ID. The type of RTP session that is created will be compatible with the transport. At this time only IP (RTP over UDP) is supported.

Parameters
sessionIdUnique (in connection) session ID for session
mediaTypeMedia type for session
sessionTypeType of session to create
virtual OpalMediaStream* OpalRTPConnection::CreateMediaStream ( const OpalMediaFormat mediaFormat,
unsigned  sessionID,
PBoolean  isSource 
)
virtual

Create a new media stream. This will create a media stream of an appropriate subclass as required by the underlying connection protocol. For instance H.323 would create an OpalRTPStream.

The sessionID parameter may not be needed by a particular media stream and may be ignored. In the case of an OpalRTPStream it us used.

Note that media streams may be created internally to the underlying protocol. This function is not the only way a stream can come into existance.

Parameters
mediaFormatMedia format for stream
sessionIDSession number for stream
isSourceIs a source stream

Reimplemented from OpalConnection.

virtual void OpalRTPConnection::DetermineRTPNAT ( const OpalTransport transport,
const OpalTransportAddress signalAddr 
)
virtual

Determine if the RTP session needs to accommodate a NAT router. For endpoints that do not use STUN or something similar to set up all the correct protocol embeddded addresses correctly when a NAT router is between the endpoints, it is possible to still accommodate the call, with some restrictions. This function determines if the RTP can proceed with special NAT allowances.

The special allowance is that the RTP code will ignore whatever the remote indicates in the protocol for the address to send RTP data and wait for the first packet to arrive from the remote and will then proceed to send all RTP data back to that address AND port.

The default behaviour checks the values of the physical link (localAddr/peerAddr) against the signaling address the remote indicated in the protocol, eg H.323 SETUP sourceCallSignalAddress or SIP "To" or "Contact" fields, and makes a guess that the remote is behind a NAT router.

Parameters
transportTransport to get physical address of connection
signalAddrRemotes signaling address as indicated by protocol of connection

Reimplemented in H323Connection.

virtual OpalMediaSession* OpalRTPConnection::FindSessionByLocalPort ( WORD  port) const
virtual

Find an RTP session for the specified local port. If there is no session, NULL is returned.

Parameters
portLocal port number
virtual OpalMediaSession* OpalRTPConnection::FindSessionByMediaType ( const OpalMediaType mediaType) const
virtual

Find an RTP session for the media type. If there is no session, NULL is returned.

Parameters
mediaTypeMedia type for session
virtual bool OpalRTPConnection::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.

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

Indicate crypto key exchange modes available in media negotiation. For example, offers in CreateAllMediaSessions().

virtual OpalMediaSession* OpalRTPConnection::GetMediaSession ( unsigned  sessionID) const
virtual

Get an RTP session for the specified ID. If there is no session of the specified ID, NULL is returned.

Parameters
sessionIDRTP session number
virtual bool OpalRTPConnection::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

Reimplemented from OpalConnection.

Reimplemented in H323Connection.

virtual unsigned OpalRTPConnection::GetNextSessionID ( const OpalMediaType mediaType,
bool  isSource 
)
virtual

Get next available session ID for the media type.

Parameters
mediaTypeMedia type of stream being opened
isSourceStream is a source/sink

Reimplemented from OpalConnection.

Reimplemented in H323Connection.

virtual bool OpalRTPConnection::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 OpalConnection.

Reimplemented in H323Connection.

virtual void OpalRTPConnection::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

Reimplemented from OpalConnection.

virtual void OpalRTPConnection::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 OpalConnection.

Reimplemented in H323Connection.

OpalRTPConnection::P_REMOVE_VIRTUAL ( PBoolean  ,
IsRTPNATEnabled(const PIPSocket::Address &, const PIPSocket::Address &, const PIPSocket::Address &, PBoolean)  ,
false   
)
protected
OpalRTPConnection::PDECLARE_NOTIFIER2 ( OpalRFC2833Info  ,
OpalRTPConnection  ,
OnUserInputInlineRFC2833  ,
OpalRFC2833Proto::NotifyState   
)
protected
virtual void OpalRTPConnection::ReleaseMediaSession ( unsigned  sessionID)
virtual

Release the session.

Parameters
sessionIDRTP session number
virtual void OpalRTPConnection::ReplaceMediaSession ( unsigned  sessionId,
OpalMediaSession mediaSession 
)
virtual

Replace existing session with new one, exchanging transports.

Parameters
sessionIdSession ID to replace
mediaSessionNew session
virtual PBoolean OpalRTPConnection::SendUserInputTone ( char  tone,
unsigned  duration = 0 
)
virtual

Send a user input indication to the remote endpoint. This sends DTMF emulation user input indication.

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.

A duration of zero indicates that a default duration (90ms) is to be used.

The default behaviour sends the tone using RFC2833.

Parameters
toneDTMF tone code
durationDuration of tone in milliseconds

Reimplemented from OpalConnection.

Reimplemented in H323Connection.

virtual void OpalRTPConnection::SetAudioVideoMediaStreamIDs ( OpalRTPSession::Direction  direction)
virtual

Set the media stream identifiers for the audio/video sessions

virtual bool OpalRTPConnection::SetSessionQoS ( OpalRTPSession session)
virtual

Set QoS on session.

virtual OpalMediaSession* OpalRTPConnection::UseMediaSession ( unsigned  sessionId,
const OpalMediaType mediaType,
const PString &  sessionType = PString::Empty() 
)
virtual

Use an RTP session for the specified ID. This will find a session of the specified ID and uses it if available.

If there is no session of the specified ID one is created.

The type of RTP session that is created will be compatible with the transport. At this time only IP (RTP over UDP) is supported.

Parameters
sessionIdUnique (in connection) session ID for session
mediaTypeMedia type for session
sessionTypeType of session to create

Field Documentation

bool OpalRTPConnection::m_remoteBehindNAT
protected
OpalRFC2833Proto* OpalRTPConnection::m_rfc2833Handler
protected
SessionMap OpalRTPConnection::m_sessions
protected

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