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 voidAddBundleL(CMceStreamBundle *)
voidAddStreamL(CMceMediaStream *)
IMPORT_C RPointerArray< CMceEvent > *AssociatedEventsL()
IMPORT_C RPointerArray< CMceRefer > *AssociatedRefersL()
TMceFactory BaseFactory()
IMPORT_C const RPointerArray< CMceStreamBundle > &Bundles()
IMPORT_C TBoolConnectionActive()
IMPORT_C TControlPathSecurityLevelControlPathSecurityLevel()
TUint32 DialogId()
voidErrorOccuredL(TInt)
voidEventReceivedL(TMceIds &)
voidEventReceivedL(TMceIds &, CMceMsgBase &)
voidEventReceivedL(TMceIds &, CMceMsgBase &, HBufC8 *)
voidExternalizeFlatL(RWriteStream &)
voidExternalizeL(MMceComSerializationContext &)
voidFCErrorOccurred(TInt)
voidFCMessageReceived(HBufC8 *)
TMceFactory Factory()
IMPORT_C voidGetModifierL(TMceSessionModifier, TUint &)
voidGetSIPParams(CDesC8Array *&, HBufC8 *&, CDesC8Array *&)
CMceItcSender &ITCSender()
TUint32 Id()
voidIncomingUpdateL(CMceInSession *, HBufC8 *)
voidInternalizeFlatL(RReadStream &)
voidInternalizeL(MMceComSerializationContext &)
TBool IsZombie()
CMceManager &Manager()
IMPORT_C const TDesC8 &Originator()
voidPrepareForITC(TMceIds &)
IMPORT_C TUint32Profile()
IMPORT_C const TDesC8 &Recipient()
IMPORT_C voidRemoveBundleL(CMceStreamBundle &)
IMPORT_C voidRemoveStreamL(CMceMediaStream &)
voidSIPParamsCleanup(TAny *)
IMPORT_C TMceTransactionIdSendRequestL(const TDesC8 &, CDesC8Array *, HBufC8 *, HBufC8 *)
IMPORT_C voidSendResponseL(TMceTransactionId, const TDesC8 &, TUint32, CDesC8Array *, HBufC8 *, HBufC8 *)
TUint64 SerializationId()
IMPORT_C TUint32ServiceType()
IMPORT_C MDesC8Array *SessionSDPLinesL()
IMPORT_C TUint32SessionTimer()
voidSetFCObserver(MMceFcMsgObserver *)
IMPORT_C voidSetModifierL(TMceSessionModifier, TUint)
voidSetSIPParams(CDesC8Array *, HBufC8 *, CDesC8Array *)
IMPORT_C voidSetServiceTypeL(TUint32)
IMPORT_C voidSetSessionSDPLinesL(CDesC8Array *)
voidSetZombie(CMceInSession &)
IMPORT_C TStateState()
IMPORT_C const RPointerArray< CMceMediaStream > &Streams()
IMPORT_C voidTerminateL(CDesC8Array *, HBufC8 *, HBufC8 *)
TMceSessionType Type()
IMPORT_C voidUpdateL(TUint32, CDesC8Array *, HBufC8 *, HBufC8 *, CDesC8Array *)
Protected Member Functions
CMceSession(CMceManager *, TUint32)
voidConstructL(TBool)
voidDoAddStreamL(CMceMediaStream *)
voidInitializeL(TBool, TBool)
voidSendITCEventL(TUint8)
TBool StreamInitializeCondition(CMceMediaStream &)
voidSynchronizeL(TMceIds &)
Private Member Functions
voidEventReceivedL(TMceEvent &)
voidHandleEvent(TMceEvent &)
voidHandleEventRequestReceivedL(TMceEvent &)
voidHandleEventResponseReceivedL(TMceEvent &)
voidSendUpdateL(HBufC8 *)
TBool SetContainer(CMceMsgSIPReply &, HBufC8 *)
TBool SetContainer(CMceMsgSIPData &, HBufC8 *)
voidSetContainer(CMceMsgArray< TMceFactory > &, HBufC8 *)
voidUpdateFailed(TMceEvent &, TMceTransactionDataContainer *)
voidUpdateL(CMceSession &)
voidUpdated()
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
enumTControlPathSecurityLevel { EControlPathSecurityUnknown, EControlPathUnsecure, EControlPathSecure }
enumTReason { EDeclined, EBusy, ECancelled, EDisconnected }
enumTState {
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,
TUint32aProfileId
)[protected]

C++ default constructor.

Parameters

CMceManager * aManager
TUint32 aProfileId

~CMceSession()

~CMceSession()[virtual]

Destructor.

Member Functions Documentation

AddBundleL(CMceStreamBundle *)

