telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmphonetsy.cpp
branchRCL_3
changeset 19 630d2f34d719
parent 18 17af172ffa5f
child 20 07a122eea281
--- a/telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmphonetsy.cpp	Thu Aug 19 11:03:36 2010 +0300
+++ b/telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmphonetsy.cpp	Tue Aug 31 16:23:08 2010 +0300
@@ -14,6 +14,11 @@
 //
 
 
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cmmphonetsyTraces.h"
+#endif
+
 
 //INCLUDES
 #include <etelmm.h>
@@ -90,7 +95,7 @@
     CMmPhoneFactoryTsy* aMmPhoneFactoryTsy,
     MLtsyFactoryBase* aFactory )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::NewL - Phone model Id: %S", &KPhoneModelId);
+OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CMMPHONETSY_NEWL_1, "TSY: CMmPhoneTsy::NewL - Phone model Id: %S", KPhoneModelId);
     CleanupStack::PushL( aMessageManager );
     CMmPhoneTsy* mmPhoneTsy = new (ELeave) CMmPhoneTsy();
 
@@ -130,9 +135,9 @@
 
 void CMmPhoneTsy::ConstructL()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::ConstructL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CONSTRUCTL_1, "TSY: CMmPhoneTsy::ConstructL");
 	iCentRep = CRepository::NewL( KCRUidCtsyMEAlsLine );
-TFLOGSTRING("TSY: CMmPhoneTsy::ConstructL Central Repository opened successfully");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CONSTRUCTL_2, "TSY: CMmPhoneTsy::ConstructL Central Repository opened successfully");
 	
 	//iPublic Central Repositories
     iMWISCentRep = CRepository::NewL( KCRUidCtsyMessageWaitingIndicator );
@@ -182,7 +187,7 @@
 	// initialize HWRM & its observers
 	if(IsHWRMSupported())
 		{
-		TFLOGSTRING("TSY: HWRM Battery API is in use.");
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CONSTRUCTL_3, "TSY: HWRM Battery API is in use.");
 		iPowerManager = CHWRMPower::NewL();
 		iBattery = CBatteryInfoObserver::NewL( *iPowerManager, *this ); 
 		iChargingStatus = CChargingStatusObserver::NewL( *this );
@@ -349,7 +354,7 @@
     
 CMmPhoneTsy::~CMmPhoneTsy()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::~CMmPhoneTsy");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DTOR_1, "TSY: CMmPhoneTsy::~CMmPhoneTsy");
 
 	if(IsHWRMSupported())
 		{
@@ -559,7 +564,7 @@
         delete iSystemStatePluginHandler;
         }
     iSystemStatePluginHandler = NULL;
-TFLOGSTRING("TSY: CMmPhoneTsy::~CMmPhoneTsy DONE");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DTOR_2, "TSY: CMmPhoneTsy::~CMmPhoneTsy DONE");
    }
 
 // ---------------------------------------------------------------------------
@@ -583,7 +588,7 @@
 //
 void CMmPhoneTsy::CompleteNotifyModemStatusReady()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyModemStatusReady");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYMODEMSTATUSREADY_1, "TSY: CMmPhoneTsy::CompleteNotifyModemStatusReady");
 
     TRAP_IGNORE(
     //update the network registration status
@@ -612,7 +617,7 @@
     {
     if ( !iBootState.iSIMReady )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - SIM is ready, start initialisations");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYSIMSTATUSREADYL_1, "TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - SIM is ready, start initialisations");
 
         iBootState.iSIMReady = ETrue;
         iBootState.iADNReady = ETrue;
@@ -657,14 +662,14 @@
         // VIAG homezone parameters. 
         if ( iMmCustomTsy )
             {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CustomTSY ready");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYSIMSTATUSREADYL_2, "TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CustomTSY ready");
             // Get pointer to SIM Custom TSY
             CMmSIMTsy* simCustomTsy =
                 ( ( CMmSIMTsy* ) iMmCustomTsy->GetSIMTsyPtr() );
             
             if ( simCustomTsy )
                 {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CheckViagHomeZoneParamsL()");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYSIMSTATUSREADYL_3, "TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CheckViagHomeZoneParamsL()");
                 simCustomTsy->CheckViagHomezoneParamsL();
                 iViagHomeZoneParamsChecked = ETrue;
                 }
@@ -673,7 +678,7 @@
         else
         	{
         	iViagHomeZoneParamsChecked = EFalse;
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CustomTSY NOT ready");        		
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYSIMSTATUSREADYL_4, "TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CustomTSY NOT ready");
         	}
         } 
     }
@@ -717,7 +722,7 @@
 TInt CMmPhoneTsy::NotifyIndicatorChange(
     TUint32* aIndicatorState )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::NotifyIndicatorChange");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYINDICATORCHANGE_1, "TSY: CMmPhoneTsy::NotifyIndicatorChange");
 
     // Update indicator state, we don't keep track of it
     // unless notify is on. So we need to update starting
@@ -736,17 +741,17 @@
 //
 void CMmPhoneTsy::CompleteNotifyIndicatorChange()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYINDICATORCHANGE_1, "TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange");
 
     // first check if this notify is actually requested..
     if (NULL != iRetIndicatorState)
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange -- notify is on");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYINDICATORCHANGE_2, "TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange -- notify is on");
         TUint32 newIndicatorState = GetIndicatorState();
         if (newIndicatorState != iIndicatorState)
             {
             iIndicatorState = newIndicatorState;
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange -- changed to 0x%x", iIndicatorState);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYINDICATORCHANGE_3, "TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange -- changed to 0x%08x", iIndicatorState);
 
             //reset req handle. Returns the deleted req handle
             TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
@@ -772,7 +777,7 @@
 TInt CMmPhoneTsy::NotifyIndicatorChangeCancel(
     const TTsyReqHandle aTsyReqHandle )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::NotifyIndicatorChangeCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYINDICATORCHANGECANCEL_1, "TSY: CMmPhoneTsy::NotifyIndicatorChangeCancel");
 
     iRetIndicatorState = NULL;
     iTsyReqHandleStore->ResetTsyReqHandle( 
@@ -1063,8 +1068,7 @@
     if ( KErrNone != trapError || KErrNone != addLineSucceeded
         || KErrNone != addPBSucceeded )
         {
-TFLOGSTRING2("TSY: CMmPhoneTsy::OpenNewObjectByNameL - Failed: %d",
-    trapError);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_OPENNEWOBJECTBYNAMEL_1, "TSY: CMmPhoneTsy::OpenNewObjectByNameL - Failed: %d",trapError);
 
         if ( mmLine )
             {
@@ -1121,7 +1125,7 @@
     const TInt aIpc,
     const TDataPackage& aPackage )
     {
-TFLOGSTRING3("TSY: CMmPhoneTsy::ExtFunc, IPC:%d, Handle:%d", aIpc, aTsyReqHandle);
+OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_EXTFUNC_1, "TSY: CMmPhoneTsy::ExtFunc, IPC:%d, Handle:%d", aIpc, aTsyReqHandle);
 
     TInt ret = KErrNone;
     TInt trapError = KErrNone;
@@ -1139,7 +1143,7 @@
     if ( ERfsStateInfoInactive == iStateInfo &&
         !IsRequestPossibleInOffline( aIpc ) )
         {
-TFLOGSTRING2 ("TSY: Offline mode ON, request is not allowed: %d", aIpc );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_EXTFUNC_2, "TSY: Offline mode ON, request is not allowed: %d", aIpc );
         ret = CMmCommonStaticUtility::EpocErrorCode( KErrGeneral,
                 KErrGsmOfflineOpNotAllowed );
 
@@ -1191,7 +1195,7 @@
     const TInt aIpc,
     const TDataPackage& aPackage )
     {
-TFLOGSTRING3("TSY: CMmPhoneTsy::DoExtFuncL - IPC:%d Handle:%d", aIpc, aTsyReqHandle);
+OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DOEXTFUNCL_1, "TSY: CMmPhoneTsy::DoExtFuncL - IPC:%d Handle:%d", aIpc, aTsyReqHandle);
 
     TInt ret = KErrNone;
 
@@ -1231,11 +1235,7 @@
         case EMobilePhoneAuthorizationInfoPhase2:
         case EMobilePhoneGetCellInfo:
         case EMobilePhoneNotifyCellInfoChange:
-        case EMobilePhoneGetCurrentActiveUSimApplication:
-        case EMobilePhoneGetPreferredNetworksPhase1:
-        case EMobilePhoneGetPreferredNetworksPhase2:
-        case EMobilePhoneStorePreferredNetworksList:
-        case EMobilePhoneNotifyStorePreferredNetworksListChange:
+        case EMobilePhoneGetCurrentActiveUSimApplication:                
             //direct this request to the net specific DoExtFuncL
             ret = iMmNetTsy->DoExtFuncL ( aTsyReqHandle, aIpc, aPackage );
             break;
@@ -1343,6 +1343,10 @@
         case EMobilePhoneTerminateAllCalls:
             ret = TerminateAllCallsL( aTsyReqHandle );
             break;			
+        // Active calls termination
+        case EMobilePhoneTerminateActiveCalls:
+            ret = TerminateActiveCallsL( aTsyReqHandle );
+            break;          
       // DTMF
 		// forward request to the DTMF-specific Tsy
         case EMobilePhoneGetDTMFCaps:
@@ -1614,6 +1618,7 @@
         //indicates that same method has been called and has not been 
         //completed, the method should return KErrServerBusy.
         case EMobilePhoneTerminateAllCalls:
+        case EMobilePhoneTerminateActiveCalls:
         case EMobilePhoneGetFdnStatus:
         case EMobilePhoneGetCustomerServiceProfile:
         case EMobilePhoneGetDetectedNetworksV2Phase1:
@@ -1636,9 +1641,6 @@
         case EMobilePhoneDeleteAPNName:
         case EMobilePhoneAppendAPNName:
         case EMobilePhoneGetSecurityCodeInfo:
-		case EMobilePhoneGetPreferredNetworksPhase1:
-		case EMobilePhoneGetPreferredNetworksPhase2:		
-		case EMobilePhoneStorePreferredNetworksList:
 
         //SS related methods.
         case EMobilePhoneGetCallForwardingStatusPhase1:
@@ -1762,7 +1764,6 @@
         case EMobilePhoneNotifySendNetworkServiceRequest:
         case EMobilePhoneNotifyAllSendNetworkServiceRequest: 
         case EMobilePhoneNotifyCellInfoChange:
-		case EMobilePhoneNotifyStorePreferredNetworksListChange:
             ret=KReqModeMultipleCompletionEnabled | KReqModeRePostImmediately;
             break;
         // Cancel Requests
@@ -1777,7 +1778,7 @@
             break;
 
         }
-	TFLOGSTRING3("TSY: CMmPhoneTsy::ReqModeL - IPC:%d, Mode:%d", aIpc, ret);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_REQMODEL_1, "TSY: CMmPhoneTsy::ReqModeL - IPC:%d, Mode:%d", aIpc, ret);
 
     return ret;
     }
@@ -1913,9 +1914,6 @@
         case EMobilePhoneNotifyCellInfoChange:
         	numberOfSlots = KMmPhoneCellInfoChangeSlots;
         	break;
-		case EMobilePhoneNotifyStorePreferredNetworksListChange:
-			numberOfSlots = KMmPhoneStorePreferredNetworksListChangeSlots;
-            break;
         default:
             // Unknown or invalid Phone IPC
             User::Leave( KErrNotSupported );
