phoneengine/phonemodel/src/cpemessagehandler.cpp
branchRCL_3
changeset 23 40a3f856b14d
parent 14 b8d67d6176f5
child 24 41a7f70b3818
equal deleted inserted replaced
22:94dc1107e8b2 23:40a3f856b14d
   160             iLogHandling( aLogHandling ),
   160             iLogHandling( aLogHandling ),
   161             iContactHandling( aContactHandling ),
   161             iContactHandling( aContactHandling ),
   162             iExternalDataHandler( aExternalDataHandler ),
   162             iExternalDataHandler( aExternalDataHandler ),
   163             iSimStateMonitor( aSimStateMonitor ),
   163             iSimStateMonitor( aSimStateMonitor ),
   164             iFsSession( aFsSession ),
   164             iFsSession( aFsSession ),
       
   165 			iSwitchToVidCalReconFlag( EFalse ),
   165             iServiceHandling( aServiceHandling ),
   166             iServiceHandling( aServiceHandling ),
   166             iDataStore( *aModel.DataStore() )
   167             iDataStore( *aModel.DataStore() )
   167     {
   168     {
   168     }
   169     }
   169 
   170 
  1877     numberOfCalls = iCallHandling.GetNumberOfCalls();
  1878     numberOfCalls = iCallHandling.GetNumberOfCalls();
  1878 
  1879 
  1879     // Check the phone number for prefix change and change the prefix if needed
  1880     // Check the phone number for prefix change and change the prefix if needed
  1880     CheckPrefix();
  1881     CheckPrefix();
  1881 
  1882 
  1882     phoneNumber = iDataStore.PhoneNumber();
  1883     if( iSwitchToVidCalReconFlag )
  1883   
  1884         {
       
  1885         phoneNumber = iDataStore.SwitchToNumberCommand();
       
  1886 		// Clear flag to match the previous set operation in HandleSwitchToVideoOrVoice() function.
       
  1887         iSwitchToVidCalReconFlag = EFalse;
       
  1888         }
       
  1889     else
       
  1890         {
       
  1891         phoneNumber = iDataStore.PhoneNumber();
       
  1892         }
       
  1893     
  1884     __ASSERT_ALWAYS( !( phoneNumber == KNullDesC ), User::Leave( ECCPErrorInvalidPhoneNumber ));
  1894     __ASSERT_ALWAYS( !( phoneNumber == KNullDesC ), User::Leave( ECCPErrorInvalidPhoneNumber ));
  1885     
  1895     
  1886     // Number parser operations
  1896     // Number parser operations
  1887     iOptions->SetOptionStatus( KPhoneOptionSend, ETrue );
  1897     iOptions->SetOptionStatus( KPhoneOptionSend, ETrue );
  1888     iOptions->SetOptionStatus( KPhoneOptionInCall, numberOfCalls > 0 );
  1898     iOptions->SetOptionStatus( KPhoneOptionInCall, numberOfCalls > 0 );
  2074     {
  2084     {
  2075     TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleDisconnecting" );
  2085     TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleDisconnecting" );
  2076 
  2086 
  2077     iAutomaticAnswerTimer->Cancel();
  2087     iAutomaticAnswerTimer->Cancel();
  2078 
  2088 
  2079     TEFLOGSTRING( KTAMESOUT, 
  2089     // Prevent playing inband tone when phone is in silent mode and 
       
  2090     // audio output is not defined (call is  not connected).
       
  2091     if ( ( iDataStore.RingingType() != EProfileRingingTypeSilent ) || 
       
  2092          ( iDataStore.AudioOutput() != EPENotActive ) )
       
  2093         {
       
  2094         TEFLOGSTRING( KTAMESOUT, 
  2080         "PE CPEMessageHandler::HandleDisconnecting > iGsmAudioData.PlayInbandTone()");
  2095         "PE CPEMessageHandler::HandleDisconnecting > iGsmAudioData.PlayInbandTone()");
  2081     iGsmAudioData.PlayInbandTone();
  2096         iGsmAudioData.PlayInbandTone();
  2082     
  2097         }
       
  2098 
  2083     return ECCPErrorNone;
  2099     return ECCPErrorNone;
  2084     }
  2100     }
  2085 
  2101 
  2086 // -----------------------------------------------------------------------------
  2102 // -----------------------------------------------------------------------------
  2087 // CPEMessageHandler::HandleDisconnectingWithInband
  2103 // CPEMessageHandler::HandleDisconnectingWithInband
  2717         if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileOriginated )
  2733         if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileOriginated )
  2718             {
  2734             {
  2719             iDataStore.SetSwitchToNumberCommand( iDataStore.WholeOutgoingPhoneNumber( aCallId ) );  
  2735             iDataStore.SetSwitchToNumberCommand( iDataStore.WholeOutgoingPhoneNumber( aCallId ) );  
  2720             // Clear phonenumber to prevent using the wrong number in MO video call.
  2736             // Clear phonenumber to prevent using the wrong number in MO video call.
  2721             iDataStore.SetPhoneNumber( KNullDesC() );
  2737             iDataStore.SetPhoneNumber( KNullDesC() );
       
  2738             iSwitchToVidCalReconFlag = ETrue;
  2722             }
  2739             }
  2723         else
  2740         else
  2724             {
  2741             {
  2725             iDataStore.SetSwitchToNumberCommand( iDataStore.RemotePhoneNumber( aCallId ) );
  2742             iDataStore.SetSwitchToNumberCommand( iDataStore.RemotePhoneNumber( aCallId ) );
  2726             // Remote phone number must be stored as the phone number in case of low-memory situation where 
  2743             // Remote phone number must be stored as the phone number in case of low-memory situation where 
  2745         "PE CPEMessageHandler::ContinueSwitchToCall, aCallId : %d", aCallId );
  2762         "PE CPEMessageHandler::ContinueSwitchToCall, aCallId : %d", aCallId );
  2746     TInt callId;
  2763     TInt callId;
  2747     TInt errorCode( ECCPErrorNone );
  2764     TInt errorCode( ECCPErrorNone );
  2748   
  2765   
  2749     TPEPhoneNumber phoneNumber = iDataStore.SwitchToNumberCommand();
  2766     TPEPhoneNumber phoneNumber = iDataStore.SwitchToNumberCommand();
       
  2767     RemovePreAndPostFix( phoneNumber );
       
  2768     
  2750     TEFLOGSTRING2( KTAINT, 
  2769     TEFLOGSTRING2( KTAINT, 
  2751         "PE CPEMessageHandler::ContinueSwitchToCall, phoneNumber : %S", 
  2770         "PE CPEMessageHandler::ContinueSwitchToCall, phoneNumber : %S", 
  2752         &phoneNumber );
  2771         &phoneNumber );
  2753 
  2772 
  2754     // Check is current call voice or video
  2773     // Check is current call voice or video