IMPORT_C voidAddBundleL(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 * aBundlegroup of media streams; ownership of the bundle is transferred

AddStreamL(CMceMediaStream *)

voidAddStreamL(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 TBoolConnectionActive()const

Returns the state of network connection of the session.

ConstructL(TBool)

voidConstructL(TBoolaUpdateSession = EFalse)[protected]

second-phase constructor

Parameters

TBool aUpdateSession = EFalse

ControlPathSecurityLevel()

IMPORT_C TControlPathSecurityLevelControlPathSecurityLevel()const

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

DialogId()

TUint32 DialogId()const

Dialog ID

DoAddStreamL(CMceMediaStream *)

voidDoAddStreamL(CMceMediaStream *aMediaStream)[protected]

Adds stream to media streams list

Parameters

CMceMediaStream * aMediaStreammedia stream

ErrorOccuredL(TInt)

voidErrorOccuredL(TIntaError)

Handling of error

Parameters

TInt aErrorthe error

EventReceivedL(TMceIds &)

voidEventReceivedL(TMceIds &aId)

Handles reception of session update

Parameters

TMceIds & aIdid of object whose state is needed to be updated

EventReceivedL(TMceIds &, CMceMsgBase &)

voidEventReceivedL(TMceIds &aId,
CMceMsgBase &aMessage
)

Handles reception of session update

Parameters

TMceIds & aIdid of object whose state is needed to be updated
CMceMsgBase & aMessagethe message

EventReceivedL(TMceIds &, CMceMsgBase &, HBufC8 *)

voidEventReceivedL(TMceIds &aId,
CMceMsgBase &aMessage,
HBufC8 *aContent
)

Handles reception of session update

Parameters

TMceIds & aIdid of object whose state is needed to be updated
CMceMsgBase & aMessagethe message
HBufC8 * aContentthe content

EventReceivedL(TMceEvent &)

voidEventReceivedL(TMceEvent &aEvent)[private]

Traversal event handler

Parameters

TMceEvent & aEventthe event

ExternalizeFlatL(RWriteStream &)

voidExternalizeFlatL(RWriteStream &aWriteStream)

Externalizes flat data

Parameters

RWriteStream & aWriteStreamwrite stream

ExternalizeL(MMceComSerializationContext &)

voidExternalizeL(MMceComSerializationContext &aSerCtx)[virtual]

Externalizes

Parameters

MMceComSerializationContext & aSerCtxcontext for serialization

FCErrorOccurred(TInt)

voidFCErrorOccurred(TIntaError)

Floor control error handling

Parameters

TInt aErrorFC error

FCMessageReceived(HBufC8 *)

voidFCMessageReceived(HBufC8 *aMessage)

Floor control message handling

Parameters

HBufC8 * aMessageFC message

Factory()

TMceFactory Factory()[static]

Factory

GetModifierL(TMceSessionModifier, TUint &)

IMPORT_C voidGetModifierL(TMceSessionModifieraModifier,
TUint &aValue
)const
Gets session modifier of type TUint.
leave
KErrNotFound if modifier is not found

Parameters

TMceSessionModifier aModifieris a modifier to be retrieved
TUint & aValueon return will contain modifier value

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

voidGetSIPParams(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 *& aHeadersSIP headers
HBufC8 *& aContentTypeSIP content type
CDesC8Array *& aContentHeadersSIP content headers

HandleEvent(TMceEvent &)

voidHandleEvent(TMceEvent &aEvent)[private]

Handles event

Parameters

TMceEvent & aEventthe event

HandleEventRequestReceivedL(TMceEvent &)

voidHandleEventRequestReceivedL(TMceEvent &aEvent)[private]

Handles Request Event within session

Parameters

TMceEvent & aEventthe event

HandleEventResponseReceivedL(TMceEvent &)

voidHandleEventResponseReceivedL(TMceEvent &aEvent)[private]

Handles Responses Event within session

Parameters

TMceEvent & aEventthe event

ITCSender()

CMceItcSender &ITCSender()const

Gets sender for ITC.

Id()

TUint32 Id()const

ID

IncomingUpdateL(CMceInSession *, HBufC8 *)

voidIncomingUpdateL(CMceInSession *aInSession,
HBufC8 *aContent
)

Handles reception of session update

Parameters

CMceInSession * aInSessionthe incoming update
HBufC8 * aContentthe content

InitializeL(TBool, TBool)

voidInitializeL(TBoolaClientSideMedia = ETrue,
TBoolaDiscardUnusedCodecs = EFalse
)[protected]

Initializes

Parameters

TBool aClientSideMedia = ETrue
TBool aDiscardUnusedCodecs = EFalse

InternalizeFlatL(RReadStream &)

voidInternalizeFlatL(RReadStream &aReadStream)

Internalizes flat data

Parameters

RReadStream & aReadStreamread stream

InternalizeL(MMceComSerializationContext &)

voidInternalizeL(MMceComSerializationContext &aSerCtx)[virtual]

Internalizes

Parameters

MMceComSerializationContext & aSerCtxcontext 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
Returns the originator of the session.
Pre-condition
State() == CMceSession::EIdle || State() == CMceSession::EIncoming || State() == CMceSession::EEstablished

PrepareForITC(TMceIds &)

voidPrepareForITC(TMceIds &aId)

Prepares ids for ITC

Parameters

TMceIds & aIdITC ids

Profile()

IMPORT_C TUint32Profile()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 voidRemoveBundleL(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 & aBundlebundle to be removed

RemoveStreamL(CMceMediaStream &)

IMPORT_C voidRemoveStreamL(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 & aMediaStreammedia stream to be removed

SIPParamsCleanup(TAny *)

voidSIPParamsCleanup(TAny *aSession)[static]

Handles SIP parameter cleanup in leave situations.

Parameters

TAny * aSession

SendITCEventL(TUint8)

voidSendITCEventL(TUint8aITCFunction)[protected]

Sends an ITC event

Parameters

TUint8 aITCFunctionITC operation

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

IMPORT_C TMceTransactionIdSendRequestL(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 voidSendResponseL(TMceTransactionIdaTransactionId,
const TDesC8 &aReason,
TUint32aCode,
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 aTransactionIdTransaction Identifier
const TDesC8 & aReason
TUint32 aCode
CDesC8Array * aHeaders = 0
HBufC8 * aContentType = 0
HBufC8 * aContent = 0

SendUpdateL(HBufC8 *)

voidSendUpdateL(HBufC8 *aContent)[private]

Sends the Update

Parameters

HBufC8 * aContent

SerializationId()

TUint64 SerializationId()const

Returns serialization id

ServiceType()

IMPORT_C TUint32ServiceType()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 TUint32SessionTimer()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 & aReplythe data for container
HBufC8 * aContenta content

SetContainer(CMceMsgSIPData &, HBufC8 *)

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

Sets container based on request

Parameters

CMceMsgSIPData & aRequestthe data for container
HBufC8 * aContenta content

SetContainer(CMceMsgArray< TMceFactory > &, HBufC8 *)

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

Sets container based on response & handles session update

Parameters

CMceMsgArray< TMceFactory > & aMsgArraythe data for container
HBufC8 * aContenta content

SetFCObserver(MMceFcMsgObserver *)

voidSetFCObserver(MMceFcMsgObserver *aPtr)

Sets observer for FC.

Parameters

MMceFcMsgObserver * aPtr

SetModifierL(TMceSessionModifier, TUint)

IMPORT_C voidSetModifierL(TMceSessionModifieraModifier,
TUintaValue
)
Sets session modifier of type TUint.
leave
KErrNotFound if modifier is not found

Parameters

TMceSessionModifier aModifieris a modifier to be set
TUint aValueis a new value of a modifier

SetSIPParams(CDesC8Array *, HBufC8 *, CDesC8Array *)

voidSetSIPParams(CDesC8Array *aHeaders,
HBufC8 *aContentType,
CDesC8Array *aContentHeaders
)

Sets SIP params

Parameters

CDesC8Array * aHeadersSIP headers
HBufC8 * aContentTypeSIP content type
CDesC8Array * aContentHeadersSIP content headers

SetServiceTypeL(TUint32)

IMPORT_C voidSetServiceTypeL(TUint32aServiceType)
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 voidSetSessionSDPLinesL(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 &)

voidSetZombie(CMceInSession &aInSession)

Sets this instance as zombie

Parameters

CMceInSession & aInSessionthe incoming update

State()

IMPORT_C TStateState()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 & aMediaStreammedia stream

Streams()

IMPORT_C const RPointerArray< CMceMediaStream > &Streams()const

Returns the streams belonging to the session.

SynchronizeL(TMceIds &)

voidSynchronizeL(TMceIds &aIds)[protected]

Synchronizes session data with server

Parameters

TMceIds & aIdsITC ids

TerminateL(CDesC8Array *, HBufC8 *, HBufC8 *)

IMPORT_C voidTerminateL(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 *)

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

Called after update has failed

Parameters

TMceEvent & aEvent
TMceTransactionDataContainer * aContainer

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

IMPORT_C voidUpdateL(TUint32aTimeout = 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 &)

voidUpdateL(CMceSession &aSession)[private]

Updates whole session object witn new one

Parameters

CMceSession & aSessionnew session

Updated()

voidUpdated()[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