#include <SessionContext.h>

This includes adjusting SDP and configuring the Media Relay when needed.
Public Member Functions | |
| SessionContext (const SipMessage &sipRequest, const NatTraversalRules *pNatRules, const UtlString &handle, MediaRelay *pMediaRelayToUse, const RegistrationDB *pRegistrationDB, CallTrackerInterfaceForSessionContext *pOwningCallTracker) | |
| virtual | ~SessionContext () |
| virtual UtlContainableType | getContainableType (void) const |
| virtual unsigned | hash () const |
| virtual int | compareTo (UtlContainable const *rhsContainable) const |
| bool | handleRequest (SipMessage &message, const char *address, int port, bool bFromCallerToCallee) |
| void | handleResponse (SipMessage &message, const char *address, int port) |
| void | handleCleanUpTimerTick (void) |
| virtual bool | doesEndpointsLocationImposeMediaRelay (void) const |
| Determines whether or not a media relay needs to be employed in the media session between the caller and the callee baed o ntheir relative location in the network. | |
| virtual bool | allocateMediaRelaySession (const UtlString &handleOfRequestingDialogContext, tMediaRelayHandle &relayHandle, int &callerRelayRtpPort, int &calleeRelayRtpPort) |
| Requests the allocation of a media relay session on the Smmitron. | |
| virtual tMediaRelayHandle | cloneMediaRelaySession (const UtlString &handleOfRequestingDialogContext, tMediaRelayHandle &relayHandleToClone, bool doSwapCallerAndCallee) |
| Requests the cloning of an existing media relay session. | |
| virtual bool | deallocateMediaRelaySession (const UtlString &handleOfRequestingDialogContext, const tMediaRelayHandle &relayHandle) |
| Requests the de-allocation of a previously allocated media relay session. | |
| virtual bool | setMediaRelayDirectionMode (const UtlString &handleOfRequestingDialogContext, const tMediaRelayHandle &relayHandle, MediaDirectionality mediaRelayDirectionMode, EndpointRole endpointRole) |
| Configures the directionality of the media relay. | |
| virtual bool | linkFarEndMediaRelayPortToRequester (const UtlString &handleOfRequestingDialogContext, const tMediaRelayHandle &relayHandle, const MediaDescriptor *pMediaDescriptor, EndpointRole endpointRoleOfRequester) |
| Establishes the requester as the media destination for the far-end's media relay port. | |
| virtual bool | getMediaRelayAddressToUseInSdp (UtlString &mediaRelayAddressToUse, EndpointRole endpointRole) const |
| Computes the media relay IP address to use when patching SDP originating from endpoint designated by endpointRole param. | |
| virtual int | getRtpRelayPortForMediaRelaySession (const tMediaRelayHandle &handle, EndpointRole endpointRole) |
| Used to query the RTP port that a given MediaRelaySession has allocated to the endpoint whose role is passed as a parameter. | |
| virtual void | reportDialogTrackerReadyForDeletion (const UtlString &handleOfRequestingDialogContext) |
| Used to notify the owning SessionContext that the dialog a DialogTracker non longer needs to be tracked and that the DialogTracker object is redy for deletion. | |
| virtual bool | getPacketProcessingStatsForMediaRelaySession (const tMediaRelayHandle &handle, PacketProcessingStatistics &stats) |
| Retrieves the packet processing statistics for a given media relay session designated by its handle. | |
| const EndpointDescriptor & | getEndpointDescriptor (EndpointRole endpointRole) const |
| ssize_t | getNumberOfTrackedDialogs (void) const |
| DialogTracker * | getDialogTrackerForMessage (const SipMessage &message) const |
Static Public Member Functions | |
| static EndpointDescriptor * | createCallerEndpointDescriptor (const SipMessage &sipRequest, const NatTraversalRules &natTraversalRules) |
| Creates an endpoint descriptor representing the caller. | |
| static EndpointDescriptor * | createCalleeEndpointDescriptor (const SipMessage &sipRequest, const NatTraversalRules &natTraversalRules, const RegistrationDB *pRegistrationDB) |
| Creates an endpoint descriptor representing the callee. | |
Static Public Attributes | |
| static const UtlContainableType | TYPE = "SessionContext" |
Private Types | |
| enum | SdpRecipient { SDP_TOWARDS_CALLER, SDP_TOWARDS_CALLEE } |
Private Member Functions | |
| UtlString | getDiscriminatingTagValue (const SipMessage &message, bool bFromCallerToCallee) const |
| < Class type used for runtime checking | |
| UtlString | getDiscriminatingTagValue (const SipMessage &message) const |
| DialogTracker * | getDialogTrackerForTag (const UtlString &tag) const |
| void | addDialogTrackerToList (const UtlString &tag, DialogTracker *pNewDialogTracker) |
| bool | removeDialogTrackerFromListAndDelete (const UtlString &tag) |
| DialogTracker * | allocateNewDialogTrackerBasedOnReference (const UtlString &discriminatingTag) |
| ssize_t | deleteDialogTrackersReadyForDeletion (void) |
Private Attributes | |
| UtlString | mSystemIdentificationString |
| CseqData | mDialogFormingInviteCseq |
| UtlString | mDialogOriginalFromTag |
| DialogTracker * | mpReferenceDialogTracker |
| EndpointDescriptor * | mpCaller |
| EndpointDescriptor * | mpCallee |
| const NatTraversalRules * | mpNatTraversalRules |
| UtlString | mHandle |
| MediaRelay * | mpMediaRelay |
| UtlHashMap | mDialogTrackersMap |
| CallTrackerInterfaceForSessionContext * | mpOwningCallTracker |
| vector< UtlString > | mListOfDialogTrackersReadyForDeletion |
Friends | |
| class | SessionContextTest |
Classes | |
| struct | CseqData |
enum SdpRecipient [private] |
| SessionContext | ( | const SipMessage & | sipRequest, | |
| const NatTraversalRules * | pNatRules, | |||
| const UtlString & | handle, | |||
| MediaRelay * | pMediaRelayToUse, | |||
| const RegistrationDB * | pRegistrationDB, | |||
| CallTrackerInterfaceForSessionContext * | pOwningCallTracker | |||
| ) |
| ~SessionContext | ( | ) | [virtual] |
| UtlContainableType getContainableType | ( | void | ) | const [virtual] |
Implements UtlContainable.
| unsigned hash | ( | ) | const [virtual] |
Implements UtlContainable.
| int compareTo | ( | UtlContainable const * | rhsContainable | ) | const [virtual] |
Implements UtlContainable.
| bool handleRequest | ( | SipMessage & | message, | |
| const char * | address, | |||
| int | port, | |||
| bool | bFromCallerToCallee | |||
| ) |
| void handleResponse | ( | SipMessage & | message, | |
| const char * | address, | |||
| int | port | |||
| ) |
| void handleCleanUpTimerTick | ( | void | ) |
| bool doesEndpointsLocationImposeMediaRelay | ( | void | ) | const [virtual] |
Determines whether or not a media relay needs to be employed in the media session between the caller and the callee baed o ntheir relative location in the network.
Implements SessionContextInterfaceForDialogTracker.
| bool allocateMediaRelaySession | ( | const UtlString & | handleOfRequestingDialogContext, | |
| tMediaRelayHandle & | relayHandle, | |||
| int & | callerRelayRtpPort, | |||
| int & | calleeRelayRtpPort | |||
| ) | [virtual] |
Requests the allocation of a media relay session on the Smmitron.
| [in] | handleOfRequestingDialogContext | - what it says |
| [out] | relayHandle | - handle to allocated media relay session |
| [out] | callerRelayRtpPort | - RTP port representing caller on the Symmitron. This is the RTP port the callee will be asked to send its media to. |
| [out] | calleeRelayRtpPort | - RTP port representing callee on the Symmitron. This is the RTP port the caller will be asked to send its media to. |
Implements SessionContextInterfaceForDialogTracker.
| tMediaRelayHandle cloneMediaRelaySession | ( | const UtlString & | handleOfRequestingDialogContext, | |
| tMediaRelayHandle & | relayHandleToClone, | |||
| bool | doSwapCallerAndCallee | |||
| ) | [virtual] |
Requests the cloning of an existing media relay session.
This cloning technique is utilized in scenarios where multiple unrelated dialogs use the same media relay session. The best example of such a scenario is a 3PCC call such as MOH.
| [in] | handleOfRequestingDialogContext | - what it says |
| [in] | relayHandleToClone | - handle of media relay session to clone |
| [in] | doSwapCallerAndCallee | - indicates whether or not the roles of the caller and callee need to be inverted in the cloned session. |
Implements SessionContextInterfaceForDialogTracker.
| bool deallocateMediaRelaySession | ( | const UtlString & | handleOfRequestingDialogContext, | |
| const tMediaRelayHandle & | relayHandle | |||
| ) | [virtual] |
Requests the de-allocation of a previously allocated media relay session.
| [in] | handleOfRequestingDialogContext | - what it says |
| [in] | relayHandle | - handle of media relay session to de-allocate |
Implements SessionContextInterfaceForDialogTracker.
| bool setMediaRelayDirectionMode | ( | const UtlString & | handleOfRequestingDialogContext, | |
| const tMediaRelayHandle & | relayHandle, | |||
| MediaDirectionality | mediaRelayDirectionMode, | |||
| EndpointRole | endpointRole | |||
| ) | [virtual] |
Configures the directionality of the media relay.
Note that the directionality specified in the 'mediaRelayDirectionMode' parameter is referenced from the caller.
| [in] | handleOfRequestingDialogContext | - what it says |
| [in] | relayHandle | - handle of media relay session on which to apply the direction mode |
| [in] | mediaRelayDirectionMode | - direction mode to apply to media relay session referenced to the originator of the request. |
| [in] | endpointRole | - role of the originator of the request. |
Implements SessionContextInterfaceForDialogTracker.
| bool linkFarEndMediaRelayPortToRequester | ( | const UtlString & | handleOfRequestingDialogContext, | |
| const tMediaRelayHandle & | relayHandle, | |||
| const MediaDescriptor * | pMediaDescriptor, | |||
| EndpointRole | endpointRoleOfRequester | |||
| ) | [virtual] |
Establishes the requester as the media destination for the far-end's media relay port.
| [in] | handleOfRequestingDialogContext | - what it says |
| [in] | relayHandle | - handle of media relay session to apply the change |
| [in] | pMediaDescriptor | - pointer descriptor containing information about the requestor |
| [in] | endpointRoleOfRequester | - role of requestor. |
Implements SessionContextInterfaceForDialogTracker.
| bool getMediaRelayAddressToUseInSdp | ( | UtlString & | mediaRelayAddressToUse, | |
| EndpointRole | endpointRole | |||
| ) | const [virtual] |
Computes the media relay IP address to use when patching SDP originating from endpoint designated by endpointRole param.
| [out] | mediaRelayAddressToUse | - will contain the Symmitron address to use when patching SDP |
| [in] | endpointRole | - role of endpoint making the request. |
Implements SessionContextInterfaceForDialogTracker.
| int getRtpRelayPortForMediaRelaySession | ( | const tMediaRelayHandle & | handle, | |
| EndpointRole | endpointRole | |||
| ) | [virtual] |
Used to query the RTP port that a given MediaRelaySession has allocated to the endpoint whose role is passed as a parameter.
| [in] | handle | - handle of media relay session to query ]param [in] endpointRole - role of endpoint for which to retrieve RTP port |
Implements SessionContextInterfaceForDialogTracker.
| void reportDialogTrackerReadyForDeletion | ( | const UtlString & | handleOfRequestingDialogContext | ) | [virtual] |
Used to notify the owning SessionContext that the dialog a DialogTracker non longer needs to be tracked and that the DialogTracker object is redy for deletion.
| [in] | handleOfRequestingDialogContext | - what it says |
Implements SessionContextInterfaceForDialogTracker.
| bool getPacketProcessingStatsForMediaRelaySession | ( | const tMediaRelayHandle & | handle, | |
| PacketProcessingStatistics & | stats | |||
| ) | [virtual] |
Retrieves the packet processing statistics for a given media relay session designated by its handle.
| [in] | handle | - handle of media relay session for which to obtain packet processing stats |
| [out] | stats | - structure that will receive the requested stats information |
Implements SessionContextInterfaceForDialogTracker.
| const EndpointDescriptor & getEndpointDescriptor | ( | EndpointRole | endpointRole | ) | const |
| ssize_t getNumberOfTrackedDialogs | ( | void | ) | const |
| DialogTracker * getDialogTrackerForMessage | ( | const SipMessage & | message | ) | const |
| EndpointDescriptor * createCallerEndpointDescriptor | ( | const SipMessage & | sipRequest, | |
| const NatTraversalRules & | natTraversalRules | |||
| ) | [static] |
Creates an endpoint descriptor representing the caller.
| [in] | sipRequest | - request from which caller endpoint descritptor will be initialized |
| [in] | natTraversalRules | - rules containing valuable topology info to initialize descriptor |
| EndpointDescriptor * createCalleeEndpointDescriptor | ( | const SipMessage & | sipRequest, | |
| const NatTraversalRules & | natTraversalRules, | |||
| const RegistrationDB * | pRegistrationDB | |||
| ) | [static] |
Creates an endpoint descriptor representing the callee.
| [in] | sipRequest | - request from which callee endpoint descritptor will be initialized |
| [in] | natTraversalRules | - rules containing valuable topology info to initialize descriptor |
| [in] | pRegistrationDB | - pointer to registration DB sometimes used to deduce the callee's location info |
| UtlString getDiscriminatingTagValue | ( | const SipMessage & | message, | |
| bool | bFromCallerToCallee | |||
| ) | const [private] |
< Class type used for runtime checking
| UtlString getDiscriminatingTagValue | ( | const SipMessage & | message | ) | const [private] |
| DialogTracker * getDialogTrackerForTag | ( | const UtlString & | tag | ) | const [private] |
| void addDialogTrackerToList | ( | const UtlString & | tag, | |
| DialogTracker * | pNewDialogTracker | |||
| ) | [private] |
| bool removeDialogTrackerFromListAndDelete | ( | const UtlString & | tag | ) | [private] |
| DialogTracker * allocateNewDialogTrackerBasedOnReference | ( | const UtlString & | discriminatingTag | ) | [private] |
| ssize_t deleteDialogTrackersReadyForDeletion | ( | void | ) | [private] |
friend class SessionContextTest [friend] |
const UtlContainableType TYPE = "SessionContext" [static] |
Reimplemented from UtlContainable.
UtlString mSystemIdentificationString [private] |
CseqData mDialogFormingInviteCseq [private] |
UtlString mDialogOriginalFromTag [private] |
DialogTracker* mpReferenceDialogTracker [private] |
EndpointDescriptor* mpCaller [private] |
EndpointDescriptor* mpCallee [private] |
const NatTraversalRules* mpNatTraversalRules [private] |
MediaRelay* mpMediaRelay [private] |
UtlHashMap mDialogTrackersMap [private] |
vector<UtlString> mListOfDialogTrackersReadyForDeletion [private] |