phoneengine/callhandling/src/cpecallhandling.cpp
changeset 1 838b0a10d15b
parent 0 5f000ab63145
child 3 8871b09be73b
equal deleted inserted replaced
0:5f000ab63145 1:838b0a10d15b
    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>
       
    44 #include    <telconfigcrkeys.h>
    42 
    45 
    43 // EXTERNAL DATA STRUCTURES
    46 // EXTERNAL DATA STRUCTURES
    44 // None
    47 // None
    45 
    48 
    46 // EXTERNAL FUNCTION PROTOTYPES  
    49 // EXTERNAL FUNCTION PROTOTYPES  
    47 // None
    50 // None
    48 
    51 
    49 // CONSTANTS
    52 // CONSTANTS
    50 // None
    53 const TInt KPEMatchDefault = 7;
    51 
    54 
    52 // MACROS
    55 // MACROS
    53 // None
    56 // None
    54 
    57 
    55 // LOCAL CONSTANTS AND MACROS
    58 // LOCAL CONSTANTS AND MACROS
    90 // Destructor
    93 // Destructor
    91 EXPORT_C CPECallHandling::~CPECallHandling()
    94 EXPORT_C CPECallHandling::~CPECallHandling()
    92     {  
    95     {  
    93     TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::~CPECallHandling() start");
    96     TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::~CPECallHandling() start");
    94     
    97     
       
    98     delete iRepository;
    95     delete iSystemCallState;
    99     delete iSystemCallState;
    96     delete iDtmfHandling;
   100     delete iDtmfHandling;
    97     
   101     
    98     // No need to uninitialize feature manager - this is done in MPEPhoneModelInternal .cpp
   102     // No need to uninitialize feature manager - this is done in MPEPhoneModelInternal .cpp
    99         
   103         
   161             *iCallArrayOwner );
   165             *iCallArrayOwner );
   162                                                           
   166                                                           
   163     iCallOpenParams = CCCECallParameters::NewL();
   167     iCallOpenParams = CCCECallParameters::NewL();
   164     
   168     
   165     iSystemCallState = CPESystemCallState::NewL( *iCallArrayOwner, *iModel.DataStore() );
   169     iSystemCallState = CPESystemCallState::NewL( *iCallArrayOwner, *iModel.DataStore() );
       
   170     
       
   171     iRepository = CRepository::NewL( KCRUidTelConfiguration );
   166     
   172     
   167     TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::BaseConstructL() complete");
   173     TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::BaseConstructL() complete");
   168     }
   174     }
   169 
   175 
   170 // -----------------------------------------------------------------------------
   176 // -----------------------------------------------------------------------------
   440             CPESingleCall* connectedCall;
   446             CPESingleCall* connectedCall;
   441             connectedCall = iCallArrayOwner->CallPointerByState( EPEStateConnected );
   447             connectedCall = iCallArrayOwner->CallPointerByState( EPEStateConnected );
   442             
   448             
   443             if( connectedCall )
   449             if( connectedCall )
   444                 {
   450                 {
   445                 CCPCall::TCallType callType = connectedCall->Call().Parameters().CallType();
   451                 MCCECall& call = connectedCall->Call();
       
   452                 CCPCall::TCallType callType = call.Parameters().CallType();
   446                 
   453                 
   447                 if ( callType == CCPCall::ECallTypePS ) 
   454                 if ( callType == CCPCall::ECallTypePS ) 
   448                     {
   455                     {
   449                     TEFLOGSTRING( KTAMESINT, 
   456                     TEFLOGSTRING( KTAMESINT, 
   450                         "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to PS");
   457                         "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to PS");
   456                     {
   463                     {
   457                      TEFLOGSTRING( KTAMESINT, 
   464                      TEFLOGSTRING( KTAMESINT, 
   458                         "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to CS");
   465                         "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to CS");
   459                     iCallOpenParams->SetCallType( CCPCall::ECallTypeCSVoice );
   466                     iCallOpenParams->SetCallType( CCPCall::ECallTypeCSVoice );
   460                     iModel.DataStore()->SetServiceIdCommand( 1 );
   467                     iModel.DataStore()->SetServiceIdCommand( 1 );
   461                     iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId );    
   468                     iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId );  
       
   469                     SetColpNumber( aCallId, call );
   462                     }
   470                     }
       
   471                 
       
   472                 iModel.DataStore()->SetRemotePartyName( call.RemotePartyName(), aCallId );                
       
   473                 iModel.DataStore()->SetRemotePhoneNumber( call.RemoteParty(), aCallId );
       
   474                 iModel.DataStore()->SetCallIndex(call.CallIndex(), aCallId );
   463                 }
   475                 }
   464             }
   476             break;
   465        // Flow throught
   477             }
   466             
   478                    
   467         case MEngineMonitor::EPEMessageIncoming:
   479         case MEngineMonitor::EPEMessageIncoming:
   468             {
   480             {
       
   481             TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::SendMessage -> EPEMessageIncoming");
   469             CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId );
   482             CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId );
   470             if( callData )
   483             if( callData )
   471                 {
   484                 {
   472                 MCCECall& call = callData->Call();
   485                 MCCECall& call = callData->Call();
   473                 iModel.DataStore()->SetRemotePartyName( call.RemotePartyName(), aCallId );
   486                 iModel.DataStore()->SetRemotePartyName( call.RemotePartyName(), aCallId );
  2417                 }
  2430                 }
  2418             }                    
  2431             }                    
  2419         }                
  2432         }                
  2420     }
  2433     }
  2421 
  2434 
       
  2435 // -----------------------------------------------------------------------------
       
  2436 // CPECallHandling::SetColpNumber
       
  2437 // -----------------------------------------------------------------------------
       
  2438 //
       
  2439 void CPECallHandling::SetColpNumber( TInt aCallId, const MCCECall& aCall ) const
       
  2440     {
       
  2441     TEFLOGSTRING( KTAINT, "CALL CPECallHandling::SetColpNumber" );
       
  2442     
       
  2443     TInt errorCode( KErrNone );
       
  2444     TInt value( KPEMatchDefault );
       
  2445     TPEMatcher matcher;    
       
  2446     
       
  2447     const TPEPhoneNumber& origRemoteNumber = iModel.DataStore()->RemotePhoneNumber( aCallId );    
       
  2448     const TPEPhoneNumber& remoteNumber = aCall.RemoteParty();
       
  2449     
       
  2450     errorCode = iRepository->Get( KTelMatchDigits, value );
       
  2451 
       
  2452     if ( !errorCode == KErrNone )
       
  2453         {
       
  2454         TEFLOGSTRING( KTAOBJECT, "Reading KTelMatchDigits failed, use default value for matching");
       
  2455         }    
       
  2456     
       
  2457     //check if remote number is different from dialled number
       
  2458     if ( !matcher.numbersMatch( origRemoteNumber, remoteNumber, value ) )
       
  2459         {
       
  2460         //set COLP number        
       
  2461         iModel.DataStore()->SetRemoteColpNumber( remoteNumber, aCallId );
       
  2462         
       
  2463         TEFLOGSTRING3( KTAMESINT, 
       
  2464                 "CPECallHandling::SetColpNumber, colp number: '%S', call id: %d", 
       
  2465                 &remoteNumber, aCallId );
       
  2466         }        
       
  2467     }
       
  2468         
       
  2469 
  2422 
  2470 
  2423 //  End of File 
  2471 //  End of File