phoneengine/callhandling/src/cpevideocallhandling.cpp
branchRCL_3
changeset 24 41a7f70b3818
parent 0 5f000ab63145
child 25 5266b1f337bd
equal deleted inserted replaced
23:40a3f856b14d 24:41a7f70b3818
    26 
    26 
    27 #include <mpephonemodelinternal.h>
    27 #include <mpephonemodelinternal.h>
    28 #include <e32property.h>
    28 #include <e32property.h>
    29 #include <gsmerror.h>
    29 #include <gsmerror.h>
    30 #include <mpedatastore.h>
    30 #include <mpedatastore.h>
    31 #include <NetworkHandlingDomainPSKeys.h>
    31 #include <networkhandlingdomainpskeys.h>
    32 #include <pepanic.pan>
    32 #include <pepanic.pan>
    33 #include <pevirtualengine.h>
    33 #include <pevirtualengine.h>
    34 #include <talogger.h>
    34 #include <talogger.h>
    35 #include <ctsydomainpskeys.h>
    35 #include <ctsydomainpskeys.h>
    36 #include <connect/sbdefs.h>
    36 #include <connect/sbdefs.h>
   181     TEFLOGSTRING2( KTAINT, 
   181     TEFLOGSTRING2( KTAINT, 
   182             "VID CPEVideoCallHandling::CallTerminatedError, aCallId: %d",
   182             "VID CPEVideoCallHandling::CallTerminatedError, aCallId: %d",
   183             aCallId );
   183             aCallId );
   184     
   184     
   185     TInt errorCode( KErrNone );    
   185     TInt errorCode( KErrNone );    
   186 	CPESingleCall* dataCall = iCallArrayOwner.GetCallObject( aCallId );
   186     CPESingleCall* dataCall = iCallArrayOwner.GetCallObject( aCallId );
   187 	if ( dataCall )
   187     if ( dataCall )
   188 	    {
   188         {
   189 	    dataCall->GetErrorCode( errorCode );
   189         dataCall->GetErrorCode( errorCode );
   190 	    }
   190         }
   191 	
   191     
   192 	TEFLOGSTRING2( KTAINT, 
   192     TEFLOGSTRING2( KTAINT, 
   193 	            "VID CPEVideoCallHandling::CallTerminatedError, errorCode: %d",
   193                 "VID CPEVideoCallHandling::CallTerminatedError, errorCode: %d",
   194 	            errorCode );
   194                 errorCode );
   195     return errorCode;
   195     return errorCode;
   196     }
   196     }
   197 
   197 
   198 // -----------------------------------------------------------------------------
   198 // -----------------------------------------------------------------------------
   199 // CPEVideoCallHandling::DataPortInUse
   199 // CPEVideoCallHandling::DataPortInUse
   307 //
   307 //
   308 void CPEVideoCallHandling::InitCall( MCCECall& aCall )
   308 void CPEVideoCallHandling::InitCall( MCCECall& aCall )
   309     {
   309     {
   310     TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::InitCall" );
   310     TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::InitCall" );
   311     CPESingleCall* callData( NULL );
   311     CPESingleCall* callData( NULL );
   312 	  TRAP_IGNORE( callData = iCallArrayOwner.CreateDataCallL( *this ) );
   312       TRAP_IGNORE( callData = iCallArrayOwner.CreateDataCallL( *this ) );
   313 
   313 
   314     if ( callData )
   314     if ( callData )
   315         {
   315         {
   316         iModel.DataStore()->SetPhoneNumber( KNullDesC() );
   316         iModel.DataStore()->SetPhoneNumber( KNullDesC() );
   317         iModel.DataStore()->SetServiceId( callData->GetCallId(), aCall.ServiceId() );
   317         iModel.DataStore()->SetServiceId( callData->GetCallId(), aCall.ServiceId() );
   318         callData->SetCall( aCall );
   318         callData->SetCall( aCall );
   319         iModel.DataStore()->SetCallSecureStatus( callData->IsSecureCall(), callData->GetCallId() );
   319         iModel.DataStore()->SetCallSecureStatus( callData->IsSecureCall(), callData->GetCallId() );
   320         iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() );
   320         iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() );
   321         
   321         
   322     	const CCCPCallParameters& callParameters = aCall.Parameters();
   322         const CCCPCallParameters& callParameters = aCall.Parameters();
   323         switch ( callParameters.CallType() )
   323         switch ( callParameters.CallType() )
   324             {
   324             {
   325             case CCPCall::ECallTypeCSVoice:
   325             case CCPCall::ECallTypeCSVoice:
   326                 {
   326                 {
   327                 iModel.DataStore()->SetCallType( EPECallTypeCSVoice, callData->GetCallId() );
   327                 iModel.DataStore()->SetCallType( EPECallTypeCSVoice, callData->GetCallId() );
   341                 __ASSERT_DEBUG( EFalse, Panic( EPEPanicIndexOutOfRange ));
   341                 __ASSERT_DEBUG( EFalse, Panic( EPEPanicIndexOutOfRange ));
   342                 break;
   342                 break;
   343             }
   343             }
   344         }
   344         }
   345     else
   345     else
   346     	{
   346         {
   347     	Panic( EPEPanicNoFreeCalls );
   347         Panic( EPEPanicNoFreeCalls );
   348     	}
   348         }
   349     }
   349     }
   350  
   350  
   351 // -----------------------------------------------------------------------------
   351 // -----------------------------------------------------------------------------
   352 // CPEVideoCallHandling::IsMultimedia
   352 // CPEVideoCallHandling::IsMultimedia
   353 // Checks if the data call is a multimedia call. Requires that the data call has
   353 // Checks if the data call is a multimedia call. Requires that the data call has
   379 void CPEVideoCallHandling::NotifySystemCallStateChanged( 
   379 void CPEVideoCallHandling::NotifySystemCallStateChanged( 
   380         MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,  // The enumeration number of the message
   380         MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,  // The enumeration number of the message
   381         TInt aCallId )
   381         TInt aCallId )
   382     {
   382     {
   383     TEFLOGSTRING2( KTAINT, "VID CPEVideoCallHandling::NotifySystemCallStateChanged %d", aCallId );
   383     TEFLOGSTRING2( KTAINT, "VID CPEVideoCallHandling::NotifySystemCallStateChanged %d", aCallId );
   384 	// this needs to be checked because this function is called for all data calls
   384     // this needs to be checked because this function is called for all data calls
   385 	if ( IsMultimedia( aCallId ) )
   385     if ( IsMultimedia( aCallId ) )
   386         {
   386         {
   387 	    if ( aMessage == MEngineMonitor::EPEMessageIncoming ||
   387         if ( aMessage == MEngineMonitor::EPEMessageIncoming ||
   388 	       aMessage == MEngineMonitor::EPEMessageDialing )
   388            aMessage == MEngineMonitor::EPEMessageDialing )
   389 	        {
   389             {
   390             TInt updateError = RProperty::Set( KPSUidCtsyCallInformation, 
   390             TInt updateError = RProperty::Set( KPSUidCtsyCallInformation, 
   391                 KCTsyCallType, EPSCTsyCallTypeH324Multimedia );
   391                 KCTsyCallType, EPSCTsyCallTypeH324Multimedia );
   392             TEFLOGSTRING2( updateError?KTAERROR:KTAMESOUT, 
   392             TEFLOGSTRING2( updateError?KTAERROR:KTAMESOUT, 
   393                 "VID CPEVideoCallHandling::NotifySystemCallStateChanged request RProperty::Set, EPSCTsyCallTypeH324Multimedia, updateError: ",
   393                 "VID CPEVideoCallHandling::NotifySystemCallStateChanged request RProperty::Set, EPSCTsyCallTypeH324Multimedia, updateError: ",
   394                 updateError );
   394                 updateError );
   395 	        }
   395             }
   396         }
   396         }
   397     }
   397     }
   398 
   398 
   399 // -----------------------------------------------------------------------------
   399 // -----------------------------------------------------------------------------
   400 // CPEVideoCallHandling::SendMessage
   400 // CPEVideoCallHandling::SendMessage
   425                 TInt restoreValue;
   425                 TInt restoreValue;
   426                 RProperty::Get( KUidSystemCategory, conn::KUidBackupRestoreKey, restoreValue );
   426                 RProperty::Get( KUidSystemCategory, conn::KUidBackupRestoreKey, restoreValue );
   427                 if( ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial ) ) )
   427                 if( ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial ) ) )
   428                     {
   428                     {
   429                     // First phase VT and restore: Check if there is a arriving VT 
   429                     // First phase VT and restore: Check if there is a arriving VT 
   430             	    // call and Restore ongoing.
   430                     // call and Restore ongoing.
   431             	    TEFLOGSTRING( KTAINT, 
   431                     TEFLOGSTRING( KTAINT, 
   432                         "VID CPEVideoCallHandling::SendMessage > HangUp restore active " );
   432                         "VID CPEVideoCallHandling::SendMessage > HangUp restore active " );
   433                	    iRestoreCauseVTCallReject = ETrue;
   433                     iRestoreCauseVTCallReject = ETrue;
   434                	    if( videoCall )
   434                     if( videoCall )
   435                	        {
   435                         {
   436                	        videoCall->HangUp();
   436                         videoCall->HangUp();
   437                	        }
   437                         }
   438                	    aMessage = MEngineMonitor::EPEMessageDoNotSendMe;
   438                     aMessage = MEngineMonitor::EPEMessageDoNotSendMe;
   439                     }
   439                     }
   440                 break;
   440                 break;
   441                 }
   441                 }
   442             case MEngineMonitor::EPEMessageDisconnecting:
   442             case MEngineMonitor::EPEMessageDisconnecting:
   443                 {
   443                 {
   444                 if( iRestoreCauseVTCallReject )
   444                 if( iRestoreCauseVTCallReject )
   445 	                {
   445                     {
   446 	            	// Second phase VT and restore: Check if there is a rejected arriving VT call 
   446                     // Second phase VT and restore: Check if there is a rejected arriving VT call 
   447 	                // and Restore ongoing, then don't notify observers.
   447                     // and Restore ongoing, then don't notify observers.
   448 	                iRestoreCauseVTCallReject = EFalse;
   448                     iRestoreCauseVTCallReject = EFalse;
   449 	                TEFLOGSTRING( KTAINT, 
   449                     TEFLOGSTRING( KTAINT, 
   450 				        "VID CPEVideoCallHandling::SendMessage Second phase Restore and VT call" );
   450                         "VID CPEVideoCallHandling::SendMessage Second phase Restore and VT call" );
   451 	                aMessage = MEngineMonitor::EPEMessageDoNotSendMe;
   451                     aMessage = MEngineMonitor::EPEMessageDoNotSendMe;
   452 	                }
   452                     }
   453                 break;
   453                 break;
   454                 }
   454                 }
   455             case MEngineMonitor::EPEMessageIdle:
   455             case MEngineMonitor::EPEMessageIdle:
   456                 {
   456                 {
   457                 iRestoreCauseVTCallReject = EFalse;
   457                 iRestoreCauseVTCallReject = EFalse;
   458                 // Check reject video cace, if there is connect VT call don't disconnect
   458                 // Check reject video cace, if there is connect VT call don't disconnect
   459                 if( !connectedVideoCall )
   459                 if( !connectedVideoCall )
   460 	                {
   460                     {
   461 	                if ( CallTerminatedError( aCallId ) == KErrGsmCCIncompatibleDestination )
   461                     if ( CallTerminatedError( aCallId ) == KErrGsmCCIncompatibleDestination )
   462 	                    {
   462                         {
   463 	                    error = KErrGsmCCIncompatibleDestination;
   463                         error = KErrGsmCCIncompatibleDestination;
   464 	                    }
   464                         }
   465 	                }
   465                     }
   466                 break;
   466                 break;
   467                 }
   467                 }
   468             default:
   468             default:
   469                 {
   469                 {
   470                 TEFLOGSTRING2( 
   470                 TEFLOGSTRING2( 
   519         "VID CPEVideoCallHandling::IsPhoneNumberAvailable, aCallId: %d"
   519         "VID CPEVideoCallHandling::IsPhoneNumberAvailable, aCallId: %d"
   520         , aCallId );
   520         , aCallId );
   521     TBool phoneNumberAvailable ( EFalse );
   521     TBool phoneNumberAvailable ( EFalse );
   522         
   522         
   523     if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileOriginated )
   523     if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileOriginated )
   524 	    {
   524         {
   525 	    phoneNumberAvailable = ETrue;	
   525         phoneNumberAvailable = ETrue;   
   526 	    }
   526         }
   527     else
   527     else
   528 	    {
   528         {
   529 	    RMobileCall::TMobileCallRemoteIdentityStatus remoteIdentity;
   529         RMobileCall::TMobileCallRemoteIdentityStatus remoteIdentity;
   530 	    remoteIdentity = iDataStore.RemoteIdentity( aCallId );
   530         remoteIdentity = iDataStore.RemoteIdentity( aCallId );
   531 	    TEFLOGSTRING2( KTAINT, 
   531         TEFLOGSTRING2( KTAINT, 
   532 	        "VID CPEVideoCallHandling::IsPhoneNumberAvailable, remoteIdentity: %d", 
   532             "VID CPEVideoCallHandling::IsPhoneNumberAvailable, remoteIdentity: %d", 
   533 	        remoteIdentity);
   533             remoteIdentity);
   534 	    phoneNumberAvailable = ( remoteIdentity == RMobileCall::ERemoteIdentityAvailable ); 	
   534         phoneNumberAvailable = ( remoteIdentity == RMobileCall::ERemoteIdentityAvailable );     
   535 	    }
   535         }
   536     TEFLOGSTRING2( KTAINT, 
   536     TEFLOGSTRING2( KTAINT, 
   537         "VID CPEVideoCallHandling::IsPhoneNumberAvailable, isAvailable: %d", 
   537         "VID CPEVideoCallHandling::IsPhoneNumberAvailable, isAvailable: %d", 
   538         phoneNumberAvailable );
   538         phoneNumberAvailable );
   539     return phoneNumberAvailable;
   539     return phoneNumberAvailable;
   540     }
   540     }
   630     TRAP( errorCode, 
   630     TRAP( errorCode, 
   631           cceCall = &( iConvergedCallEngine.OpenNewCallL( aNumber, 
   631           cceCall = &( iConvergedCallEngine.OpenNewCallL( aNumber, 
   632                                                           *iCallOpenParams, 
   632                                                           *iCallOpenParams, 
   633                                                           *callData ) ) );
   633                                                           *callData ) ) );
   634     if ( errorCode == KErrNone )
   634     if ( errorCode == KErrNone )
   635     	{
   635         {
   636     	callData->SetCall( *cceCall );
   636         callData->SetCall( *cceCall );
   637     	iModel.DataStore()->SetServiceId( callData->GetCallId(), cceCall->ServiceId() );
   637         iModel.DataStore()->SetServiceId( callData->GetCallId(), cceCall->ServiceId() );
   638     	iModel.DataStore()->SetCallSecureStatus( callData->IsSecureCall(), callData->GetCallId() );
   638         iModel.DataStore()->SetCallSecureStatus( callData->IsSecureCall(), callData->GetCallId() );
   639         iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() );
   639         iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() );
   640     	}
   640         }
   641     else
   641     else
   642     	{
   642         {
   643     	// Open new call failed
   643         // Open new call failed
   644     	ReleaseCallObject( callData->GetCallId() );
   644         ReleaseCallObject( callData->GetCallId() );
   645 		TEFLOGSTRING2( KTAERROR, 
   645         TEFLOGSTRING2( KTAERROR, 
   646 		        "VID CPEVideoCallHandling::DIALCALL ! OPENNEWCALL FAILED: MAY NOT PROCEED! %d", 
   646                 "VID CPEVideoCallHandling::DIALCALL ! OPENNEWCALL FAILED: MAY NOT PROCEED! %d", 
   647 		        errorCode );
   647                 errorCode );
   648 	    User::Leave( errorCode );
   648         User::Leave( errorCode );
   649     	}
   649         }
   650     return callData;
   650     return callData;
   651     }
   651     }
   652 
   652 
   653 // -----------------------------------------------------------------------------
   653 // -----------------------------------------------------------------------------
   654 // CPEVideoCallHandling::GetCallState
   654 // CPEVideoCallHandling::GetCallState