CMceSession Class Reference

class CMceSession : public CBase

Base class for MCE sessions, inherited by both CMceInSession and CMceOutSession .

CMceSession represents peer-to-peer connection made with remote terminal. This connection is also known as dialog and it is set up using SIP INVITE method.

The characteristics of the session are defined by user of this class by attaching media streams into the session.

After the session has been succesfylly established, it can be later updated and must be finally terminated.

If for any reason instance of this class is deleted while in established state, session is automatically terminated by MCE server.

mceclient.lib

Inherits from

Public Member Functions
~CMceSession ()
IMPORT_C void AddBundleL ( CMceStreamBundle *)
void AddStreamL ( CMceMediaStream *)
IMPORT_C RPointerArray < CMceEvent > * AssociatedEventsL ()
IMPORT_C RPointerArray < CMceRefer > * AssociatedRefersL ()
TMceFactory BaseFactory ()
IMPORT_C const RPointerArray < CMceStreamBundle > & Bundles ()
IMPORT_C TBool ConnectionActive ()
IMPORT_C TControlPathSecurityLevel ControlPathSecurityLevel ()
TUint32 DialogId ()
void ErrorOccuredL ( TInt )
void EventReceivedL ( TMceIds &)
void EventReceivedL ( TMceIds &, CMceMsgBase &)
void EventReceivedL ( TMceIds &, CMceMsgBase &, HBufC8 *)
void ExternalizeFlatL ( RWriteStream &)
void ExternalizeL ( MMceComSerializationContext &)
void FCErrorOccurred ( TInt )
void FCMessageReceived ( HBufC8 *)
TMceFactory Factory ()
IMPORT_C void GetModifierL ( TMceSessionModifier , TUint &)
void GetSIPParams ( CDesC8Array *&, HBufC8 *&, CDesC8Array *&)
CMceItcSender & ITCSender ()
TUint32 Id ()
void IncomingUpdateL ( CMceInSession *, HBufC8 *)
void InternalizeFlatL ( RReadStream &)
void InternalizeL ( MMceComSerializationContext &)
TBool IsZombie ()
CMceManager & Manager ()
IMPORT_C const TDesC8 & Originator ()
void PrepareForITC ( TMceIds &)
IMPORT_C TUint32 Profile ()
IMPORT_C const TDesC8 & Recipient ()
IMPORT_C void RemoveBundleL ( CMceStreamBundle &)
IMPORT_C void RemoveStreamL ( CMceMediaStream &)
void SIPParamsCleanup ( TAny *)
IMPORT_C TMceTransactionId SendRequestL (const TDesC8 &, CDesC8Array *, HBufC8 *, HBufC8 *)
IMPORT_C void SendResponseL ( TMceTransactionId , const TDesC8 &, TUint32 , CDesC8Array *, HBufC8 *, HBufC8 *)
TUint64 SerializationId ()
IMPORT_C TUint32 ServiceType ()
IMPORT_C MDesC8Array * SessionSDPLinesL ()
IMPORT_C TUint32 SessionTimer ()
void SetFCObserver ( MMceFcMsgObserver *)
IMPORT_C void SetModifierL ( TMceSessionModifier , TUint )
void SetSIPParams ( CDesC8Array *, HBufC8 *, CDesC8Array *)
IMPORT_C void SetServiceTypeL ( TUint32 )
IMPORT_C void SetSessionSDPLinesL ( CDesC8Array *)
void SetZombie ( CMceInSession &)
IMPORT_C TState State ()
IMPORT_C const RPointerArray < CMceMediaStream > & Streams ()
IMPORT_C void TerminateL ( CDesC8Array *, HBufC8 *, HBufC8 *)
TMceSessionType Type ()
IMPORT_C void UpdateL ( TUint32 , CDesC8Array *, HBufC8 *, HBufC8 *, CDesC8Array *)
Protected Member Functions
CMceSession ( CMceManager *, TUint32 )
void ConstructL ( TBool )
void DoAddStreamL ( CMceMediaStream *)
void InitializeL ( TBool , TBool )
void SendITCEventL ( TUint8 )
TBool StreamInitializeCondition ( CMceMediaStream &)
void SynchronizeL ( TMceIds &)
Private Member Functions
void EventReceivedL ( TMceEvent &)
void HandleEvent ( TMceEvent &)
void HandleEventRequestReceivedL ( TMceEvent &)
void HandleEventResponseReceivedL ( TMceEvent &)
void SendUpdateL ( HBufC8 *)
TBool SetContainer ( CMceMsgSIPReply &, HBufC8 *)
TBool SetContainer ( CMceMsgSIPData &, HBufC8 *)
void SetContainer ( CMceMsgArray < TMceFactory > &, HBufC8 *)
void UpdateFailed ( TMceEvent &, TMceTransactionDataContainer *)
void UpdateL ( CMceSession &)
void Updated ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enum TControlPathSecurityLevel { EControlPathSecurityUnknown , EControlPathUnsecure , EControlPathSecure }
enum TReason { EDeclined , EBusy , ECancelled , EDisconnected }
enum TState {
EIdle , EOffering , EIncoming , EReserving , EAnswering , EProceeding , EEstablished , ECancelling , ETerminating , ETerminated
}
Protected Attributes
MMceFcMsgObserver * iFCObserver
CMceComSession * iFlatData
CMceManager * iManager
RPointerArray < CMceMediaStream > iMediaStreams
TUint32 iProfileId
CMceSessionReceiver * iReceiver
CMceItcSender * iSender
Private Attributes
RPointerArray < CMceStreamBundle > iBundles
TAny * iReserved