@@ -1935,7 +1933,7 @@
     const TInt aIpc,
     const TTsyReqHandle aTsyReqHandle )
     {
-TFLOGSTRING3("TSY: CMmPhoneTsy::CancelService - IPC:%d, Handle:%d", aIpc, aTsyReqHandle);
+OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CANCELSERVICE_1, "TSY: CMmPhoneTsy::CancelService - IPC:%d, Handle:%d", aIpc, aTsyReqHandle);
 
     TInt ret ( KErrNotSupported );
 
@@ -1974,9 +1972,6 @@
         case EMobilePhoneGetCellInfo:
         case EMobilePhoneNotifyCellInfoChange:
         case EMobilePhoneGetCurrentActiveUSimApplication:        
-        case EMobilePhoneGetPreferredNetworksPhase1:
-        case EMobilePhoneStorePreferredNetworksList:
-        case EMobilePhoneNotifyStorePreferredNetworksListChange:
         	ret = iMmNetTsy->CancelService( aIpc, aTsyReqHandle );
             break;
 		// forward SS cancellations
@@ -2029,6 +2024,7 @@
         case EMobilePhoneNotifyDefaultPrivacyChange:
         case EMobilePhoneSetDefaultPrivacy:
         case EMobilePhoneTerminateAllCalls:
+        case EMobilePhoneTerminateActiveCalls:
         case EMobilePhoneSetNetworkSelectionSetting:        
             ret = KErrNone;
             break;
@@ -2449,7 +2445,7 @@
 //
 TInt CMmPhoneTsy::TerminateAllCallsL(const TTsyReqHandle aTsyReqHandle)
 	{
-TFLOGSTRING("TSY: CMmPhoneTsy::TerminateAllCalls");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TERMINATEALLCALLSL_1, "TSY: CMmPhoneTsy::TerminateAllCalls");
 
 	// Check if some other client has already requested this
 	TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(EMultimodePhoneTerminateAllCalls);
@@ -2499,7 +2495,7 @@
 		}
 	else
 		{
-TFLOGSTRING("TSY: CMmPhoneTsy::TerminateAllCalls - Already requested");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TERMINATEALLCALLSL_2, "TSY: CMmPhoneTsy::TerminateAllCalls - Already requested");
 		ReqCompleted( aTsyReqHandle, KErrServerBusy );
 		}
 	return KErrNone;
@@ -2517,6 +2513,63 @@
 	     }	 
 	}
 
+
+// ---------------------------------------------------------------------------
+// CMmPhoneTsy::TerminateActiveCallsL
+// Terminates all active calls simultaneously.
+// ---------------------------------------------------------------------------
+//
+TInt CMmPhoneTsy::TerminateActiveCallsL(const TTsyReqHandle aTsyReqHandle)
+    {
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TERMINATEACTIVECALLSL_1, "TSY: CMmPhoneTsy::TerminateActiveCalls");
+
+    // Check if some other client has already requested this
+    TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(EMultimodePhoneTerminateActiveCalls);
+    
+    if (EMultimodePhoneReqHandleUnknown >= reqHandle )
+        {
+        // The request is not already in processing because of a previous request
+
+        TInt err = iMessageManager->HandleRequestL(ECtsyPhoneTerminateActiveCallsReq);
+        if ( err == KErrNone )
+            {
+#ifdef REQHANDLE_TIMER
+            SetTypeOfResponse( EMultimodePhoneTerminateActiveCalls, aTsyReqHandle );
+#else
+            iTsyReqHandleStore->SetTsyReqHandle( 
+                    iReqHandleType, aTsyReqHandle );
+#endif //REQHANDLE_TIMER
+            }
+        else
+            {
+            // request failed, complete with error value
+            ReqCompleted( aTsyReqHandle, err );
+            } 
+        }
+    else
+        {
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TERMINATEACTIVECALLSL_2, "TSY: CMmPhoneTsy::TerminatActiveCalls - Already requested"); 
+        ReqCompleted( aTsyReqHandle, KErrServerBusy );
+        }
+    return KErrNone;
+    }
+// ---------------------------------------------------------------------------
+// CMmPhoneTsy::CompleteTerminateActiveCallsReq
+// Description: Complete TerminateActiveCallsRequest
+// ---------------------------------------------------------------------------
+//
+void CMmPhoneTsy::CompleteTerminateActiveCallsReq(TInt aErrorCode)
+    {
+    // Reset req handle. Returns the deleted req handle
+     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
+         EMultimodePhoneTerminateActiveCalls );
+    
+     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
+         {
+         ReqCompleted( reqHandle, aErrorCode );
+         }   
+    }
+
 // ---------------------------------------------------------------------------
 // CMmPhoneTsy::RegisterNotification
 // This function is used by ETel Server to subscribe
@@ -2572,7 +2625,6 @@
         case EMobilePhoneNotifySendNetworkServiceRequest:
         case EMobilePhoneNotifyAllSendNetworkServiceRequest:
         case EMobilePhoneNotifyCellInfoChange:
-        case EMobilePhoneNotifyStorePreferredNetworksListChange:
             ret = KErrNone;
             break;
         default:
@@ -2638,7 +2690,6 @@
         case EMobilePhoneNotifySendNetworkServiceRequest:
         case EMobilePhoneNotifyAllSendNetworkServiceRequest:
         case EMobilePhoneNotifyCellInfoChange:
-		case EMobilePhoneNotifyStorePreferredNetworksListChange:
             ret = KErrNone;
             break;
         default:
@@ -2731,7 +2782,7 @@
     const RMobilePhone::TMobileName* aStoreName )
     {
     TInt ret( KErrArgument );
-TFLOGSTRING("TSY: CMmPhoneTsy::GetPhoneStoreInfoL" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETPHONESTOREINFOL_1, "TSY: CMmPhoneTsy::GetPhoneStoreInfoL" );
     
     if(sizeof(RMobilePhoneStore::TMobilePhoneStoreInfoV1) <= aInfo->MaxLength())
       	{
@@ -2744,7 +2795,7 @@
              
         if ( KETelExtMultimodeV1 != storeInfo.ExtensionId() )
     		{
-			TFLOGSTRING("TSY: Phonebook not supported. Only KETelExtMultimodeV1 types supported for RMobilePhone::GetPhoneStoreInfo" );
+			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETPHONESTOREINFOL_2, "TSY: Phonebook not supported. Only KETelExtMultimodeV1 types supported for RMobilePhone::GetPhoneStoreInfo" );
     		ret = KErrNotSupported;
     		}
     	else
@@ -2759,7 +2810,7 @@
     	         0x0 == aStoreName->Compare( KETelMeSmsStore )              
     	       )
     	        {
-				TFLOGSTRING("TSY: Phonebook name is not supported. " );
+				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETPHONESTOREINFOL_3, "TSY: Phonebook name is not supported. " );
     	        ret = KErrNotSupported;
     	        }
     	    else
@@ -2848,7 +2899,7 @@
     const TTsyReqHandle aTsyReqHandle,
     TDes8* aCspFile )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetCustomerServiceProfileL" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCUSTOMERSERVICEPROFILEL_1, "TSY: CMmPhoneTsy::GetCustomerServiceProfileL" );
     
     TInt ret = KErrArgument;
     
@@ -2865,7 +2916,7 @@
 
         if ( 0 < reqHandle )
             {
- TFLOGSTRING("TSY: CMmPhoneTsy::GetCustomerServiceProfileL one req already ongoing" );  
+ OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCUSTOMERSERVICEPROFILEL_2, "TSY: CMmPhoneTsy::GetCustomerServiceProfileL one req already ongoing" );
             ret = KErrNone;
             //The request is already in processing because of previous request
             //Complete request with status value informing the client about
@@ -2911,7 +2962,7 @@
     TInt aErrorCode )
     {
 
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetCustomerServiceProfile" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETCUSTOMERSERVICEPROFILE_1, "TSY: CMmPhoneTsy::CompleteGetCustomerServiceProfile" );
     
     // Check if the get was called internally during boot
     if( iCspFileQueryInBoot )
@@ -2944,7 +2995,7 @@
             //set value in client side
             *(req->iRetCspFile) = aCspFile;
 			//reset the return pointer
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetCustomerServiceProfile queue handling" ); 
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETCUSTOMERSERVICEPROFILE_2, "TSY: CMmPhoneTsy::CompleteGetCustomerServiceProfile queue handling" );
             ReqCompleted( req->iReqHandle, aErrorCode );
 			}
         // Complete the client request
@@ -2962,14 +3013,14 @@
 //
 TInt CMmPhoneTsy::GetCustomerServiceProfileCancel( const TTsyReqHandle aTsyReqHandle )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel aTsyReqHandle: %d", aTsyReqHandle);   
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCUSTOMERSERVICEPROFILECANCEL_1, "TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel aTsyReqHandle: %d", aTsyReqHandle);
 
     TInt customerServiceProfileRequestsCount = iCustomerServiceProfileRequests.Count();
 
     //reset the req handle if only one req remains
     if( 1 == customerServiceProfileRequestsCount )
         {
-        TFLOGSTRING("TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - one req");       
+        OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCUSTOMERSERVICEPROFILECANCEL_2, "TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - one req");
         TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
                 EMultimodePhoneGetCustomerServiceProfile );       
         }
@@ -2977,7 +3028,7 @@
     // go through array if one or more requests remain and find the correct request handle to cancel
     for ( TInt i=0; i < customerServiceProfileRequestsCount ; i++ )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - queued requests");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCUSTOMERSERVICEPROFILECANCEL_3, "TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - queued requests");
 
         TCustomerServiceProfileIdRequest* req =
         iCustomerServiceProfileRequests[ i ];
@@ -3024,7 +3075,7 @@
     const TTsyReqHandle aTsyReqHandle,
     RMobilePhone::TMobilePhoneBatteryInfoV1* aInfo )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetBatteryInfoL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETBATTERYINFOL_1, "TSY: CMmPhoneTsy::GetBatteryInfoL");
 
     // Battery info is requested when phone is booted up and updated when
     // EM server sends indications.
@@ -3044,7 +3095,7 @@
 TInt CMmPhoneTsy::NotifyBatteryInfoChange(
     RMobilePhone::TMobilePhoneBatteryInfoV1* aInfo )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::NotifyBatteryInfoChange");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYBATTERYINFOCHANGE_1, "TSY: CMmPhoneTsy::NotifyBatteryInfoChange");
 
     iRetBatteryInfo = aInfo;
     iReqHandleType = EMultimodePhoneNotifyBatteryInfoChange;
@@ -3062,7 +3113,7 @@
     CMmDataPackage* aDataPackage,
     TInt aErrorCode )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyBatteryInfoChange");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYBATTERYINFOCHANGE_1, "TSY: CMmPhoneTsy::CompleteNotifyBatteryInfoChange");
 
     if ( KErrNone == aErrorCode )
         {
@@ -3072,7 +3123,7 @@
         iBatteryInfo = *batteryInfo;
         }
 
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteNotifyBatteryInfoChange, battery status: %d", (TInt)iBatteryInfo.iStatus);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYBATTERYINFOCHANGE_2, "TSY: CMmPhoneTsy::CompleteNotifyBatteryInfoChange, battery status: %d", (TInt)iBatteryInfo.iStatus);
 
     //reset req handle. Returns the deleted req handle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
