phoneengine/phonemodel/src/cpephonemodel.cpp
branchRCL_3
changeset 26 8baf28733c3d
parent 25 5266b1f337bd
equal deleted inserted replaced
25:5266b1f337bd 26:8baf28733c3d
    41 #include <mpeloghandling.h>
    41 #include <mpeloghandling.h>
    42 
    42 
    43 // CONSTANTS
    43 // CONSTANTS
    44 const TInt KDriveProfile ( 6 );
    44 const TInt KDriveProfile ( 6 );
    45 const TInt KPECallTimerOff = 0;
    45 const TInt KPECallTimerOff = 0;
       
    46 const TInt KTimesToSplitValue = 16;
    46 
    47 
    47 // ==================== LOCAL FUNCTIONS ====================
    48 // ==================== LOCAL FUNCTIONS ====================
    48 
    49 
    49 // ================= MEMBER FUNCTIONS =======================
    50 // ================= MEMBER FUNCTIONS =======================
    50 
    51 
    94     TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 4" );
    95     TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 4" );
    95     iActiveStarter = CPEActiveStarter::NewL( this );
    96     iActiveStarter = CPEActiveStarter::NewL( this );
    96     TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 5" );
    97     TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 5" );
    97     iActiveStarter->StartUp();
    98     iActiveStarter->StartUp();
    98     TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 6" );
    99     TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 6" );
       
   100     // Reserve needed callinfo and remoteinfo from heap.
       
   101     iCallInfo = new ( ELeave ) RMobileCall::TMobileCallInfoV3;
    99     }// ConstructL
   102     }// ConstructL
   100 
   103 
   101 // -----------------------------------------------------------------------------
   104 // -----------------------------------------------------------------------------
   102 // CPEPhoneModel::NewL
   105 // CPEPhoneModel::NewL
   103 // Two-phased constructor.
   106 // Two-phased constructor.
   143     delete iLogHandling;
   146     delete iLogHandling;
   144     delete iAudioData;
   147     delete iAudioData;
   145     delete iCallHandling;
   148     delete iCallHandling;
   146     delete iExternalDataHandler;
   149     delete iExternalDataHandler;
   147     delete iCallStackCutter;
   150     delete iCallStackCutter;
       
   151     delete iCallInfo;
   148 
   152 
   149     if ( iActiveStarter )
   153     if ( iActiveStarter )
   150         {
   154         {
   151         delete iActiveStarter;
   155         delete iActiveStarter;
   152         }
   156         }
   965         TEFLOGSTRING3( 
   969         TEFLOGSTRING3( 
   966             KTAERROR,
   970             KTAERROR,
   967             "PE cpephonemodel::sendmessage > iEngineMonitor.HandleError: messageName=%s, CallId=%d",
   971             "PE cpephonemodel::sendmessage > iEngineMonitor.HandleError: messageName=%s, CallId=%d",
   968         messageName2.Ptr( ), aCallId );
   972         messageName2.Ptr( ), aCallId );
   969         #endif
   973         #endif
       
   974         SetCallError( aCallId );
   970         TPEErrorInfo errorInfo;
   975         TPEErrorInfo errorInfo;
   971     	errorInfo.iErrorCode = errorCode;
   976     	errorInfo.iErrorCode = errorCode;
   972     	errorInfo.iCallId = aCallId;
   977     	errorInfo.iCallId = aCallId;
   973         errorInfo.iErrorType = EPECcp;
   978         errorInfo.iErrorType = EPECcp;
   974         iEngineMonitor.HandleError( errorInfo );
   979         iEngineMonitor.HandleError( errorInfo );
   977 	    {
   982 	    {
   978         TEFLOGSTRING2( 
   983         TEFLOGSTRING2( 
   979             KTAERROR, 
   984             KTAERROR, 
   980             "PE cpephonemodel::sendmessage > iEngineMonitor.HandleError: messageName=EPEMessageCallHandlingError, CallId=%d"
   985             "PE cpephonemodel::sendmessage > iEngineMonitor.HandleError: messageName=EPEMessageCallHandlingError, CallId=%d"
   981         , aCallId );
   986         , aCallId );
       
   987         SetCallError( aCallId );
   982 	    TPEErrorInfo errorInfo = iEngineInfo->ErrorInfo();
   988 	    TPEErrorInfo errorInfo = iEngineInfo->ErrorInfo();
   983     	errorInfo.iCallId = aCallId;
   989     	errorInfo.iCallId = aCallId;
   984     	errorInfo.iErrorType = EPECcp;
   990     	errorInfo.iErrorType = EPECcp;
   985 
   991 
   986         if ( ECCPErrorCCCallRejected == errorInfo.iErrorCode )
   992         if ( ECCPErrorCCCallRejected == errorInfo.iErrorCode )
   994     else if ( message == MEngineMonitor::EPEMessageServiceHandlingError )
  1000     else if ( message == MEngineMonitor::EPEMessageServiceHandlingError )
   995         {
  1001         {
   996         TEFLOGSTRING( 
  1002         TEFLOGSTRING( 
   997             KTAERROR, 
  1003             KTAERROR, 
   998             "PE cpephonemodel::sendmessage > iEngineMonitor.HandleError: messageName=EPEMessageServiceHandlingError" );
  1004             "PE cpephonemodel::sendmessage > iEngineMonitor.HandleError: messageName=EPEMessageServiceHandlingError" );
       
  1005         SetCallError( aCallId );
   999         TPEErrorInfo errorInfo = iEngineInfo->ErrorInfo();
  1006         TPEErrorInfo errorInfo = iEngineInfo->ErrorInfo();
  1000         errorInfo.iCallId = aCallId;
  1007         errorInfo.iCallId = aCallId;
  1001         errorInfo.iErrorType = EPECch;
  1008         errorInfo.iErrorType = EPECch;
  1002         iEngineMonitor.HandleError( errorInfo );
  1009         iEngineMonitor.HandleError( errorInfo );
  1003 	    }
  1010 	    }
  1503     self->iEngineMonitor.HandleMessage( self->iCallBackMessage, self->iCallBackCallId );
  1510     self->iEngineMonitor.HandleMessage( self->iCallBackMessage, self->iCallBackCallId );
  1504    
  1511    
  1505     return KErrNone;
  1512     return KErrNone;
  1506     }
  1513     }
  1507 
  1514 
       
  1515 // -----------------------------------------------------------------------------
       
  1516 // SetCallError
       
  1517 // -----------------------------------------------------------------------------
       
  1518 //
       
  1519 void CPEPhoneModel::SetCallError( TInt aCallId )
       
  1520     {
       
  1521     TInt callError = KErrNone;
       
  1522     if ( iCallHandling )
       
  1523         {
       
  1524         TInt err = iCallHandling->GetCallInfo( *iCallInfo, aCallId );
       
  1525         
       
  1526         if ( err == KErrNone && ( iCallInfo->iExitCode & 0xFFFF0000 ) &&
       
  1527                 aCallId > KErrNotFound ) 
       
  1528             {
       
  1529             callError = ( iCallInfo->iExitCode >> KTimesToSplitValue ); 
       
  1530             //Set protocol spesific error code to EngineInfo
       
  1531             EngineInfo()->SetProtocolError( callError, aCallId );
       
  1532             }
       
  1533         }
       
  1534     }
       
  1535 	
  1508 // End of File
  1536 // End of File