Constructor & Destructor Documentation

CMceSession(CMceManager *, TUint32)

CMceSession ( CMceManager * aManager,
TUint32 aProfileId
) [protected]

C++ default constructor.

Parameters

CMceManager * aManager
TUint32 aProfileId

~CMceSession()

~CMceSession ( ) [virtual]

Destructor.

Member Functions Documentation

AddBundleL(CMceStreamBundle *)

IMPORT_C void AddBundleL ( CMceStreamBundle * aBundle )
Adds grouped media streams to the session. Changes SDP of the session. In order to get complete update, whole session must be updated causing sending of re-invite.
Pre-condition
State() == CMceSession::EIdle || State() == CMceSession::EIncoming || State() == CMceSession::EEstablished
aBundle != 0

Parameters

CMceStreamBundle * aBundle group of media streams; ownership of the bundle is transferred

AddStreamL(CMceMediaStream *)

void AddStreamL ( CMceMediaStream * aMediaStream ) [virtual]
Adds media stream into session.
Pre-condition
State() == CMceSession::EIdle || State() == CMceSession::EIncoming || State() == CMceSession::EEstablished
aMediaStream != 0

Parameters

CMceMediaStream * aMediaStream

AssociatedEventsL()

IMPORT_C RPointerArray < CMceEvent > * AssociatedEventsL ( ) const

Returns the associated events, if any.

AssociatedRefersL()

IMPORT_C RPointerArray < CMceRefer > * AssociatedRefersL ( ) const

Returns the associated refers, if any.

BaseFactory()

TMceFactory BaseFactory ( )

Factory

Bundles()

IMPORT_C const RPointerArray < CMceStreamBundle > & Bundles ( ) const

Gets the grouped media streams of the session.

ConnectionActive()

IMPORT_C TBool ConnectionActive ( ) const

Returns the state of network connection of the session.

ConstructL(TBool)

void ConstructL ( TBool aUpdateSession = EFalse ) [protected]

second-phase constructor

Parameters

TBool aUpdateSession = EFalse

ControlPathSecurityLevel()

IMPORT_C TControlPathSecurityLevel ControlPathSecurityLevel ( ) const

Checks the assumed end-to-end security level on the session control/signalling path.

DialogId()

TUint32 DialogId ( ) const

Dialog ID

DoAddStreamL(CMceMediaStream *)

void DoAddStreamL ( CMceMediaStream * aMediaStream ) [protected]