@@ -3099,7 +3150,7 @@
 TInt CMmPhoneTsy::NotifyBatteryInfoChangeCancel(
     const TTsyReqHandle aTsyReqHandle )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::NotifyBatteryInfoChangeCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYBATTERYINFOCHANGECANCEL_1, "TSY: CMmPhoneTsy::NotifyBatteryInfoChangeCancel");
 
     iRetBatteryInfo = NULL;
     iTsyReqHandleStore->ResetTsyReqHandle( 
@@ -3184,12 +3235,12 @@
     
     if ( iBootState.iSIMReady )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceProviderNameL -Sim ready");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMEL_1, "TSY: CMmPhoneTsy::GetServiceProviderNameL -Sim ready");
 
         if ( sizeof( RMobilePhone::TMobilePhoneServiceProviderNameV2 ) >
              aName->MaxLength() )
             {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceProviderNameL -Invalid parameter!");        
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMEL_2, "TSY: CMmPhoneTsy::GetServiceProviderNameL -Invalid parameter!");
             ret = KErrArgument;
             }
 		else
@@ -3207,7 +3258,7 @@
         if ( KErrNone == ret )
             {
             // save reqhandle to queue
-TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceProviderNameL - Client to queue");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMEL_3, "TSY: CMmPhoneTsy::GetServiceProviderNameL - Client to queue");
             RMobilePhone::TMobilePhoneServiceProviderNameV2Pckg* nameV2Pckg =
                 REINTERPRET_CAST( 
                     RMobilePhone::TMobilePhoneServiceProviderNameV2Pckg*, 
@@ -3228,7 +3279,7 @@
          }
      else
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceProviderNameL - Sim not ready");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMEL_4, "TSY: CMmPhoneTsy::GetServiceProviderNameL - Sim not ready");
         ret = KErrNotReady;
         }
 
@@ -3246,7 +3297,7 @@
     CMmDataPackage* aDataPackage,
     TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error %d", aErrorCode );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICEPROVIDERNAME_1, "TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error %d", aErrorCode );
    
     // reset req handle. Returns the deleted req handle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
@@ -3261,24 +3312,24 @@
             {
             aDataPackage->UnPackData( &name );
 
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceProviderName name: %S", &name->iSPName );
+OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICEPROVIDERNAME_2, "TSY: CMmPhoneTsy::CompleteGetServiceProviderName name: %S", name->iSPName );
 		    for ( TInt i=0; i < requestCount ; i++ )
 		        {
 		        TServiceProviderNameRequest* req = 
 		            iServiceProviderNameRequests[ i ];
 		        *(req->iServiceProviderName) = *name;
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceProviderName client %d", i );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICEPROVIDERNAME_3, "TSY: CMmPhoneTsy::CompleteGetServiceProviderName client %d", i );
 		        ReqCompleted( req->iReqHandle, aErrorCode );
 		        }
             }
         else
         	{
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error %d", aErrorCode );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICEPROVIDERNAME_4, "TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error %d", aErrorCode );
         	for ( TInt i=0; i < requestCount ; i++ )
 		        {
 		        TServiceProviderNameRequest* req = 
 		            iServiceProviderNameRequests[ i ];
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error queue: %d", i );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICEPROVIDERNAME_5, "TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error queue: %d", i );
 		        ReqCompleted( req->iReqHandle, aErrorCode );
 		        }	
         	}
@@ -3297,14 +3348,14 @@
 //
 TInt CMmPhoneTsy::GetServiceProviderNameCancel( const TTsyReqHandle aTsyReqHandle )
     {
-    TFLOGSTRING2("TSY: CMmPhoneTsy::GetServiceProviderNameCancel aTsyReqHandle: %d", aTsyReqHandle);   
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMECANCEL_1, "TSY: CMmPhoneTsy::GetServiceProviderNameCancel aTsyReqHandle: %d", aTsyReqHandle);
 
     TInt requestCount = iServiceProviderNameRequests.Count();
     
     //reset the req handle if only one req remains
     if( 1 == requestCount )
         {
-        TFLOGSTRING("TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - one req");       
+        OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMECANCEL_2, "TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - one req");
         TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
                 EMultimodePhoneGetServiceProviderName );       
         }
@@ -3312,7 +3363,7 @@
     // qo throw array if several requests and find correct reqhandle to cancel
     for ( TInt i = 0; i < requestCount; i++ )
         {
-        TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceProviderNameCancel - queued requests");
+        OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMECANCEL_3, "TSY: CMmPhoneTsy::GetServiceProviderNameCancel - queued requests");
 
         TServiceProviderNameRequest* req =
         iServiceProviderNameRequests[i];
@@ -3461,10 +3512,8 @@
       }
    else
       {
-      TFLOGSTRING3("TSY: CMmPhoneTsy::GetPhoneIdL - iManufacturer: %S, iModel: %S", &iPhoneIdentity.iManufacturer, 
-             		                                                                      &iPhoneIdentity.iModel );             
-      TFLOGSTRING3("TSY: CMmPhoneTsy::GetPhoneIdL - iRevision: %S, iSerialNumber: %S", &iPhoneIdentity.iRevision, 
-             		                                                                         &iPhoneIdentity.iSerialNumber);
+      OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DOGETPHONEIDL_1, "TSY: CMmPhoneTsy::GetPhoneIdL - iManufacturer: %S, iModel: %S", iPhoneIdentity.iManufacturer, iPhoneIdentity.iModel );
+      OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DOGETPHONEIDL_2, "TSY: CMmPhoneTsy::GetPhoneIdL - iRevision: %S, iSerialNumber: %S", iPhoneIdentity.iRevision, iPhoneIdentity.iSerialNumber);
      	  
 	  *aId = iPhoneIdentity;
 	  ReqCompleted( aTsyReqHandle, KErrNone );	   
@@ -3486,7 +3535,7 @@
         // Copy serial number
         iPhoneIdentity.iSerialNumber.Copy(aSerialData.Left( aSerialData.Length() ) );
         
-        TFLOGSTRING2("TSY: CMmPhoneTsy::CompletePhoneSerialNumber - iSerialNumber: %S", &iPhoneIdentity.iSerialNumber );
+        OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETPHONEID_1, "TSY: CMmPhoneTsy::CompletePhoneSerialNumber - iSerialNumber: %S", iPhoneIdentity.iSerialNumber );
         }
 
     //reset req handle. Returns the deleted req handle
@@ -3512,7 +3561,7 @@
 //
 TInt CMmPhoneTsy::MobilePhoneGetPhoneIdCancel(const TTsyReqHandle aTsyReqHandle )
     {
-    TFLOGSTRING("TSY: CMmPhoneTsy::MobilePhoneGetPhoneIdCancel");    
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MOBILEPHONEGETPHONEIDCANCEL_1, "TSY: CMmPhoneTsy::MobilePhoneGetPhoneIdCancel");
     
     TInt reqCount = iGetPhoneIdRequests.Count();
     
@@ -3586,7 +3635,7 @@
 			}
 		else
 			{
-			TFLOGSTRING("TSY: CMmPhoneTsy::GetSubscriberIdL - queued requests add req to queue");
+			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSUBSCRIBERIDL_1, "TSY: CMmPhoneTsy::GetSubscriberIdL - queued requests add req to queue");
 			TSubscriberIdRequest* req = new (ELeave) TSubscriberIdRequest();
 			req->iReqHandle = aTsyReqHandle;
 			req->iRetSubscrId = aId;
@@ -3616,7 +3665,7 @@
     {
     TInt ret( KErrGeneral );
 
-TFLOGSTRING("TSY: CMmPhoneTsy::GetIndicatorCaps" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORCAPS_1, "TSY: CMmPhoneTsy::GetIndicatorCaps" );
     if(	 NULL != aActCaps && NULL != aIndCaps )
     	{
     	*aActCaps = RMobilePhone::KCapsGetIndicator | 
@@ -3642,7 +3691,7 @@
     const TTsyReqHandle aTsyReqHandle,
     TUint32* aIndicators )
     {
-TFLOGSTRING( "TSY: CMmPhoneTsy::GetIndicators" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORS_1,  "TSY: CMmPhoneTsy::GetIndicators" );
     TInt ret( KErrGeneral );
 
     if( aIndicators )
@@ -3667,7 +3716,7 @@
 	TUint32 indicators( 0 );
 
 	//Charger connected?
-TFLOGSTRING2( "TSY: CMmPhoneTsy::GetIndicatorState charger: %d", (TInt)iBatteryInfo.iStatus );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORSTATE_1,  "TSY: CMmPhoneTsy::GetIndicatorState charger: %d", (TInt)iBatteryInfo.iStatus );
 	if( RMobilePhone::EBatteryConnectedButExternallyPowered == 
         iBatteryInfo.iStatus )
 		{
@@ -3684,7 +3733,7 @@
 			{
 			indicators |= RMobilePhone::KIndNetworkAvailable;
 			}
-TFLOGSTRING2( "TSY: CMmPhoneTsy::GetIndicatorState network: %d", (TInt)networkRegStatus );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORSTATE_2,  "TSY: CMmPhoneTsy::GetIndicatorState network: %d", (TInt)networkRegStatus );
 		}
 
 	//Call in progress?
@@ -3696,12 +3745,12 @@
 		CMmCallTsy* mmCall = CallList()->GetMmCallByIndex( i );
 		if ( RMobileCall::EStatusConnected == mmCall->MobileCallStatus() )
 			{
-TFLOGSTRING3( "TSY: CMmPhoneTsy::GetIndicatorState call id: %d, status: %d", mmCall->CallId(), (TInt)mmCall->MobileCallStatus() );
+OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORSTATE_3,  "TSY: CMmPhoneTsy::GetIndicatorState call id: %d, status: %d", mmCall->CallId(), (TInt)mmCall->MobileCallStatus() );
 			indicators |= RMobilePhone::KIndCallInProgress;
 			break;
 			}
 		}
-TFLOGSTRING2( "TSY: CMmPhoneTsy::GetIndicatorState - ok, Indicators: %d", indicators );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORSTATE_4,  "TSY: CMmPhoneTsy::GetIndicatorState - ok, Indicators: %d", indicators );
 
     return indicators;
 	}
@@ -3716,7 +3765,7 @@
     TBuf8<RMobilePhone::KIMSISize> aImsiData,
     TInt aError )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL, aError=%d", aError );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_1, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL, aError=%d", aError );
 
     // Set the flag to EFalse
     iTSYSubscriberIdReq = EFalse;
