telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmlinetsy.cpp
branchRCL_3
changeset 66 07a122eea281
parent 65 630d2f34d719
child 74 9200f38b1324
equal deleted inserted replaced
65:630d2f34d719 66:07a122eea281
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-2009 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 "cmmlinetsyTraces.h"
       
    23 #endif
       
    24 
       
    25 #include "cmmlinetsy.h"
    19 #include "cmmlinetsy.h"
    26 #include "cmmphonetsy.h"
    20 #include "cmmphonetsy.h"
    27 #include "cmmcalltsy.h"
    21 #include "cmmcalltsy.h"
    28 #include "cmmlinelist.h"
    22 #include "cmmlinelist.h"
    29 #include "cmmcalllist.h"
    23 #include "cmmcalllist.h"
    30 #include "cmmtsyreqhandlestore.h"
    24 #include "cmmtsyreqhandlestore.h"
    31 #include "MmTsy_numberOfSlots.h"
    25 #include "MmTsy_numberOfSlots.h"
       
    26 #include <ctsy/tflogger.h>
    32 #include <ctsy/pluginapi/cmmdatapackage.h>
    27 #include <ctsy/pluginapi/cmmdatapackage.h>
    33 #include <et_struct.h>
    28 #include <et_struct.h>
    34 
    29 
    35 
    30 
    36 // ======== MEMBER FUNCTIONS ========
    31 // ======== MEMBER FUNCTIONS ========
    39     {
    34     {
    40     }
    35     }
    41 
    36 
    42 void CMmLineTsy::ConstructL()
    37 void CMmLineTsy::ConstructL()
    43     {
    38     {
    44     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_CONSTRUCTL_1, "TSY: CMmLineTsy::ConstructL");
    39     TFLOGSTRING("TSY: CMmLineTsy::ConstructL");
    45     //Initialise miscellaneous internal attributes
    40     //Initialise miscellaneous internal attributes
    46     InitInternalAttributesL();
    41     InitInternalAttributesL();
    47 
    42 
    48     // Create and store a Call Object for incoming calls.
    43     // Create and store a Call Object for incoming calls.
    49     TInt ret = CreateCallObjectForIncomingCall();
    44     TInt ret = CreateCallObjectForIncomingCall();
    59         EMultimodeLineMaxNumOfRequests, iLineReqHandles );
    54         EMultimodeLineMaxNumOfRequests, iLineReqHandles );
    60     }
    55     }
    61 
    56 
    62 CMmLineTsy::~CMmLineTsy()
    57 CMmLineTsy::~CMmLineTsy()
    63     {
    58     {
    64     OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_DTOR_1, "TSY: CMmLineTsy::~CMmLineTsy. Line name: %S", iLineName);
    59     TFLOGSTRING2("TSY: CMmLineTsy::~CMmLineTsy. Line name: %S", &iLineName);
    65 
    60 
    66     //delete req handle store
    61     //delete req handle store
    67     delete iTsyReqHandleStore;
    62     delete iTsyReqHandleStore;
    68 
    63 
    69     //delete incoming call object
    64     //delete incoming call object
    99 // ---------------------------------------------------------------------------
    94 // ---------------------------------------------------------------------------
   100 //
    95 //
   101 CTelObject* CMmLineTsy::OpenNewObjectByNameL(
    96 CTelObject* CMmLineTsy::OpenNewObjectByNameL(
   102     const TDesC& aName )
    97     const TDesC& aName )
   103     {
    98     {
   104     OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_OPENNEWOBJECTBYNAMEL_1, "TSY: CMmLineTsy::OpenNewObjectByNameL %S", aName);
    99     TFLOGSTRING2("TSY: CMmLineTsy::OpenNewObjectByNameL %S", &aName);
   105 
   100 
   106     TName mmCallName( aName );
   101     TName mmCallName( aName );
   107     CMmCallTsy* mmCall = iMmPhone->CallList()->GetMmCallByName( &mmCallName );
   102     CMmCallTsy* mmCall = iMmPhone->CallList()->GetMmCallByName( &mmCallName );
   108 
   103 
   109     //if not found, Leave...
   104     //if not found, Leave...
   168 // ---------------------------------------------------------------------------
   163 // ---------------------------------------------------------------------------
   169 //
   164 //
   170 CTelObject::TReqMode CMmLineTsy::ReqModeL(
   165 CTelObject::TReqMode CMmLineTsy::ReqModeL(
   171     const TInt aIpc )
   166     const TInt aIpc )
   172     {
   167     {
   173     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_REQMODEL_1, "TSY: CMmLineTsy::ReqModeL IPC:%d",aIpc);
   168     TFLOGSTRING2("TSY: CMmLineTsy::ReqModeL IPC:%d",aIpc);
   174     
   169     
   175     CTelObject::TReqMode ret( 0 );    // default return value
   170     CTelObject::TReqMode ret( 0 );    // default return value
   176     
   171     
   177     switch( aIpc )
   172     switch( aIpc )
   178         {
   173         {
   314 TInt CMmLineTsy::DoExtFuncL(
   309 TInt CMmLineTsy::DoExtFuncL(
   315     const TTsyReqHandle aTsyReqHandle,
   310     const TTsyReqHandle aTsyReqHandle,
   316     const TInt aIpc,
   311     const TInt aIpc,
   317     const TDataPackage& aPackage )
   312     const TDataPackage& aPackage )
   318     {
   313     {
   319     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_DOEXTFUNCL_1, "TSY: CMmLineTsy::DoExtFuncL IPC:%d Handle:%d", aIpc, aTsyReqHandle);
   314     TFLOGSTRING3("TSY: CMmLineTsy::DoExtFuncL IPC:%d Handle:%d", aIpc, \
       
   315         aTsyReqHandle);
   320 
   316 
   321     TInt ret ( KErrNone );
   317     TInt ret ( KErrNone );
   322 
   318 
   323     TAny* dataPtr = aPackage.Ptr1();
   319     TAny* dataPtr = aPackage.Ptr1();
   324 
   320 
   778 //
   774 //
   779 TInt CMmLineTsy::NotifyCallAdded(
   775 TInt CMmLineTsy::NotifyCallAdded(
   780     const TTsyReqHandle aTsyReqHandle,
   776     const TTsyReqHandle aTsyReqHandle,
   781     TName* aName )
   777     TName* aName )
   782     {
   778     {
   783     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_NOTIFYCALLADDED_1, "TSY: CMmLineTsy::NotifyCallAdded requested by client, \lineMode:%d", iLineMode);
   779     TFLOGSTRING2("TSY: CMmLineTsy::NotifyCallAdded requested by client, \
       
   780         lineMode:%d", iLineMode);
   784     // On return, contains the name of the new call.
   781     // On return, contains the name of the new call.
   785     iRetCallAdded = aName;    
   782     iRetCallAdded = aName;    
   786     iTsyReqHandleStore->SetTsyReqHandle( EMultimodeLineNotifyCallAdded,
   783     iTsyReqHandleStore->SetTsyReqHandle( EMultimodeLineNotifyCallAdded,
   787         aTsyReqHandle );
   784         aTsyReqHandle );
   788     return KErrNone;
   785     return KErrNone;
   797 // ---------------------------------------------------------------------------
   794 // ---------------------------------------------------------------------------
   798 //
   795 //
   799 TInt CMmLineTsy::NotifyCallAddedCancel(
   796 TInt CMmLineTsy::NotifyCallAddedCancel(
   800     const TTsyReqHandle aTsyReqHandle )
   797     const TTsyReqHandle aTsyReqHandle )
   801     {
   798     {
   802     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_NOTIFYCALLADDEDCANCEL_1, "TSY: CMmLineTsy::NotifyCallAddedCancel requested by client");
   799     TFLOGSTRING("TSY: CMmLineTsy::NotifyCallAddedCancel requested by client");
   803     iRetCallAdded = NULL;
   800     iRetCallAdded = NULL;
   804     iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeLineNotifyCallAdded );
   801     iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeLineNotifyCallAdded );
   805     ReqCompleted( aTsyReqHandle, KErrCancel );
   802     ReqCompleted( aTsyReqHandle, KErrCancel );
   806     return KErrNone;    
   803     return KErrNone;    
   807     }
   804     }
   814 // (other items were commented in a header).
   811 // (other items were commented in a header).
   815 // ---------------------------------------------------------------------------
   812 // ---------------------------------------------------------------------------
   816 //
   813 //
   817 void CMmLineTsy::CompleteNotifyCallAdded(const TDesC& aName )    
   814 void CMmLineTsy::CompleteNotifyCallAdded(const TDesC& aName )    
   818     {
   815     {
   819     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_COMPLETENOTIFYCALLADDED_1, "TSY: CMmLineTsy::CompleteNotifyCallAdded entered, \CALL ADDED, Call name: %S, Call mode: %d", aName, iLineMode );
   816     TFLOGSTRING3("TSY: CMmLineTsy::CompleteNotifyCallAdded entered, \
       
   817     CALL ADDED, Call name: %S, Call mode: %d", &aName, iLineMode );
   820 
   818 
   821     //reset req handle. Returns the deleted req handle
   819     //reset req handle. Returns the deleted req handle
   822     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   820     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   823                                 EMultimodeLineNotifyCallAdded );
   821                                 EMultimodeLineNotifyCallAdded );
   824 
   822 
   825     iNumCalls++;
   823     iNumCalls++;
   826 
   824 
   827     if ( EMultimodeLineReqHandleUnknown != reqHandle )
   825     if ( EMultimodeLineReqHandleUnknown != reqHandle )
   828         {
   826         {
   829         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_COMPLETENOTIFYCALLADDED_2, "TSY: CMmLineTsy::CompleteNotifyCallAdded, Completed!");
   827         TFLOGSTRING("TSY: CMmLineTsy::CompleteNotifyCallAdded, Completed!");
   830         *iRetCallAdded = aName;
   828         *iRetCallAdded = aName;
   831         ReqCompleted( reqHandle, KErrNone );
   829         ReqCompleted( reqHandle, KErrNone );
   832         }
   830         }
   833     }
   831     }
   834 
   832 
   899 //
   897 //
   900 TInt CMmLineTsy::GetCallInfo(
   898 TInt CMmLineTsy::GetCallInfo(
   901     const TTsyReqHandle aTsyReqHandle,
   899     const TTsyReqHandle aTsyReqHandle,
   902     TCallInfoIndex* aCallInfoIndex )
   900     TCallInfoIndex* aCallInfoIndex )
   903     {
   901     {
   904     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_GETCALLINFO_1, "TSY: CMmLineTsy::GetCallInfo - Line name: %S, Index: %d",iLineName, aCallInfoIndex->iIndex );
   902     TFLOGSTRING3("TSY: CMmLineTsy::GetCallInfo - Line name: %S, Index: %d",
       
   903         &iLineName, aCallInfoIndex->iIndex );
   905 
   904 
   906     TInt ret( KErrNotFound );
   905     TInt ret( KErrNotFound );
   907 
   906 
   908     // Check if the call object can be found from call list by index
   907     // Check if the call object can be found from call list by index
   909     CMmCallTsy* mmCall = REINTERPRET_CAST( CMmCallTsy*, 
   908     CMmCallTsy* mmCall = REINTERPRET_CAST( CMmCallTsy*, 
   915         {
   914         {
   916         aCallInfoIndex->iInfo.iCallName      = mmCall->CallName();
   915         aCallInfoIndex->iInfo.iCallName      = mmCall->CallName();
   917         aCallInfoIndex->iInfo.iStatus        = mmCall->Status();
   916         aCallInfoIndex->iInfo.iStatus        = mmCall->Status();
   918         aCallInfoIndex->iInfo.iCallCapsFlags = mmCall->CallCaps();
   917         aCallInfoIndex->iInfo.iCallCapsFlags = mmCall->CallCaps();
   919 
   918 
   920         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_GETCALLINFO_2, "TSY: CMmLineTsy::GetCallInfo - Call name: %S, Status: %d",aCallInfoIndex->iInfo.iCallName, aCallInfoIndex->iInfo.iStatus );
   919         TFLOGSTRING3("TSY: CMmLineTsy::GetCallInfo - Call name: %S, Status: %d",
       
   920             &aCallInfoIndex->iInfo.iCallName, aCallInfoIndex->iInfo.iStatus );
   921 
   921 
   922         ret = KErrNone;
   922         ret = KErrNone;
   923         }
   923         }
   924 
   924 
   925     ReqCompleted( aTsyReqHandle, ret );
   925     ReqCompleted( aTsyReqHandle, ret );
  1199 
  1199 
  1200     if ( mobileCallInfo->iStatus == RMobileCall::EStatusDialling ||
  1200     if ( mobileCallInfo->iStatus == RMobileCall::EStatusDialling ||
  1201          mobileCallInfo->iStatus == RMobileCall::EStatusConnecting ||
  1201          mobileCallInfo->iStatus == RMobileCall::EStatusConnecting ||
  1202          mobileCallInfo->iStatus == RMobileCall::EStatusConnected )
  1202          mobileCallInfo->iStatus == RMobileCall::EStatusConnected )
  1203         {
  1203         {
  1204         OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_COMPLETENOTIFYADDBYPASSINGCALL_1, "TSY: CMmLineTsy::CompleteNotifyAddBypassingCall, \CALL INITIATED - NOT REQUESTED BY ETEL's CLIENT, Call ID: %d",callId );
  1204         TFLOGSTRING2("TSY: CMmLineTsy::CompleteNotifyAddBypassingCall, \
       
  1205             CALL INITIATED - NOT REQUESTED BY ETEL's CLIENT, Call ID: %d",
       
  1206             callId );
  1205 
  1207 
  1206         //create new call object
  1208         //create new call object
  1207         CMmCallTsy* mmGhostCall = CreateGhostCallObject(
  1209         CMmCallTsy* mmGhostCall = CreateGhostCallObject(
  1208             callId, callMode, mobileCallInfo->iStatus );
  1210             callId, callMode, mobileCallInfo->iStatus );
  1209 
  1211 
  1227                 }
  1229                 }
  1228             }
  1230             }
  1229         }
  1231         }
  1230     else
  1232     else
  1231         {
  1233         {
  1232         OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_COMPLETENOTIFYADDBYPASSINGCALL_2, "TSY: CMmLineTsy::CompleteNotifyAddBypassingCall, \CALL NOT INITIATED - Call ID:%d, Call status:%d", callId, mobileCallInfo->iStatus);
  1234         TFLOGSTRING3("TSY: CMmLineTsy::CompleteNotifyAddBypassingCall, \
       
  1235             CALL NOT INITIATED - Call ID:%d, Call status:%d", 
       
  1236             callId, mobileCallInfo->iStatus);
  1233         }
  1237         }
  1234     }
  1238     }
  1235 
  1239 
  1236 #ifdef TF_LOGGING_ENABLED
  1240 #ifdef TF_LOGGING_ENABLED
  1237 // ---------------------------------------------------------------------------
  1241 // ---------------------------------------------------------------------------
  1244 //
  1248 //
  1245 void CMmLineTsy::ReqCompleted(
  1249 void CMmLineTsy::ReqCompleted(
  1246     const TTsyReqHandle aTsyReqHandle,
  1250     const TTsyReqHandle aTsyReqHandle,
  1247     const TInt aError )
  1251     const TInt aError )
  1248     {
  1252     {
  1249     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINETSY_REQCOMPLETED_1, "TSY: CMmLineTsy::ReqCompleted Handle:%d Error:%d", aTsyReqHandle, aError);
  1253     TFLOGSTRING3("TSY: CMmLineTsy::ReqCompleted Handle:%d Error:%d", 
       
  1254         aTsyReqHandle, aError);
  1250 
  1255 
  1251     CTelObject::ReqCompleted(aTsyReqHandle,aError);        
  1256     CTelObject::ReqCompleted(aTsyReqHandle,aError);        
  1252     }
  1257     }
  1253 
  1258 
  1254 #endif
  1259 #endif