Adds stream to media streams list

Parameters

CMceMediaStream * aMediaStream media stream

ErrorOccuredL(TInt)

void ErrorOccuredL ( TInt aError )

Handling of error

Parameters

TInt aError the error

EventReceivedL(TMceIds &)

void EventReceivedL ( TMceIds & aId )

Handles reception of session update

Parameters

TMceIds & aId id of object whose state is needed to be updated

EventReceivedL(TMceIds &, CMceMsgBase &)

void EventReceivedL ( TMceIds & aId,
CMceMsgBase & aMessage
)

Handles reception of session update

Parameters

TMceIds & aId id of object whose state is needed to be updated
CMceMsgBase & aMessage the message

EventReceivedL(TMceIds &, CMceMsgBase &, HBufC8 *)

void EventReceivedL ( TMceIds & aId,
CMceMsgBase & aMessage,
HBufC8 * aContent
)

Handles reception of session update

Parameters

TMceIds & aId id of object whose state is needed to be updated
CMceMsgBase & aMessage the message
HBufC8 * aContent the content

EventReceivedL(TMceEvent &)

void EventReceivedL ( TMceEvent & aEvent ) [private]

Traversal event handler

Parameters

TMceEvent & aEvent the event

ExternalizeFlatL(RWriteStream &)

void ExternalizeFlatL ( RWriteStream & aWriteStream )

Externalizes flat data

Parameters

RWriteStream & aWriteStream write stream

ExternalizeL(MMceComSerializationContext &)

void ExternalizeL ( MMceComSerializationContext & aSerCtx ) [virtual]

Externalizes

Parameters

MMceComSerializationContext & aSerCtx context for serialization

FCErrorOccurred(TInt)

void FCErrorOccurred ( TInt aError )

Floor control error handling

Parameters

TInt aError FC error

FCMessageReceived(HBufC8 *)

void FCMessageReceived ( HBufC8 * aMessage )

Floor control message handling

Parameters

HBufC8 * aMessage FC message

Factory()

TMceFactory Factory ( ) [static]

Factory

GetModifierL(TMceSessionModifier, TUint &)

IMPORT_C void GetModifierL ( TMceSessionModifier aModifier,
TUint & aValue
) const
Gets session modifier of type TUint.
leave
KErrNotFound if modifier is not found

Parameters

TMceSessionModifier aModifier is a modifier to be retrieved
TUint & aValue on return will contain modifier value

GetSIPParams(CDesC8Array *&, HBufC8 *&, CDesC8Array *&)

void GetSIPParams ( CDesC8Array *& aHeaders,
HBufC8 *& aContentType,
CDesC8Array *& aContentHeaders
)

Returns SIP params and gives ownership of them to caller. After call, SIP params are destroyed from session

Parameters

CDesC8Array *& aHeaders SIP headers
HBufC8 *& aContentType SIP content type
CDesC8Array *& aContentHeaders SIP content headers

HandleEvent(TMceEvent &)

void HandleEvent ( TMceEvent & aEvent ) [private]

Handles event

Parameters

TMceEvent & aEvent the event

HandleEventRequestReceivedL(TMceEvent &)

void HandleEventRequestReceivedL ( TMceEvent & aEvent ) [private]

Handles Request Event within session

Parameters

TMceEvent & aEvent the event

HandleEventResponseReceivedL(TMceEvent &)

void HandleEventResponseReceivedL ( TMceEvent & aEvent ) [private]

Handles Responses Event within session

Parameters

TMceEvent & aEvent the event

ITCSender()

CMceItcSender & ITCSender ( ) const

Gets sender for ITC.

Id()

TUint32 Id ( ) const

ID

IncomingUpdateL(CMceInSession *, HBufC8 *)

void IncomingUpdateL ( CMceInSession * aInSession,
HBufC8 * aContent
)

Handles reception of session update

Parameters

CMceInSession * aInSession the incoming update
HBufC8 * aContent the content

InitializeL(TBool, TBool)

void InitializeL ( TBool aClientSideMedia = ETrue,
TBool aDiscardUnusedCodecs = EFalse
) [protected]