@@ -3726,19 +3775,19 @@
   
     // Retrieve previous IMSI value from the Central Repository
 	iCFISPrivateCentRep->Get( KCtsyIMSI, subscriberIdTmp );
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Get old IMSI from CenRep: %S", &subscriberIdTmp );
+OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_2, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Get old IMSI from CenRep: %S", subscriberIdTmp );
 	
     if ( ( KErrNone == aError ) && ( 0 < aImsiData.Length() ) )
         {
         // Copy new IMSI value to the member variable
         iSubscriberId.Copy( aImsiData.Left( aImsiData.Length() ) );
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Copy new IMSI: %S", &iSubscriberId );
+OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_3, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Copy new IMSI: %S", iSubscriberId );
         }
     
     // check the boot state security, is the security ready (PIN query)
     if ( iBootState.iSecReady )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Security ready");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_4, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Security ready");
   
         // Check has the IMSI changed and is there previous info: or an error
         if ( KErrNotFound == subscriberIdTmp.Match( iSubscriberId ) && 
@@ -3755,7 +3804,7 @@
             iCFISPrivateCentRep->Reset();
             // Reset MWIS support
             iMmSupplServTsy->SetIccSupportForMWIS( ETrue );   
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Central Repositories have been reseted!");     
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_5, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Central Repositories have been reseted!");
             
             // intialize the previous SIM related data
             if ( iMmCustomTsy )
@@ -3767,7 +3816,7 @@
             // get new infromation from lower levels, if sim is ready
             if ( iBootState.iSIMReady )
                 {                       
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - SIM ready, retrive intial ICC SIM data."); 
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_6, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - SIM ready, retrive intial ICC SIM data.");
 
                 // update ALS line information 
                 iMessageManager->HandleRequestL( EMobilePhoneGetALSLine );
@@ -3790,7 +3839,7 @@
         {    
     	// Write new IMSI value to the central repository
     	iCFISPrivateCentRep->Set( KCtsyIMSI, iSubscriberId );
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Write new IMSI to the CenRep: %S", &iSubscriberId );
+OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_7, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Write new IMSI to the CenRep: %S", iSubscriberId );
         }
         
     //reset req handle. Returns the deleted req handle
@@ -3851,7 +3900,7 @@
     const TTsyReqHandle aTsyReqHandle,
     RMobilePhone::TMobilePhoneALSLine* aALSLine )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetALSLineL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETALSLINEL_1, "TSY: CMmPhoneTsy::GetALSLineL");
 	
     TInt ret ( KErrNone );
 	TBool alsSupportedBySim;
@@ -3967,7 +4016,7 @@
     RMobilePhone::TMobilePhoneALSLine aAlsStatus,
     TInt aErrorCode )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetAlsLine - ALS line" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETALSLINE_1, "TSY: CMmPhoneTsy::CompleteGetAlsLine - ALS line" );
 
     //check if value has been updated
     if ( aAlsStatus != iAlsLine )
@@ -4007,7 +4056,7 @@
     const TTsyReqHandle aTsyReqHandle,
     RMobilePhone::TMobilePhoneALSLine* aALSLine )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::SetALSLineL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETALSLINEL_1, "TSY: CMmPhoneTsy::SetALSLineL");
     TInt ret ( KErrNone );
 	TBool alsSupportedBySim ( EFalse );
 	
@@ -4080,7 +4129,7 @@
 void CMmPhoneTsy::CompleteSetAlsLine(
     TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteSetAlsLine - ALS line: %d", iTempAlsLine );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETESETALSLINE_1, "TSY: CMmPhoneTsy::CompleteSetAlsLine - ALS line: %d", iTempAlsLine );
 
     //reset req handle. Returns the deleted req handle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
@@ -4169,7 +4218,7 @@
     const TTsyReqHandle aTsyReqHandle,
     RMobilePhone::TMobilePhoneFdnStatus* aFdnStatus )
     {
-TFLOGSTRING( "TSY: CMmPhoneTsy::GetFdnStatusL" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETFDNSTATUSL_1,  "TSY: CMmPhoneTsy::GetFdnStatusL" );
 
     TInt ret ( KErrServerBusy );
 
@@ -4213,7 +4262,7 @@
         CMmDataPackage* aDataPackage,
         TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetFdnStatus - Error: %d", aErrorCode );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETFDNSTATUS_1, "TSY: CMmPhoneTsy::CompleteGetFdnStatus - Error: %d", aErrorCode );
 
 
     //reset req handle. Returns the deleted req handle
@@ -4246,7 +4295,7 @@
 TInt CMmPhoneTsy::GetFdnStatusCancel(
     const TTsyReqHandle aTsyReqHandle )
     {
-TFLOGSTRING( "TSY: CMmPhoneTsy::GetFdnStatusCancel" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETFDNSTATUSCANCEL_1,  "TSY: CMmPhoneTsy::GetFdnStatusCancel" );
     iRetGetFdnStatus = NULL;
     
     iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneGetFdnStatus );
@@ -4296,8 +4345,7 @@
 void CMmPhoneTsy::CompleteSetFdnSettingL(
     TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteSetFdnSettingL - Error: %d",
-    aErrorCode);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETESETFDNSETTINGL_1, "TSY: CMmPhoneTsy::CompleteSetFdnSettingL - Error: %d",aErrorCode);
 
     //reset req handle. Returns the deleted req handle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
@@ -4554,14 +4602,14 @@
     if ( CMmPhoneGsmWcdmaExt::EICCTypeSim2GGsm ==  currentIccType)
         {
         *aCaps = RMobilePhone::KCapsSimAccessSupported;
-TFLOGSTRING("TSY: CMmPhoneTsy::GetIccAccessCaps: aCaps = KCapsSimAccessSupported.");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETICCACCESSCAPS_1, "TSY: CMmPhoneTsy::GetIccAccessCaps: aCaps = KCapsSimAccessSupported.");
         }
     // 3G USIM
     else if ( CMmPhoneGsmWcdmaExt::EICCTypeSim3G == currentIccType )
         {
         *aCaps = RMobilePhone::KCapsUSimAccessSupported +
             RMobilePhone::KCapsSimAccessSupported;
-TFLOGSTRING("TSY: CMmPhoneTsy::GetIccAccessCaps: aCaps = KCapsUSimAccessSupported + KCapsSimAccessSupported.");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETICCACCESSCAPS_2, "TSY: CMmPhoneTsy::GetIccAccessCaps: aCaps = KCapsUSimAccessSupported + KCapsSimAccessSupported.");
         }
     ReqCompleted( aTsyReqHandle, ret );
 
@@ -4625,11 +4673,11 @@
             {
             case CMmPhoneGsmWcdmaExt::EICCTypeSim2GGsm:     // 2G SIM
                 *iICCCaps = RMobilePhone::KCapsSimAccessSupported;
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyIccAccessCapsChange: KCapsSimAccessSupported.");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYICCACCESSCAPSCHANGE_1, "TSY: CMmPhoneTsy::CompleteNotifyIccAccessCapsChange: KCapsSimAccessSupported.");
                 break;
             case CMmPhoneGsmWcdmaExt::EICCTypeSim3G:   // 3G USIM
                 *iICCCaps = RMobilePhone::KCapsUSimAccessSupported;
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyIccAccessCapsChange: KCapsUSimAccessSupported.");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYICCACCESSCAPSCHANGE_2, "TSY: CMmPhoneTsy::CompleteNotifyIccAccessCapsChange: KCapsUSimAccessSupported.");
                 break;
 
             default:
@@ -4674,7 +4722,7 @@
         ret = GetServiceTableL( aTsyReqHandle, aTable, serviceTableV1 );
         }
 
-TFLOGSTRING2("TSY: CMmPhoneTsy::GetServiceTableCheckParametersL - ret:%d",ret);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLECHECKPARAMETERSL_1, "TSY: CMmPhoneTsy::GetServiceTableCheckParametersL - ret:%d",ret);
     return ret;
     }        
 
@@ -4689,7 +4737,7 @@
     RMobilePhone::TMobilePhoneServiceTable* aTable,
     RMobilePhone::TMobilePhoneServiceTableV1* aTableData )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::GetServiceTableL - Handle:%d", aTsyReqHandle);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLEL_1, "TSY: CMmPhoneTsy::GetServiceTableL - Handle:%d", aTsyReqHandle);
     TInt ret( KErrServerBusy );
 
     TTsyReqHandle serviceTableHandle =
@@ -4744,7 +4792,7 @@
             // if SIM is not ready, store request and complete it when SIM is ready
             if ( !iBootState.iSIMReady )
 		        {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceTableL - request when SIM not ready - store req" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLEL_2, "TSY: CMmPhoneTsy::GetServiceTableL - request when SIM not ready - store req" );
 		    	TServiceTableRequests* req = new (ELeave) TServiceTableRequests();
 		    	req->iReqHandle = aTsyReqHandle;
 		    	req->iTable = aTable;
@@ -4756,7 +4804,7 @@
             if( RMobilePhone::ESIMServiceTable == 
                     *aTable && iServiceTableDataCache )
             	{
-TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceTableL ESIMServiceTable returned from cache");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLEL_3, "TSY: CMmPhoneTsy::GetServiceTableL ESIMServiceTable returned from cache");
             	*aTableData = *iServiceTableDataCache;
             	ReqCompleted( aTsyReqHandle, ret );
             	return KErrNone;
@@ -4764,7 +4812,7 @@
            	else if ( RMobilePhone::EUSIMServiceTable== 
                           *aTable && iServiceTableUSIMDataCache )
            		{
-TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceTableL EUSIMServiceTable returned from cache");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLEL_4, "TSY: CMmPhoneTsy::GetServiceTableL EUSIMServiceTable returned from cache");
            		*aTableData = *iServiceTableUSIMDataCache;
             	ReqCompleted( aTsyReqHandle, ret );
             	return KErrNone;
@@ -4773,7 +4821,7 @@
             	{
             	if( !iSimRefreshRegisterOk && !( iServiceTableReq->iCaching ) )
             		{
-TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceTableL sim refresh registration failed - possible old data - cache and complete ");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLEL_5, "TSY: CMmPhoneTsy::GetServiceTableL sim refresh registration failed - possible old data - cache and complete ");
             		//Store reguest parameters for completion
             		iServiceTableReq->iReqHandle = aTsyReqHandle;
             		iServiceTableReq->iTable = aTable;
@@ -4848,7 +4896,7 @@
 //
 void CMmPhoneTsy::CacheServiceTablesL()
 	{
-TFLOGSTRING("TSY: CMmPhoneTsy::CacheServiceTables.");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHESERVICETABLESL_1, "TSY: CMmPhoneTsy::CacheServiceTables.");
 
 	// Start caching if it is not already ongoing
 	if ( (((iSimCacheQueue && ( KCacheServiceTable & iSimCacheQueue )) )
@@ -4877,11 +4925,11 @@
 //
 void CMmPhoneTsy::CompleteCacheServiceTablesL( const TInt aError )
 	{
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL Error = %d", aError);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_1, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL Error = %d", aError);
 	if ( ( iSimCacheQueue && ( KCacheServiceTable & iSimCacheQueue ) ) 
             && IsRefreshOngoing() )
 		{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_2, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL");
 		CompleteCacheSimL( KCacheServiceTable, aError );
 		}
 		
@@ -4889,42 +4937,42 @@
 		
 	// check pending requests and proceed if any
     TInt serviceTableRequestsCount = iServiceTableRequests.Count();
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - serviceTableRequestsCount: %d", serviceTableRequestsCount );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_3, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - serviceTableRequestsCount: %d", serviceTableRequestsCount );
 
 	 if ( serviceTableRequestsCount )
 	 	{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Completing pending ServiceTableRequests");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_4, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Completing pending ServiceTableRequests");
 		// check request type for every pending request and complete
 		for ( TInt i = 0; i < serviceTableRequestsCount; i++ )
 			{
 			TServiceTableRequests* req = iServiceTableRequests[ i ];
 			if ( RMobilePhone::ESIMServiceTable == *req->iTable )
 				{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending ESIMServiceTableRequest");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_5, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending ESIMServiceTableRequest");
 				*(req->iTableData) = *iServiceTableDataCache;
 				}
 			else if ( RMobilePhone::EUSIMServiceTable == *req->iTable )
 				{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending ESIMServiceTableRequest");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_6, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending ESIMServiceTableRequest");
 				*(req->iTableData) = *iServiceTableUSIMDataCache;
 				}
 			else 
 				{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending BadRequest - KErrGeneral");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_7, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending BadRequest - KErrGeneral");
 				ret = KErrGeneral;	
 				}
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - ReqCompleted for pending req withHandle:%d", req->iReqHandle);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_8, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - ReqCompleted for pending req withHandle:%d", req->iReqHandle);
 			ReqCompleted(req->iReqHandle, ret);
 			}
 		// Reset req handle
 		iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneGetServiceTable );
 		iServiceTableRequests.ResetAndDestroy();
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Reset and ResetAndDestroy!");	
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_9, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Reset and ResetAndDestroy!");
 		}
 		
 	if ( ENoRequest != iPendingServiceTableReq )
 		{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL completing client request");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_10, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL completing client request");
 		// Complete client request if pending
 		
 		// Reset req handle. Returns the deleted req handle
