MediaRelay Class Reference

#include <MediaRelay.h>

Inheritance diagram for MediaRelay:

OsNotification

List of all members.


Detailed Description

The class is used to abstract the Symmitron which is the external process that actually performs the media relaying.

Applicatiosn needing to use the services of the Symmitron need to isntantiate and initialize() a MediaRelay object which will take care of all the communication with the Symmitron. The API it exposes lets the application perform all the necessary operations to utilize the services of the Symmitron.

Public Member Functions

 MediaRelay ()
 ~MediaRelay ()
void notifySymmitronResetDetected (const UtlString &newSymmitronInstanceHandle)
 Method used to notify the MediaRelay class that a Symmitron reset was detected.
void notifyBridgeStatistics (const UtlString &bridgeId, intptr_t numberOfPacketsProcessed, void *opaqueData)
 Method used to notify the MediaRelay class that the bridge stats it has queried have been received.
bool initialize (const UtlString &publicAddress, const UtlString &nativeAddress, bool bXmlRpcSecured, bool isPartOfsipXLocalPrivateNetwork, int xmlRpcPort, size_t maxMediaRelaySessions)
 Method to call to initialize the MediaRelay object.
bool isPartOfsipXLocalPrivateNetwork (void) const
 Getter for isPartOfsipXLocalPrivateNetwork setting passed to initialize() method.
const UtlStringgetPublicAddress (void) const
 Getter for publicAddress setting passed to initialize() method.
const UtlStringgetNativeAddress (void) const
 Getter for nativeAddress setting passed to initialize() method.
bool allocateSession (tMediaRelayHandle &relayHandle, int &enpoint1RelayRtpPort, int &enpoint2RelayRtpPort)
 Method used to obtain a media relay session capable of relaying RTP and RTCP streams.
tMediaRelayHandle cloneSession (const tMediaRelayHandle &relayHandleToClone, bool doSwapCallerAndCallee)
bool deallocateSession (const tMediaRelayHandle &relayHandle)
bool setDirectionMode (const tMediaRelayHandle &relayHandle, MediaDirectionality mediaRelayDirectionMode)
bool linkSymToEndpoint (const tMediaRelayHandle &relayHandle, const UtlString &endpointIpAddress, int endpointRtpPort, int endpointRtcpPort, EndpointRole ownerOfSymToLink)
ssize_t incrementLinkCountOfMediaRelaySession (const tMediaRelayHandle &handle)
int getRtpRelayPortForMediaRelaySession (const tMediaRelayHandle &handle, EndpointRole endpointRole)
void deallocateAllSymmitronResourcesAndSignOut (void)
const UrlgetXmlRpcServerUrl (void) const
bool getPacketProcessingStatsForMediaRelaySession (const tMediaRelayHandle &handle, PacketProcessingStatistics &stats)
virtual OsStatus signal (intptr_t eventData)

Static Public Member Functions

static UtlHashMapexecuteAndValudateSymmitronRequest (XmlRpcRequest &requestToSend, UtlString &symmitronInstanceHandle, int &errorCode, UtlString &errorDescription, XmlRpcResponse &xmlRpcResponse, bool bRetryFailedConnection=true)

Private Member Functions

MediaRelaySessiongetSessionByHandle (const tMediaRelayHandle &handle)
bool preAllocateSymmitronResources (void)
UtlHashMapgetAndValidateStandardMap (XmlRpcResponse &responseToValidate, UtlString &symmitronInstanceHandle, int &errorCode, UtlString &errorDescription)
bool createPausedBridgeOnSymmitron (Sym *pEndpoint1Sym, Sym *pEndpoint2Sym, UtlString &returnedBridgeId, UtlString &symmitronInstanceHandle, int &errorCode, UtlString &errorDescription)
bool addSymToBridge (UtlString &symId, UtlString &bridgeId, UtlString &symmitronInstanceHandle, int &errorCode, UtlString &errorDescription)
void cleanUpEverything (void)

Private Attributes

UtlString mPublicAddress
UtlString mNativeAddress
bool mbIsPartOfsipXLocalPrivateNetwork
int mXmlRpcPort
size_t mMaxMediaRelaySessions
UtlHashMap mActiveMediaRelaySessions
int mRelaySessionHandle
Url mSymmitronUrl
UtlString mOurInstanceHandle
UtlString mSymmitronInstanceHandle
bool mbSignedInWithSymmitron
UtlSortedList mSymList
std::vector< MediaBridgePair * > mAvailableMediaBridgePairsList
std::vector< MediaBridgePair * > mBusyMediaBridgePairsList
AsynchMediaRelayRequestSender mAsynchMediaRelayRequestSender
OsMutex mMutex
OsTimer mGenericTimer
ssize_t mGenericTimerTickCounter
bool mbPollForSymmitronRecovery


Constructor & Destructor Documentation

MediaRelay (  ) 

~MediaRelay (  ) 


Member Function Documentation

void notifySymmitronResetDetected ( const UtlString newSymmitronInstanceHandle  ) 

Method used to notify the MediaRelay class that a Symmitron reset was detected.