Initializes

Parameters

TBool aClientSideMedia = ETrue
TBool aDiscardUnusedCodecs = EFalse

InternalizeFlatL(RReadStream &)

void InternalizeFlatL ( RReadStream & aReadStream )

Internalizes flat data

Parameters

RReadStream & aReadStream read stream

InternalizeL(MMceComSerializationContext &)

void InternalizeL ( MMceComSerializationContext & aSerCtx ) [virtual]

Internalizes

Parameters

MMceComSerializationContext & aSerCtx context for serialization

IsZombie()

TBool IsZombie ( )

Return ETrue, if session is zombie by update

Manager()

CMceManager & Manager ( ) const

Gets manager

Originator()

IMPORT_C const TDesC8 & Originator ( ) const

PrepareForITC(TMceIds &)

void PrepareForITC ( TMceIds & aId )

Prepares ids for ITC

Parameters

TMceIds & aId ITC ids

Profile()

IMPORT_C TUint32 Profile ( ) const

Returns the identifier of profile used by the sesison.

Recipient()

IMPORT_C const TDesC8 & Recipient ( ) const
Returns the recipient of the session.
Pre-condition
State() == CMceSession::EIncoming || State() == CMceSession::EEstablished

RemoveBundleL(CMceStreamBundle &)

IMPORT_C void RemoveBundleL ( CMceStreamBundle & aBundle )
Removes grouped media stream from session. Changes SDP of the session. In order to get complete update, whole session must be updated causing sending of re-invite.
Pre-condition
State() == CMceSession::EIdle || State() == CMceSession::EIncoming || State() == CMceSession::EEstablished
Post-condition
aBundle cannot be used anymore and contents of previously returned bundle array ( CMceSession::Bundles() ) are not anymore valid

Parameters

CMceStreamBundle & aBundle bundle to be removed

RemoveStreamL(CMceMediaStream &)

IMPORT_C void RemoveStreamL ( CMceMediaStream & aMediaStream )
Removes media stream from session.
Pre-condition
State() == CMceSession::EIdle || State() == CMceSession::EIncoming || State() == CMceSession::EEstablished
Post-condition
aMediaStream cannot be used anymore and contents of previously returned stream array ( CMceSession::Streams() ) are not anymore valid

Parameters

CMceMediaStream & aMediaStream media stream to be removed

SIPParamsCleanup(TAny *)

void SIPParamsCleanup ( TAny * aSession ) [static]

Handles SIP parameter cleanup in leave situations.

Parameters

TAny * aSession

SendITCEventL(TUint8)

void SendITCEventL ( TUint8 aITCFunction ) [protected]

Sends an ITC event

Parameters

TUint8 aITCFunction ITC operation

SendRequestL(const TDesC8 &, CDesC8Array *, HBufC8 *, HBufC8 *)

IMPORT_C TMceTransactionId SendRequestL ( const TDesC8 & aMethod,
CDesC8Array * aHeaders = 0,
HBufC8 * aContentType = 0,
HBufC8 * aContent = 0
)
Sends an outgoing extension SIP request such as INFO within an existing session.
Pre-condition
State() != CMceSession::EIdle && State() != CMceSession::EIncoming && State() != CMceSession::ETerminated
aMethod != "REGISTER" |"INVITE" | "BYE" | "CANCEL" | "ACK" | "SUBSCRIBE" | "NOTIFY" | "UPDATE" | "PRACK" | "REFER"

Parameters

const TDesC8 & aMethod
CDesC8Array * aHeaders = 0
HBufC8 * aContentType = 0
HBufC8 * aContent = 0

SendResponseL(TMceTransactionId, const TDesC8 &, TUint32, CDesC8Array *, HBufC8 *, HBufC8 *)

IMPORT_C void SendResponseL ( TMceTransactionId aTransactionId,
const TDesC8 & aReason,
TUint32 aCode,
CDesC8Array * aHeaders = 0,
HBufC8 * aContentType = 0,
HBufC8 * aContent = 0
)
Sends a response to an incoming extension SIP request such as INFO within an existing session.
Pre-condition
State() != CMceSession::EIdle && State() != CMceSession::EIncoming && State() != CMceSession::ETerminated