@@ -4960,7 +5008,7 @@
 	     	
 	     	if ( iCalledOnGet && ( iServiceTableReq->iCaching ) )
 				{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Called when reading service tables - ");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_11, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Called when reading service tables - ");
 				iCalledOnGet = EFalse;
 				iSimCacheQueue = 0;
 				iRefreshOngoing = EFalse;
@@ -4979,7 +5027,7 @@
 	        	iPendingServiceTableReq = ENoRequest;
 	        	
 	        	// Complete request if error occured
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Completing req if error occurred");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_12, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Completing req if error occurred");
 	        	ReqCompleted( reqHandle, ret );
 				}
 	        }	
@@ -4997,36 +5045,36 @@
     RMobilePhone::TMobilePhoneServiceTableV1 aTableData,
     TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceTableL Error = %d", aErrorCode);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_1, "TSY: CMmPhoneTsy::CompleteGetServiceTableL Error = %d", aErrorCode);
     // Check if timeout has happend, complete to all pending ServiceTable
     // requests and clear queue
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_2, "TSY: CMmPhoneTsy::CompleteGetServiceTableL");
 	if ( KErrTimedOut == aErrorCode )
 		{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL - Timeout happened");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_3, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - Timeout happened");
 		// Reset req handle. Returns the deleted req handle
 	    TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
             EMultimodePhoneGetServiceTable );
 
 	    if ( EMultimodePhoneReqHandleUnknown != reqHandle )
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL - in EMultimodePhoneReqHandleUnknown != reqHandle" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_4, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - in EMultimodePhoneReqHandleUnknown != reqHandle" );
 	    	{
 			// count pending requests and proceed if any
 			TInt serviceTableRequestsCount = iServiceTableRequests.Count();
 
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceTableL - serviceTableRequestsCount: %d", serviceTableRequestsCount );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_5, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - serviceTableRequestsCount: %d", serviceTableRequestsCount );
 	 		if ( serviceTableRequestsCount )
 	 			{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL - Completing pending ServiceTableRequests");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_6, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - Completing pending ServiceTableRequests");
 				// complete pending requests
 				for ( TInt i = 0; i < serviceTableRequestsCount; i++ )
 					{
 					TServiceTableRequests* req = iServiceTableRequests[ i ];
 
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceTableL - ReqCompleted for pending req withHandle:%d", req->iReqHandle);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_7, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - ReqCompleted for pending req withHandle:%d", req->iReqHandle);
 					ReqCompleted(req->iReqHandle, aErrorCode);
 					}
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL - in iServiceTableRequests.ResetAndDestroy()" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_8, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - in iServiceTableRequests.ResetAndDestroy()" );
 				iServiceTableRequests.ResetAndDestroy();	
 				}
 	        }
@@ -5034,7 +5082,7 @@
 
     if ( ESIMRequest == iPendingServiceTableCacheReq )
 		{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL got Service Table");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_9, "TSY: CMmPhoneTsy::CompleteGetServiceTableL got Service Table");
 		
 		delete iServiceTableDataCache;
 		iServiceTableDataCache = NULL;
@@ -5052,7 +5100,7 @@
             iMmPhoneExtInterface->CurrentICCType() ) &&
             ENoRequest != iPendingServiceTableCacheReq )
 			{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL requesting USIM Service Table");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_10, "TSY: CMmPhoneTsy::CompleteGetServiceTableL requesting USIM Service Table");
 
 			RMobilePhone::TMobilePhoneServiceTable serviceTable = 
 				RMobilePhone::EUSIMServiceTable;
@@ -5077,7 +5125,7 @@
 		}
 	else if ( EUSIMRequest == iPendingServiceTableCacheReq )
 		{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL got USIM Service Table");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_11, "TSY: CMmPhoneTsy::CompleteGetServiceTableL got USIM Service Table");
 
 		delete iServiceTableUSIMDataCache;
 		iServiceTableUSIMDataCache = NULL;
@@ -5101,7 +5149,7 @@
 	if ( ENoRequest != iPendingServiceTableReq &&
         ENoRequest == iPendingServiceTableCacheReq )
 		{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL completing client request");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_12, "TSY: CMmPhoneTsy::CompleteGetServiceTableL completing client request");
 		// Complete client request if pending
 		
 		// Reset req handle. Returns the deleted req handle
@@ -5117,7 +5165,7 @@
 		
 	    		if( KErrNone == aErrorCode )
 	    			{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL copy SIM ST data to client");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_13, "TSY: CMmPhoneTsy::CompleteGetServiceTableL copy SIM ST data to client");
 	    			iServiceTableDataCache = new (ELeave) 
 					    RMobilePhone::TMobilePhoneServiceTableV1();
 	    			*iServiceTableDataCache	= aTableData;
@@ -5131,7 +5179,7 @@
 				
 	        	if( KErrNone == aErrorCode )
 	        		{
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL copy USIM ST data to client");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_14, "TSY: CMmPhoneTsy::CompleteGetServiceTableL copy USIM ST data to client");
 	        		iServiceTableUSIMDataCache = new (ELeave) 
 					    RMobilePhone::TMobilePhoneServiceTableV1();
 	        		*iServiceTableUSIMDataCache = aTableData;	
@@ -5156,7 +5204,7 @@
 TInt CMmPhoneTsy::GetServiceTableCancel (
 	const TTsyReqHandle aTsyReqHandle )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceTableCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLECANCEL_1, "TSY: CMmPhoneTsy::GetServiceTableCancel");
     iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneGetServiceTable );
     ReqCompleted( aTsyReqHandle, KErrCancel );
 
@@ -5172,7 +5220,7 @@
 //
 TInt CMmPhoneTsy::SimRefreshRegisterL()
     {
-TFLOGSTRING( "TSY: CMmPhoneTsy::SimRefreshRegisterL" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SIMREFRESHREGISTERL_1,  "TSY: CMmPhoneTsy::SimRefreshRegisterL" );
 
     TInt ret( KErrNone );
 
@@ -5191,7 +5239,7 @@
     if ( KErrNone != ret )
         {
         // the sending has failed
-TFLOGSTRING( "TSY: CMmPhoneTsy::SimRefreshRegisterL, Registration for Refresh failed" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SIMREFRESHREGISTERL_2,  "TSY: CMmPhoneTsy::SimRefreshRegisterL, Registration for Refresh failed" );
         }
 
     return ret;
@@ -5206,7 +5254,7 @@
 void CMmPhoneTsy::CompleteSimRefreshRegister(
      TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteSimRefreshRegisterL Error = %d", aErrorCode );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETESIMREFRESHREGISTER_1, "TSY: CMmPhoneTsy::CompleteSimRefreshRegisterL Error = %d", aErrorCode );
 
 	if( KErrNone == aErrorCode )
 		{
@@ -5222,7 +5270,7 @@
 //
 TBool CMmPhoneTsy::GetSimRefreshRegister()
     {
-TFLOGSTRING2( "TSY: CMmPhoneTsy::GetSimRefreshRegister iSimRefreshRegisterOk = %d", iSimRefreshRegisterOk );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSIMREFRESHREGISTER_1,  "TSY: CMmPhoneTsy::GetSimRefreshRegister iSimRefreshRegisterOk = %d", iSimRefreshRegisterOk );
 
 	return iSimRefreshRegisterOk;		
     }
@@ -5237,7 +5285,7 @@
     {
 	if( KErrNone != aErrorCode)
 		{
-		TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteUpdateLifeTimer Error = %d", aErrorCode );
+		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEUPDATELIFETIMER_1, "TSY: CMmPhoneTsy::CompleteUpdateLifeTimer Error = %d", aErrorCode );
 		}
     }    
 
@@ -5296,7 +5344,7 @@
 void CMmPhoneTsy::CompleteSimRefreshNowL(
     TUint16 aFilesToRefresh )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteSimRefreshNowL filemask: %d", aFilesToRefresh);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETESIMREFRESHNOWL_1, "TSY: CMmPhoneTsy::CompleteSimRefreshNowL filemask: %d", aFilesToRefresh);
 
     // Set flag to indicate that refresh has started
     iRefreshOngoing = ETrue;
@@ -5346,13 +5394,13 @@
         //FDN requested? (FDN has the first priority)
         if( KCacheFdn & iSimCacheQueue )
             {
-TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - FDN" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_1,  "TSY: CMmPhoneTsy::CacheNextL - FDN" );
             pbRequested = KETelIccFdnPhoneBook;
             resetFlag = KCacheFdn;
             }
         else if( KCacheALSline & iSimCacheQueue )
             {
-TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - ALS" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_2,  "TSY: CMmPhoneTsy::CacheNextL - ALS" );
 			ResetMEAlsInfo();
 			pbRequested = KNullDesC;
 			cacheStarted = ETrue;
@@ -5360,7 +5408,7 @@
         //ADN requested?
         else if( KCacheAdn & iSimCacheQueue )
             {
-TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - ADN" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_3,  "TSY: CMmPhoneTsy::CacheNextL - ADN" );
             //NOTE: Here should be added the checking of FDN active state
             pbRequested = KETelIccAdnPhoneBook;
             resetFlag = KCacheAdn;
@@ -5369,7 +5417,7 @@
         //checked and the queue can be reset)
         else
             {
-TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - Unknown" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_4,  "TSY: CMmPhoneTsy::CacheNextL - Unknown" );
             pbRequested = KNullDesC;
             resetFlag = iSimCacheQueue;
             }
@@ -5378,7 +5426,7 @@
         if( (pbRequested!=KNullDesC) && (iPBList) )
             {
             TInt numberOfPBooks = iPBList->GetNumberOfObjects();
-TFLOGSTRING2( "TSY: CMmPhoneTsy::CacheNextL - Num Of PBs: %d", numberOfPBooks );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_5,  "TSY: CMmPhoneTsy::CacheNextL - Num Of PBs: %d", numberOfPBooks );
 
             //Browse through the phonebook names for the one required
             for( TInt i=0; i < numberOfPBooks; i++ )
@@ -5399,24 +5447,23 @@
                     	TRAP_IGNORE( MessageManager()->HandleRequestL( 
                             EMmTsyPhoneBookStoreCacheCancelIPC, &package ); );
 
-#if ( TF_LOGGING_METHOD > 0 )
+
                     	if ( pbRequested == KETelIccFdnPhoneBook ) 
                     	    {
-TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - CancelCache for : KETelIccFdnPhoneBook" ); 
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_6,  "TSY: CMmPhoneTsy::CacheNextL - CancelCache for : KETelIccFdnPhoneBook" );
                             }
                     	else 
                     	    {
-TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - CancelCache for : KETelIccAdnPhoneBook" ); 
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_7,  "TSY: CMmPhoneTsy::CacheNextL - CancelCache for : KETelIccAdnPhoneBook" );
                             }
-#endif // TF_LOGGING_METHOD
                     	}                   
                     // perform the various stages of phonebook 
                     // cache re-initialisation
-TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - Resetting cache.");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_8,  "TSY: CMmPhoneTsy::CacheNextL - Resetting cache.");
                     pbStore->ResetCacheReady();
                     pbStore->ResetInitialisationStatus();
                     pbStore->ResetCache();
-TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL -> Cache entries" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_9,  "TSY: CMmPhoneTsy::CacheNextL -> Cache entries" );
                     pbStore->CacheEntriesL();
 
                     cacheStarted = ETrue;
@@ -5430,14 +5477,14 @@
         //so the file is removed from the cache queue
         if( !cacheStarted )
             {
-TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - No PB Could be found, or Unknown request" );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_10,  "TSY: CMmPhoneTsy::CacheNextL - No PB Could be found, or Unknown request" );
             CompleteCacheSimL( resetFlag, ETrue ); //complete with error
             }
         }
     //more files in the queue?
     result = ( iSimCacheQueue )? ETrue : EFalse;
 
-TFLOGSTRING2( "TSY: CMmPhoneTsy::CacheNextL: (Success/Fail = 1/0) %d",(TInt)result );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_11,  "TSY: CMmPhoneTsy::CacheNextL: (Success/Fail = 1/0) %d",(TInt)result );
     return result;
     }
 
