27 #include "cpeconferencecall.h" |
27 #include "cpeconferencecall.h" |
28 #include "cpecallarrayowner.h" |
28 #include "cpecallarrayowner.h" |
29 #include "mpecallhandling.h" |
29 #include "mpecallhandling.h" |
30 #include "cpecceobserver.h" |
30 #include "cpecceobserver.h" |
31 #include "cpesystemcallstate.h" |
31 #include "cpesystemcallstate.h" |
|
32 #include "tpematcher.h" |
32 |
33 |
33 #include <gsmerror.h> |
34 #include <gsmerror.h> |
34 #include <mpedatastore.h> |
35 #include <mpedatastore.h> |
35 #include <pepanic.pan> |
36 #include <pepanic.pan> |
36 #include <talogger.h> |
37 #include <talogger.h> |
37 #include <PSVariables.h> |
38 #include <PSVariables.h> |
38 #include <ctsydomainpskeys.h> |
39 #include <ctsydomainpskeys.h> |
39 #include <mccecall.h> |
40 #include <mccecall.h> |
40 #include <psetsaobserver.h> |
41 #include <psetsaobserver.h> |
41 #include <cccecallparameters.h> |
42 #include <cccecallparameters.h> |
|
43 #include <centralrepository.h> |
42 |
44 |
43 // EXTERNAL DATA STRUCTURES |
45 // EXTERNAL DATA STRUCTURES |
44 // None |
46 // None |
45 |
47 |
46 // EXTERNAL FUNCTION PROTOTYPES |
48 // EXTERNAL FUNCTION PROTOTYPES |
47 // None |
49 // None |
48 |
50 |
49 // CONSTANTS |
51 // CONSTANTS |
50 // None |
52 /****************************************************************************** |
|
53 * Telephony Configuration API |
|
54 * Keys under this category are used in defining telephony configuration. |
|
55 ******************************************************************************/ |
|
56 const TUid KCRUidTelConfiguration = {0x102828B8}; |
|
57 |
|
58 /** |
|
59 * Amount of digits to be used in contact matching. |
|
60 * This allows a customer to variate the amount of digits to be matched. |
|
61 */ |
|
62 const TUint32 KTelMatchDigits = 0x00000001; |
|
63 |
|
64 const TInt KPEMatchDefault = 7; |
51 |
65 |
52 // MACROS |
66 // MACROS |
53 // None |
67 // None |
54 |
68 |
55 // LOCAL CONSTANTS AND MACROS |
69 // LOCAL CONSTANTS AND MACROS |
435 |
452 |
436 case MEngineMonitor::EPEMessageRemotePartyInfoChanged: |
453 case MEngineMonitor::EPEMessageRemotePartyInfoChanged: |
437 { |
454 { |
438 TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged"); |
455 TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged"); |
439 // HO cases call type can changes |
456 // HO cases call type can changes |
440 CPESingleCall* connectedCall; |
457 CPESingleCall* call; |
441 connectedCall = iCallArrayOwner->CallPointerByState( EPEStateConnected ); |
458 call = static_cast<CPESingleCall*>( iCallArrayOwner->CallByCallId( aCallId ) ); |
442 |
459 |
443 if( connectedCall ) |
460 MCCECall& connectedCall = call->Call(); |
|
461 CCPCall::TCallType callType = connectedCall.Parameters().CallType(); |
|
462 |
|
463 if ( EPEStateConnected == call->GetCallState() ) |
444 { |
464 { |
445 CCPCall::TCallType callType = connectedCall->Call().Parameters().CallType(); |
|
446 |
|
447 if ( callType == CCPCall::ECallTypePS ) |
465 if ( callType == CCPCall::ECallTypePS ) |
448 { |
466 { |
449 TEFLOGSTRING( KTAMESINT, |
467 TEFLOGSTRING( KTAMESINT, |
450 "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to PS"); |
468 "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to PS"); |
451 iModel.DataStore()->SetCallType( EPECallTypeVoIP, aCallId ); |
469 iModel.DataStore()->SetCallType( EPECallTypeVoIP, aCallId ); |
452 iModel.DataStore()->SetServiceIdCommand( connectedCall->Call().Parameters().ServiceId() ); |
470 iModel.DataStore()->SetServiceIdCommand( call->Call().Parameters().ServiceId() ); |
453 iCallOpenParams->SetCallType( CCPCall::ECallTypePS); |
471 iCallOpenParams->SetCallType( CCPCall::ECallTypePS); |
454 } |
472 } |
455 else if ( callType == CCPCall::ECallTypeCSVoice ) |
473 else if ( callType == CCPCall::ECallTypeCSVoice ) |
456 { |
474 { |
457 TEFLOGSTRING( KTAMESINT, |
475 TEFLOGSTRING( KTAMESINT, |
458 "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to CS"); |
476 "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to CS"); |
459 iCallOpenParams->SetCallType( CCPCall::ECallTypeCSVoice ); |
477 iCallOpenParams->SetCallType( CCPCall::ECallTypeCSVoice ); |
460 iModel.DataStore()->SetServiceIdCommand( 1 ); |
478 iModel.DataStore()->SetServiceIdCommand( 1 ); |
461 iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId ); |
479 iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId ); |
|
480 if ( UpdateColpNumber( aCallId, connectedCall )) |
|
481 { |
|
482 iModel.SendMessage( MEngineMonitor::EPEMessageColpNumberAvailable, aCallId ); |
|
483 } |
462 } |
484 } |
463 } |
485 } |
464 } |
486 // CNAP informations must be in incoming call |
465 // Flow throught |
487 iModel.DataStore()->SetRemotePartyName( connectedCall.RemotePartyName(), aCallId ); |
466 |
488 iModel.DataStore()->SetRemotePhoneNumber( connectedCall.RemoteParty().Left( KPEPhoneNumberMaxLength ), aCallId ); |
|
489 iModel.DataStore()->SetCallIndex( connectedCall.CallIndex(), aCallId ); |
|
490 break; |
|
491 } |
|
492 |
467 case MEngineMonitor::EPEMessageIncoming: |
493 case MEngineMonitor::EPEMessageIncoming: |
468 { |
494 { |
|
495 TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::SendMessage -> EPEMessageIncoming"); |
469 CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId ); |
496 CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId ); |
470 if( callData ) |
497 if( callData ) |
471 { |
498 { |
472 MCCECall& call = callData->Call(); |
499 MCCECall& call = callData->Call(); |
473 iModel.DataStore()->SetRemotePartyName( call.RemotePartyName(), aCallId ); |
500 iModel.DataStore()->SetRemotePartyName( call.RemotePartyName(), aCallId ); |
868 //Terminate all ringing data calls, connected data calls and packet data connections |
895 //Terminate all ringing data calls, connected data calls and packet data connections |
869 return iVideoCallHandling->TerminateAllConnections(); |
896 return iVideoCallHandling->TerminateAllConnections(); |
870 } |
897 } |
871 |
898 |
872 // ----------------------------------------------------------------------------- |
899 // ----------------------------------------------------------------------------- |
873 // CPECallHandling::UpdatePhoneIdentity |
|
874 // Method updates phone identity |
|
875 // ----------------------------------------------------------------------------- |
|
876 // |
|
877 EXPORT_C TInt CPECallHandling::UpdatePhoneIdentity( |
|
878 MEngineMonitor::TPEMessagesFromPhoneEngine /*aMessage*/ ) |
|
879 { |
|
880 TInt retValue( KErrNone ); |
|
881 CSInfo csinfo; |
|
882 retValue = iConvergedCallEngine.GetCSInfo( csinfo ); |
|
883 |
|
884 TPEPhoneIdentityParameters phoneIdentityParameters; |
|
885 |
|
886 phoneIdentityParameters.iSerialNumber = csinfo.iSerialNumber; |
|
887 |
|
888 iModel.DataStore()->SetPhoneIdentityParameters( phoneIdentityParameters ); |
|
889 |
|
890 SendMessage( MEngineMonitor::EPEMessageShowIMEI ); |
|
891 return retValue; |
|
892 } |
|
893 |
|
894 // ----------------------------------------------------------------------------- |
|
895 // CPECallHandling::IsCallInState |
900 // CPECallHandling::IsCallInState |
896 // returns ETrue if there is a call in given state; otherwise EFalse |
901 // returns ETrue if there is a call in given state; otherwise EFalse |
897 // ----------------------------------------------------------------------------- |
902 // ----------------------------------------------------------------------------- |
898 // |
903 // |
899 EXPORT_C TBool CPECallHandling::IsCallInState( TPEState aState ) const |
904 EXPORT_C TBool CPECallHandling::IsCallInState( TPEState aState ) const |
1947 } |
1952 } |
1948 |
1953 |
1949 TEFLOGSTRING( KTAINT, "CALL CPECallHandling::CreateConferenceCallL end" ); |
1954 TEFLOGSTRING( KTAINT, "CALL CPECallHandling::CreateConferenceCallL end" ); |
1950 } |
1955 } |
1951 |
1956 |
1952 // ----------------------------------------------------------------------------- |
1957 |
1953 // CPECallHandling::GetLifeTime |
|
1954 // ----------------------------------------------------------------------------- |
|
1955 // |
|
1956 EXPORT_C TBool CPECallHandling::GetLifeTime( TDes8& aLifeTimeInfo ) |
|
1957 { |
|
1958 TEFLOGSTRING( KTAINT, "CALL CPECallHandling::GetLifeTime" ); |
|
1959 return iConvergedCallEngine.GetLifeTime( aLifeTimeInfo ); |
|
1960 } |
|
1961 |
|
1962 // ----------------------------------------------------------------------------- |
1958 // ----------------------------------------------------------------------------- |
1963 // CPECallHandling::UpdateSaSetting |
1959 // CPECallHandling::UpdateSaSetting |
1964 // ----------------------------------------------------------------------------- |
1960 // ----------------------------------------------------------------------------- |
1965 // |
1961 // |
1966 void CPECallHandling::UpdateSaSetting() |
1962 void CPECallHandling::UpdateSaSetting() |
2416 } |
2412 } |
2417 } |
2413 } |
2418 } |
2414 } |
2419 |
2415 |
2420 |
2416 |
|
2417 // ----------------------------------------------------------------------------- |
|
2418 // CPECallHandling::UpdateColpNumber |
|
2419 // ----------------------------------------------------------------------------- |
|
2420 // |
|
2421 TBool CPECallHandling::UpdateColpNumber( TInt aCallId, const MCCECall& aCall ) const |
|
2422 { |
|
2423 TEFLOGSTRING( KTAINT, "CALL CPECallHandling::UpdateColpNumber" ); |
|
2424 |
|
2425 TBool updateDone( EFalse ); |
|
2426 TInt errorCode( KErrNone ); |
|
2427 TInt value( KPEMatchDefault ); |
|
2428 TPEMatcher matcher; |
|
2429 TPEPhoneNumber remoteNumber; |
|
2430 |
|
2431 MPEDataStore* dataStore = iModel.DataStore(); |
|
2432 |
|
2433 if ( dataStore->RemoteColpNumber( aCallId ).Length() ) |
|
2434 { |
|
2435 remoteNumber = dataStore->RemoteColpNumber( aCallId ); |
|
2436 } |
|
2437 else |
|
2438 { |
|
2439 remoteNumber = dataStore->RemotePhoneNumber( aCallId ); |
|
2440 } |
|
2441 |
|
2442 const TPEPhoneNumber& updatedNumber = aCall.RemoteParty(); |
|
2443 |
|
2444 errorCode = iRepository->Get( KTelMatchDigits, value ); |
|
2445 if ( !errorCode == KErrNone ) |
|
2446 { |
|
2447 TEFLOGSTRING( KTAOBJECT, "Reading KTelMatchDigits failed, use default value for matching"); |
|
2448 } |
|
2449 |
|
2450 //check if remote number is different from dialled number |
|
2451 if ( !matcher.numbersMatch( remoteNumber, updatedNumber, value ) ) |
|
2452 { |
|
2453 //set COLP number |
|
2454 dataStore->SetRemoteColpNumber( updatedNumber, aCallId ); |
|
2455 |
|
2456 TEFLOGSTRING3( KTAMESINT, |
|
2457 "CPECallHandling::UpdateColpNumber, colp number: '%S', call id: %d", |
|
2458 &updatedNumber, aCallId ); |
|
2459 updateDone = ETrue; |
|
2460 } |
|
2461 |
|
2462 return updateDone; |
|
2463 } |
|
2464 |
|
2465 |
2421 // End of File |
2466 // End of File |