Parameters

TMceTransactionId aTransactionId Transaction Identifier
const TDesC8 & aReason
TUint32 aCode
CDesC8Array * aHeaders = 0
HBufC8 * aContentType = 0
HBufC8 * aContent = 0

SendUpdateL(HBufC8 *)

void SendUpdateL ( HBufC8 * aContent ) [private]

Sends the Update

Parameters

HBufC8 * aContent

SerializationId()

TUint64 SerializationId ( ) const

Returns serialization id

ServiceType()

IMPORT_C TUint32 ServiceType ( ) const

Returns setting for type of service value for outgoing datagrams used in session.

SessionSDPLinesL()

IMPORT_C MDesC8Array * SessionSDPLinesL ( )

Gets SDP lines of the session.

SessionTimer()

IMPORT_C TUint32 SessionTimer ( ) const

Returns the session timer value of the session.

SetContainer(CMceMsgSIPReply &, HBufC8 *)

TBool SetContainer ( CMceMsgSIPReply & aReply,
HBufC8 * aContent
) [private]

Sets container based on response

Parameters

CMceMsgSIPReply & aReply the data for container
HBufC8 * aContent a content

SetContainer(CMceMsgSIPData &, HBufC8 *)

TBool SetContainer ( CMceMsgSIPData & aRequest,
HBufC8 * aContent
) [private]

Sets container based on request

Parameters

CMceMsgSIPData & aRequest the data for container
HBufC8 * aContent a content

SetContainer(CMceMsgArray< TMceFactory > &, HBufC8 *)

void SetContainer ( CMceMsgArray < TMceFactory > & aMsgArray,
HBufC8 * aContent
) [private]

Sets container based on response & handles session update

Parameters

CMceMsgArray < TMceFactory > & aMsgArray the data for container
HBufC8 * aContent a content

SetFCObserver(MMceFcMsgObserver *)

void SetFCObserver ( MMceFcMsgObserver * aPtr )

Sets observer for FC.

Parameters

MMceFcMsgObserver * aPtr

SetModifierL(TMceSessionModifier, TUint)

IMPORT_C void SetModifierL ( TMceSessionModifier aModifier,
TUint aValue
)
Sets session modifier of type TUint.
leave
KErrNotFound if modifier is not found

Parameters

TMceSessionModifier aModifier is a modifier to be set
TUint aValue is a new value of a modifier

SetSIPParams(CDesC8Array *, HBufC8 *, CDesC8Array *)

void SetSIPParams ( CDesC8Array * aHeaders,
HBufC8 * aContentType,
CDesC8Array * aContentHeaders
)

Sets SIP params

Parameters

CDesC8Array * aHeaders SIP headers
HBufC8 * aContentType SIP content type
CDesC8Array * aContentHeaders SIP content headers

SetServiceTypeL(TUint32)

IMPORT_C void SetServiceTypeL ( TUint32 aServiceType )
Configures connections of the session by setting type of service value for outgoing datagrams.
Pre-condition
State() == CMceSession::EIdle || State() == CMceSession::EIncoming
aServiceType >= 0 && aServiceType < 256

Parameters

TUint32 aServiceType

SetSessionSDPLinesL(CDesC8Array *)

IMPORT_C void SetSessionSDPLinesL ( CDesC8Array * aSessionSDPLines )
Configures session by updating SDP session lines. In order to get complete update, whole session must be updated causing sending of re-invite.
Pre-condition
State() == CMceSession::EIdle || State() == CMceSession::EIncoming || State() == CMceSession::EEstablished
aSessionSDPLines != 0

Parameters

CDesC8Array * aSessionSDPLines

SetZombie(CMceInSession &)

void SetZombie ( CMceInSession & aInSession )

Sets this instance as zombie

Parameters

CMceInSession & aInSession the incoming update

State()