@@ -5453,7 +5500,7 @@
     TUint8	aFileType,
     TBool	aReadError)
     {
-TFLOGSTRING2( "TSY: CMmPhoneTsy::CompleteCacheSimL, FileType: 0x%x", aFileType );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESIML_1,  "TSY: CMmPhoneTsy::CompleteCacheSimL, FileType: 0x%x", aFileType );
 
     TBool filesInCacheQueue(EFalse); //By default: "no more files in cache"
 
@@ -5489,7 +5536,7 @@
         }
      else
      	{
-TFLOGSTRING( "TSY: CMmPhoneTsy::CompleteCacheSimL, caching still in progress." );
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESIML_2,  "TSY: CMmPhoneTsy::CompleteCacheSimL, caching still in progress." );
      	}
     }
 
@@ -5502,7 +5549,7 @@
 void CMmPhoneTsy::NotifySimRefreshCompletionL(
     TBool aReadError )
     {
-TFLOGSTRING2( "TSY: CMmPhoneTsy::NotifySimRefreshCompletionL error = %d",aReadError );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYSIMREFRESHCOMPLETIONL_1,  "TSY: CMmPhoneTsy::NotifySimRefreshCompletionL error = %d",aReadError );
 
     // Refresh is finished, update flag
     iRefreshOngoing = EFalse;
@@ -5528,7 +5575,7 @@
 TInt CMmPhoneTsy::ImsAuthenticationL( 
     TDes8* aAuthenticationData )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::ImsAuthenticationL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_IMSAUTHENTICATIONL_1, "TSY: CMmPhoneTsy::ImsAuthenticationL");
 
 	TInt ret = KErrServerBusy;
     
@@ -5581,7 +5628,7 @@
     CMmDataPackage* aDataPackage, 
     TInt aResult )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteImsAuthentication");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEIMSAUTHENTICATION_1, "TSY: CMmPhoneTsy::CompleteImsAuthentication");
 
     // reset req handle. Returns the deleted req handle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
@@ -5648,7 +5695,7 @@
 //
 TInt CMmPhoneTsy::ImsAuthenticationCancel()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::ImsAuthenticationCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_IMSAUTHENTICATIONCANCEL_1, "TSY: CMmPhoneTsy::ImsAuthenticationCancel");
     // reset the reqhandle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
         EMultimodePhoneIMSAuthenticate );
@@ -5674,7 +5721,7 @@
 TInt CMmPhoneTsy::GetMailboxNumbersL(
     TDes8* aMailBox )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetMailboxNumbersL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETMAILBOXNUMBERSL_1, "TSY: CMmPhoneTsy::GetMailboxNumbersL");
     TInt ret = KErrServerBusy;
     
     // Check if request handle already exists
@@ -5711,7 +5758,7 @@
                         found = ETrue;
                         if( !pbStore->IsPBInitDone() )
                             {
-                            TFLOGSTRING("TSY: CMmPhoneTsy::GetMailboxNumbersL VoiceMailBox initilizing was not complete... Waiting for completion");
+                            OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETMAILBOXNUMBERSL_2, "TSY: CMmPhoneTsy::GetMailboxNumbersL VoiceMailBox initilizing was not complete... Waiting for completion");
                             iReqHandleType = EMultimodePhoneGetMailboxNumbers;
                             return KErrNone;
                             }
@@ -5719,7 +5766,7 @@
                     }
                 if(!found)
                     {
-                    TFLOGSTRING("TSY: CMmPhoneTsy::GetMailboxNumbersL VoiceMailBox should be created...");
+                    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETMAILBOXNUMBERSL_3, "TSY: CMmPhoneTsy::GetMailboxNumbersL VoiceMailBox should be created...");
                     iMmPhoneBookStoreTsy = 
                         CMmPhoneBookStoreTsy::NewL( this, KETelIccVoiceMailBox );
                     
@@ -5759,7 +5806,7 @@
     CMmDataPackage* aDataPackage, 
     TInt aResult )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetMailboxNumbers");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETMAILBOXNUMBERS_1, "TSY: CMmPhoneTsy::CompleteGetMailboxNumbers");
 
     // reset req handle. Returns the deleted req handle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
@@ -5796,7 +5843,7 @@
 //
 TInt CMmPhoneTsy::GetMailboxNumbersCancel()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetMailboxNumbersCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETMAILBOXNUMBERSCANCEL_1, "TSY: CMmPhoneTsy::GetMailboxNumbersCancel");
     // reset the reqhandle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
         EMultimodePhoneGetMailboxNumbers );
@@ -5931,7 +5978,7 @@
     //Check if the object is the Phone object
     if( this == aObject )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - this == aObject");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_1, "TSY: CMmPhoneTsy::TimerExpired - this == aObject");
         //call phone object to complete this request
         this->Complete( aReqHandleType, error );
         }
@@ -5942,14 +5989,14 @@
     //Check if the object is a Call object
     for ( i = 0; i < iCallList->GetNumberOfObjects(); i++ )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iCallList->GetNumberOfObjects()");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_2, "TSY: CMmPhoneTsy::TimerExpired - iCallList->GetNumberOfObjects()");
         //Get call object
         CMmCallTsy* call = iCallList->GetMmCallByIndex( i );
         //check if the current call is the object that we are
         //trying to find
         if( call == aObject )
             {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - call == aObject");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_3, "TSY: CMmPhoneTsy::TimerExpired - call == aObject");
             //call the complete method
             call->Complete( aReqHandleType, error );
             //object found, break
@@ -5960,7 +6007,7 @@
     // Check if the object is a ConferenceCall object
     if ( iMmConferenceCall == aObject )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmConferenceCall");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_4, "TSY: CMmPhoneTsy::TimerExpired - iMmConferenceCall");
         iMmConferenceCall->Complete( aReqHandleType, error );
         }
     //OTHER MODULES
@@ -5968,14 +6015,14 @@
     //Check if the object is a PBStore object
     for ( i = 0; i < iPBList->GetNumberOfObjects(); i++ )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iPBList->GetNumberOfObjects()");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_5, "TSY: CMmPhoneTsy::TimerExpired - iPBList->GetNumberOfObjects()");
         //Get PBStore object
         CMmPhoneBookStoreTsy* pbStore = iPBList->GetMmPBByIndex( i );
         //check if the current PB is the object that we are
         //trying to find
         if ( pbStore == aObject )
             {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - aPBStore == aObject");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_6, "TSY: CMmPhoneTsy::TimerExpired - aPBStore == aObject");
             //call the complete method
 			pbStore->Complete( aReqHandleType, error );
             //object found, break
@@ -5986,41 +6033,41 @@
     // Check if the object is the SMS object
     if ( iMmSmsTsy == aObject )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmSmsTsy == aObject");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_7, "TSY: CMmPhoneTsy::TimerExpired - iMmSmsTsy == aObject");
         //call the complete method
         iMmSmsTsy->Complete( aReqHandleType, error );
         }
     // Check if the object is the Broadcast object
     else if ( iMmBroadcastTsy == aObject )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmBroadcastTsy == aObject");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_8, "TSY: CMmPhoneTsy::TimerExpired - iMmBroadcastTsy == aObject");
         //call the complete method
         iMmBroadcastTsy->Complete( aReqHandleType, error );
         }
     // Check if the object is the USSD object
     else if ( iMmUssdTsy == aObject )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmUssdTsy == aObject");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_9, "TSY: CMmPhoneTsy::TimerExpired - iMmUssdTsy == aObject");
         //call the complete method
         iMmUssdTsy->Complete( aReqHandleType, error );
         }
     // Check if the object is the ONstore object
     else if ( iMmONStoreTsy == aObject )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmONStoreTsy == aObject");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_10, "TSY: CMmPhoneTsy::TimerExpired - iMmONStoreTsy == aObject");
         //call the complete method
         iMmONStoreTsy->Complete( aReqHandleType, error );
         }
     // Check if the object is the ENstore object
     else if ( iMmENStoreTsy == aObject )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmENStoreTsy == aObject");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_11, "TSY: CMmPhoneTsy::TimerExpired - iMmENStoreTsy == aObject");
         //call the complete method
         iMmENStoreTsy->Complete( aReqHandleType, error );
         }
     else if ( iMmCustomTsy == aObject )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmCustomTsy == aObject");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_12, "TSY: CMmPhoneTsy::TimerExpired - iMmCustomTsy == aObject");
         iMmCustomTsy->Complete( aReqHandleType, error , aIPC );
         }
 
@@ -6032,13 +6079,13 @@
     // Data session
     else if ( NULL != iMmPacketServiceTsy )
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - NULL != iMmPacketServiceTsy");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_13, "TSY: CMmPhoneTsy::TimerExpired - NULL != iMmPacketServiceTsy");
         //call the complete method
         iMmPacketServiceTsy->Complete( aObject, aReqHandleType, error );
         }
     else
     	{
-TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - else");		
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_14, "TSY: CMmPhoneTsy::TimerExpired - else");
         }
     }
 
@@ -6074,6 +6121,10 @@
         case EMultimodePhoneTerminateAllCalls:
             timeOut = KMmPhoneTerminateAllCallsTimeOut;
             break;
+      // Active Calls Termination
+        case EMultimodePhoneTerminateActiveCalls:
+            timeOut = KMmPhoneTerminateActiveCallsTimeOut;
+            break;
       //NET
         case EMultimodePhoneSelectNetwork:
             timeOut = KMmPhoneSelectNetworkTimeOut;
@@ -6272,12 +6323,15 @@
 	RMobilePhone::TMobilePhoneServiceTableV1 emptyServiceTable;
 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 emptyPhoneStoreInfo;
 	TInt trapError = KErrNone;
