telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmdatacalltsy.cpp
changeset 42 3adadc800673
parent 23 6b1d113cdff3
child 53 12b52b1a573e
equal deleted inserted replaced
31:8ab6687fb94c 42:3adadc800673
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    14 //
    14 //
    15 
    15 
    16 
    16 
    17 
    17 
    18 // INCLUDE FILES
    18 // INCLUDE FILES
       
    19 
       
    20 #include "OstTraceDefinitions.h"
       
    21 #ifdef OST_TRACE_COMPILER_IN_USE
       
    22 #include "cmmdatacalltsyTraces.h"
       
    23 #endif
       
    24 
    19 #include "cmmdatacalltsy.h"
    25 #include "cmmdatacalltsy.h"
    20 #include "cmmdatalinetsy.h"
    26 #include "cmmdatalinetsy.h"
    21 #include "cmmphonetsy.h"
    27 #include "cmmphonetsy.h"
    22 #include "cmmtsyreqhandlestore.h"
    28 #include "cmmtsyreqhandlestore.h"
    23 #include "cmmcalllist.h"
    29 #include "cmmcalllist.h"
    41     CMmPhoneTsy* aMmPhone, CMmDataLineTsy* aMmLine,
    47     CMmPhoneTsy* aMmPhone, CMmDataLineTsy* aMmLine,
    42     RMobilePhone::TMobileService aMode, 
    48     RMobilePhone::TMobileService aMode, 
    43     TDes& aName, 
    49     TDes& aName, 
    44     CMmMessageManagerBase* aMessageManager )
    50     CMmMessageManagerBase* aMessageManager )
    45     {
    51     {
    46 TFLOGSTRING2("TSY: CMmDataCallTsy::NewL. Call name: %S", &aName);
    52 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_NEWL_1, "TSY: CMmDataCallTsy::NewL. Call name: %S", aName);
    47 
    53 
    48     CMmDataCallTsy* mmCall = NULL;
    54     CMmDataCallTsy* mmCall = NULL;
    49 
    55 
    50     //check input parameters
    56     //check input parameters
    51     if ( NULL != aMmPhone && NULL != aMmLine &&
    57     if ( NULL != aMmPhone && NULL != aMmLine &&
    65     return mmCall;
    71     return mmCall;
    66     }
    72     }
    67 
    73 
    68 CMmDataCallTsy::~CMmDataCallTsy()
    74 CMmDataCallTsy::~CMmDataCallTsy()
    69     {
    75     {
    70 TFLOGSTRING3("TSY: CMmDataCallTsy::~CMmDataCallTsy - Call deleted iCallId: %d iCallName: %S",
    76 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DTOR_1, "TSY: CMmDataCallTsy::~CMmDataCallTsy - Call deleted iCallId: %d iCallName: %S",iCallId, iCallName);
    71     iCallId, &iCallName);
       
    72 
    77 
    73     // If Dial fails, Symbian CSD agent will close the call immediately.
    78     // If Dial fails, Symbian CSD agent will close the call immediately.
    74     // This means that TSY has not yet received call status indications, 
    79     // This means that TSY has not yet received call status indications, 
    75     // where call status changes to idle. Thus responses from modem are 
    80     // where call status changes to idle. Thus responses from modem are 
    76     // passed to call object. 
    81     // passed to call object. 
   143 TInt CMmDataCallTsy::DoExtFuncL(
   148 TInt CMmDataCallTsy::DoExtFuncL(
   144     const TTsyReqHandle aTsyReqHandle,
   149     const TTsyReqHandle aTsyReqHandle,
   145     const TInt aIpc,
   150     const TInt aIpc,
   146     const TDataPackage& aPackage )
   151     const TDataPackage& aPackage )
   147     {
   152     {
   148 TFLOGSTRING3("TSY: CMmDataCallTsy::DoExtFuncL - IPC: %d Handle: %d",
   153 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DOEXTFUNCL_1, "TSY: CMmDataCallTsy::DoExtFuncL - IPC: %d Handle: %d",aIpc, aTsyReqHandle);
   149     aIpc, aTsyReqHandle);
       
   150 
   154 
   151     TInt ret( KErrNone );
   155     TInt ret( KErrNone );
   152 
   156 
   153     TAny* dataPtr = aPackage.Ptr1();
   157     TAny* dataPtr = aPackage.Ptr1();
   154     TAny* dataPtr2 = aPackage.Ptr2();
   158     TAny* dataPtr2 = aPackage.Ptr2();
   283 // ---------------------------------------------------------------------------
   287 // ---------------------------------------------------------------------------
   284 //
   288 //
   285 CTelObject::TReqMode CMmDataCallTsy::ReqModeL(
   289 CTelObject::TReqMode CMmDataCallTsy::ReqModeL(
   286     const TInt aIpc )
   290     const TInt aIpc )
   287     {
   291     {
   288 TFLOGSTRING2("TSY: CMmDataCallTsy::ReqModeL - IPC: %d", aIpc);
   292 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_REQMODEL_1, "TSY: CMmDataCallTsy::ReqModeL - IPC: %d", aIpc);
   289 
   293 
   290     CTelObject::TReqMode ret( 0 ); // default return value
   294     CTelObject::TReqMode ret( 0 ); // default return value
   291     
   295     
   292     switch ( aIpc )
   296     switch ( aIpc )
   293         {
   297         {
   529 //
   533 //
   530 TInt CMmDataCallTsy::CancelService(
   534 TInt CMmDataCallTsy::CancelService(
   531     const TInt aIpc,
   535     const TInt aIpc,
   532     const TTsyReqHandle aTsyReqHandle )
   536     const TTsyReqHandle aTsyReqHandle )
   533     {
   537     {
   534     TFLOGSTRING3("TSY: CMmDataCallTsy::CancelService - IPC: %d, Req handle: %d",
   538     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_CANCELSERVICE_1, "TSY: CMmDataCallTsy::CancelService - IPC: %d, Req handle: %d",aIpc, aTsyReqHandle);
   535         aIpc, aTsyReqHandle); 
       
   536 
   539 
   537     TInt ret( KErrNone );
   540     TInt ret( KErrNone );
   538 
   541 
   539     //When the clients close their sub-sessions (eg. by calling RPhone::Close)
   542     //When the clients close their sub-sessions (eg. by calling RPhone::Close)
   540     //they may not have cancelled all their outstanding asynchronous requests
   543     //they may not have cancelled all their outstanding asynchronous requests
   635         CCallDataPackage* callDataPackage = 
   638         CCallDataPackage* callDataPackage = 
   636             reinterpret_cast<CCallDataPackage*>( aDataPackage );
   639             reinterpret_cast<CCallDataPackage*>( aDataPackage );
   637 
   640 
   638         callDataPackage->UnPackData( callStatus );
   641         callDataPackage->UnPackData( callStatus );
   639 
   642 
   640         TFLOGSTRING2("TSY: CMmDataCallTsy::CompleteNotifyStatusChange - \
   643         OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETENOTIFYSTATUSCHANGE_1, "TSY: CMmDataCallTsy::CompleteNotifyStatusChange - \aResult: %d", aResult );
   641             aResult: %d", aResult );
   644         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETENOTIFYSTATUSCHANGE_2, "TSY: CMmDataCallTsy::CompleteNotifyStatusChange - \Call status: %d, Call name: %S", callStatus, iCallName);
   642         TFLOGSTRING3("TSY: CMmDataCallTsy::CompleteNotifyStatusChange - \
       
   643             Call status: %d, Call name: %S", callStatus, &iCallName);
       
   644 
   645 
   645         switch( callStatus )
   646         switch( callStatus )
   646             {
   647             {
   647             case RMobileCall::EStatusIdle:
   648             case RMobileCall::EStatusIdle:
   648                 // stop the call duration timer
   649                 // stop the call duration timer
   758                         iTsyReqHandleStore->GetTsyReqHandle( 
   759                         iTsyReqHandleStore->GetTsyReqHandle( 
   759                         EMultimodeCallDialNoFdnCheck );                   
   760                         EMultimodeCallDialNoFdnCheck );                   
   760 
   761 
   761                     if ( 0 < dialCancelHandle )
   762                     if ( 0 < dialCancelHandle )
   762                         {
   763                         {
   763 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteNotifyStatusChange. - HangUp - EMultimodeCallDial");                        
   764 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETENOTIFYSTATUSCHANGE_3, "TSY: CMmDataCallTsy::CompleteNotifyStatusChange. - HangUp - EMultimodeCallDial");
   764                         HangUp( dialCancelHandle );
   765                         HangUp( dialCancelHandle );
   765                         } 
   766                         } 
   766                     else if ( 0 < dialCancelHandleNoFdn )
   767                     else if ( 0 < dialCancelHandleNoFdn )
   767                         {
   768                         {
   768 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteNotifyStatusChange. - HangUp - EMultimodeCallDialNoFdnCheck");
   769 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETENOTIFYSTATUSCHANGE_4, "TSY: CMmDataCallTsy::CompleteNotifyStatusChange. - HangUp - EMultimodeCallDialNoFdnCheck");
   769                         HangUp( dialCancelHandleNoFdn );
   770                         HangUp( dialCancelHandleNoFdn );
   770                         } 
   771                         } 
   771                     else
   772                     else
   772                         {
   773                         {
   773                         iDialCancelFlag = CMmCallTsy::EDialCancelNotCalled;
   774                         iDialCancelFlag = CMmCallTsy::EDialCancelNotCalled;
   800                 CompleteNotifyCapsChange();
   801                 CompleteNotifyCapsChange();
   801 
   802 
   802                 // Check if the call is for Call Back functionality.
   803                 // Check if the call is for Call Back functionality.
   803                 // E.g. client has dialled server, which calls back to 
   804                 // E.g. client has dialled server, which calls back to 
   804                 // save user the data call charging.
   805                 // save user the data call charging.
   805                 TFLOGSTRING("TSY: CMmDataCallTsy::Check for waiting call");
   806                 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETENOTIFYSTATUSCHANGE_5, "TSY: CMmDataCallTsy::Check for waiting call");
   806                 if ( this == iMmPhone->WaitingCallForData() )
   807                 if ( this == iMmPhone->WaitingCallForData() )
   807                     {
   808                     {
   808                     // Client has already tried to answer the incoming 
   809                     // Client has already tried to answer the incoming 
   809                     // call, so do it now
   810                     // call, so do it now
   810                     CallComingForWaitingCall();
   811                     CallComingForWaitingCall();
   835                     
   836                     
   836                         // if there is call with status Answering, complete
   837                         // if there is call with status Answering, complete
   837                         // it with CALL_CAUSE_NOT_ALLOWED    
   838                         // it with CALL_CAUSE_NOT_ALLOWED    
   838                         if( RCall::EStatusAnswering == call->Status() )
   839                         if( RCall::EStatusAnswering == call->Status() )
   839                             {
   840                             {
   840 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteNotifyStatusChange Answering not allowed!");                                
   841 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETENOTIFYSTATUSCHANGE_6, "TSY: CMmDataCallTsy::CompleteNotifyStatusChange Answering not allowed!");
   841                             TInt errorValue = 
   842                             TInt errorValue = 
   842                                 CMmCommonStaticUtility::EpocErrorCode( 
   843                                 CMmCommonStaticUtility::EpocErrorCode( 
   843                                    KErrAccessDenied, KErrMMEtelCallForbidden );
   844                                    KErrAccessDenied, KErrMMEtelCallForbidden );
   844                             call->CompleteAnswerIncomingCall( errorValue );
   845                             call->CompleteAnswerIncomingCall( errorValue );
   845                             }
   846                             }
  1041 TInt CMmDataCallTsy::Dial(
  1042 TInt CMmDataCallTsy::Dial(
  1042     const TTsyReqHandle aTsyReqHandle,
  1043     const TTsyReqHandle aTsyReqHandle,
  1043     const TDesC8* aCallParams,
  1044     const TDesC8* aCallParams,
  1044     TDesC* aTelNumber )
  1045     TDesC* aTelNumber )
  1045     {
  1046     {
  1046 TFLOGSTRING3("TSY: CMmDataCallTsy::Dial - Req handle: %d, Call name: %S",
  1047 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIAL_1, "TSY: CMmDataCallTsy::Dial - Req handle: %u, Call name: %S",aTsyReqHandle, iCallName);
  1047     aTsyReqHandle, &iCallName);
       
  1048 
  1048 
  1049 	if( aCallParams->Length()!= 0)
  1049 	if( aCallParams->Length()!= 0)
  1050 		{
  1050 		{
  1051 		if(sizeof(RCall::TCallParams) > aCallParams->Length())
  1051 		if(sizeof(RCall::TCallParams) > aCallParams->Length())
  1052 			{
  1052 			{
  1053 			TFLOGSTRING ("TSY: CMmDataCallTsy::Dial bad size argument");
  1053 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIAL_2, "TSY: CMmDataCallTsy::Dial bad size argument");
  1054 			// Complete the request with appropiate error        
  1054 			// Complete the request with appropiate error        
  1055 			return KErrArgument;
  1055 			return KErrArgument;
  1056 			}
  1056 			}
  1057 		}
  1057 		}
  1058 	CMmCallList* callList = iMmPhone->CallList();
  1058 	CMmCallList* callList = iMmPhone->CallList();
  1068 			}
  1068 			}
  1069 		}
  1069 		}
  1070 	
  1070 	
  1071 	if(!dialFlag )
  1071 	if(!dialFlag )
  1072 		{
  1072 		{
  1073 TFLOGSTRING("TSY: CMmDataCallTsy::Dial ONGOING" );		
  1073 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIAL_3, "TSY: CMmDataCallTsy::Dial ONGOING" );
  1074 		SetDialFlag( ETrue );
  1074 		SetDialFlag( ETrue );
  1075 		TTsyReqHandle dialHandle = 
  1075 		TTsyReqHandle dialHandle = 
  1076 			iTsyReqHandleStore->GetTsyReqHandle( EMultimodeCallDial );
  1076 			iTsyReqHandleStore->GetTsyReqHandle( EMultimodeCallDial );
  1077     
  1077     
  1078 		// reset exit code
  1078 		// reset exit code
  1081 		// reset finished data call flag
  1081 		// reset finished data call flag
  1082 		iIsFinishedDataCall = EFalse;
  1082 		iIsFinishedDataCall = EFalse;
  1083 	
  1083 	
  1084 		if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() )  
  1084 		if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() )  
  1085 			{
  1085 			{
  1086 			TFLOGSTRING("TSY: Offline mode ON, Dial request is not allowed" );
  1086 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIAL_4, "TSY: Offline mode ON, Dial request is not allowed" );
  1087 			TInt ret = CMmCommonStaticUtility::EpocErrorCode(
  1087 			TInt ret = CMmCommonStaticUtility::EpocErrorCode(
  1088 				KErrGeneral, KErrGsmOfflineOpNotAllowed );
  1088 				KErrGeneral, KErrGsmOfflineOpNotAllowed );
  1089 	
  1089 	
  1090 			// Complete the request with appropiate error
  1090 			// Complete the request with appropiate error
  1091 			ReqCompleted ( aTsyReqHandle, ret ); 
  1091 			ReqCompleted ( aTsyReqHandle, ret ); 
  1096 			{
  1096 			{
  1097 			// The request cannot be forwarded since this call object
  1097 			// The request cannot be forwarded since this call object
  1098 			// is still in use.
  1098 			// is still in use.
  1099 			// Complete request with status value informing the client
  1099 			// Complete request with status value informing the client
  1100 			// about the situation.
  1100 			// about the situation.
  1101 			TFLOGSTRING("TSY: CMmDataCallTsy::Dial - KErrNotReady");
  1101 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIAL_5, "TSY: CMmDataCallTsy::Dial - KErrNotReady");
  1102 			ReqCompleted( aTsyReqHandle, KErrNotReady );
  1102 			ReqCompleted( aTsyReqHandle, KErrNotReady );
  1103 			}
  1103 			}
  1104 		else if ( 0 < dialHandle )
  1104 		else if ( 0 < dialHandle )
  1105 			{
  1105 			{
  1106 			// The request is already in processing because of previous request
  1106 			// The request is already in processing because of previous request
  1107 			// Complete request with status value informing the client about 
  1107 			// Complete request with status value informing the client about 
  1108 			// the situation.
  1108 			// the situation.
  1109 			TFLOGSTRING("TSY: CMmDataCallTsy::Dial - KErrServerBusy");
  1109 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIAL_6, "TSY: CMmDataCallTsy::Dial - KErrServerBusy");
  1110 			ReqCompleted( aTsyReqHandle, KErrServerBusy );
  1110 			ReqCompleted( aTsyReqHandle, KErrServerBusy );
  1111 			}
  1111 			}
  1112 		else
  1112 		else
  1113 			{
  1113 			{
  1114 		   
  1114 		   
  1168 				{
  1168 				{
  1169 				SetOwnership( aTsyReqHandle );
  1169 				SetOwnership( aTsyReqHandle );
  1170 	
  1170 	
  1171 				if ( KErrNone == ret )
  1171 				if ( KErrNone == ret )
  1172 					{
  1172 					{
  1173 					TFLOGSTRING("TSY: CMmDataCallTsy::Dial - DialDataCall");
  1173 					OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIAL_7, "TSY: CMmDataCallTsy::Dial - DialDataCall");
  1174 					TRAP( trapError,
  1174 					TRAP( trapError,
  1175 						ret = iMmCallExtInterface->DialDataCallL(
  1175 						ret = iMmCallExtInterface->DialDataCallL(
  1176 							iCallMode, aCallParams, aTelNumber );
  1176 							iCallMode, aCallParams, aTelNumber );
  1177 						);
  1177 						);
  1178 					if ( KErrNone != trapError )
  1178 					if ( KErrNone != trapError )
  1229 // ---------------------------------------------------------------------------
  1229 // ---------------------------------------------------------------------------
  1230 //
  1230 //
  1231 void CMmDataCallTsy::CompleteDial(
  1231 void CMmDataCallTsy::CompleteDial(
  1232     TInt aResult )
  1232     TInt aResult )
  1233     {
  1233     {
  1234 TFLOGSTRING2("TSY: CMmDataCallTsy::CompleteDial - Result: %d", aResult ); 
  1234 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEDIAL_1, "TSY: CMmDataCallTsy::CompleteDial - Result: %d", aResult );
  1235 TFLOGSTRING3("TSY: CMmDataCallTsy::CompleteDial - Call Id: %d, Call name: %S",
  1235 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEDIAL_2, "TSY: CMmDataCallTsy::CompleteDial - Call Id: %d, Call name: %S",iCallId, iCallName);
  1236     iCallId, &iCallName);
       
  1237     
  1236     
  1238     // Set dial flag to false
  1237     // Set dial flag to false
  1239     SetDialFlag( EFalse );
  1238     SetDialFlag( EFalse );
  1240     
  1239     
  1241     // reset req handle. Returns the deleted req handle
  1240     // reset req handle. Returns the deleted req handle
  1284 //
  1283 //
  1285 TInt CMmDataCallTsy::AnswerIncomingCall(
  1284 TInt CMmDataCallTsy::AnswerIncomingCall(
  1286     const TTsyReqHandle aTsyReqHandle,
  1285     const TTsyReqHandle aTsyReqHandle,
  1287     const TDesC8* )
  1286     const TDesC8* )
  1288     {
  1287     {
  1289 TFLOGSTRING2("TSY: CMmDataCallTsy::AnswerIncomingCall. \n\t\t\t Handle: %d",
  1288 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_ANSWERINCOMINGCALL_1, "TSY: CMmDataCallTsy::AnswerIncomingCall. \n\t\t\t Handle: %d",aTsyReqHandle);
  1290     aTsyReqHandle); 
       
  1291 
  1289 
  1292     TTsyReqHandle answerCallHandle = 
  1290     TTsyReqHandle answerCallHandle = 
  1293         iTsyReqHandleStore->GetTsyReqHandle( EMultimodeCallAnswer );
  1291         iTsyReqHandleStore->GetTsyReqHandle( EMultimodeCallAnswer );
  1294 
  1292 
  1295     if ( 0 < answerCallHandle )
  1293     if ( 0 < answerCallHandle )
  1398 // ---------------------------------------------------------------------------
  1396 // ---------------------------------------------------------------------------
  1399 //
  1397 //
  1400 TInt CMmDataCallTsy::AnswerIncomingCallCancel(
  1398 TInt CMmDataCallTsy::AnswerIncomingCallCancel(
  1401     const TTsyReqHandle aTsyReqHandle )
  1399     const TTsyReqHandle aTsyReqHandle )
  1402     {
  1400     {
  1403 TFLOGSTRING3("TSY: CMmDataCallTsy::AnswerIncomingCallCancel. Req handle: %d, Call name: %S",
  1401 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_ANSWERINCOMINGCALLCANCEL_1, "TSY: CMmDataCallTsy::AnswerIncomingCallCancel. Req handle: %u, Call name: %S",aTsyReqHandle, iCallName);
  1404     aTsyReqHandle, &iCallName);
       
  1405 
  1402 
  1406     TInt ret( KErrNone );
  1403     TInt ret( KErrNone );
  1407 
  1404 
  1408     if( iAnswerCancelFlag )
  1405     if( iAnswerCancelFlag )
  1409         {
  1406         {
  1417             {
  1414             {
  1418             HangUp( aTsyReqHandle );
  1415             HangUp( aTsyReqHandle );
  1419             }
  1416             }
  1420         else 
  1417         else 
  1421             {
  1418             {
  1422 TFLOGSTRING2("TSY: CMmDataCallTsy::AnswerIncomingCallCancel -- iCallStatus = %d", 
  1419 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_ANSWERINCOMINGCALLCANCEL_2, "TSY: CMmDataCallTsy::AnswerIncomingCallCancel -- iCallStatus = %d", iCallStatus);
  1423     iCallStatus);       
       
  1424             if ( RCall::EStatusUnknown == iCallStatus )
  1420             if ( RCall::EStatusUnknown == iCallStatus )
  1425                 {               
  1421                 {               
  1426                 // Cancel automatic answering
  1422                 // Cancel automatic answering
  1427 
  1423 
  1428                 //Create package
  1424                 //Create package
  1462 // ---------------------------------------------------------------------------
  1458 // ---------------------------------------------------------------------------
  1463 //
  1459 //
  1464 void CMmDataCallTsy::CompleteAnswerIncomingCall(
  1460 void CMmDataCallTsy::CompleteAnswerIncomingCall(
  1465     TInt aResult )
  1461     TInt aResult )
  1466     {
  1462     {
  1467 TFLOGSTRING2("TSY: CMmDataCallTsy::CompleteAnswerIncomingCall - Result: %d",
  1463 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEANSWERINCOMINGCALL_1, "TSY: CMmDataCallTsy::CompleteAnswerIncomingCall - Result: %d",aResult );
  1468     aResult ); 
  1464 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEANSWERINCOMINGCALL_2, "TSY: CMmDataCallTsy::CompleteAnswerIncomingCall - Call Id: %d, Call name: %S",iCallId, iCallName);
  1469 TFLOGSTRING3("TSY: CMmDataCallTsy::CompleteAnswerIncomingCall - Call Id: %d, Call name: %S",
       
  1470     iCallId, &iCallName);
       
  1471 
  1465 
  1472     //reset req handle. Returns the deleted req handle
  1466     //reset req handle. Returns the deleted req handle
  1473     TTsyReqHandle reqHandle =
  1467     TTsyReqHandle reqHandle =
  1474         iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeCallAnswer );
  1468         iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeCallAnswer );
  1475 
  1469 
  1527 // ---------------------------------------------------------------------------
  1521 // ---------------------------------------------------------------------------
  1528 //
  1522 //
  1529 TInt CMmDataCallTsy::HangUp(
  1523 TInt CMmDataCallTsy::HangUp(
  1530     const TTsyReqHandle aTsyReqHandle )
  1524     const TTsyReqHandle aTsyReqHandle )
  1531     {
  1525     {
  1532 TFLOGSTRING3("TSY: CMmDataCallTsy::HangUp - Req. handle: %d, Call name: %S",
  1526 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_HANGUP_1, "TSY: CMmDataCallTsy::HangUp - Req. handle: %u, Call name: %S",aTsyReqHandle, iCallName);
  1533     aTsyReqHandle, &iCallName);
       
  1534 
  1527 
  1535     TInt hangUpCause( KErrNone );
  1528     TInt hangUpCause( KErrNone );
  1536     TInt ret( KErrNone );
  1529     TInt ret( KErrNone );
  1537 
  1530 
  1538     TTsyReqHandle hangUpHandle = 
  1531     TTsyReqHandle hangUpHandle = 
  1545     if ( 0 < hangUpHandle || iHangUpFlag )
  1538     if ( 0 < hangUpHandle || iHangUpFlag )
  1546         {
  1539         {
  1547         //The request is already in processing because of previous request
  1540         //The request is already in processing because of previous request
  1548         //Complete request with status value informing the client about 
  1541         //Complete request with status value informing the client about 
  1549         //the situation.
  1542         //the situation.
  1550 TFLOGSTRING("TSY: CMmDataCallTsy::HangUp - KErrServerBusy");
  1543 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_HANGUP_2, "TSY: CMmDataCallTsy::HangUp - KErrServerBusy");
  1551         ReqCompleted( aTsyReqHandle, KErrServerBusy );
  1544         ReqCompleted( aTsyReqHandle, KErrServerBusy );
  1552         }
  1545         }
  1553     else if ( RCall::EStatusIdle == iCallStatus &&
  1546     else if ( RCall::EStatusIdle == iCallStatus &&
  1554         EMultimodeCallReqHandleUnknown == dialHandle )
  1547         EMultimodeCallReqHandleUnknown == dialHandle )
  1555         {
  1548         {
  1556         //Call object is already in idle state. Complete HangUp request with
  1549         //Call object is already in idle state. Complete HangUp request with
  1557         //error.
  1550         //error.
  1558 TFLOGSTRING("TSY: CMmDataCallTsy::HangUp - KErrNotReady");        
  1551 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_HANGUP_3, "TSY: CMmDataCallTsy::HangUp - KErrNotReady");
  1559         ReqCompleted( aTsyReqHandle, KErrNotReady );
  1552         ReqCompleted( aTsyReqHandle, KErrNotReady );
  1560         }
  1553         }
  1561     else
  1554     else
  1562         {
  1555         {
  1563         // If this was not called by DialCancel or AnswerIncomingCallCancel
  1556         // If this was not called by DialCancel or AnswerIncomingCallCancel
  1589         //If the call is ringing e.g. MT call, we do not have ownership
  1582         //If the call is ringing e.g. MT call, we do not have ownership
  1590         //yet. So let the client reject the call without checking 
  1583         //yet. So let the client reject the call without checking 
  1591         //ownership.
  1584         //ownership.
  1592         if ( RCall::EStatusRinging == iCallStatus )
  1585         if ( RCall::EStatusRinging == iCallStatus )
  1593             {
  1586             {
  1594             TFLOGSTRING("TSY: CMmDataCallTsy::HangUp - Reject incoming call");
  1587             OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_HANGUP_4, "TSY: CMmDataCallTsy::HangUp - Reject incoming call");
  1595             }
  1588             }
  1596         //Phone Application is the first client that is started, it 
  1589         //Phone Application is the first client that is started, it 
  1597         //will always be the priority client and thus able to hangup calls
  1590         //will always be the priority client and thus able to hangup calls
  1598         //Owner of the call is also able to hangup the call.
  1591         //Owner of the call is also able to hangup the call.
  1599         else if ( ( CCallBase::CheckPriorityClient( aTsyReqHandle ) ) ||
  1592         else if ( ( CCallBase::CheckPriorityClient( aTsyReqHandle ) ) ||
  1666 // ---------------------------------------------------------------------------
  1659 // ---------------------------------------------------------------------------
  1667 //
  1660 //
  1668 void CMmDataCallTsy::CompleteHangUp(
  1661 void CMmDataCallTsy::CompleteHangUp(
  1669     TInt aResult )
  1662     TInt aResult )
  1670     {
  1663     {
  1671 TFLOGSTRING2("TSY: CMmDataCallTsy::CompleteHangUp.\n  \t\t\t Result: %d",
  1664 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEHANGUP_1, "TSY: CMmDataCallTsy::CompleteHangUp.\n  \t\t\t Result: %d",aResult );
  1672     aResult ); 
  1665 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEHANGUP_2, "TSY: CMmDataCallTsy::CompleteHangUp - Call Id: %d, Call name: %S", iCallId, iCallName);
  1673 TFLOGSTRING3("TSY: CMmDataCallTsy::CompleteHangUp - Call Id: %d, Call name: %S", 
       
  1674     iCallId, &iCallName);
       
  1675 
  1666 
  1676     TInt ret( KErrNone );
  1667     TInt ret( KErrNone );
  1677 
  1668 
  1678     // Complete for HangUp request
  1669     // Complete for HangUp request
  1679     // (not to DialCancel or AnswerIncomingCallCancel)
  1670     // (not to DialCancel or AnswerIncomingCallCancel)
  1736             }
  1727             }
  1737         }
  1728         }
  1738     // Complete for DialCancel or AnswerIncomingCallCancel, success
  1729     // Complete for DialCancel or AnswerIncomingCallCancel, success
  1739     else if ( KErrNone == aResult ) 
  1730     else if ( KErrNone == aResult ) 
  1740         { 
  1731         { 
  1741 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteHangUp - EMultimodeCallDial");           
  1732 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEHANGUP_3, "TSY: CMmDataCallTsy::CompleteHangUp - EMultimodeCallDial");
  1742         // Find out if this is cancelling of Dial
  1733         // Find out if this is cancelling of Dial
  1743         TTsyReqHandle cancelHandle =
  1734         TTsyReqHandle cancelHandle =
  1744             iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeCallDial ); 
  1735             iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeCallDial ); 
  1745 
  1736 
  1746         if ( NULL == cancelHandle ) 
  1737         if ( NULL == cancelHandle ) 
  1747             { 
  1738             { 
  1748 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteHangUp - EMultimodeCallDialNoFdnCheck");                
  1739 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEHANGUP_4, "TSY: CMmDataCallTsy::CompleteHangUp - EMultimodeCallDialNoFdnCheck");
  1749 	        // Find out if this is cancelling of DialNoFdnCheck
  1740 	        // Find out if this is cancelling of DialNoFdnCheck
  1750 	        cancelHandle = iTsyReqHandleStore->
  1741 	        cancelHandle = iTsyReqHandleStore->
  1751             ResetTsyReqHandle( EMultimodeCallDialNoFdnCheck );
  1742             ResetTsyReqHandle( EMultimodeCallDialNoFdnCheck );
  1752         
  1743         
  1753             if ( NULL == cancelHandle )
  1744             if ( NULL == cancelHandle )
  1754                 { 
  1745                 { 
  1755 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteHangUp - EMultimodeCallAnswer");                
  1746 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEHANGUP_5, "TSY: CMmDataCallTsy::CompleteHangUp - EMultimodeCallAnswer");
  1756                 // Find out if this is cancelling of AnswerIncomingCall
  1747                 // Find out if this is cancelling of AnswerIncomingCall
  1757                 cancelHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  1748                 cancelHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  1758                     EMultimodeCallAnswer );
  1749                     EMultimodeCallAnswer );
  1759                 }
  1750                 }
  1760         	}
  1751         	}
  1761         
  1752         
  1762         if ( 0 < cancelHandle ) 
  1753         if ( 0 < cancelHandle ) 
  1763             { 
  1754             { 
  1764 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteHangUp with KErrCancel");
  1755 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEHANGUP_6, "TSY: CMmDataCallTsy::CompleteHangUp with KErrCancel");
  1765              
  1756              
  1766             // Complete with error value KErrCancel
  1757             // Complete with error value KErrCancel
  1767             ReqCompleted( cancelHandle, KErrCancel );
  1758             ReqCompleted( cancelHandle, KErrCancel );
  1768 
  1759 
  1769             // Cancel has succeeded, update core status -
  1760             // Cancel has succeeded, update core status -
  1792         TTsyReqHandle cancelHandle =
  1783         TTsyReqHandle cancelHandle =
  1793             iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeCallDial ); 
  1784             iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeCallDial ); 
  1794 
  1785 
  1795         if ( NULL == cancelHandle ) 
  1786         if ( NULL == cancelHandle ) 
  1796             { 
  1787             { 
  1797 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteHangUp - cancelling of EMultimodeCallDialNoFdnCheck");     
  1788 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEHANGUP_7, "TSY: CMmDataCallTsy::CompleteHangUp - cancelling of EMultimodeCallDialNoFdnCheck");
  1798             // Find out if this is cancelling of DialNoFdnCheck
  1789             // Find out if this is cancelling of DialNoFdnCheck
  1799             TTsyReqHandle cancelHandle =
  1790             TTsyReqHandle cancelHandle =
  1800                 iTsyReqHandleStore->ResetTsyReqHandle( 
  1791                 iTsyReqHandleStore->ResetTsyReqHandle( 
  1801                     EMultimodeCallDialNoFdnCheck ); 
  1792                     EMultimodeCallDialNoFdnCheck ); 
  1802             
  1793             
  1803             if ( NULL == cancelHandle )
  1794             if ( NULL == cancelHandle )
  1804                 {
  1795                 {
  1805 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteHangUp - cancelling of AnswerIncomingCall");                     
  1796 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEHANGUP_8, "TSY: CMmDataCallTsy::CompleteHangUp - cancelling of AnswerIncomingCall");
  1806                 // Find out if this is cancelling of AnswerIncomingCall
  1797                 // Find out if this is cancelling of AnswerIncomingCall
  1807                 cancelHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  1798                 cancelHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  1808                     EMultimodeCallAnswer );
  1799                     EMultimodeCallAnswer );
  1809                 }
  1800                 }
  1810             }
  1801             }
  1811 
  1802 
  1812 
  1803 
  1813         // Cancel to Dial or AnswerIncomingCall
  1804         // Cancel to Dial or AnswerIncomingCall
  1814         if ( 0 < cancelHandle ) 
  1805         if ( 0 < cancelHandle ) 
  1815             { 
  1806             { 
  1816 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteHangUp - with KErrNone");             
  1807 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEHANGUP_9, "TSY: CMmDataCallTsy::CompleteHangUp - with KErrNone");
  1817             // Complete with success (KErrNone)
  1808             // Complete with success (KErrNone)
  1818             ReqCompleted( cancelHandle, KErrNone ); 
  1809             ReqCompleted( cancelHandle, KErrNone ); 
  1819 
  1810 
  1820             // Succeeded, update core status - hangup possible again
  1811             // Succeeded, update core status - hangup possible again
  1821             iCallCaps.iFlags |= RCall::KCapsHangUp;
  1812             iCallCaps.iFlags |= RCall::KCapsHangUp;
  2242 //
  2233 //
  2243 void CMmDataCallTsy::CallComingForWaitingCall()
  2234 void CMmDataCallTsy::CallComingForWaitingCall()
  2244     {
  2235     {
  2245     //Incoming call detected, which is directed to this call object
  2236     //Incoming call detected, which is directed to this call object
  2246     //which should be waiting for incoming call
  2237     //which should be waiting for incoming call
  2247     TFLOGSTRING("TSY: CMmDataCallTsy::CallComingForWaitingCall");
  2238     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_CALLCOMINGFORWAITINGCALL_1, "TSY: CMmDataCallTsy::CallComingForWaitingCall");
  2248 
  2239 
  2249     TInt ret( KErrNone );
  2240     TInt ret( KErrNone );
  2250 
  2241 
  2251     TFLOGSTRING("TSY: CMmDataCallTsy::AnswerIncomingCall - Data call");
  2242     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_CALLCOMINGFORWAITINGCALL_2, "TSY: CMmDataCallTsy::AnswerIncomingCall - Data call");
  2252     //Answer incoming call
  2243     //Answer incoming call
  2253     TRAPD( trapError,
  2244     TRAPD( trapError,
  2254         ret = iMmCallExtInterface->AnswerIncomingDataCallL( iCallId );
  2245         ret = iMmCallExtInterface->AnswerIncomingDataCallL( iCallId );
  2255         );
  2246         );
  2256 
  2247 
  2292 //
  2283 //
  2293 TInt CMmDataCallTsy::LoanDataPort(
  2284 TInt CMmDataCallTsy::LoanDataPort(
  2294     const TTsyReqHandle aTsyReqHandle,
  2285     const TTsyReqHandle aTsyReqHandle,
  2295     RCall::TCommPort* aCommPort )
  2286     RCall::TCommPort* aCommPort )
  2296     {
  2287     {
  2297 TFLOGSTRING2("TSY: CMmDataCallTsy::LoanDataPort - Client taking control: %S",
  2288 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_LOANDATAPORT_1, "TSY: CMmDataCallTsy::LoanDataPort - Client taking control: %S",iCallName );
  2298     &iCallName );
       
  2299 
  2289 
  2300     TInt ret( KErrNone );
  2290     TInt ret( KErrNone );
  2301 
  2291 
  2302     // Check if the port is loaned!
  2292     // Check if the port is loaned!
  2303     if ( iLoanedCommPort.iPort.Compare( KNullDesC) == 0 )
  2293     if ( iLoanedCommPort.iPort.Compare( KNullDesC) == 0 )
  2403 // ---------------------------------------------------------------------------
  2393 // ---------------------------------------------------------------------------
  2404 //
  2394 //
  2405 TInt CMmDataCallTsy::RecoverDataPort(
  2395 TInt CMmDataCallTsy::RecoverDataPort(
  2406     const TTsyReqHandle aTsyReqHandle )
  2396     const TTsyReqHandle aTsyReqHandle )
  2407     {
  2397     {
  2408 TFLOGSTRING2("TSY: CMmDataCallTsy::RecoverDataPort - Client returning control: %S",
  2398 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_RECOVERDATAPORT_1, "TSY: CMmDataCallTsy::RecoverDataPort - Client returning control: %S",iCallName );
  2409     &iCallName );
       
  2410 
  2399 
  2411     TInt ret( KErrNone );
  2400     TInt ret( KErrNone );
  2412 
  2401 
  2413     // Check if the port is loaned!
  2402     // Check if the port is loaned!
  2414     if ( iLoanedCommPort.iPort.Compare( KNullDesC) != 0 )
  2403     if ( iLoanedCommPort.iPort.Compare( KNullDesC) != 0 )
  2463 // (other items were commented in a header).
  2452 // (other items were commented in a header).
  2464 // ---------------------------------------------------------------------------
  2453 // ---------------------------------------------------------------------------
  2465 //
  2454 //
  2466 TInt CMmDataCallTsy::RecoverDataPortAndRelinquishOwnership()
  2455 TInt CMmDataCallTsy::RecoverDataPortAndRelinquishOwnership()
  2467     {
  2456     {
  2468 TFLOGSTRING2("TSY: CMmDataCallTsy::RecoverDataPortAndRelinquishOwnership - \
  2457 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_RECOVERDATAPORTANDRELINQUISHOWNERSHIP_1, "TSY: CMmDataCallTsy::RecoverDataPortAndRelinquishOwnership - \Client returning control: %S", iCallName );
  2469     Client returning control: %S", &iCallName );
       
  2470 
  2458 
  2471     TInt ret( KErrNone );
  2459     TInt ret( KErrNone );
  2472 
  2460 
  2473     // Check if the port is loaned!
  2461     // Check if the port is loaned!
  2474     if ( iLoanedCommPort.iPort.Compare( KNullDesC) != 0 )
  2462     if ( iLoanedCommPort.iPort.Compare( KNullDesC) != 0 )
  2541 //
  2529 //
  2542 TInt CMmDataCallTsy::Connect(
  2530 TInt CMmDataCallTsy::Connect(
  2543     const TTsyReqHandle aTsyReqHandle,
  2531     const TTsyReqHandle aTsyReqHandle,
  2544     const TDesC8* aCallParams )
  2532     const TDesC8* aCallParams )
  2545     {
  2533     {
  2546 TFLOGSTRING("TSY: CMmDataCallTsy::Connect");      
  2534 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_CONNECT_1, "TSY: CMmDataCallTsy::Connect");
  2547     if ( CheckOwnership( aTsyReqHandle ) == CCallBase::EOwnedUnowned )
  2535     if ( CheckOwnership( aTsyReqHandle ) == CCallBase::EOwnedUnowned )
  2548         {
  2536         {
  2549         SetOwnership( aTsyReqHandle );
  2537         SetOwnership( aTsyReqHandle );
  2550         }
  2538         }
  2551     TDes8* callParams = reinterpret_cast<TDes8*>(const_cast<TDesC8*> (aCallParams));
  2539     TDes8* callParams = reinterpret_cast<TDes8*>(const_cast<TDesC8*> (aCallParams));
  2575 
  2563 
  2576         return KErrNone;
  2564         return KErrNone;
  2577     	}
  2565     	}
  2578     if(sizeof(RMobileCall::TMobileCallParamsV1) > aCallParams->Length())
  2566     if(sizeof(RMobileCall::TMobileCallParamsV1) > aCallParams->Length())
  2579        	{
  2567        	{
  2580         TFLOGSTRING ("TSY: CMmDataCallTsy::Connect bad size argument");
  2568         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_CONNECT_2, "TSY: CMmDataCallTsy::Connect bad size argument");
  2581         // Complete the request with appropiate error        
  2569         // Complete the request with appropiate error        
  2582         return KErrArgument;
  2570         return KErrArgument;
  2583     	}
  2571     	}
  2584     RMobileCall::TMobileCallParamsV1Pckg* paramsPckgV1 = 
  2572     RMobileCall::TMobileCallParamsV1Pckg* paramsPckgV1 = 
  2585         reinterpret_cast<RMobileCall::TMobileCallParamsV1Pckg*> ( callParams );
  2573         reinterpret_cast<RMobileCall::TMobileCallParamsV1Pckg*> ( callParams );
  2800     TInt* aRxTimeslots )
  2788     TInt* aRxTimeslots )
  2801     {
  2789     {
  2802     TInt ret( KErrNone );
  2790     TInt ret( KErrNone );
  2803     // HSCSD parameters can be set only if this call has been opened
  2791     // HSCSD parameters can be set only if this call has been opened
  2804     // from the phone's data line.
  2792     // from the phone's data line.
  2805 TFLOGSTRING3("TSY: CMmDataCallTsy::SetDynamicHscsdParams.\n  \t\t\t Air Intrf: %d\n  \t\t\t RX slots: %d", 
  2793 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_SETDYNAMICHSCSDPARAMS_1, "TSY: CMmDataCallTsy::SetDynamicHscsdParams.\n  \t\t\t Air Intrf: %d\n  \t\t\t RX slots: %d", *aAiur, *aRxTimeslots);
  2806     *aAiur, *aRxTimeslots);
       
  2807 
  2794 
  2808     iReqHandleType = EMultimodeCallSetDynamicHscsdParams;
  2795     iReqHandleType = EMultimodeCallSetDynamicHscsdParams;
  2809 
  2796 
  2810     TRAP_IGNORE( 
  2797     TRAP_IGNORE( 
  2811         ret = iMmCallExtInterface->SetDynamicHscsdParamsL(
  2798         ret = iMmCallExtInterface->SetDynamicHscsdParamsL(
  2841 // ---------------------------------------------------------------------------
  2828 // ---------------------------------------------------------------------------
  2842 //
  2829 //
  2843 void CMmDataCallTsy::CompleteSetDynamicHscsdParams(
  2830 void CMmDataCallTsy::CompleteSetDynamicHscsdParams(
  2844     TInt aErrorCode )
  2831     TInt aErrorCode )
  2845     {
  2832     {
  2846 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteSetDynamicHscsdParams");    
  2833 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETESETDYNAMICHSCSDPARAMS_1, "TSY: CMmDataCallTsy::CompleteSetDynamicHscsdParams");
  2847     //reset req handle. Returns the deleted req handle
  2834     //reset req handle. Returns the deleted req handle
  2848     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  2835     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  2849         EMultimodeCallSetDynamicHscsdParams );
  2836         EMultimodeCallSetDynamicHscsdParams );
  2850 
  2837 
  2851     if ( EMultimodeCallReqHandleUnknown != reqHandle )
  2838     if ( EMultimodeCallReqHandleUnknown != reqHandle )
  2862 //
  2849 //
  2863 TInt CMmDataCallTsy::GetCurrentHscsdInfo(
  2850 TInt CMmDataCallTsy::GetCurrentHscsdInfo(
  2864     const TTsyReqHandle aTsyReqHandle,
  2851     const TTsyReqHandle aTsyReqHandle,
  2865     TDes8* aHSCSDInfo )
  2852     TDes8* aHSCSDInfo )
  2866     {
  2853     {
  2867 TFLOGSTRING("TSY: CMmDataCallTsy::GetCurrentHscsdInfo");        
  2854 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_GETCURRENTHSCSDINFO_1, "TSY: CMmDataCallTsy::GetCurrentHscsdInfo");
  2868     TInt ret( KErrNone );
  2855     TInt ret( KErrNone );
  2869     // HSCSD info can be read only if this call has been opened from the 
  2856     // HSCSD info can be read only if this call has been opened from the 
  2870     // phone's data line and call is connected.
  2857     // phone's data line and call is connected.
  2871     // Connected here means that TSY gas has received CONNECT: XXXX from modem
  2858     // Connected here means that TSY gas has received CONNECT: XXXX from modem
  2872     // When CONNECT: XXXX has been received, TSY has completed clients request
  2859     // When CONNECT: XXXX has been received, TSY has completed clients request
  2948 // (other items were commented in a header).
  2935 // (other items were commented in a header).
  2949 // ---------------------------------------------------------------------------
  2936 // ---------------------------------------------------------------------------
  2950 //
  2937 //
  2951 void CMmDataCallTsy::CompleteNotifyHscsdInfoChange()
  2938 void CMmDataCallTsy::CompleteNotifyHscsdInfoChange()
  2952     {
  2939     {
  2953 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteNotifyHscsdInfoChange");       
  2940 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETENOTIFYHSCSDINFOCHANGE_1, "TSY: CMmDataCallTsy::CompleteNotifyHscsdInfoChange");
  2954     //reset req handle. Returns the deleted req handle
  2941     //reset req handle. Returns the deleted req handle
  2955     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  2942     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  2956         EMultimodeCallNotifyHscsdInfoChange );
  2943         EMultimodeCallNotifyHscsdInfoChange );
  2957 
  2944 
  2958     if ( EMultimodeCallReqHandleUnknown != reqHandle )
  2945     if ( EMultimodeCallReqHandleUnknown != reqHandle )
  2988 TInt CMmDataCallTsy::DialNoFdnCheck(
  2975 TInt CMmDataCallTsy::DialNoFdnCheck(
  2989     const TTsyReqHandle aTsyReqHandle,
  2976     const TTsyReqHandle aTsyReqHandle,
  2990     const TDesC8* aCallParams,
  2977     const TDesC8* aCallParams,
  2991     TDesC* aTelNumber )
  2978     TDesC* aTelNumber )
  2992     {
  2979     {
  2993 TFLOGSTRING3("TSY: CMmDataCallTsy::DialNoFdnCheck - Req handle: %d, Call name: %S",
  2980 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIALNOFDNCHECK_1, "TSY: CMmDataCallTsy::DialNoFdnCheck - Req handle: %u, Call name: %S",aTsyReqHandle, iCallName);
  2994     aTsyReqHandle, &iCallName);
       
  2995 
  2981 
  2996 	CMmCallList* callList = iMmPhone->CallList();
  2982 	CMmCallList* callList = iMmPhone->CallList();
  2997 	TBool dialFlag( EFalse );
  2983 	TBool dialFlag( EFalse );
  2998 	
  2984 	
  2999 	for(TInt i=0; i< callList->GetNumberOfObjects();i++)
  2985 	for(TInt i=0; i< callList->GetNumberOfObjects();i++)
  3006 			}
  2992 			}
  3007 		}
  2993 		}
  3008 	
  2994 	
  3009 	if( !dialFlag )
  2995 	if( !dialFlag )
  3010 		{
  2996 		{
  3011 TFLOGSTRING("TSY: CMmDataCallTsy::DialNoFdnCheck ONGOING" );		
  2997 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIALNOFDNCHECK_2, "TSY: CMmDataCallTsy::DialNoFdnCheck ONGOING" );
  3012     		
  2998     		
  3013     	SetDialFlag( ETrue );
  2999     	SetDialFlag( ETrue );
  3014     		
  3000     		
  3015         TTsyReqHandle dialHandle = iTsyReqHandleStore->GetTsyReqHandle(
  3001         TTsyReqHandle dialHandle = iTsyReqHandleStore->GetTsyReqHandle(
  3016         		EMultimodeCallDialNoFdnCheck );
  3002         		EMultimodeCallDialNoFdnCheck );
  3021         // reset finished data call flag
  3007         // reset finished data call flag
  3022         iIsFinishedDataCall = EFalse;
  3008         iIsFinishedDataCall = EFalse;
  3023     
  3009     
  3024         if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() )  
  3010         if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() )  
  3025             {
  3011             {
  3026 TFLOGSTRING("TSY: CMmDataCallTsy - DialNoFdnCheck - Offline mode ON, Dial request is not allowed" );
  3012 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIALNOFDNCHECK_3, "TSY: CMmDataCallTsy - DialNoFdnCheck - Offline mode ON, Dial request is not allowed" );
  3027             TInt ret = CMmCommonStaticUtility::EpocErrorCode(
  3013             TInt ret = CMmCommonStaticUtility::EpocErrorCode(
  3028                 KErrGeneral, KErrGsmOfflineOpNotAllowed );
  3014                 KErrGeneral, KErrGsmOfflineOpNotAllowed );
  3029             SetDialFlag( EFalse );
  3015             SetDialFlag( EFalse );
  3030 TFLOGSTRING("TSY: CMmDataCallTsy::DialNoFdnCheck - RF inactive -> dial-flag false" );        
  3016 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIALNOFDNCHECK_4, "TSY: CMmDataCallTsy::DialNoFdnCheck - RF inactive -> dial-flag false" );
  3031             // Complete the request with appropiate error
  3017             // Complete the request with appropiate error
  3032             ReqCompleted ( aTsyReqHandle, ret ); 
  3018             ReqCompleted ( aTsyReqHandle, ret ); 
  3033             }
  3019             }
  3034 
  3020 
  3035         // check that status is Idle
  3021         // check that status is Idle
  3037             {
  3023             {
  3038             // Request cannot be forwarded since this call object
  3024             // Request cannot be forwarded since this call object
  3039             // is still in use.
  3025             // is still in use.
  3040             // Complete request with status value informing the client
  3026             // Complete request with status value informing the client
  3041             // about the situation.
  3027             // about the situation.
  3042 TFLOGSTRING("TSY: CMmDataCallTsy::DialNoFdnCheck - KErrNotReady");
  3028 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIALNOFDNCHECK_5, "TSY: CMmDataCallTsy::DialNoFdnCheck - KErrNotReady");
  3043             ReqCompleted( aTsyReqHandle, KErrNotReady );
  3029             ReqCompleted( aTsyReqHandle, KErrNotReady );
  3044             }
  3030             }
  3045         else if ( 0 < dialHandle )
  3031         else if ( 0 < dialHandle )
  3046             {
  3032             {
  3047             // Request is already in processing because of previous request
  3033             // Request is already in processing because of previous request
  3048             // Complete request with status value informing the client about 
  3034             // Complete request with status value informing the client about 
  3049             // the situation.
  3035             // the situation.
  3050 TFLOGSTRING("TSY: CMmDataCallTsy::DialNoFdnCheck - KErrServerBusy");
  3036 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIALNOFDNCHECK_6, "TSY: CMmDataCallTsy::DialNoFdnCheck - KErrServerBusy");
  3051             ReqCompleted( aTsyReqHandle, KErrServerBusy );
  3037             ReqCompleted( aTsyReqHandle, KErrServerBusy );
  3052             }
  3038             }
  3053         else
  3039         else
  3054             {
  3040             {
  3055             TInt ret( KErrNone );
  3041             TInt ret( KErrNone );
  3101     
  3087     
  3102                 if ( KErrNone == ret )
  3088                 if ( KErrNone == ret )
  3103                     {
  3089                     {
  3104                     SetDialTypeId( KMultimodeCallTypeIDNoFdnCheck );
  3090                     SetDialTypeId( KMultimodeCallTypeIDNoFdnCheck );
  3105                     
  3091                     
  3106 TFLOGSTRING("TSY: CMmDataCallTsy::DialNoFdnCheck - DialDataCall");
  3092 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_DIALNOFDNCHECK_7, "TSY: CMmDataCallTsy::DialNoFdnCheck - DialDataCall");
  3107                     TRAP( trapError,
  3093                     TRAP( trapError,
  3108                         ret = iMmCallExtInterface->DialDataCallL(
  3094                         ret = iMmCallExtInterface->DialDataCallL(
  3109                             iCallMode, aCallParams, aTelNumber );
  3095                             iCallMode, aCallParams, aTelNumber );
  3110                         );
  3096                         );
  3111                     if ( KErrNone != trapError )
  3097                     if ( KErrNone != trapError )
  3165 // ---------------------------------------------------------------------------
  3151 // ---------------------------------------------------------------------------
  3166 //
  3152 //
  3167 void CMmDataCallTsy::CompleteDialNoFdn(
  3153 void CMmDataCallTsy::CompleteDialNoFdn(
  3168     TInt aResult )
  3154     TInt aResult )
  3169     {
  3155     {
  3170 TFLOGSTRING2("TSY: CMmDataCallTsy::CompleteDialNoFdn - Result: %d", aResult ); 
  3156 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEDIALNOFDN_1, "TSY: CMmDataCallTsy::CompleteDialNoFdn - Result: %d", aResult );
  3171 TFLOGSTRING3("TSY: CMmDataCallTsy::CompleteDialNoFdn - Call Id: %d, Call name: %S",
  3157 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEDIALNOFDN_2, "TSY: CMmDataCallTsy::CompleteDialNoFdn - Call Id: %d, Call name: %S",iCallId, iCallName);
  3172     iCallId, &iCallName);
       
  3173     
  3158     
  3174     // Set dial flag to false
  3159     // Set dial flag to false
  3175     SetDialFlag( EFalse );
  3160     SetDialFlag( EFalse );
  3176     
  3161     
  3177     // reset req handle. Returns the deleted req handle
  3162     // reset req handle. Returns the deleted req handle
  3191             iCallCaps.iFlags &= ~( RCall::KCapsHangUp );
  3176             iCallCaps.iFlags &= ~( RCall::KCapsHangUp );
  3192 
  3177 
  3193             //complete caps change notification
  3178             //complete caps change notification
  3194             CompleteNotifyCapsChange();
  3179             CompleteNotifyCapsChange();
  3195             }
  3180             }
  3196 TFLOGSTRING2("TSY: CMmDataCallTsy::CompleteDialNoFdn before ReqComplete %d", aResult );
  3181 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEDIALNOFDN_3, "TSY: CMmDataCallTsy::CompleteDialNoFdn before ReqComplete %d", aResult );
  3197         ReqCompleted( reqHandle, aResult );
  3182         ReqCompleted( reqHandle, aResult );
  3198 
  3183 
  3199 TFLOGSTRING("TSY: CMmDataCallTsy::CompleteDialNoFdn - set dialtype to none ");
  3184 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_COMPLETEDIALNOFDN_4, "TSY: CMmDataCallTsy::CompleteDialNoFdn - set dialtype to none ");
  3200 	    //Set dial type to none 
  3185 	    //Set dial type to none 
  3201 	    SetDialTypeId( KMultimodeCallTypeDialNone );
  3186 	    SetDialTypeId( KMultimodeCallTypeDialNone );
  3202         }
  3187         }
  3203 
  3188 
  3204     // Set also new call caps to enable dataport loaning!
  3189     // Set also new call caps to enable dataport loaning!
  3229     const TInt aError )
  3214     const TInt aError )
  3230     {
  3215     {
  3231     //Overloads CTelObject::ReqCompleted for logging purposes. It 
  3216     //Overloads CTelObject::ReqCompleted for logging purposes. It 
  3232     //prints the aTsyReqHandle and aError variable in the log file and then 
  3217     //prints the aTsyReqHandle and aError variable in the log file and then 
  3233     //calls CTelObject::ReqCompleted.
  3218     //calls CTelObject::ReqCompleted.
  3234 TFLOGSTRING3("TSY: CMmDataCallTsy::Request Completed. Handle:%d Error:%d", aTsyReqHandle, aError); 
  3219 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMDATACALLTSY_REQCOMPLETED_1, "TSY: CMmDataCallTsy::Request Completed. Handle:%d Error:%d", aTsyReqHandle, aError);
  3235 
  3220 
  3236     CTelObject::ReqCompleted(aTsyReqHandle,aError);
  3221     CTelObject::ReqCompleted(aTsyReqHandle,aError);
  3237     }
  3222     }
  3238 #endif
  3223 #endif
  3239 
  3224