void notifyBridgeStatistics ( const UtlString bridgeId,
intptr_t  numberOfPacketsProcessed,
void *  opaqueData 
)

Method used to notify the MediaRelay class that the bridge stats it has queried have been received.

bool initialize ( const UtlString publicAddress,
const UtlString nativeAddress,
bool  bXmlRpcSecured,
bool  isPartOfsipXLocalPrivateNetwork,
int  xmlRpcPort,
size_t  maxMediaRelaySessions 
)

Method to call to initialize the MediaRelay object.

  • publicAddress: [input] public IP address of Symmitron. If the symmitron is behind a NAT, that value should be the public IP address of that NAT otherwise it is the IP address of the machine it is running on.
  • nativeAddress: [input] IP address of the machine the Symmitron is running on
  • bXmlRpcSecured: [input] true will send XMLRPC over HTTPS, otherwise it will use HTTP.
  • isPartOfsipXLocalPrivateNetwork: [input] True of the symmitron is part of the same local private network as the application that will utilize the media relay.
  • xmlRpcPort: [input] Port number to utilize to communicate with Symmitron.
  • maxMediaRelaySessions: [input] maximum of media relay sessions to allocate

Returns: true for success and false for failure.

bool isPartOfsipXLocalPrivateNetwork ( void   )  const [inline]

Getter for isPartOfsipXLocalPrivateNetwork setting passed to initialize() method.

const UtlString& getPublicAddress ( void   )  const [inline]

Getter for publicAddress setting passed to initialize() method.

const UtlString& getNativeAddress ( void   )  const [inline]

Getter for nativeAddress setting passed to initialize() method.

bool allocateSession ( tMediaRelayHandle relayHandle,
int &  enpoint1RelayRtpPort,
int &  enpoint2RelayRtpPort 
)

Method used to obtain a media relay session capable of relaying RTP and RTCP streams.

  • relayHandle: [output] handle to allocated session
  • enpoint1RelayRtpPort: [output] RTP port that symmitron will expect traffic from. Note that RTCP port is +1;
  • enpoint2RelayRtpPort: [output] oOther RTP port that symmitron will expect traffic from Note that RTCP port is +1;

tMediaRelayHandle cloneSession ( const tMediaRelayHandle relayHandleToClone,
bool  doSwapCallerAndCallee 
)

bool deallocateSession ( const tMediaRelayHandle relayHandle  ) 

bool setDirectionMode ( const tMediaRelayHandle relayHandle,
MediaDirectionality  mediaRelayDirectionMode 
)

bool linkSymToEndpoint ( const tMediaRelayHandle relayHandle,
const UtlString endpointIpAddress,
int  endpointRtpPort,
int  endpointRtcpPort,
EndpointRole  ownerOfSymToLink 
)

ssize_t incrementLinkCountOfMediaRelaySession ( const tMediaRelayHandle handle  ) 

int getRtpRelayPortForMediaRelaySession ( const tMediaRelayHandle handle,
EndpointRole  endpointRole 
)

void deallocateAllSymmitronResourcesAndSignOut ( void   ) 

const Url & getXmlRpcServerUrl ( void   )  const

UtlHashMap * executeAndValudateSymmitronRequest ( XmlRpcRequest requestToSend,
UtlString symmitronInstanceHandle,
int &  errorCode,
UtlString errorDescription,
XmlRpcResponse xmlRpcResponse,
bool  bRetryFailedConnection = true 
) [static]

bool getPacketProcessingStatsForMediaRelaySession ( const tMediaRelayHandle handle,
PacketProcessingStatistics stats 
)

OsStatus signal ( intptr_t  eventData  )  [virtual]

Implements OsNotification.

MediaRelaySession * getSessionByHandle ( const tMediaRelayHandle handle  )  [private]

bool preAllocateSymmitronResources ( void   )  [private]

UtlHashMap* getAndValidateStandardMap ( XmlRpcResponse responseToValidate,
UtlString symmitronInstanceHandle,
int &  errorCode,
UtlString errorDescription 
) [private]

bool createPausedBridgeOnSymmitron ( Sym pEndpoint1Sym,
Sym pEndpoint2Sym,
UtlString returnedBridgeId,
UtlString symmitronInstanceHandle,
int &  errorCode,
UtlString errorDescription 
) [private]

bool addSymToBridge ( UtlString symId,
UtlString bridgeId,
UtlString symmitronInstanceHandle,
int &  errorCode,
UtlString errorDescription 
) [private]

void cleanUpEverything ( void   )  [private]


Member Data Documentation

int mXmlRpcPort [private]

size_t mMaxMediaRelaySessions [private]

int mRelaySessionHandle [private]

Url mSymmitronUrl [private]

bool mbSignedInWithSymmitron [private]

std::vector<MediaBridgePair*> mBusyMediaBridgePairsList [private]

OsMutex mMutex [private]

ssize_t mGenericTimerTickCounter [private]


Online Library Docs

sipXecs home page

Version 4.2.1-018930 2010-07-31T01:50:17 build33 abuild