-TFLOGSTRING2("TSY: CMmPhoneTsy::Complete - ReqHandleType: %d", aReqHandleType);	
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETE_1, "TSY: CMmPhoneTsy::Complete - ReqHandleType: %d", aReqHandleType);
     switch( aReqHandleType )
         {
         case EMultimodePhoneTerminateAllCalls:
         	CompleteTerminateAllCallsReq(aError);
         	break;
+        case EMultimodePhoneTerminateActiveCalls:
+            CompleteTerminateActiveCallsReq(aError);
+            break;
       //DTMF
         case EMultimodePhoneSendDTMFTones:
         case EMultimodePhoneStartDTMFTone:
@@ -6402,7 +6456,7 @@
             CompleteGetFdnStatus( NULL, aError );
             break;         
         default:
-TFLOGSTRING("TSY: CMmPhoneTsy::Complete default handle type" );        
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETE_2, "TSY: CMmPhoneTsy::Complete default handle type" );
             if ( iTsyReqHandleStore->GetTsyReqHandle(
                     aReqHandleType ))
             	{
@@ -6487,7 +6541,7 @@
     const TTsyReqHandle aTsyReqHandle,
     const TInt aError  )
     {
-TFLOGSTRING3("TSY: CMmPhoneTsy::Request Completed - Handle:%d Error:%d", aTsyReqHandle, aError);
+OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_REQCOMPLETED_1, "TSY: CMmPhoneTsy::Request Completed - Handle:%d Error:%d", aTsyReqHandle, aError);
 
     CTelObject::ReqCompleted( aTsyReqHandle, aError );
 
@@ -6715,6 +6769,7 @@
     return iMmSecurityTsy;
     }
 
+
 // ---------------------------------------------------------------------------
 // CMmPhoneTsy::IsRequestPossibleInOffLine
 // Checks wether a ETel request can be performed or not while offline mode is
@@ -6844,7 +6899,7 @@
             break;
         }
 
-TFLOGSTRING3("TSY: CMmPhoneTsy::IsRequestPossibleInOffline - IPC:%d, ret:%d", aIpc, isRequestPossible);
+OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ISREQUESTPOSSIBLEINOFFLINE_1, "TSY: CMmPhoneTsy::IsRequestPossibleInOffline - IPC:%d, ret:%d", aIpc, isRequestPossible);
     return isRequestPossible;
     }
 
@@ -6861,7 +6916,7 @@
     iCallForwardingNumber.Zero();
     aDataPackage->UnPackData( iCallForwardingNumber );
 
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetCallForwardingNumber number = %S ", &iCallForwardingNumber);
+OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETCALLFORWARDINGNUMBER_1, "TSY: CMmPhoneTsy::CompleteGetCallForwardingNumber number = %S ", iCallForwardingNumber);
 
     }
 
@@ -6875,7 +6930,7 @@
     const TTsyReqHandle aTsyReqHandle, 
     TUint32* aIndex )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::EnumerateAPNEntries");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ENUMERATEAPNENTRIESL_1, "TSY: CMmPhoneTsy::EnumerateAPNEntries");
 
     // Check if request handle already exists
     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
@@ -6927,7 +6982,7 @@
 //
 TInt CMmPhoneTsy::EnumerateAPNEntriesCancel()
     {
-TFLOGSTRING("CMmPhoneTsy::EnumerateAPNEntriesCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ENUMERATEAPNENTRIESCANCEL_1, "CMmPhoneTsy::EnumerateAPNEntriesCancel");
     iRetAPNEntries = NULL;
     
     //reset the req handle
@@ -6953,7 +7008,7 @@
     CMmDataPackage* aDataPackage, 
     TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteEnumerateAPNEntries Error: %d", aErrorCode);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEENUMERATEAPNENTRIES_1, "TSY: CMmPhoneTsy::CompleteEnumerateAPNEntries Error: %d", aErrorCode);
 
     //reset req handle. Returns the deleted req handle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
@@ -6989,7 +7044,7 @@
     TUint32* aIndex, 
     TDes8* aAPN )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetAPNnameL");    
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETAPNNAMEL_1, "TSY: CMmPhoneTsy::GetAPNnameL");
 
     TInt ret = KErrServerBusy;
     
@@ -7043,7 +7098,7 @@
 //
 TInt CMmPhoneTsy::GetAPNnameCancel()
     {
-TFLOGSTRING("CMmPhoneTsy::GetAPNnameCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETAPNNAMECANCEL_1, "CMmPhoneTsy::GetAPNnameCancel");
     iRetAPNname = NULL;
     
     //reset the req handle
@@ -7069,7 +7124,7 @@
     CMmDataPackage* aDataPackage, 
     TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetAPNname Error: %d", aErrorCode);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETAPNNAME_1, "TSY: CMmPhoneTsy::CompleteGetAPNname Error: %d", aErrorCode);
     
     //reset req handle. Returns the deleted req handle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
@@ -7111,7 +7166,7 @@
 void CMmPhoneTsy::SetAlsState( 
 	TBool aState )
 	{
-TFLOGSTRING2("TSY: CMmPhoneTsy::SetAlsState Error: %d", aState);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETALSSTATE_1, "TSY: CMmPhoneTsy::SetAlsState Error: %d", aState);
 	
 	// Check where set was called
 	if( iCspFileAlsSet )
@@ -7148,7 +7203,7 @@
 RMobilePhone::TMobilePhoneALSLine CMmPhoneTsy::MapMEALSLine( 
 	TInt aAlsLineInfo )
 	{
-TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSLine");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_1, "TSY: CMmPhoneTsy::MapMEALSLine");
 
 	RMobilePhone::TMobilePhoneALSLine lineInfo;
 	
@@ -7156,23 +7211,23 @@
 		{
 		case 0://TInt from CentRep
 			lineInfo = RMobilePhone::EAlternateLinePrimary;
-TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSInfo Line line = EAlternateLinePrimary");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_2, "TSY: CMmPhoneTsy::MapMEALSInfo Line line = EAlternateLinePrimary");
 			break;
 		case 1://TInt from CentRep
 			lineInfo = RMobilePhone::EAlternateLineAuxiliary;
-TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineAuxiliary");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_3, "TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineAuxiliary");
 			break;
 		case 2://TInt from CentRep
 			lineInfo = RMobilePhone::EAlternateLineUnknown;
-TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineUnknown");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_4, "TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineUnknown");
 			break;
 		case 3://TInt from CentRep
 			lineInfo = RMobilePhone::EAlternateLineNotAvailable;
-TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineNotAvailable");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_5, "TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineNotAvailable");
 			break;
 		default:
 			lineInfo = RMobilePhone::EAlternateLineUnknown;
-TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineUnknown");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_6, "TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineUnknown");
 			break;
 		}
 		
@@ -7188,13 +7243,13 @@
 void CMmPhoneTsy::ResetMEAlsInfo()
 	{
 	
-TFLOGSTRING("TSY: CMmPhoneTsy::ResetMEAlsInfo");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_RESETMEALSINFO_1, "TSY: CMmPhoneTsy::ResetMEAlsInfo");
 	
 	iCentRep->Reset();
 	
 	if( iSimCacheQueue && ( KCacheALSline & iSimCacheQueue ) )
 	    { 
-TFLOGSTRING("TSY: CMmPhoneTsy::ResetMEAlsInfo -> CompleteCacheSimL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_RESETMEALSINFO_2, "TSY: CMmPhoneTsy::ResetMEAlsInfo -> CompleteCacheSimL");
         // function can leave, so there for it must be trapped, the error 
         // value is ingnored, because the functionality doesn't depend on it
 	    TRAP_IGNORE( CompleteCacheSimL( KCacheALSline, EFalse ) );	
@@ -7210,7 +7265,7 @@
 //
 CRepository* CMmPhoneTsy::GetCfisCenRep()
 	{
-TFLOGSTRING("TSY: CMmPhoneTsy::GetCfisCenRep");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCFISCENREP_1, "TSY: CMmPhoneTsy::GetCfisCenRep");
 
 	if( iCFISCentRep )
 		{
@@ -7228,7 +7283,7 @@
 //
 CRepository* CMmPhoneTsy::GetMwisCenRep()
 	{
-TFLOGSTRING("TSY: CMmPhoneTsy::GetMwisCenRep");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETMWISCENREP_1, "TSY: CMmPhoneTsy::GetMwisCenRep");
 
 	if( iMWISCentRep )
 		{
@@ -7246,7 +7301,7 @@
 //
 CRepository* CMmPhoneTsy::GetCfisPRCenRep()
 	{
-TFLOGSTRING("TSY: CMmPhoneTsy::GetCfisPRCenRep");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCFISPRCENREP_1, "TSY: CMmPhoneTsy::GetCfisPRCenRep");
 
 	if( iCFISPrivateCentRep )
 		{
@@ -7264,7 +7319,7 @@
 //
 void CMmPhoneTsy::GetSubscriberIdForTSYL()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetSubscriberIdForTSYL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSUBSCRIBERIDFORTSYL_1, "TSY: CMmPhoneTsy::GetSubscriberIdForTSYL");
     
     // Check if some client has already requested this
     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
@@ -7278,7 +7333,7 @@
         }
     else
         {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetSubscriberIdForTSYL - Already requested");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSUBSCRIBERIDFORTSYL_2, "TSY: CMmPhoneTsy::GetSubscriberIdForTSYL - Already requested");
         }
     }
 	
@@ -7291,7 +7346,7 @@
 TInt CMmPhoneTsy::AppendAPNNameL( 
     RMobilePhone::TAPNEntryV3* aAPNEntry )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::AppendAPNNameL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_APPENDAPNNAMEL_1, "TSY: CMmPhoneTsy::AppendAPNNameL");
 
     TInt ret ( KErrServerBusy );
 
@@ -7324,7 +7379,7 @@
 //
 TInt CMmPhoneTsy::AppendAPNNameCancel()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::AppendAPNNameCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_APPENDAPNNAMECANCEL_1, "TSY: CMmPhoneTsy::AppendAPNNameCancel");
     // reset the reqhandle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
         EMultimodePhoneAppendAPNName );
@@ -7347,7 +7402,7 @@
 void CMmPhoneTsy::CompleteAppendAPNName( 
     TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteAppendAPNName. Error: %d", aErrorCode);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEAPPENDAPNNAME_1, "TSY: CMmPhoneTsy::CompleteAppendAPNName. Error: %d", aErrorCode);
     
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
         EMultimodePhoneAppendAPNName );
@@ -7368,7 +7423,7 @@
     const TTsyReqHandle aTsyReqHandle, 
     TUint32* aIndex )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::DeleteAPNNameL, index = %d", aIndex);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DELETEAPNNAMEL_1, "TSY: CMmPhoneTsy::DeleteAPNNameL, index = %d", aIndex);
 
     // get the handle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
@@ -7408,7 +7463,7 @@
 //
 TInt CMmPhoneTsy::DeleteAPNNameCancel()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::DeleteAPNNameCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DELETEAPNNAMECANCEL_1, "TSY: CMmPhoneTsy::DeleteAPNNameCancel");
     // reset the reqhandle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
         EMultimodePhoneDeleteAPNName );