IMPORT_C TState State ( ) const

Returns the state of the session.

StreamInitializeCondition(CMceMediaStream &)

TBool StreamInitializeCondition ( CMceMediaStream & aMediaStream ) const [protected, pure virtual]

Checks if the stream should be initialized.

Parameters

CMceMediaStream & aMediaStream media stream

Streams()

IMPORT_C const RPointerArray < CMceMediaStream > & Streams ( ) const

Returns the streams belonging to the session.

SynchronizeL(TMceIds &)

void SynchronizeL ( TMceIds & aIds ) [protected]

Synchronizes session data with server

Parameters

TMceIds & aIds ITC ids

TerminateL(CDesC8Array *, HBufC8 *, HBufC8 *)

IMPORT_C void TerminateL ( CDesC8Array * aHeaders = 0,
HBufC8 * aContentType = 0,
HBufC8 * aContent = 0
)
Terminates established session.
Pre-condition
State() == CMceSession::EEstablished
Post-condition
State() == CMceSession::ETerminating

Parameters

CDesC8Array * aHeaders = 0
HBufC8 * aContentType = 0
HBufC8 * aContent = 0

Type()

TMceSessionType Type ( ) const [virtual]

Returns the type of the session.

UpdateFailed(TMceEvent &, TMceTransactionDataContainer *)

void UpdateFailed ( TMceEvent & aEvent,
TMceTransactionDataContainer * aContainer
) [private]

Called after update has failed

Parameters

TMceEvent & aEvent
TMceTransactionDataContainer * aContainer

UpdateL(TUint32, CDesC8Array *, HBufC8 *, HBufC8 *, CDesC8Array *)

IMPORT_C void UpdateL ( TUint32 aTimeout = 0,
CDesC8Array * aHeaders = 0,
HBufC8 * aContentType = 0,
HBufC8 * aContent = 0,
CDesC8Array * aContentHeaders = 0
)
Updates offered session parameters during session establishement phase for first answer. Updates established session using re-invite. In state EIncoming the timeout value must be smaller or equal to offered value obtained by SessionTimer() .
Pre-condition
State() == CMceSession::EIncoming || State() == CMceSession::EEstablished
Post-condition
State() == CMceSession::EReserving for incoming session || State() == CMceSession::EOffering for established session

Parameters

TUint32 aTimeout = 0
CDesC8Array * aHeaders = 0
HBufC8 * aContentType = 0
HBufC8 * aContent = 0
CDesC8Array * aContentHeaders = 0

UpdateL(CMceSession &)

void UpdateL ( CMceSession & aSession ) [private]

Updates whole session object witn new one

Parameters

CMceSession & aSession new session

Updated()

void Updated ( ) [private]

Called after update

Member Enumerations Documentation

Enum TControlPathSecurityLevel

Enumerators

EControlPathSecurityUnknown
EControlPathUnsecure
EControlPathSecure

Enum TReason

Enumerators

EDeclined
EBusy
ECancelled
EDisconnected

Enum TState

Enumerators

EIdle
EOffering
EIncoming
EReserving
EAnswering
EProceeding
EEstablished
ECancelling
ETerminating
ETerminated

Member Data Documentation

RPointerArray< CMceStreamBundle > iBundles

RPointerArray < CMceStreamBundle > iBundles [private]

bundles

MMceFcMsgObserver * iFCObserver

MMceFcMsgObserver * iFCObserver [protected]

FC observer

CMceComSession * iFlatData

CMceComSession * iFlatData [protected]

flat data container

CMceManager * iManager

CMceManager * iManager [protected]

manager

RPointerArray< CMceMediaStream > iMediaStreams

RPointerArray < CMceMediaStream > iMediaStreams [protected]

media streams

TUint32 iProfileId

TUint32 iProfileId [protected]

profile id

CMceSessionReceiver * iReceiver

CMceSessionReceiver * iReceiver [protected]

receiver

TAny * iReserved

TAny * iReserved [private]

CMceItcSender * iSender

CMceItcSender * iSender [protected]

sender