Revision: 201019 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 17:18:08 +0300
branchRCL_3
changeset 10 4284d6390a82
parent 9 2492a6e4aed7
child 12 cca59d85ca31
Revision: 201019 Kit: 201019
telephonyprotocols/csdagt/src/ND_DIRCT.CPP
telephonyprotocols/csdagt/src/Nd_Bases.cpp
telephonyprotocols/pdplayer/group/bld.inf
telephonyprotocols/pdplayer/group/pdp.mmp
telephonyprotocols/pdplayer/inc/PDPSCPR.h
telephonyprotocols/pdplayer/inc/PDPSCPRStates.h
telephonyprotocols/pdplayer/src/PDPDeftSCPR.cpp
telephonyprotocols/pdplayer/src/PDPSCPR.cpp
telephonyprotocols/pdplayer/src/PDPSCPRStates.cpp
telephonyprotocols/rawipnif/group/RawIPNif.mmp
telephonyprotocols/rawipnif/group/RawIPNif2.mmp
telephonyprotocols/rawipnif/inc/Receiver.h
telephonyprotocols/rawipnif/inc/bttlog.h
telephonyprotocols/rawipnif/rawipnif2/inc/bttlog.h
telephonyprotocols/rawipnif/src/Receiver.cpp
telephonyprotocols/rawipnif/version1/inc/bttlog.h
telephonyserverplugins/simtsy/inc/CSimMbmsPacketContext.h
telephonyserverplugins/simtsy/src/CSimMbmsPacketContext.cpp
--- a/telephonyprotocols/csdagt/src/ND_DIRCT.CPP	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/csdagt/src/ND_DIRCT.CPP	Tue May 11 17:18:08 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -90,10 +90,18 @@
 	iDbAccess->GetCommPortRoleL(role);
 	TInt len;
 	iDbAccess->GetScriptDetailsL(iUseScript,len);
+	
 	if (!iUseScript || len==0)	
 		{		// set them consistently
 		iUseScript=EFalse;
 		}
+	
+	if (iNdScript != NULL)
+	    {
+        delete iNdScript;
+        iNdScript = NULL;
+	    }
+	
 	iNdScript=CNetDialScript::NewL(iDbAccess,iDlgPrc,commPort,role,len);	// create it whatever because we need other stuff
 	}
 
--- a/telephonyprotocols/csdagt/src/Nd_Bases.cpp	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/csdagt/src/Nd_Bases.cpp	Tue May 11 17:18:08 2010 +0300
@@ -29,7 +29,8 @@
 // Netdial SM base class 
 
 CNetdialSM::CNetdialSM(MAgentNotify& aControllerObserver, CDialogProcessor* aDlgPrc, CCommsDbAccess& aDbAccess)