@@ -7430,7 +7485,7 @@
 void CMmPhoneTsy::CompleteDeleteAPNName( 
     TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteDeleteAPNName. Error: %d", aErrorCode);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEDELETEAPNNAME_1, "TSY: CMmPhoneTsy::CompleteDeleteAPNName. Error: %d", aErrorCode);
 
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
         EMultimodePhoneDeleteAPNName );
@@ -7450,7 +7505,7 @@
 //
 TInt CMmPhoneTsy::NotifyAPNListChanged()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::NotifyAPNListChanged");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYAPNLISTCHANGED_1, "TSY: CMmPhoneTsy::NotifyAPNListChanged");
 
     iReqHandleType = EMultimodePhoneNotifyAPNListChange;
     
@@ -7466,7 +7521,7 @@
 //
 TInt CMmPhoneTsy::NotifyAPNListChangedCancel()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::NotifyAPNListChangedCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYAPNLISTCHANGEDCANCEL_1, "TSY: CMmPhoneTsy::NotifyAPNListChangedCancel");
     
     TTsyReqHandle reqHandle = iTsyReqHandleStore->
         ResetTsyReqHandle( EMultimodePhoneNotifyAPNListChange );
@@ -7488,7 +7543,7 @@
 void CMmPhoneTsy::CompleteNotifyAPNListChanged( 
     TInt aErrorCode )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyAPNListChanged");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYAPNLISTCHANGED_1, "TSY: CMmPhoneTsy::CompleteNotifyAPNListChanged");
 
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
         EMultimodePhoneNotifyAPNListChange );
@@ -7510,7 +7565,7 @@
     const TTsyReqHandle aTsyReqHandle, 
     RMobilePhone::TAPNControlListServiceStatus* aAPNControlListServiceStatus )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::SetAPNControlListServiceStatusL.");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETAPNCONTROLLISTSERVICESTATUSL_1, "TSY: CMmPhoneTsy::SetAPNControlListServiceStatusL.");
 
     iSetAclStatus = aAPNControlListServiceStatus;
     
@@ -7552,7 +7607,7 @@
 //
 TInt CMmPhoneTsy::SetAPNControlListServiceStatusCancel()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::SetAPNControlListServiceStatusCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETAPNCONTROLLISTSERVICESTATUSCANCEL_1, "TSY: CMmPhoneTsy::SetAPNControlListServiceStatusCancel");
     
     // erase pointer to client data
     iSetAclStatus = NULL;
@@ -7578,7 +7633,7 @@
 void CMmPhoneTsy::CompleteSetAPNControlListServiceStatus( 
     TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteSetAPNControlListServiceStatus. Error: %d", aErrorCode);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETESETAPNCONTROLLISTSERVICESTATUS_1, "TSY: CMmPhoneTsy::CompleteSetAPNControlListServiceStatus. Error: %d", aErrorCode);
 
     //reset req handle. Returns the deleted req handle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
@@ -7601,7 +7656,7 @@
     const TTsyReqHandle aTsyReqHandle, 
     RMobilePhone::TAPNControlListServiceStatus* aAPNControlListServiceStatus )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetAPNControlListServiceStatusL");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETAPNCONTROLLISTSERVICESTATUSL_1, "TSY: CMmPhoneTsy::GetAPNControlListServiceStatusL");
 
     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
         EMultimodePhoneGetAPNControlListServiceStatus );
@@ -7642,7 +7697,7 @@
 //
 TInt CMmPhoneTsy::GetAPNControlListServiceStatusCancel()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::GetAPNControlListServiceStatusCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETAPNCONTROLLISTSERVICESTATUSCANCEL_1, "TSY: CMmPhoneTsy::GetAPNControlListServiceStatusCancel");
     // reset the reqhandle
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
         EMultimodePhoneGetAPNControlListServiceStatus );
@@ -7665,7 +7720,7 @@
     CMmDataPackage* aDataPackage, 
     TInt aErrorCode )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetAPNControlListServiceStatus. Error %d", aErrorCode);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETAPNCONTROLLISTSERVICESTATUS_1, "TSY: CMmPhoneTsy::CompleteGetAPNControlListServiceStatus. Error %d", aErrorCode);
     
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
         EMultimodePhoneGetAPNControlListServiceStatus );
@@ -7704,7 +7759,7 @@
 TInt CMmPhoneTsy::NotifyAPNControlListServiceStatusChange( 
     RMobilePhone::TAPNControlListServiceStatus* aAPNControlListServiceStatus )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::NotifyAPNControlListServiceStatusChange");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYAPNCONTROLLISTSERVICESTATUSCHANGE_1, "TSY: CMmPhoneTsy::NotifyAPNControlListServiceStatusChange");
     
     iRetNotifyAclStatus = aAPNControlListServiceStatus;
     iReqHandleType = EMultimodePhoneNotifyAPNControlListServiceStatusChange;
@@ -7721,7 +7776,7 @@
 //
 TInt CMmPhoneTsy::NotifyAPNControlListServiceStatusChangeCancel()
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::NotifyAPNControlListServiceStatusChangeCancel");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYAPNCONTROLLISTSERVICESTATUSCHANGECANCEL_1, "TSY: CMmPhoneTsy::NotifyAPNControlListServiceStatusChangeCancel");
 
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
         EMultimodePhoneNotifyAPNControlListServiceStatusChange );
@@ -7746,7 +7801,7 @@
     CMmDataPackage* aDataPackage, 
     TInt aErrorCode )
     {
-TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyAPNControlListServiceStatusChange");
+OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYAPNCONTROLLISTSERVICESTATUSCHANGE_1, "TSY: CMmPhoneTsy::CompleteNotifyAPNControlListServiceStatusChange");
 
     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
         EMultimodePhoneNotifyAPNControlListServiceStatusChange );
@@ -7832,8 +7887,7 @@
     CMmDataPackage dataPackage;
     dataPackage.PackData( &duration );
 
-    TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteNotifyCallDurationChange - \
-         duration: %d", duration);
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYCALLDURATIONCHANGE_1, "TSY: CMmPhoneTsy::CompleteNotifyCallDurationChange - \duration: %d", duration);
 
 #ifdef USING_CTSY_DISPATCHER	
     TRAP_IGNORE(iMessageManager->HandleRequestL( 
@@ -7851,16 +7905,16 @@
 // Receives error notifications from Telephony audio control
 // ---------------------------------------------------------------------------
 //
-#if TF_LOGGING_METHOD == 1
+#if (OST_TRACE_CATEGORY & OST_TRACE_CATEGORY_DEBUG)
 void CMmPhoneTsy::NotifyTelephonyAudioControlError( const TName& aCallName, 
                                                     const TInt& aError )
     {       
-    TFLOGSTRING3("TSY: CMmPhoneTsy::NotifyAudioControlError. Call name:%S, Error code %d", &aCallName, aError );
+    OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYTELEPHONYAUDIOCONTROLERROR_1, "TSY: CMmPhoneTsy::NotifyAudioControlError. Call name:%S, Error code %d", aCallName, aError );
 #else
 void CMmPhoneTsy::NotifyTelephonyAudioControlError( const TName& /*aCallName*/, 
                                                     const TInt& /*aError*/ )
     {
-#endif // TF_LOGGING_METHOD
+#endif // 
     
     TInt callCount( iCallList->GetNumberOfObjects() );
     // find all the audio calls and hang up them all
@@ -7887,8 +7941,8 @@
 //    
 void CMmPhoneTsy::SetPBInitActiveStatus( TBool aIsInitializationActive )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::SetPBInitActiveStatus: - prev.status %i", iIsInitializationActive);    
-TFLOGSTRING2("TSY: CMmPhoneTsy::SetPBInitActiveStatus: %i", aIsInitializationActive);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETPBINITACTIVESTATUS_1, "TSY: CMmPhoneTsy::SetPBInitActiveStatus: - prev.status %u", (TUint)iIsInitializationActive);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETPBINITACTIVESTATUS_2, "TSY: CMmPhoneTsy::SetPBInitActiveStatus: %u", (TUint)aIsInitializationActive);
     
     iIsInitializationActive = aIsInitializationActive;
     }
@@ -7901,7 +7955,7 @@
 //    
 TBool CMmPhoneTsy::IsPBInitActive()
     {   
-TFLOGSTRING2("TSY: CMmPhoneTsy::IsPBInitActive: %i", iIsInitializationActive);
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ISPBINITACTIVE_1, "TSY: CMmPhoneTsy::IsPBInitActive: %x", (TUint)iIsInitializationActive);
     
     return iIsInitializationActive;
     }
@@ -7934,7 +7988,7 @@
 //
 TBool CMmPhoneTsy::IsSIMReady()
 	{
-	TFLOGSTRING2("TSY: CMmPhoneTsy::IsSIMReady: %i", iBootState.iSIMReady);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ISSIMREADY_1, "TSY: CMmPhoneTsy::IsSIMReady: %u", (TUint)iBootState.iSIMReady);
 	return iBootState.iSIMReady;
 	}
 
@@ -7946,7 +8000,7 @@
 //   
 void CMmPhoneTsy::SaveFdnInfoDetails( TInt aResult, CMmDataPackage* aDataPackage )
     {
-TFLOGSTRING2("TSY: CMmPhoneTsy::SaveFdnInfoDetails aResult:  %d", aResult );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SAVEFDNINFODETAILS_1, "TSY: CMmPhoneTsy::SaveFdnInfoDetails aResult:  %d", aResult );
 
    // Store FDN info only in successfull case
     if ( KErrNone == aResult )
@@ -7957,9 +8011,9 @@
        iPhoneBookState->iFDNNumberLengthMax = pbFdnInfo.iFDNNumberLengthMax;
        iPhoneBookState->iFDNTextLengthMax = pbFdnInfo.iFDNTextLengthMax;
 
-TFLOGSTRING2("TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNNumOfEntries: %i",iPhoneBookState->iFDNNumOfEntries );
-TFLOGSTRING2("TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNNumberLengthMax: %i",iPhoneBookState->iFDNNumberLengthMax );
-TFLOGSTRING2("TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNTextLengthMax: %i",iPhoneBookState->iFDNTextLengthMax );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SAVEFDNINFODETAILS_2, "TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNNumOfEntries: %d",iPhoneBookState->iFDNNumOfEntries );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SAVEFDNINFODETAILS_3, "TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNNumberLengthMax: %d",iPhoneBookState->iFDNNumberLengthMax );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SAVEFDNINFODETAILS_4, "TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNTextLengthMax: %d",iPhoneBookState->iFDNTextLengthMax );
        }
     }
 
@@ -7971,7 +8025,7 @@
 //    
 TBool CMmPhoneTsy::IsModemStatusReady() const
     {   
-TFLOGSTRING2("TSY: CMmPhoneTsy::IsModemStatusReady: %i", iIsModemReady );
+OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ISMODEMSTATUSREADY_1, "TSY: CMmPhoneTsy::IsModemStatusReady: %u", (TUint)iIsModemReady );
     
     return iIsModemReady;
     }
@@ -7984,7 +8038,7 @@
 //    
 void CMmPhoneTsy::PhoneBookStoreInitCompleteL(TInt aError)
     {
-    TFLOGSTRING("TSY: CMmPhoneTsy::PhoneBookStoreInitCompleteL ");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_PHONEBOOKSTOREINITCOMPLETEL_1, "TSY: CMmPhoneTsy::PhoneBookStoreInitCompleteL ");
     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
         EMultimodePhoneGetMailboxNumbers );   
     if( EMultimodePhoneReqHandleUnknown != reqHandle )