-	: CAgentSMBase(aControllerObserver,aDlgPrc,aDbAccess)
+	: CAgentSMBase(aControllerObserver,aDlgPrc,aDbAccess),
+	  iNdScript(NULL)
 /**
 Constructor.
 
--- a/telephonyprotocols/pdplayer/group/bld.inf	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/pdplayer/group/bld.inf	Tue May 11 17:18:08 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -30,7 +30,7 @@
 PRJ_TESTMMPFILES
 
 
-#include "..\test\controlplane\group\bld.inf"
+#include "../test/controlplane/group/BLD.INF"
 
 #endif
 
--- a/telephonyprotocols/pdplayer/group/pdp.mmp	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/pdplayer/group/pdp.mmp	Tue May 11 17:18:08 2010 +0300
@@ -25,6 +25,9 @@
 UID            0x10009D8D 0x102822EF
 VENDORID       0x70000001
 
+//PDP logging in commsdbg.ini is enabled with  'LOG SPUD *'
+MACRO 	_INFO_LOG
+MACRO 	_ERROR_LOG
 
 SOURCEPATH     	../src
 SOURCE		PDPSCPRStates.cpp 
--- a/telephonyprotocols/pdplayer/inc/PDPSCPR.h	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/pdplayer/inc/PDPSCPR.h	Tue May 11 17:18:08 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -58,6 +58,7 @@
     class TRetrieveSipAddr;
     class TModifyActivePDPContext;
 	class TSetMbmsParameters;
+	class TCleanupFSM;
     }
 
 namespace PDPSCprActivities
@@ -93,6 +94,7 @@
     friend class PDPSCprStates::TRetrieveSipAddr;
 	friend class PDPSCprStates::TSetMbmsParameters;
     friend class PDPSCprStates::TModifyActivePDPContext;
+    friend class PDPSCprStates::TCleanupFSM;
 
 
 public:
--- a/telephonyprotocols/pdplayer/inc/PDPSCPRStates.h	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/pdplayer/inc/PDPSCPRStates.h	Tue May 11 17:18:08 2010 +0300
@@ -377,6 +377,16 @@
   	virtual TInt TransitionTag();
 DECLARE_SMELEMENT_FOOTER( TNoTagOrProviderStopped )
 
+DECLARE_SMELEMENT_HEADER( TCleanupFSM, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
+    virtual void DoL();
+DECLARE_SMELEMENT_FOOTER( TCleanupFSM)
+
+DECLARE_AGGREGATED_TRANSITION2(
+   TCleanupFSMAndDataClients,
+   PDPSCprStates::TCleanupFSM,
+   PRStates::TDestroyOrphanedDataClients
+   )    
+
 
 //===========================================================
 //   Sip Address retrieval
--- a/telephonyprotocols/pdplayer/src/PDPDeftSCPR.cpp	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/pdplayer/src/PDPDeftSCPR.cpp	Tue May 11 17:18:08 2010 +0300
@@ -65,7 +65,7 @@
     NODEACTIVITY_ENTRY(KNoTag, SCprStates::TStopYourFlows, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TTag<CoreNetStates::KNoDataClientsToStop>)
     THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KNoDataClientsToStop, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrProviderStopped)
     NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TDestroyPDPContext, PDPSCprStates::TAwaitingPDPContextDestroyed, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
-    THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PRStates::TDestroyOrphanedDataClients, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
+    THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TCleanupFSMAndDataClients, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
     LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, MeshMachine::TRaiseActivityError)
 NODEACTIVITY_END()
 }
@@ -103,21 +103,21 @@
 //           to TRejoin, whereas TRejoin doesn't mean swap - suggesting to
 //           introduce PDP level msg: TRejoinAndSwap.
 DECLARE_DEFINE_CUSTOM_NODEACTIVITY(ECFActivityGoneDown, PDPDeftSCprGoneDown, TPDPMessages::TPDPFSMMessage, PDPSCprStates::CPrimaryPDPGoneDownActivity::NewL)
-	FIRST_NODEACTIVITY_ENTRY(PDPSCprStates::TAwaitingPDPContextGoneDown, MeshMachine::TActiveOrNoTag<ECFActivityStartDataClient>)
-	THROUGH_NODEACTIVITY_ENTRY(KNoTag, MeshMachine::TDoNothing, PDPSCprStates::CPrimaryPDPGoneDownActivity::TNoTagOrProviderStopped)
+    FIRST_NODEACTIVITY_ENTRY(PDPSCprStates::TAwaitingPDPContextGoneDown, MeshMachine::TActiveOrNoTag<ECFActivityStartDataClient>)
+    THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TCleanupFSM, PDPSCprStates::CPrimaryPDPGoneDownActivity::TNoTagOrProviderStopped)
     THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TStoreOriginalDataClient, MeshMachine::TNoTag)
-	NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TRejoinDataClient, CoreNetStates::TAwaitingRejoinDataClientComplete, MeshMachine::TNoTag)
-	NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TApplyNewDefault, TAwaitingApplyResponseOrError, MeshMachine::TNoTag)
-	THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TSwitchToNewDefault, MeshMachine::TNoTag)
-	NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TStopOriginalDataClient, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TNoTag)
-
-	LAST_NODEACTIVITY_ENTRY(KNoTag, MeshMachine::TClearError)
-	THROUGH_NODEACTIVITY_ENTRY(KActiveTag, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrContentionTag)
-	//Awaiting for contention result, do not stop the start activity.
-	LAST_NODEACTIVITY_ENTRY(PDPSCprStates::KContentionTag, MeshMachine::TDoNothing)
-
-	LAST_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TCancelDataClientStartInPDP)
-
+    NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TRejoinDataClient, CoreNetStates::TAwaitingRejoinDataClientComplete, MeshMachine::TNoTag)
+    NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TApplyNewDefault, TAwaitingApplyResponseOrError, MeshMachine::TNoTag)
+    THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TSwitchToNewDefault, MeshMachine::TNoTag)
+    NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TStopOriginalDataClient, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TNoTag)
+    
+    LAST_NODEACTIVITY_ENTRY(KNoTag, MeshMachine::TClearError)
+    THROUGH_NODEACTIVITY_ENTRY(KActiveTag, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrContentionTag)
+    //Awaiting for contention result, do not stop the start activity.
+    LAST_NODEACTIVITY_ENTRY(PDPSCprStates::KContentionTag, MeshMachine::TDoNothing)
+    
+    LAST_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TCancelDataClientStartInPDP)
+    
     NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, CoreNetStates::TStopSelf, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
     LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TSendGoneDown)
 NODEACTIVITY_END()
--- a/telephonyprotocols/pdplayer/src/PDPSCPR.cpp	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/pdplayer/src/PDPSCPR.cpp	Tue May 11 17:18:08 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -91,7 +91,7 @@
     NODEACTIVITY_ENTRY(KNoTag, SCprStates::TStopYourFlows, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TTag<CoreNetStates::KNoDataClientsToStop>)
     THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KNoDataClientsToStop, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrProviderStopped)
     NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TDestroyPDPContext, PDPSCprStates::TAwaitingPDPContextDestroyed, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
-    THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PRStates::TDestroyOrphanedDataClients, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
+    THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TCleanupFSMAndDataClients, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
     LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, MeshMachine::TRaiseActivityError)
 NODEACTIVITY_END()
 }
@@ -106,7 +106,7 @@
     NODEACTIVITY_ENTRY(KNoTag, SCprStates::TStopYourFlows, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
 	THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrProviderStopped)
 	NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TDestroyPDPContext, PDPSCprStates::TAwaitingPDPContextDestroyed, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
-	THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PRStates::TDestroyOrphanedDataClients, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
+	THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TCleanupFSMAndDataClients, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
 	LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TSendDataClientStopped)
 NODEACTIVITY_END()
 }
--- a/telephonyprotocols/pdplayer/src/PDPSCPRStates.cpp	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/pdplayer/src/PDPSCPRStates.cpp	Tue May 11 17:18:08 2010 +0300
@@ -226,7 +226,9 @@
     
     //It's not legal for the qos defaults to be absent.
     CDefaultPacketQoSProvision* defaultQoS = NULL;
+    
     TRAPD(ret, defaultQoS = CDefaultPacketQoSProvision::NewL(aIapView));   
+    
     if ((KErrNone == ret) && defaultQoS)           
         {
         CleanupStack::PushL(defaultQoS);
@@ -658,115 +660,192 @@
     User::LeaveIfError(tNode.iProvisionFailure);
     
     ASSERT(tNode.iPdpFsmInterface);
-
-    iContext.Node().PostToClients<TDefaultClientMatchPolicy>(
+    
+    tNode.PostToClients<TDefaultClientMatchPolicy>(
             iContext.NodeId(),
             TCFMessage::TStateChange(
                     Elements::TStateChange(KPsdStartingConfiguration, KErrNone)).CRef(),
             TClientType(TCFClientType::ECtrlProvider));
-
-	CGPRSProvision* gprsProvision = const_cast<CGPRSProvision*>(static_cast<const CGPRSProvision*>(
-	    iContext.Node().AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId))));
-
-	//retrieve QoS (should be provisioned, but can also be overriden with SetParams).
-	RPacketQoS::TQoSR5Requested qosOverridenParams;
-	const RPacketQoS::TQoSR5Requested* qosParams = NULL;
-	if (! iContext.Node().iParameterBundle.IsNull() && ! iContext.Node().iParameterBundle.FindFamily(KSubConQoSFamily).IsNull())
-    	{
-    	MPDPParamMapper::MapQosParamBundleToEtelL(iContext.Node().iParameterBundle, qosOverridenParams);
-    	qosParams = &qosOverridenParams;
-    	}
-	else
-    	{
-    	const CDefaultPacketQoSProvision* defaultQoSProvision = static_cast<const CDefaultPacketQoSProvision*>(
-    	    iContext.Node().AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CDefaultPacketQoSProvision::EUid,CDefaultPacketQoSProvision::ETypeId)));
-    	qosParams = defaultQoSProvision ? &defaultQoSProvision->iParams : NULL;
-
+    
+    CGPRSProvision* gprsProvision = const_cast<CGPRSProvision*>(static_cast<const CGPRSProvision*>(
+        tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId))));
+    
+    if (gprsProvision == NULL)
+        {
+        User::Leave(KErrCorrupt);
+        }
+    
+    //retrieve QoS (should be provisioned, but can also be overriden with SetParams).
+    RPacketQoS::TQoSR5Requested qosOverridenParams;
+    
+    const RPacketQoS::TQoSR5Requested* qosParams = NULL;
+    
+    if ((!tNode.iParameterBundle.IsNull()) &&\
+            (!tNode.iParameterBundle.FindFamily(KSubConQoSFamily).IsNull()))
+        {
+        MPDPParamMapper::MapQosParamBundleToEtelL(tNode.iParameterBundle, qosOverridenParams);
+        qosParams = &qosOverridenParams;
+        }
+    else
+        {
+        const CDefaultPacketQoSProvision* defaultQoSProvision = static_cast<const CDefaultPacketQoSProvision*>(
+            tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CDefaultPacketQoSProvision::EUid,CDefaultPacketQoSProvision::ETypeId)));
+        
+        if (defaultQoSProvision)
+            {
+            qosParams = &defaultQoSProvision->iParams;
+            }
+        else
+            {
+            User::Leave(KErrCorrupt);
+            }
+    
         //Here we're taking the qos defaults from the provision info, hence skipping the iParameterBundle.
         //The lack of iParameterBundle however and the respective ERequested params is badly tolerated by the rest
         //of the code (e.g.: when subsequently raising granted params it is assumed something has been requested).
-        //Let's create a phoney requested params.
-        //iContext.Node().CreateParameterBundleL();
-		//RParameterFamily family = iContext.Node().iParameterBundle.CreateFamilyL(KSubConQoSFamily); //PJLEFT
-
-		RCFParameterFamilyBundle newBundle;
-		newBundle.CreateL();
-		iContext.Node().iParameterBundle.Open(newBundle);
-		RParameterFamily family = newBundle.CreateFamilyL(KSubConQoSFamily);
-		CSubConQosGenericParamSet::NewL(family, RParameterFamily::ERequested);
-    	}
-	TTFTInfo tft; //We'll use empty/thus default TFT
-	if (gprsProvision == NULL || qosParams == NULL)
-    	{
-    	User::Leave(KErrCorrupt);
-    	}
-
-	const CImsExtProvision* imsprov = static_cast<const CImsExtProvision*>(
-		iContext.Node().AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CImsExtProvision::EUid, CImsExtProvision::ETypeId)));
-
-	TRAP_IGNORE(iContext.Node().iIsModeGsm = IsModeGsmL());
-
-	switch (gprsProvision->UmtsGprsRelease())
-			{
-	    	case TPacketDataConfigBase::KConfigGPRS:
-				{
-				SetImsSignallingFlagL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption, imsprov->iImsSignalIndicator);
+ 
+        // These parameter bundles are also used in a situation when a context has failed to create because of a lack
+        // of modem / network resources, as the SCPR isn't torn down, the parameter bundles need to hold the 
+        // information of the default QoS otherwise bad things happen [bad QoS].
+        
+        RCFParameterFamilyBundle newBundle;
+        newBundle.CreateL();
+        tNode.iParameterBundle.Open(newBundle);
+        RParameterFamily family = newBundle.CreateFamilyL(KSubConQoSFamily);
+       
+        TInt tRelease = gprsProvision->UmtsGprsRelease();
+     
+        CSubConQosR99ParamSet* extRequestedR99  = NULL;
+        CSubConQosR99ParamSet* extAcceptableR99 = NULL;
+        CSubConQosR5ParamSet* extRequestedR5    = NULL;
+        CSubConQosR5ParamSet* extAcceptableR5   = NULL;
+        
+        if (tRelease == TPacketDataConfigBase::KConfigRel5)
+            {
+            // R5 - basically R4 + a few parameters
+        
+            extRequestedR5 = CSubConQosR5ParamSet::NewL(family,RParameterFamily::ERequested);        
+            extAcceptableR5 = CSubConQosR5ParamSet::NewL(family,RParameterFamily::EAcceptable);
 
-				// Only request SIP server address retrieval when network not in GSM/GPRS mode
-			    // e.g. UMTS/WCDMA
-				if (!iContext.Node().iIsModeGsm)
-				    {
-				    SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption);
-				    }
-				
-				SetChapInformationL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption);
-
-				}
-				break;
-
-	    	case TPacketDataConfigBase::KConfigRel5:
-		    case TPacketDataConfigBase::KConfigRel99Rel4:
-				{
-				SetImsSignallingFlagL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption, imsprov->iImsSignalIndicator);
-
-			    // Only request SIP server address retrieval when network not in GSM/GPRS mode
-			    // e.g. UMTS/WCDMA
-				if (!iContext.Node().iIsModeGsm)
-                    {
-                    SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption);
-                    }
-				
-				SetChapInformationL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption);
-				
-				}
-				break;				
-			}
-	
-	iContext.Node().iPDPFsmContextId = iContext.Node().iPdpFsmInterface->NewFsmContextL(iContext.Node(),SpudMan::EPrimary);
-
-    iContext.Node().PostToClients<TDefaultClientMatchPolicy>(
+            // Requested QoS Parameters
+            extRequestedR5->SetSourceStatisticsDescriptor(qosParams->iSourceStatisticsDescriptor);
+            extRequestedR5->SetSignallingIndicator(qosParams->iSignallingIndication);
+            
+            extRequestedR99 = dynamic_cast<CSubConQosR99ParamSet*>(extRequestedR5);
+                 
+            // Acceptable QoS Parameters
+            
+            extAcceptableR5->SetSourceStatisticsDescriptor(qosParams->iSourceStatisticsDescriptor);
+            extAcceptableR5->SetSignallingIndicator(qosParams->iSignallingIndication);
+            
+            extAcceptableR99 = dynamic_cast<CSubConQosR99ParamSet*>(extAcceptableR5);
+                      
+            }
+        else
+            {
+            // R4 and R99
+            extRequestedR99  = CSubConQosR99ParamSet::NewL(family,RParameterFamily::ERequested);
+            extAcceptableR99 = CSubConQosR99ParamSet::NewL(family,RParameterFamily::EAcceptable);
+            }
+        
+        // Requested QoS Parameters
+        extRequestedR99->SetTrafficClass(qosParams->iReqTrafficClass);
+        extRequestedR99->SetDeliveryOrder(qosParams->iReqDeliveryOrderReqd);
+        extRequestedR99->SetErroneousSDUDelivery(qosParams->iReqDeliverErroneousSDU);
+        extRequestedR99->SetResidualBitErrorRatio(qosParams->iReqBER);
+        extRequestedR99->SetSDUErrorRatio(qosParams->iReqSDUErrorRatio);
+        extRequestedR99->SetTrafficHandlingPriority(qosParams->iReqTrafficHandlingPriority);
+        extRequestedR99->SetTransferDelay(qosParams->iReqTransferDelay);
+        extRequestedR99->SetMaxSduSize(qosParams->iReqMaxSDUSize);
+        extRequestedR99->SetMaxBitrateUplink(qosParams->iReqMaxRate.iUplinkRate);
+        extRequestedR99->SetMaxBitrateDownlink(qosParams->iReqMaxRate.iDownlinkRate);
+        extRequestedR99->SetGuaBitrateUplink(qosParams->iReqGuaranteedRate.iUplinkRate);
+        extRequestedR99->SetGuaBitrateDownlink(qosParams->iReqGuaranteedRate.iDownlinkRate);    
+        
+        // Acceptable QoS Parameters
+        extAcceptableR99->SetTrafficClass(qosParams->iMinTrafficClass);
+        extAcceptableR99->SetDeliveryOrder(qosParams->iMinDeliveryOrderReqd);
+        extAcceptableR99->SetErroneousSDUDelivery(qosParams->iMinDeliverErroneousSDU);
+        extAcceptableR99->SetResidualBitErrorRatio(qosParams->iMaxBER);
+        extAcceptableR99->SetSDUErrorRatio(qosParams->iMaxSDUErrorRatio);
+        extAcceptableR99->SetTrafficHandlingPriority(qosParams->iMinTrafficHandlingPriority);
+        extAcceptableR99->SetTransferDelay(qosParams->iMaxTransferDelay);
+        extAcceptableR99->SetMaxSduSize(qosParams->iMinAcceptableMaxSDUSize);
+        extAcceptableR99->SetMaxBitrateUplink(qosParams->iMinAcceptableMaxRate.iUplinkRate);
+        extAcceptableR99->SetMaxBitrateDownlink(qosParams->iMinAcceptableMaxRate.iDownlinkRate);
+        extAcceptableR99->SetGuaBitrateUplink(qosParams->iMinGuaranteedRate.iUplinkRate);
+        extAcceptableR99->SetGuaBitrateDownlink(qosParams->iMinGuaranteedRate.iDownlinkRate);               
+        
+        }
+        
+    TTFTInfo tft; //We'll use empty/thus default TFT
+    
+    const CImsExtProvision* imsprov = static_cast<const CImsExtProvision*>(
+        tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CImsExtProvision::EUid, CImsExtProvision::ETypeId)));
+    
+    TRAP_IGNORE(tNode.iIsModeGsm = IsModeGsmL());
+    
+    switch (gprsProvision->UmtsGprsRelease())
+        {
+        case TPacketDataConfigBase::KConfigGPRS:
+            {
+            SetImsSignallingFlagL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption, imsprov->iImsSignalIndicator);
+        
+            // Only request SIP server address retrieval when network not in GSM/GPRS mode
+            // e.g. UMTS/WCDMA
+            if (!tNode.iIsModeGsm)
+                {
+                SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption);
+                }
+            
+            SetChapInformationL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption);
+        
+            }
+            break;
+        
+        case TPacketDataConfigBase::KConfigRel5:
+        case TPacketDataConfigBase::KConfigRel99Rel4:
+            {
+            SetImsSignallingFlagL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption, imsprov->iImsSignalIndicator);
+        
+            // Only request SIP server address retrieval when network not in GSM/GPRS mode
+            // e.g. UMTS/WCDMA
+            if (!tNode.iIsModeGsm)
+                {
+                SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption);
+                }
+            
+            SetChapInformationL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption);
+            
+            }
+            break;				
+        }
+    
+    tNode.iPDPFsmContextId = tNode.iPdpFsmInterface->NewFsmContextL(tNode,SpudMan::EPrimary);
+    
+    tNode.PostToClients<TDefaultClientMatchPolicy>(
             iContext.NodeId(),
             TCFMessage::TStateChange(
                     Elements::TStateChange(KPsdFinishedConfiguration, KErrNone)).CRef(),
             TClientType(TCFClientType::ECtrlProvider));
-
-    iContext.Node().PostToClients<TDefaultClientMatchPolicy>(
+    
+    tNode.PostToClients<TDefaultClientMatchPolicy>(
             iContext.NodeId(),
             TCFMessage::TStateChange(
                     Elements::TStateChange(KPsdStartingActivation, KErrNone)).CRef(),
             TClientType(TCFClientType::ECtrlProvider));
-
-	ASSERT(iContext.Node().iPDPFsmContextId == KPrimaryContextId);
-	iContext.Node().iContextType=SpudMan::EPrimary;
-	iContext.Node().iPdpFsmInterface->Set(KPrimaryContextId, gprsProvision->GetScratchContextAs<TPacketDataConfigBase>());
-	//Set default QoS
-	iContext.Node().iPdpFsmInterface->Set(KPrimaryContextId, *qosParams);
+    
+    ASSERT(tNode.iPDPFsmContextId == KPrimaryContextId);
+    tNode.iContextType=SpudMan::EPrimary;
+    tNode.iPdpFsmInterface->Set(KPrimaryContextId, gprsProvision->GetScratchContextAs<TPacketDataConfigBase>());
+    //Set default QoS
+    tNode.iPdpFsmInterface->Set(KPrimaryContextId, *qosParams);
     //Set default TFTs
-    iContext.Node().iPdpFsmInterface->Set(KPrimaryContextId,  tft); // ignore any error
+    tNode.iPdpFsmInterface->Set(KPrimaryContextId, tft); // ignore any error
     //Start the primary.
-    User::LeaveIfError(iContext.Node().iPdpFsmInterface->Input(KPrimaryContextId, SpudMan::ECreatePrimaryPDPContext));
+    User::LeaveIfError(tNode.iPdpFsmInterface->Input(KPrimaryContextId, SpudMan::ECreatePrimaryPDPContext));
     iContext.iNodeActivity->ClearPostedTo();
-    iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
+    tNode.iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
     }
 
 DEFINE_SMELEMENT(TOverrideProvision, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
@@ -1464,33 +1543,48 @@
     iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId();
     }
 
+DEFINE_SMELEMENT(TCleanupFSM, NetStateMachine::MStateTransition, PDPSCprStates::TContext)
+void TCleanupFSM::DoL()
+    {
+    CPDPSubConnectionProvider &tNode = static_cast<CPDPSubConnectionProvider &>(iContext.Node());
+    
+    if (tNode.iPDPFsmContextId != CPDPSubConnectionProvider::EInvalidContextId)
+        {
+    
+        // removing the memory associated with the context - this should hopefully
+        // ensure that the memory allocations that happen afterwards can be
+        // accomplished without OOM errors
+    
+        tNode.iPdpFsmInterface->DeleteFsmContext(tNode.iPDPFsmContextId);
+
+        if (tNode.ContentionRequested() == EFalse)
+            {
+            CSubConGenEventSubConDown* event = CSubConGenEventSubConDown::NewL();
+            CleanupStack::PushL(event);
+            tNode.NotifyClientsL(*event);
+            CleanupStack::Pop(event);
+            }
+
+        if (tNode.iPDPFsmContextId == KPrimaryContextId)
+            {
+            tNode.PostToClients<TDefaultClientMatchPolicy>(
+                    iContext.NodeId(),
+                    TCFMessage::TStateChange(
+                            Elements::TStateChange(KPsdFinishedDeactivation, KErrNone)).CRef(),
+                            TClientType(TCFClientType::ECtrlProvider));
+            }   
+
+        tNode.iPDPFsmContextId = CPDPSubConnectionProvider::EInvalidContextId;
+        
+        }
+    }
+
+
 DEFINE_SMELEMENT(TAwaitingPDPContextDestroyed, NetStateMachine::MState, PDPSCprStates::TContext)
 TBool TAwaitingPDPContextDestroyed::Accept()
     {
     if (TAwaitingPDPFSMMessage::Accept(KContextDeleteEvent))
         {
-        if (iContext.Node().iPDPFsmContextId != CPDPSubConnectionProvider::EInvalidContextId)
-            {
-			if (!iContext.Node().ContentionRequested())
-				{
-				CSubConGenEventSubConDown* event = CSubConGenEventSubConDown::NewL();
-				CleanupStack::PushL(event);
-				iContext.Node().NotifyClientsL(*event);
-				CleanupStack::Pop(event);
-				}
-
-			if (iContext.Node().iPDPFsmContextId == KPrimaryContextId)
-                {
-                iContext.Node().PostToClients<TDefaultClientMatchPolicy>(
-                        iContext.NodeId(),
-                        TCFMessage::TStateChange(
-                                Elements::TStateChange(KPsdFinishedDeactivation, KErrNone)).CRef(),
-                                TClientType(TCFClientType::ECtrlProvider));
-                }
-
-            iContext.Node().iPdpFsmInterface->DeleteFsmContext(iContext.Node().iPDPFsmContextId);
-            iContext.Node().iPDPFsmContextId = CPDPSubConnectionProvider::EInvalidContextId;            
-            }
         return ETrue;
         }
     return EFalse;
--- a/telephonyprotocols/rawipnif/group/RawIPNif.mmp	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/rawipnif/group/RawIPNif.mmp	Tue May 11 17:18:08 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -37,6 +37,8 @@
 
 // DEFFILE RawIp.def
 
+MACRO __BTT_LOGGING__
+
 SOURCEPATH  ../src
 
 SOURCE  RawIPFlow.cpp 
--- a/telephonyprotocols/rawipnif/group/RawIPNif2.mmp	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/rawipnif/group/RawIPNif2.mmp	Tue May 11 17:18:08 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -31,6 +31,8 @@
 
 // DEFFILE RawIp2.def
 
+MACRO __BTT_LOGGING__
+
 SOURCEPATH  ../rawipnif2/src
 SOURCE BcaController.cpp
 SOURCE BinderBase.cpp
--- a/telephonyprotocols/rawipnif/inc/Receiver.h	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/rawipnif/inc/Receiver.h	Tue May 11 17:18:08 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -37,7 +37,9 @@
 
 	// Inherited from CActive.
 	virtual void RunL();
+	virtual TInt RunError(TInt aError);
 	virtual void DoCancel();
+	
 	void StartListening();
 	
 private:
--- a/telephonyprotocols/rawipnif/inc/bttlog.h	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/rawipnif/inc/bttlog.h	Tue May 11 17:18:08 2010 +0300
@@ -77,16 +77,22 @@
 #endif // __BTT_LOG_3__
 
 #ifdef __BTT_LOG_1__
+#ifndef __BTT_LOGGING__
 #define __BTT_LOGGING__
 #endif
+#endif
 
-#ifdef __BTT_LOG_2__
+#ifdef __BTT_LOG_2__ 
+#ifndef __BTT_LOGGING__
 #define __BTT_LOGGING__
 #endif
+#endif
 
-#ifdef __BTT_LOG_3__
+#ifdef __BTT_LOG_3__ 
+#ifndef __BTT_LOGGING__
 #define __BTT_LOGGING__
 #endif
+#endif
 
 #ifdef __BTT_LOGGING__
 #define _BTT_LEAVEIFERROR(a)	iTheLogger->VerboseLeaveL(__FILE__, __LINE__, a)
--- a/telephonyprotocols/rawipnif/rawipnif2/inc/bttlog.h	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/rawipnif/rawipnif2/inc/bttlog.h	Tue May 11 17:18:08 2010 +0300
@@ -77,16 +77,22 @@
 #endif // __BTT_LOG_3__
 
 #ifdef __BTT_LOG_1__
+#ifndef __BTT_LOGGING__
 #define __BTT_LOGGING__
 #endif
+#endif
 
 #ifdef __BTT_LOG_2__
+#ifndef __BTT_LOGGING__
 #define __BTT_LOGGING__
 #endif
+#endif
 
 #ifdef __BTT_LOG_3__
+#ifndef __BTT_LOGGING__
 #define __BTT_LOGGING__
 #endif
+#endif
 
 #ifdef __BTT_LOGGING__
 #define _BTT_LEAVEIFERROR(a)	iTheLogger->VerboseLeaveL(__FILE__, __LINE__, a)
--- a/telephonyprotocols/rawipnif/src/Receiver.cpp	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/rawipnif/src/Receiver.cpp	Tue May 11 17:18:08 2010 +0300
@@ -143,6 +143,13 @@
 	    }
 	}
 
+TInt CReceiver::RunError(TInt aError)
+    {
+    _LOG_L2C1(_L8("WARNING! CReceiver::RunError Read failed"));
+    iObserver.Stop(aError); 
+    return KErrNone;  
+    }
+
 void CReceiver::DoCancel()
 /**
  *	Cancel active request
--- a/telephonyprotocols/rawipnif/version1/inc/bttlog.h	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyprotocols/rawipnif/version1/inc/bttlog.h	Tue May 11 17:18:08 2010 +0300
@@ -77,16 +77,22 @@
 #endif // __BTT_LOG_3__
 
 #ifdef __BTT_LOG_1__
+#ifndef __BTT_LOGGING__
 #define __BTT_LOGGING__
 #endif
+#endif
 
 #ifdef __BTT_LOG_2__
+#ifndef __BTT_LOGGING__
 #define __BTT_LOGGING__
 #endif
+#endif
 
 #ifdef __BTT_LOG_3__
+#ifndef __BTT_LOGGING__
 #define __BTT_LOGGING__
 #endif
+#endif
 
 #ifdef __BTT_LOGGING__
 #define _BTT_LEAVEIFERROR(a)	iTheLogger->VerboseLeaveL(__FILE__, __LINE__, a)
--- a/telephonyserverplugins/simtsy/inc/CSimMbmsPacketContext.h	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyserverplugins/simtsy/inc/CSimMbmsPacketContext.h	Tue May 11 17:18:08 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -196,7 +196,7 @@
 	TInt GetMbmsSessionsPhase2(const TTsyReqHandle aTsyReqHandle, TClientId* aClient, TDes8* aBufSize);
 	TInt GetMbmsSessionsCancel(const TTsyReqHandle aTsyReqHandle);
 
-	TInt UpdateMbmsSessionListL(const TTsyReqHandle aTsyReqHandle,TMbmsAction* aAction, TUint* aSessionId);
+	TInt UpdateMbmsSessionList(const TTsyReqHandle aTsyReqHandle,TMbmsAction* aAction, TUint* aSessionId);
 	TInt UpdateMbmsSessionListCancel(const TTsyReqHandle aTsyReqHandle);
 	
 	TInt InitialiseContext(const TTsyReqHandle aTsyReqHandle, TDes8* aDataChannelV2Pckg); // This method supersedes the LoanCommPort() and RecoverCommPort() methods.
--- a/telephonyserverplugins/simtsy/src/CSimMbmsPacketContext.cpp	Tue Apr 27 17:51:07 2010 +0300
+++ b/telephonyserverplugins/simtsy/src/CSimMbmsPacketContext.cpp	Tue May 11 17:18:08 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -477,7 +477,7 @@
 			return GetStatus(aTsyReqHandle,
 					REINTERPRET_CAST(RPacketContext::TContextStatus*, dataPtr));
 		case EPacketContextUpdateMbmsSessionList:
-			return UpdateMbmsSessionListL(aTsyReqHandle,
+			return UpdateMbmsSessionList(aTsyReqHandle,
 					REINTERPRET_CAST(TMbmsAction*, dataPtr),
 					REINTERPRET_CAST(TUint*, dataPtr2));	
 		case EPacketContextInitialiseContext:
@@ -1130,7 +1130,7 @@
 	return KErrNone;
 	}
 
-TInt CSimMbmsPacketContext::UpdateMbmsSessionListL(const TTsyReqHandle aTsyReqHandle,TMbmsAction* aAction, TUint* aSessionId)
+TInt CSimMbmsPacketContext::UpdateMbmsSessionList(const TTsyReqHandle aTsyReqHandle,TMbmsAction* aAction, TUint* aSessionId)
 /**
 * client's interest in updating the MBMS session's list.
 * This is achieved  by updating the list maintained internally by the context
@@ -1141,7 +1141,7 @@
 * @return KErrNone
 */
 	{
-	LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionListL called");
+	LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionList called");
 
 	TInt error=KErrNone;
 	iUpdateSessionHandle = aTsyReqHandle;
@@ -1151,29 +1151,34 @@
 	switch(*aAction)
 		{
 		case SIMTSY_PACKET_MBMS_ADD_ENTRIES:
-			LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionListL Action: ADD ");
-			TRAP(error,iSessionIdList->AppendL(*aSessionId));
-			if(error == KErrNone)
-				{
-				//iSessionIdList->At(0) = ++iNumOfSessionId;
-				iSessionIdList->Delete(0);
-				iSessionIdList->InsertL(0,++iNumOfSessionId);
-				iMbmsUpdateSessionTimer->Start(RandTime(),this,ETimerIdMbmsUpdateSessionId);
-				}
-			else
+			LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionList Action: ADD ");
+			
+			// TRAP can contain multiple statments
+			TRAP(error,iSessionIdList->AppendL(*aSessionId);
+                    //iSessionIdList->At(0) = ++iNumOfSessionId;
+                    iSessionIdList->Delete(0);
+                    iSessionIdList->InsertL(0,++iNumOfSessionId));
+			
+            iMbmsUpdateSessionTimer->Start(RandTime(),this,ETimerIdMbmsUpdateSessionId);
+
+			if(error != KErrNone)
 				{
 				ReqCompleted(iUpdateSessionHandle,error);
 				}
 			break;
 
 		case SIMTSY_PACKET_MBMS_REM_ENTRIES:
-			LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionListL Action: REMOVE ");
+			LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionList Action: REMOVE ");
 			iSessionIdList->Find(*aSessionId,key,position);
 			if(position != -1)
 				{
 				iSessionIdList->Delete(position);
 				//iSessionIdList->At(0) = --iNumOfSessionId;
-				iSessionIdList->InsertL(0,--iNumOfSessionId);
+				TRAP(error, iSessionIdList->InsertL(0,--iNumOfSessionId));
+	            if(error != KErrNone)
+	                {
+	                ReqCompleted(iUpdateSessionHandle,error);
+	                }
 				iMbmsUpdateSessionTimer->Start(RandTime(),this,ETimerIdMbmsUpdateSessionId);
 				}
 			else
@@ -1184,16 +1189,20 @@
 			break;
 
 		case SIMTSY_PACKET_MBMS_REM_ALL_ENTRIES:
-			LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionListL Action: REMOVE_ALL ");
+			LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionList Action: REMOVE_ALL ");
 			iNumOfSessionId=0;
 			//iSessionIdList->At(0) = iNumOfSessionId;
-			iSessionIdList->InsertL(0,iNumOfSessionId);
+			TRAP(error, iSessionIdList->InsertL(0,iNumOfSessionId));
+            if(error != KErrNone)
+                {
+                ReqCompleted(iUpdateSessionHandle,error);
+                }
 			iSessionIdList->Delete(1,iSessionIdList->Count()); // removing all session ids from the list
 			ReqCompleted(aTsyReqHandle, KErrNone);
 			break;
 
 		default:
-			LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionListL Action: Default ");
+			LOGPACKET1("CSimMbmsPacketContext::UpdateMbmsSessionList Action: Default ");
 			ReqCompleted(aTsyReqHandle,KErrNotFound);
 			break;
 		}