convergedcallengine/cce/src/cccecall.cpp
changeset 0 ff3b6d0fd310
child 12 ae8abd0db65c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Base class of call object
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 //  INCLUDE FILES
       
    20 #include "cccecall.h"
       
    21 #include <exterror.h>                // GSM error codes
       
    22 #include <gsmerror.h>
       
    23 #include <etelmm.h>
       
    24 #include <ccpdefs.h>
       
    25 
       
    26 #include <featmgr.h>
       
    27 
       
    28 #include "mccptransferprovider.h"
       
    29 #include "mccpcall.h"
       
    30 #include "mccecallobserver.h"
       
    31 #include "ccce.h"
       
    32 #include "cccelogger.h"
       
    33 #include "ccceutility.h"
       
    34 #include "cccedurationtimer.h"
       
    35 #include "mccpcscall.h"
       
    36 #include "cccecallcontainer.h"
       
    37 #include "cccetransfercontroller.h"
       
    38 #include "ccceconferencecall.h"
       
    39 #include "mccpforwardprovider.h"
       
    40 #include "cccecallobserverasynchroniser.h"
       
    41 #include "tccecallindex.h"
       
    42 
       
    43 // ======== MEMBER FUNCTIONS ========
       
    44 // ---------------------------------------------------------------------------
       
    45 // Constructor
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 CCCECall::CCCECall( CCCECallContainer& aCallContainer, TInt aCallId ) :
       
    49     iCallId( aCallId ),
       
    50     iCallContainer( aCallContainer ),
       
    51     iCallIndex( KInvalidCallIndex )
       
    52     {
       
    53     Reset();
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // Construct object
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 void CCCECall::ConstructL()
       
    61     {
       
    62     FeatureManager::InitializeLibL();
       
    63     iCCEDurationTimer = CCCEDurationTimer::NewL();
       
    64     iObserver = CCCECallObserverAsynchroniser::NewL();
       
    65     }
       
    66     
       
    67 // ---------------------------------------------------------------------------
       
    68 // Default Symbian constructor (object is left into cleanupstack)
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 CCCECall* CCCECall::NewLC( CCCECallContainer& aCallContainer, TInt aCallId )
       
    72     {
       
    73     CCCECall* self = new( ELeave ) CCCECall( aCallContainer, aCallId );
       
    74     CleanupStack::PushL( self );
       
    75     self->ConstructL();
       
    76     return self;
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------------------------
       
    80 // Destructor
       
    81 // ---------------------------------------------------------------------------
       
    82 //
       
    83 CCCECall::~CCCECall()
       
    84     {
       
    85     Reset();
       
    86     delete iCCEDurationTimer;
       
    87     delete iObserver;
       
    88     delete iCallParameters;
       
    89 	FeatureManager::UnInitializeLib();
       
    90     }
       
    91 
       
    92 // ---------------------------------------------------------------------------
       
    93 // SetObserver( MCCECallObserver& aObserver )
       
    94 // ---------------------------------------------------------------------------
       
    95 //
       
    96 void CCCECall::SetObserver( const MCCECallObserver& aObserver )
       
    97     {
       
    98     CCELOGSTRING2("id:%d CCCECall::SetObserver()", iCallId);
       
    99     
       
   100     iObserver->SetMCCECallObserver( const_cast<MCCECallObserver*>( &aObserver ));
       
   101     
       
   102     if (iCCEDurationTimer)
       
   103         {
       
   104         iCCEDurationTimer->SetObserver( iObserver );
       
   105         }
       
   106     }
       
   107 
       
   108 // ---------------------------------------------------------------------------
       
   109 // SetConvergedCall( MCCPCall* aCall )
       
   110 // ---------------------------------------------------------------------------
       
   111 //
       
   112 void CCCECall::SetConvergedCallL( MCCPCall* aCall, 
       
   113                                  TUid aImplementationUid,
       
   114                                  TBool aTransferred )
       
   115     {
       
   116     CCELOGSTRING2("id:%d CCCECall::SetConvergedCall():IN", iCallId);
       
   117        
       
   118     iCall = aCall;
       
   119     iImplementationUid = aImplementationUid;
       
   120     
       
   121     delete iCallParameters;
       
   122     iCallParameters = NULL;
       
   123     iCallParameters = aCall->Parameters().CloneL();
       
   124     
       
   125     
       
   126     // This object is now in use
       
   127 
       
   128     CCELOGSTRING3("id:%d CCCECall::SetConvergedCall: CallId = %d", iCallId, iCallId);
       
   129     // Reserve call id for this call
       
   130     // If this is transferred call then call id has been already reserved
       
   131     if( !aTransferred )
       
   132         {
       
   133         iCallContainer.ReserveCallInfoCallId( iCallId );    
       
   134         }
       
   135     
       
   136     CCELOGSTRING2("id:%d CCCECall::SetConvergedCall: CallId reserved", iCallId);
       
   137     
       
   138     // Set call direction
       
   139     if( aCall->IsMobileOriginated() ) 
       
   140         {
       
   141         CCELOGSTRING2("id:%d CCCECall::SetConvergedCall:Mobile originated call", iCallId);
       
   142         iCallDirection = CCPCall::EMobileOriginated;
       
   143         }
       
   144     else
       
   145         {
       
   146         CCELOGSTRING2("id:%d CCCECall::SetConvergedCall():Mobile terminated call", iCallId);
       
   147         
       
   148         if ( !aTransferred )
       
   149             {
       
   150             iCallState  = CCPCall::EStateRinging;
       
   151             }
       
   152         iCallDirection = CCPCall::EMobileTerminated;
       
   153         aCall->AddObserverL(*this);
       
   154         }
       
   155 
       
   156     TRAP_IGNORE( iTransferProvider = iCall->TransferProviderL(*this) );
       
   157     
       
   158     TRAP_IGNORE( iForwardProvider = iCall->ForwardProviderL(*this) );
       
   159 
       
   160     CCELOGSTRING2("id:%d CCCECall::SetConvergedCall():OUT", iCallId);
       
   161     }
       
   162 
       
   163 // ---------------------------------------------------------------------------
       
   164 // Returns implementationuid
       
   165 // ---------------------------------------------------------------------------
       
   166 //
       
   167 const TUid CCCECall::ImplementationUid() const
       
   168     {
       
   169     return iImplementationUid;
       
   170     }
       
   171 
       
   172 // ---------------------------------------------------------------------------
       
   173 // From base class MCCECallInfo
       
   174 // Returns direction of the call
       
   175 // ---------------------------------------------------------------------------
       
   176 //
       
   177 CCPCall::TCallDirection CCCECall::Direction() const
       
   178     {
       
   179     return iCallDirection;
       
   180     }
       
   181 
       
   182 // ---------------------------------------------------------------------------
       
   183 // From base class MCCECallInfo
       
   184 // Returns the type of the call
       
   185 // ---------------------------------------------------------------------------
       
   186 //
       
   187 CCPCall::TCallType CCCECall::CallType() const
       
   188     {
       
   189     if ( iCallParameters )
       
   190         {
       
   191         return iCallParameters->CallType();
       
   192         }
       
   193     return CCPCall::ECallTypeCSVoice;
       
   194     }
       
   195 
       
   196 // ---------------------------------------------------------------------------
       
   197 // From base class MCCECallInfo, MCCECall
       
   198 // Returns the index of the call
       
   199 // ---------------------------------------------------------------------------
       
   200 //
       
   201 TInt CCCECall::CallIndex() const
       
   202     {
       
   203     return iCallIndex;
       
   204     }
       
   205 
       
   206 // ---------------------------------------------------------------------------
       
   207 // ServiceId
       
   208 // ---------------------------------------------------------------------------
       
   209 //
       
   210 TUint32 CCCECall::ServiceId() const 
       
   211     {
       
   212     if( iCall )
       
   213         {
       
   214         return iCall->Parameters().ServiceId(); 
       
   215         }
       
   216     return 0;
       
   217     }
       
   218 
       
   219 // ---------------------------------------------------------------------------
       
   220 // Return ETrue if this call object is in use
       
   221 // ---------------------------------------------------------------------------
       
   222 //
       
   223 TBool CCCECall::IsInUse() const
       
   224     {
       
   225     CCELOGSTRING3("id:%d CCCECall::IsInUse() %d", iCallId, ( iCall != NULL ) );
       
   226     return ( iCall != NULL );
       
   227     }
       
   228 
       
   229 // ---------------------------------------------------------------------------
       
   230 // Return ETrue if this calls secure status can be specified
       
   231 // ---------------------------------------------------------------------------
       
   232 //
       
   233 TBool CCCECall::SecureSpecified() const
       
   234     {
       
   235     return iCall->SecureSpecified();
       
   236     }
       
   237 
       
   238 // ---------------------------------------------------------------------------
       
   239 // Return ETrue if this call object is secured
       
   240 // ---------------------------------------------------------------------------
       
   241 //
       
   242 TBool CCCECall::IsSecured() const
       
   243     {
       
   244     return iCall->IsSecured();
       
   245     }
       
   246 
       
   247 // ---------------------------------------------------------------------------
       
   248 // Return if call is an emergency call or not.
       
   249 // ---------------------------------------------------------------------------
       
   250 //
       
   251 TBool CCCECall::IsEmergency() const
       
   252     {
       
   253     return EFalse;
       
   254     }
       
   255 
       
   256 // ---------------------------------------------------------------------------
       
   257 // CCCECall::RemoteParty
       
   258 // ---------------------------------------------------------------------------
       
   259 //
       
   260 const TDesC& CCCECall::RemoteParty() const
       
   261     {
       
   262     if( iCall )
       
   263         {
       
   264         return iCall->RemoteParty();
       
   265         }
       
   266 
       
   267     return KNullDesC;
       
   268     }
       
   269 
       
   270 // ---------------------------------------------------------------------------
       
   271 // CCCECall::RemotePartyName
       
   272 // ---------------------------------------------------------------------------
       
   273 //
       
   274 const TDesC& CCCECall::RemotePartyName() const
       
   275     {
       
   276     if( iCall )
       
   277         {
       
   278         return iCall->RemotePartyName();
       
   279         }
       
   280 
       
   281     return KNullDesC;
       
   282     }
       
   283 
       
   284 // ---------------------------------------------------------------------------
       
   285 // CCCECall::DialledParty
       
   286 // ---------------------------------------------------------------------------
       
   287 //
       
   288 const TDesC& CCCECall::DialledParty() const
       
   289     {
       
   290     if( iCall )
       
   291         {
       
   292         return  iCall->DialledParty();
       
   293         }
       
   294 
       
   295     return KNullDesC;
       
   296     }
       
   297 
       
   298 // ---------------------------------------------------------------------------
       
   299 // Return current active request
       
   300 // ---------------------------------------------------------------------------
       
   301 //
       
   302 CCCECall::TCallRequest CCCECall::Request() const
       
   303     {
       
   304     return iActiveRequest;
       
   305     }
       
   306     
       
   307 // ---------------------------------------------------------------------------
       
   308 // Returns reference to converged call provider call object
       
   309 // ---------------------------------------------------------------------------
       
   310 //
       
   311 MCCPCall& CCCECall::GetCCPCall() const
       
   312     {
       
   313     return *iCall;
       
   314     }
       
   315 
       
   316 // ---------------------------------------------------------------------------
       
   317 // CallId()
       
   318 // Returns ID of the call
       
   319 // ---------------------------------------------------------------------------
       
   320 //
       
   321 TInt CCCECall::CallId() const
       
   322     {
       
   323     return iCallId;
       
   324     }
       
   325 
       
   326 // ---------------------------------------------------------------------------
       
   327 // From class MCCECall.
       
   328 // Hold()
       
   329 // ---------------------------------------------------------------------------
       
   330 //
       
   331 TInt CCCECall::Hold()
       
   332     {
       
   333     CCELOGSTRING2( "id:%d CCCECall::Hold() ", iCallId);
       
   334     TInt error = KErrNone;
       
   335     
       
   336     if( iCallState != CCPCall::EStateConnected )
       
   337         {
       
   338         if( iCallState == CCPCall::EStateHold )
       
   339             {
       
   340             error = KErrAlreadyExists;
       
   341             }
       
   342         else
       
   343             {
       
   344             error = KErrNotReady;
       
   345             }
       
   346         }
       
   347     else
       
   348         {
       
   349         iActiveRequest = ECCEHold;
       
   350         error = iCall->Hold();
       
   351         }
       
   352 
       
   353     return error;
       
   354     }
       
   355 
       
   356 // ---------------------------------------------------------------------------
       
   357 // From class MCCECall.
       
   358 // Resume()
       
   359 // ---------------------------------------------------------------------------
       
   360 //
       
   361 TInt CCCECall::Resume()
       
   362     {
       
   363     CCELOGSTRING2( "id:%d CCCECall::Resume()", iCallId );
       
   364     TInt error = KErrNone;
       
   365     
       
   366     if( iCallState != CCPCall::EStateHold )
       
   367         {
       
   368         if( iCallState == CCPCall::EStateConnected )
       
   369             {
       
   370             error = KErrAlreadyExists;
       
   371             }
       
   372         else
       
   373             {
       
   374             error = KErrNotReady;
       
   375             }
       
   376         }
       
   377     else
       
   378         {
       
   379         iActiveRequest = ECCEResume;
       
   380         error = iCall->Resume();
       
   381         }
       
   382 
       
   383     return error;
       
   384     }
       
   385 
       
   386 // ---------------------------------------------------------------------------
       
   387 // From class MCCECall.
       
   388 // HangUp()
       
   389 // ---------------------------------------------------------------------------
       
   390 //
       
   391 TInt CCCECall::HangUp()
       
   392     {
       
   393     CCELOGSTRING3("id:%d CCCECall::HangUp() callstate = %d", iCallId, iCallState);
       
   394 
       
   395     TInt error = KErrNone;
       
   396 
       
   397     // Inform that currently ongoing request is canceled
       
   398     if( iActiveRequest != ECCENone &&
       
   399         iActiveRequest != ECCEReleaseActive &&
       
   400         iActiveRequest != ECCEReleaseHeld &&
       
   401         iActiveRequest != ECCEReleaseOutgoing &&
       
   402         iActiveRequest != ECCETerminateDisconnected )
       
   403         {
       
   404         RequestComplete( ECCPErrorCancel );
       
   405         }
       
   406     
       
   407     switch(iCallState)
       
   408         {
       
   409         case CCPCall::EStateDialling:
       
   410             CCELOGSTRING2("id:%d CCCECall::HangUp(): DialCancel: Cancel", iCallId);
       
   411             iActiveRequest = ECCEReleaseOutgoing;
       
   412 
       
   413             error = iCall->Cancel();
       
   414 
       
   415             RequestComplete( ECCPErrorNone );
       
   416             CallStateChanged( MCCPCallObserver::ECCPStateIdle, EFalse );
       
   417             break;
       
   418             
       
   419         case CCPCall::EStateConnecting:
       
   420             CCELOGSTRING2("id:%d CCCECall::HangUp(): DialCancel: HangUp", iCallId);
       
   421             iActiveRequest = ECCEReleaseOutgoing;
       
   422             NotifyCallStatusChange( 
       
   423                     CCPCall::EStateDisconnecting, ETrue, CCECallEnums::ENoNotify );
       
   424             error = iCall->HangUp();
       
   425             break;
       
   426 
       
   427         case CCPCall::EStateAnswering:
       
   428         case CCPCall::EStateRinging:
       
   429         case CCPCall::EStateQueued:
       
   430             CCELOGSTRING2("id:%d CCCECall::HangUpL: Reject", iCallId);
       
   431             iActiveRequest = ECCERejectIncoming;
       
   432             // Set exitcode to rejected to avoid 
       
   433             // missed call notification
       
   434             iExitCode = ECCPErrorRejected;
       
   435             NotifyCallStatusChange( 
       
   436                     CCPCall::EStateDisconnecting, ETrue, CCECallEnums::ENoNotify );
       
   437             error = iCall->Reject();
       
   438             break;
       
   439             
       
   440         case CCPCall::EStateDisconnecting: 
       
   441             if( ECCETerminateDisconnected != iActiveRequest &&
       
   442                 ECCEReleaseOutgoing != iActiveRequest )
       
   443                 {
       
   444                 RequestComplete( ECCPErrorNone );
       
   445                 iActiveRequest = ECCETerminateDisconnected;
       
   446                 error = iCall->HangUp();
       
   447                 }
       
   448             else 
       
   449                 {
       
   450                 error = KErrGeneral;  
       
   451                 }   
       
   452             break;
       
   453             
       
   454         case CCPCall::EStateIdle:
       
   455             error = KErrAlreadyExists;
       
   456             break;
       
   457             
       
   458         case CCPCall::EStateHold:
       
   459             iActiveRequest = ECCEReleaseHeld;
       
   460             iCCEDurationTimer->Stop();
       
   461             NotifyCallStatusChange( 
       
   462                     CCPCall::EStateDisconnecting, ETrue, CCECallEnums::ENoNotify );
       
   463             error = iCall->HangUp();
       
   464             break;
       
   465             
       
   466         case CCPCall::EStateConnected:
       
   467             iActiveRequest = ECCEReleaseActive;
       
   468             iCCEDurationTimer->Stop();
       
   469             NotifyCallStatusChange( 
       
   470                     CCPCall::EStateDisconnecting, ETrue, CCECallEnums::ENoNotify );
       
   471             error = iCall->HangUp();
       
   472             break;
       
   473             
       
   474         default:
       
   475             CCCEUtility::Panic( ECCEPanicInvalidState ); 
       
   476             break;
       
   477         }
       
   478         
       
   479 
       
   480 
       
   481     // If hangup was completed successfully, change
       
   482     // call status to disconnecting. This must be done
       
   483     // because if hangup was caused by replace -command
       
   484     // and in that case AnswerIncomingCall is called right
       
   485     // after hangup. If call is not changed to disconnecting
       
   486     // state, ResumeAutomaticallyHeldCall would try to
       
   487     // resume this call and it causes error.
       
   488     return error;
       
   489     }
       
   490 
       
   491 // ---------------------------------------------------------------------------
       
   492 // Swap()
       
   493 // ---------------------------------------------------------------------------
       
   494 //
       
   495 TInt CCCECall::Swap()
       
   496     {
       
   497     CCELOGSTRING2( "id:%d CCCECall::Swap()", iCallId );
       
   498     
       
   499     TInt error = KErrNone;
       
   500 
       
   501     // if there is other CSProvider call use swap instead of Hold
       
   502     if ( ( iImplementationUid == KCSProviderUid || 
       
   503            iImplementationUid == KVCCProviderUid ) && 
       
   504          ( IsCsPlugin() ) && 
       
   505            1 < iCallContainer.CountCsCalls( iImplementationUid ) )
       
   506         {
       
   507         error = iCall->Swap();
       
   508         }
       
   509     else if( iCallState == CCPCall::EStateConnected )
       
   510         {
       
   511         // Swapping starts - 1.phase
       
   512         error = HoldNoNotify();
       
   513         }
       
   514     else
       
   515         {
       
   516         error = KErrNotReady;
       
   517         
       
   518         iActiveRequest = ECCENone;
       
   519         }
       
   520 
       
   521     if( !error )
       
   522         {
       
   523         // Everything went ok
       
   524         iActiveRequest = ECCESwap;
       
   525         }
       
   526 
       
   527     return error;
       
   528     }
       
   529 
       
   530 // ---------------------------------------------------------------------------
       
   531 // NotifyRequestComplete( TInt aRequest, TCCPError aError )
       
   532 // ---------------------------------------------------------------------------
       
   533 //
       
   534 void CCCECall::NotifyRequestComplete( TInt aRequest, TCCPError aError )
       
   535     {
       
   536     CCELOGSTRING4("id:%d CCCECall::NotifyRequestComplete: aRequest = %d, aError = %d", 
       
   537         iCallId, aRequest, aError );
       
   538 
       
   539     // Notify observer, if NoNotify is NOT set
       
   540     if ( aRequest == iDoNotReportRequest )
       
   541         {
       
   542         iDoNotReportRequest = KErrNotFound;
       
   543         }
       
   544     else
       
   545         {
       
   546         if( iObserver )
       
   547             {
       
   548             iObserver->ErrorOccurred( aError );
       
   549             }
       
   550         else
       
   551             {
       
   552             CCELOGSTRING( "CCCECall::NotifyRequestComplete: observer was NOT set!" );
       
   553             }
       
   554         }
       
   555     }
       
   556 
       
   557 // ---------------------------------------------------------------------------
       
   558 // GetMobileCallInfo( TDes8& aCallInfo ) const
       
   559 // TODO: We should use our own packet instead of TMobileCallInfoV3Pckg
       
   560 // ---------------------------------------------------------------------------
       
   561 //
       
   562 void CCCECall::GetMobileCallInfo( TDes8& aCallInfo ) const
       
   563     {
       
   564     CCELOGSTRING3("id:%d CCCECall::GetMobileCallInfo() Call = %d", iCallId, iCallId);
       
   565     
       
   566     RMobileCall::TMobileCallInfoV3Pckg& pckg =
       
   567         reinterpret_cast<RMobileCall::TMobileCallInfoV3Pckg&>( aCallInfo );
       
   568 
       
   569     // Check for call object needed, due call info can be fetched
       
   570     // also if dial fails.
       
   571     if ( iCall )
       
   572         {
       
   573         RMobileCall::TMobileCallStatus state = RMobileCall::EStatusUnknown;
       
   574 
       
   575         switch(iCallState)
       
   576             {
       
   577             case CCPCall::EStateIdle:
       
   578                 state = RMobileCall::EStatusIdle;
       
   579                 break;
       
   580             case CCPCall::EStateRinging:
       
   581                 state = RMobileCall::EStatusRinging;
       
   582                 break;
       
   583             case CCPCall::EStateConnecting:
       
   584                 state = RMobileCall::EStatusConnecting;
       
   585                 break;
       
   586             case CCPCall::EStateConnected:
       
   587                 state = RMobileCall::EStatusConnected;
       
   588                 break;
       
   589             case CCPCall::EStateDisconnecting:
       
   590                 state = RMobileCall::EStatusDisconnecting;
       
   591                 break;
       
   592             case CCPCall::EStateHold:
       
   593                 state = RMobileCall::EStatusHold;
       
   594                 break;
       
   595             case CCPCall::EStateTransferring:
       
   596                 state = RMobileCall::EStatusTransferring;
       
   597                 break;
       
   598             case CCPCall::EStateForwarding:
       
   599                 state = RMobileCall::EStatusConnecting;
       
   600                 break;
       
   601             case CCPCall::EStateQueued:
       
   602                 state = RMobileCall::EStatusRinging;
       
   603                 break;
       
   604             case CCPCall::EStateAnswering:
       
   605                 state = RMobileCall::EStatusAnswering;
       
   606                 break;
       
   607             case CCPCall::EStateDialling:
       
   608                 state = RMobileCall::EStatusDialling;
       
   609                 break;
       
   610             default:
       
   611                 state = RMobileCall::EStatusUnknown;
       
   612                 break;
       
   613             }
       
   614         
       
   615         if( IsCsPlugin() )
       
   616             {
       
   617             TInt error = 
       
   618                 static_cast<MCCPCSCall*>(iCall)->GetMobileCallInfo(aCallInfo);
       
   619             
       
   620             pckg().iCallId = iCallId+1;
       
   621             pckg().iStatus = state;
       
   622             pckg().iDuration = iCCEDurationTimer->NumberOfBeats();
       
   623             return;
       
   624             }
       
   625 
       
   626         TInt err = KErrNone;
       
   627         switch( iExitCode )
       
   628             {
       
   629             case ECCPErrorNone:
       
   630                 break;
       
   631             /**
       
   632             General: KErrNotFound
       
   633             */
       
   634             case ECCPErrorNotFound:
       
   635                 err = KErrNotFound;
       
   636                 break;
       
   637             /**
       
   638             General: KErrGeneral 
       
   639             */
       
   640             case ECCPErrorGeneral:
       
   641                 err = KErrGeneral;
       
   642                 break;
       
   643 
       
   644             /**
       
   645             General: KErrCancel
       
   646             */
       
   647             case ECCPErrorCancel:
       
   648                 err = KErrCancel;
       
   649                 break;
       
   650 
       
   651             /** 
       
   652             General: KErrNoMemory */
       
   653             case ECCPErrorNoMemory:
       
   654                 err = KErrNoMemory;
       
   655                 break;
       
   656 
       
   657             /** 
       
   658             General: KErrNotSupported */
       
   659             case ECCPErrorNotSupported:
       
   660                 err = KErrNotSupported;
       
   661                 break;
       
   662                 
       
   663             /**
       
   664             General: KErrInUse
       
   665             */
       
   666             case ECCPErrorAlreadyInUse:
       
   667                 err = KErrInUse;
       
   668                 break;
       
   669 
       
   670             /**
       
   671             No corresponding cs/sip error identified yet.
       
   672             */
       
   673             case ECCPErrorNotReady:
       
   674                 err = KErrNotReady;
       
   675                 break;
       
   676 
       
   677             /** 
       
   678             KErrGsmCCFacilityRejected
       
   679             KErrGsmCallServerFail
       
   680             KErrGsm0707NotFound
       
   681             */
       
   682             case ECCPErrorRejected:
       
   683             case ECCPErrorCCFacilityRejected:
       
   684                 err = KErrGsmCCFacilityRejected;
       
   685                 break;
       
   686 
       
   687             /** 
       
   688             KErrGsmCCUnassignedNumber 
       
   689             SIP: 404 Not found
       
   690             */
       
   691             case ECCPErrorNotReached:
       
   692                 err = KErrGsmCCUnassignedNumber;
       
   693                 break;
       
   694 
       
   695             /** KErrGsmCCNumberChanged
       
   696             SIP: 301 Moved permanently/410 Gone
       
   697             */
       
   698             case ECCPErrorMovedPermanently:
       
   699                 err = KErrGsmCCNumberChanged;
       
   700                 break;
       
   701             /**
       
   702             KErrGsmCCInvalidNumberFormat
       
   703             SIP: BadUri
       
   704             */
       
   705             case ECCPErrorInvalidURI:
       
   706                 err = KErrGsmCCInvalidNumberFormat;
       
   707                 break;
       
   708 
       
   709             /** 
       
   710             KErrGsmCCNetworkOutOfOrder
       
   711             SIP: 502 Bad gateway
       
   712             (redial logic needs)
       
   713             */
       
   714             case ECCPErrorNetworkOutOfOrder:
       
   715                 err = KErrGsmCCNetworkOutOfOrder;
       
   716                 break;
       
   717 
       
   718             /** 
       
   719             KErrGsmCCUserBusy
       
   720             SIP: 486 Busy here
       
   721             */
       
   722             case ECCPErrorBusy:
       
   723                 err = KErrGsmCCUserBusy;
       
   724                 break;
       
   725 
       
   726             /** 
       
   727             KErrGsmCCUserNotResponding
       
   728             SIP: 480 Temporarily unavailable
       
   729             */
       
   730             case ECCPErrorNotResponding:
       
   731             case ECCPErrorCCUserNotResponding:
       
   732                 err = KErrGsmCCUserNotResponding;
       
   733                 break;
       
   734 
       
   735             /** 
       
   736             KErrGsmCCTemporaryFailure
       
   737             SIP: 500 Internal server error
       
   738             KErrGsmCCSwitchingEquipmentCongestion
       
   739             SIP: 503 Service unavailable
       
   740             KErrGsmCCRequestedChannelNotAvailable
       
   741             */
       
   742             case ECCPErrorNetworkBusy:
       
   743                 err = KErrGsmCCTemporaryFailure;
       
   744                 break;
       
   745 
       
   746             /** 
       
   747             KErrGsmCCNoRouteToDestination
       
   748             SIP: 404 Not Found
       
   749             SIP: 404 Not found / Timeout
       
   750             SIP: 503 Service unavailable
       
   751             */
       
   752             case ECCPErrorConnectionErrorRedial:
       
   753             case ECCPErrorCCNoRouteToDestination:
       
   754                 err = KErrGsmCCNoRouteToDestination;
       
   755                 break;
       
   756 
       
   757             /**
       
   758             KErrArgument
       
   759             */
       
   760             case ECCPErrorInvalidPhoneNumber:
       
   761                 err = KErrArgument;
       
   762                 break;
       
   763 
       
   764             /**
       
   765             KErrGsmNoService
       
   766             */
       
   767             case ECCPErrorNoService:
       
   768                 err = KErrGsmNoService;
       
   769                 break;
       
   770 
       
   771             /**
       
   772             KErrGsmNoNumber
       
   773             */
       
   774             case ECCPErrorInvalidPhoneNumberCancelRedial:
       
   775                 err = KErrGsmNoNumber;
       
   776                 break;
       
   777 
       
   778             /**
       
   779             KErrGsmReleaseByUser
       
   780             */
       
   781             case ECCPErrorReleaseByUserForCancelRedial:
       
   782                 err = KErrGsmReleaseByUser;
       
   783                 break;
       
   784 
       
   785             /**
       
   786             KErrGsmCCRequestedFacilityNotImplemented
       
   787             */
       
   788             case ECCPErrorServiceSettingError:
       
   789                 err = KErrGsmCCRequestedFacilityNotImplemented;
       
   790                 break;
       
   791 
       
   792             /**
       
   793             KErrGsm0707SimNotInserted
       
   794             KErrGsm0707SIMPuk1Required
       
   795             KErrGsm0707SimPin1Required
       
   796             KErrGsm0707SimPin2Required
       
   797             KErrGsm0707SimFailure
       
   798             KErrGsm0707PhoneToSimLockRequired
       
   799             KErrGsm0707SimWrong
       
   800             */
       
   801             case ECCPErrorAuthenticationFailed:
       
   802                 err = KErrGsm0707SimNotInserted;
       
   803                 break;
       
   804 
       
   805             /**
       
   806             KErrGsmOfflineOpNotAllowed
       
   807             */
       
   808             case ECCPErrorNotAllowedInOfflineMode:
       
   809                 err = KErrGsmOfflineOpNotAllowed;
       
   810                 break;
       
   811 
       
   812             /**
       
   813             KErrMMEtelCallForbidden
       
   814             KErrGsmCallInProgress
       
   815             KErrGsmNumberBarred
       
   816             KErrGsmNotAllowed
       
   817             KErrEtelCallNotActive
       
   818             KErrEtelCallAlreadyActive
       
   819             SIP: 403 Forbidden
       
   820             */
       
   821             case ECCPErrorNotAllowed:
       
   822                 err = KErrGsmNotAllowed;
       
   823                 break;
       
   824 
       
   825             /**
       
   826             KErrTimedOut
       
   827             */
       
   828             case ECCPErrorTimedOut:
       
   829                 err = KErrTimedOut;
       
   830                 break;
       
   831 
       
   832             /**
       
   833             KErrGsmInvalidFdn
       
   834             */
       
   835             case ECCPErrorInvalidFDN:
       
   836                 err = KErrGsmInvalidFdn;
       
   837                 break;
       
   838 
       
   839             /**
       
   840             KErrGsmCCChannelUnacceptable
       
   841             */
       
   842             case ECCPErrorUnacceptableChannel:
       
   843                 err = KErrGsmCCChannelUnacceptable;
       
   844                 break;
       
   845 
       
   846             /**
       
   847             KErrGsmCCAccessInformationDiscarded
       
   848             */
       
   849             case ECCPErrorAccessInformationDiscarded:
       
   850                 err = KErrGsmCCAccessInformationDiscarded;
       
   851                 break;
       
   852 
       
   853             /**
       
   854             KErrGsmCCQualityOfServiceNotAvailable
       
   855             */
       
   856             case ECCPErrorQualityOfServiceNotAvailable:
       
   857                 err = KErrGsmCCQualityOfServiceNotAvailable;
       
   858                 break;
       
   859 
       
   860             /**
       
   861             KErrGsmCCInvalidCallReferenceValue
       
   862             */
       
   863             case ECCPErrorInvalidCallReferenceValue:
       
   864                 err = KErrGsmCCInvalidCallReferenceValue;
       
   865                 break;
       
   866 
       
   867             /**
       
   868             KErrGsmCCInvalidTransitNetworkSelection
       
   869             KErrGsmCCSemanticallyIncorrectMessage
       
   870             KErrGsmCCConditionalIEError
       
   871             SIP: 400 Bad request
       
   872             KErrGsmCCUnspecifiedProtocolError
       
   873             SIP: 400 Bad request
       
   874             SIP: 400 Bad request
       
   875             */
       
   876             case ECCPErrorConnectionError:
       
   877             case ECCPErrorCCInvalidTransitNetworkSelection:
       
   878                 err = KErrGsmCCInvalidTransitNetworkSelection;
       
   879                 break;
       
   880 
       
   881             /**
       
   882             KErrGsmCCIncompatibleDestination
       
   883             SIP: 400 Bad request
       
   884             */
       
   885             case ECCPErrorBadRequest:
       
   886             case ECCPErrorCCIncompatibleDestination:
       
   887                 err = KErrGsmCCIncompatibleDestination;
       
   888                 break;
       
   889 
       
   890             /**
       
   891             KErrGsmCCOperatorDeterminedBarring
       
   892             SIP: 403 Forbidden
       
   893             */
       
   894             case ECCPErrorNumberBarred:
       
   895                 err = KErrGsmCCOperatorDeterminedBarring;
       
   896                 break;
       
   897 
       
   898             /**
       
   899             KErrGsmCCNormalUnspecified
       
   900             400 Bad request
       
   901             */
       
   902             case ECCPErrorNoAnswerForVideo:
       
   903                 err = KErrGsmCCNormalUnspecified;
       
   904                 break;
       
   905 
       
   906             /**
       
   907             KErrPhoneEngineNoWcdmaNetwork
       
   908             */
       
   909             case ECCPErrorVideoCallNotSupportedByNetwork:
       
   910             //  err = KErrPhoneEngineNoWcdmaNetwork;
       
   911                 break;
       
   912 
       
   913             /**
       
   914             KErrPhoneEngineVideoCallNotAllowedDuringRestore
       
   915             */
       
   916             case ECCPErrorVideoCallNotAllowedDuringRestore:
       
   917             //  err = KErrPhoneEngineVideoCallNotAllowedDuringRestore;
       
   918                 break;
       
   919                 
       
   920             /**
       
   921             KErrPhoneEngineVideoCallSetupFailed
       
   922             */
       
   923             case ECCPErrorVideoCallSetupFailed:
       
   924             //  err = KErrPhoneEngineVideoCallSetupFailed;
       
   925                 break;
       
   926 
       
   927             /**
       
   928             KErrDiagnosticInfoBarredWithCUG
       
   929             */
       
   930             case ECCPErrorCUGOutgoingCallsBarred:
       
   931     //            err = KErrDiagnosticInfoBarredWithCUG;
       
   932                 break;
       
   933 
       
   934             /**
       
   935             KErrDiagnosticInfoBarredNoCUG
       
   936             */
       
   937             case ECCPErrorCUGNotSelected:
       
   938      //           err = KErrDiagnosticInfoBarredNoCUG;
       
   939                 break;
       
   940 
       
   941             /**
       
   942             KErrDiagnosticInfoBarredUnknownCUG
       
   943             */
       
   944             case ECCPErrorCUGIndexUnknown:
       
   945      //           err = KErrDiagnosticInfoBarredUnknownCUG;
       
   946                 break;
       
   947 
       
   948             /**
       
   949             KErrDiagnosticInfoBarredIncompatibleCUG
       
   950             */
       
   951             case ECCPErrorCUGIndexIncompatible:
       
   952     //            err = KErrDiagnosticInfoBarredIncompatibleCUG;
       
   953                 break;
       
   954 
       
   955             /**
       
   956             KErrDiagnosticInfoBarredFailureCUG
       
   957             */
       
   958             case ECCPErrorCUGCallsFailure:
       
   959      //           err = KErrDiagnosticInfoBarredFailureCUG;
       
   960                 break;
       
   961 
       
   962             /**
       
   963             KErrDiagnosticInfoBarredClirNotSubscribed
       
   964             */
       
   965             case ECCPErrorCLIRNotSubscribed:
       
   966      //           err = KErrDiagnosticInfoBarredClirNotSubscribed;
       
   967                 break;
       
   968 
       
   969             /**
       
   970             KErrDiagnosticInfoBarredCCBSPossible
       
   971             */
       
   972             case ECCPErrorCCBSPossible:
       
   973       //          err = KErrDiagnosticInfoBarredCCBSPossible;
       
   974                 break;
       
   975 
       
   976             /**
       
   977             KErrDiagnosticInfoBarredCCBSNotPossible
       
   978             */
       
   979             case ECCPErrorCCBSNotPossible:
       
   980       //          err = KErrDiagnosticInfoBarredCCBSNotPossible;
       
   981                 break;
       
   982 
       
   983             /**
       
   984             Secure call failed.
       
   985             */
       
   986             case ECCPSecureCallFailed:
       
   987                 err = KErrGsmCCChannelUnacceptable;
       
   988                 break;
       
   989 
       
   990             /**
       
   991             Emergency call failed.
       
   992             */
       
   993             case ECCPEmergencyFailed:
       
   994                 err = KErrGsmCCAcmGreaterThanAcmMax;
       
   995                 break;
       
   996 
       
   997             /**
       
   998             Transfer failed.
       
   999             */
       
  1000             case ECCPTransferFailed:
       
  1001             /**
       
  1002             Local hold failed.
       
  1003             */
       
  1004             case ECCPLocalHoldFail:
       
  1005             /**
       
  1006             Local resume failed.
       
  1007             */
       
  1008             case ECCPLocalResumeFail:
       
  1009                 err = KErrGsmCCNormalUnspecified;
       
  1010                 break;
       
  1011 
       
  1012             /**
       
  1013             When none of other errors map and received a 3XX response. 
       
  1014             */
       
  1015             case ECCPRedirection:
       
  1016                 err = KErrGsmCCUnassignedNumber;
       
  1017                 break;
       
  1018 
       
  1019             /**
       
  1020             When none of other errors map and received a 4XX response. 
       
  1021             */
       
  1022             case ECCPRequestFailure:
       
  1023                 err = KErrGsmCCUnassignedNumber;
       
  1024                 break;
       
  1025 
       
  1026             /**
       
  1027             When none of other errors map and received a 5XX response. 
       
  1028 
       
  1029             */
       
  1030             case ECCPServerFailure:
       
  1031                 err = KErrGsmCallServerFail;
       
  1032                 break;
       
  1033 
       
  1034             /** 
       
  1035             When none of other errors map and received a 6XX response. 
       
  1036             */
       
  1037             case ECCPGlobalFailure:
       
  1038                 err = KErrGsmCCUnspecifiedProtocolError;
       
  1039                 break;
       
  1040 
       
  1041             /** Rtp detection media error. */
       
  1042             case ECCPErrorMedia:
       
  1043                 err = KErrGsmCCUnspecifiedProtocolError; // TODO
       
  1044                 break;
       
  1045 
       
  1046             /**
       
  1047             KErrGsmCCServiceNotImplemented
       
  1048             SIP 488 Not Acceptable Here 
       
  1049             SIP 606 Not Acceptable 
       
  1050             */
       
  1051             case ECCPErrorNotAcceptable:
       
  1052             case ECCPErrorCCServiceNotImplemented:
       
  1053                 err = KErrGsmCCServiceNotImplemented;
       
  1054                 break;
       
  1055             
       
  1056             /* Access denied error */
       
  1057             case ECCPErrorAccessDenied:
       
  1058                 err = KErrAccessDenied;
       
  1059                 break;
       
  1060 
       
  1061 
       
  1062             /**
       
  1063             KErrGsmCCDestinationOutOfOrder
       
  1064             */
       
  1065             case ECCPErrorCCDestinationOutOfOrder:                
       
  1066                 err = KErrGsmCCDestinationOutOfOrder;
       
  1067                 break;
       
  1068 
       
  1069             /**
       
  1070             KErrGsmCCResourceNotAvailable
       
  1071             */
       
  1072             case ECCPErrorCCResourceNotAvailable:
       
  1073                 err = KErrGsmCCResourceNotAvailable;
       
  1074                 break;
       
  1075 
       
  1076             /** 
       
  1077             KErrGsmCCIncompatibleMessageInCallState;
       
  1078             */
       
  1079             case ECCPErrorCCIncompatibleMessageInCallState:
       
  1080                 err = KErrGsmCCIncompatibleMessageInCallState;
       
  1081                 break;
       
  1082 
       
  1083             /** 
       
  1084             KErrGsmCCIncompatibleMessageInProtocolState;
       
  1085             */
       
  1086             case ECCPErrorCCIncompatibleMessageInProtocolState:
       
  1087                 err = KErrGsmCCIncompatibleMessageInProtocolState;
       
  1088                 break;
       
  1089 
       
  1090 
       
  1091             /** 
       
  1092             KErrGsmCCNormalCallClearing;
       
  1093             */
       
  1094             case ECCPErrorCCNormalCallClearing:
       
  1095                 err = KErrGsmCCNormalCallClearing;
       
  1096                 break;
       
  1097 
       
  1098 
       
  1099             /** 
       
  1100             KErrGsmCCUserAlertingNoAnswer;
       
  1101             */
       
  1102             case ECCPErrorCCUserAlertingNoAnswer:
       
  1103                 err = KErrGsmCCUserAlertingNoAnswer;
       
  1104                 break;
       
  1105 
       
  1106             /** 
       
  1107             KErrGsmCCCallRejected;
       
  1108             */
       
  1109             case ECCPErrorCCCallRejected:
       
  1110                 err = KErrGsmCCCallRejected;
       
  1111                 break;
       
  1112 
       
  1113 
       
  1114             /** 
       
  1115             KErrGsmCCPreemption;
       
  1116             */
       
  1117             case ECCPErrorCCPreemption:
       
  1118                 err = KErrGsmCCPreemption;
       
  1119                 break;
       
  1120 
       
  1121             /** 
       
  1122             KErrGsmCCResponseToStatusEnquiry;
       
  1123             */
       
  1124             case ECCPErrorCCResponseToStatusEnquiry:
       
  1125                 err = KErrGsmCCResponseToStatusEnquiry;
       
  1126                 break;
       
  1127 
       
  1128 
       
  1129             /** 
       
  1130             KErrGsmCCInvalidMandatoryInformation;
       
  1131             */
       
  1132             case ECCPErrorCCInvalidMandatoryInformation:
       
  1133                 err = KErrGsmCCInvalidMandatoryInformation;
       
  1134                 break;
       
  1135 
       
  1136 
       
  1137             /** 
       
  1138             KErrGsmCCNonExistentMessageType;
       
  1139             */
       
  1140             case ECCPErrorCCNonExistentMessageType:
       
  1141                 err = KErrGsmCCNonExistentMessageType;
       
  1142                 break;
       
  1143 
       
  1144 
       
  1145             /** 
       
  1146             KErrGsmCCNonExistentInformationElement;
       
  1147             */
       
  1148             case ECCPErrorCCNonExistentInformationElement:
       
  1149                 err = KErrGsmCCNonExistentInformationElement;
       
  1150                 break;
       
  1151 
       
  1152 
       
  1153             /** 
       
  1154             KErrGsmCCNoChannelAvailable;
       
  1155             */
       
  1156             case ECCPErrorCCNoChannelAvailable:
       
  1157                 err = KErrGsmCCNoChannelAvailable;
       
  1158                 break;
       
  1159 
       
  1160 
       
  1161             /** 
       
  1162             KErrGsmCCRequestedFacilityNotSubscribed;
       
  1163             */
       
  1164             case ECCPErrorCCRequestedFacilityNotSubscribed:
       
  1165                 err = KErrGsmCCRequestedFacilityNotSubscribed;
       
  1166                 break;
       
  1167 
       
  1168 
       
  1169             /** 
       
  1170             KErrGsmCCIncomingCallsBarredInCug;
       
  1171             */
       
  1172             case ECCPErrorCCIncomingCallsBarredInCug:
       
  1173                 err = KErrGsmCCIncomingCallsBarredInCug;
       
  1174                 break;
       
  1175 
       
  1176 
       
  1177             /** 
       
  1178             KErrGsmCCBearerCapabilityNotAuthorised;
       
  1179             */
       
  1180             case ECCPErrorCCBearerCapabilityNotAuthorised:
       
  1181                 err = KErrGsmCCBearerCapabilityNotAuthorised;
       
  1182                 break;
       
  1183 
       
  1184 
       
  1185             /** 
       
  1186             KErrGsmCCBearerCapabilityNotCurrentlyAvailable;
       
  1187             */
       
  1188             case ECCPErrorCCBearerCapabilityNotCurrentlyAvailable:
       
  1189                 err = KErrGsmCCBearerCapabilityNotCurrentlyAvailable;
       
  1190                 break;
       
  1191 
       
  1192 
       
  1193             /** 
       
  1194             KErrGsmCCServiceNotAvailable;
       
  1195             */
       
  1196             case ECCPErrorCCServiceNotAvailable:
       
  1197                 err = KErrGsmCCServiceNotAvailable;
       
  1198                 break;
       
  1199 
       
  1200 
       
  1201             /** 
       
  1202             KErrGsmCCBearerServiceNotImplemented;
       
  1203             */
       
  1204             case ECCPErrorCCBearerServiceNotImplemented:
       
  1205                 err = KErrGsmCCBearerServiceNotImplemented;
       
  1206                 break;
       
  1207 
       
  1208 
       
  1209             /** 
       
  1210             KErrGsmCCOnlyRestrictedDigitalInformationBCAvailable;
       
  1211             */
       
  1212             case ECCPErrorCCOnlyRestrictedDigitalInformationBCAvailable:
       
  1213                 err = KErrGsmCCOnlyRestrictedDigitalInformationBCAvailable;
       
  1214                 break;
       
  1215 
       
  1216             /** 
       
  1217             KErrGsmCCUnspecifiedInterworkingError;
       
  1218             */
       
  1219             case ECCPErrorCCUnspecifiedInterworkingError:
       
  1220                 err = KErrGsmCCUnspecifiedInterworkingError;
       
  1221                 break;
       
  1222 
       
  1223 
       
  1224             /** User not in Gug */
       
  1225             case ECCPErrorUserNotInCug: // TODO
       
  1226             default:
       
  1227                 CCELOGSTRING3("id:%d CCCECall::GetMobileCallInfo() Unhandled iExitCode %d",
       
  1228                     iCallId, iExitCode);
       
  1229                 break;
       
  1230             }
       
  1231 
       
  1232         pckg().iValid =   RMobileCall::KCallDuration
       
  1233                         | RMobileCall::KCallId
       
  1234                         | RMobileCall::KCallRemoteParty
       
  1235                         | RMobileCall::KCallDialledParty
       
  1236                         | RMobileCall::KCallExitCode
       
  1237                         | RMobileCall::KCallEmergency
       
  1238                         | RMobileCall::KCallSecurity;
       
  1239 
       
  1240         pckg().iService = RMobilePhone::EVoiceService;
       
  1241         pckg().iStatus = state;
       
  1242         pckg().iCallId = iCallId+1;
       
  1243         pckg().iExitCode = err;
       
  1244         pckg().iEmergency = EFalse;
       
  1245         pckg().iForwarded = iCall->IsCallForwarded();
       
  1246         pckg().iDuration = iCCEDurationTimer->NumberOfBeats();
       
  1247         pckg().iStartTime = iCCEDurationTimer->StartTime();
       
  1248         
       
  1249         pckg().iRemoteParty.iDirection = 
       
  1250             (RMobileCall::TMobileCallDirection)iCallDirection;
       
  1251         pckg().iRemoteParty.iRemoteNumber.iTelNumber = 
       
  1252                 iCall->RemoteParty().Left( RMobilePhone::KMaxMobileTelNumberSize );
       
  1253                 
       
  1254         const TDesC& remoteParty = pckg().iRemoteParty.iRemoteNumber.iTelNumber;  
       
  1255 
       
  1256         if ( CCPCall::EMobileTerminated == iCallDirection )
       
  1257             {
       
  1258             if ( remoteParty == KNullDesC )
       
  1259                 {
       
  1260                 pckg().iRemoteParty.iRemoteIdStatus = 
       
  1261                     RMobileCall::ERemoteIdentitySuppressed;
       
  1262                 }
       
  1263             else
       
  1264                 {
       
  1265                 pckg().iRemoteParty.iRemoteIdStatus = 
       
  1266                     RMobileCall::ERemoteIdentityAvailable;
       
  1267                 }
       
  1268 
       
  1269             pckg().iForwarded = EFalse;
       
  1270             
       
  1271             pckg().iValid |= RMobileCall::KCallForwarded;
       
  1272             }
       
  1273         else
       
  1274             {
       
  1275             pckg().iRemoteParty.iRemoteIdStatus = 
       
  1276                 RMobileCall::ERemoteIdentityUnknown;
       
  1277             }
       
  1278 
       
  1279         pckg().iDialledParty.iTelNumber = remoteParty;
       
  1280         pckg().iCallName = KNullDesC;      
       
  1281 
       
  1282         // InfoV3
       
  1283         if ( iCallState == CCPCall::EStateConnected )
       
  1284             { 
       
  1285             if ( iCall->IsSecured())
       
  1286                 {
       
  1287                 // Because ETel does not support VoIP, GSM ciphering is reported
       
  1288                 pckg().iSecurity = RMobilePhone::ECipheringGSM;
       
  1289                 }
       
  1290             }
       
  1291        else
       
  1292             {
       
  1293             pckg().iSecurity = RMobilePhone::ECipheringOff;
       
  1294             }
       
  1295         }
       
  1296     else
       
  1297         {
       
  1298         CCELOGSTRING2("id:%d CCCECall::GetMobileCallInfo: Not found", iCallId);
       
  1299         }
       
  1300     }
       
  1301 
       
  1302 // ---------------------------------------------------------------------------
       
  1303 // From class MCCECall.
       
  1304 // 
       
  1305 // ---------------------------------------------------------------------------
       
  1306 //
       
  1307 CCPCall::TCallState CCCECall::State() const
       
  1308     {
       
  1309     CCELOGSTRING3( "id:%d CCCECall::State() = %d", iCallId, iCallState );
       
  1310     return iCallState;
       
  1311     }
       
  1312     
       
  1313 // ---------------------------------------------------------------------------
       
  1314 // TCCPTone Tone() const
       
  1315 //
       
  1316 // ---------------------------------------------------------------------------
       
  1317 //
       
  1318 TCCPTone CCCECall::Tone() const
       
  1319     {
       
  1320     TCCPTone tone = iCall->Tone();  
       
  1321     CCELOGSTRING3( "id:%d CCCECall::Tone() = %d", iCallId, (TInt)tone );
       
  1322     return tone;
       
  1323     
       
  1324     }
       
  1325 // ---------------------------------------------------------------------------
       
  1326 // CallDuration() const
       
  1327 // ---------------------------------------------------------------------------
       
  1328 //
       
  1329 TTimeIntervalSeconds CCCECall::CallDuration() const
       
  1330     {
       
  1331     return iCCEDurationTimer->NumberOfBeats();
       
  1332     }
       
  1333 
       
  1334 
       
  1335 // ---------------------------------------------------------------------------
       
  1336 // StartTime() const
       
  1337 // ---------------------------------------------------------------------------
       
  1338 //
       
  1339 TDateTime CCCECall::StartTime() const
       
  1340     {
       
  1341     return iCCEDurationTimer->StartTime();
       
  1342     }
       
  1343 
       
  1344 // ---------------------------------------------------------------------------
       
  1345 // Caps() const
       
  1346 // ---------------------------------------------------------------------------
       
  1347 //
       
  1348 MCCECallObserver::TCCECallControlCaps CCCECall::Caps() const
       
  1349     {
       
  1350     CCELOGSTRING3( "id:%d CCCECall::Caps(): caps = %d", iCallId, iCall->Caps() );
       
  1351     
       
  1352     return (MCCECallObserver::TCCECallControlCaps)iCall->Caps();
       
  1353     }
       
  1354 
       
  1355 // ---------------------------------------------------------------------------
       
  1356 // SetParameters()
       
  1357 // ---------------------------------------------------------------------------
       
  1358 //
       
  1359 void CCCECall::SetParameters( const CCCECallParameters& aNewParams )
       
  1360     {
       
  1361     delete iCallParameters;
       
  1362     iCallParameters = NULL;
       
  1363     TRAP_IGNORE(iCallParameters = aNewParams.CloneL());
       
  1364     }
       
  1365 
       
  1366 // ---------------------------------------------------------------------------
       
  1367 // Parameters() const
       
  1368 // ---------------------------------------------------------------------------
       
  1369 //
       
  1370 const CCCPCallParameters& CCCECall::Parameters() const
       
  1371     {
       
  1372     if ( FeatureManager::FeatureSupported( KFeatureIdFfVoiceCallContinuity ) )
       
  1373         {
       
  1374         return iCall->Parameters();
       
  1375         }
       
  1376     return *iCallParameters;
       
  1377     }
       
  1378 
       
  1379 // ---------------------------------------------------------------------------
       
  1380 // Get transfer target
       
  1381 // ---------------------------------------------------------------------------
       
  1382 //
       
  1383 const TDesC& CCCECall::TransferTarget() const
       
  1384     {
       
  1385     // nothing here yet
       
  1386     return KNullDesC;
       
  1387     }
       
  1388 
       
  1389 // ---------------------------------------------------------------------------
       
  1390 // AttendedTransfer()
       
  1391 // ---------------------------------------------------------------------------
       
  1392 //
       
  1393 TInt CCCECall::AttendedTransfer( const TDesC& /*aTransferTarget*/ )
       
  1394     {
       
  1395     CCELOGSTRING2( "id:%d CCCECall::AttendedTransfer()", iCallId );
       
  1396     TInt error = KErrNone;
       
  1397       
       
  1398     if ( iTransferProvider )
       
  1399         {
       
  1400         CCCECall* toCall = iCallContainer.GetCall( 
       
  1401                 CCPCall::EStateConnected, this );
       
  1402         
       
  1403         // On cs world it is possible to transfer call to connecting
       
  1404         // call
       
  1405         if( !toCall )
       
  1406             {
       
  1407             toCall = iCallContainer.GetCall( 
       
  1408                     CCPCall::EStateConnecting, this );
       
  1409             
       
  1410             TBool condition( EFalse );
       
  1411             
       
  1412             if ( FeatureManager::FeatureSupported( 
       
  1413                     KFeatureIdFfVoiceCallContinuity ) )
       
  1414                 {
       
  1415                 if ( toCall && 
       
  1416                      toCall->Parameters().CallType() != 
       
  1417                          CCPCall::ECallTypeCSVoice )
       
  1418                     {
       
  1419                     condition = ETrue;
       
  1420                     }
       
  1421                 }
       
  1422             else 
       
  1423                 {
       
  1424                 if ( toCall && toCall->ImplementationUid() != KCSProviderUid )
       
  1425                     {
       
  1426                     condition = ETrue;
       
  1427                     }
       
  1428                 }            
       
  1429             if ( condition )    
       
  1430             
       
  1431                 {
       
  1432                 toCall = NULL;
       
  1433                 }
       
  1434             }
       
  1435             
       
  1436         if( toCall )
       
  1437             {
       
  1438             error = iTransferProvider->AttendedTransfer( toCall->GetCCPCall() );      
       
  1439             
       
  1440             if ( error == KErrNone )
       
  1441                 {
       
  1442                 iActiveRequest = ECCETransfer;
       
  1443                 }
       
  1444             }    
       
  1445         else
       
  1446             {
       
  1447             error = KErrNotReady;
       
  1448             }
       
  1449         }
       
  1450     else
       
  1451         {
       
  1452         error = KErrNotSupported;
       
  1453         }
       
  1454 
       
  1455     return error;
       
  1456     }
       
  1457     
       
  1458 // ---------------------------------------------------------------------------
       
  1459 // UnattendedTransfer( const TDesC& /*aTarget*/ )
       
  1460 // ---------------------------------------------------------------------------
       
  1461 //
       
  1462 TInt CCCECall::UnattendedTransfer( const TDesC& aTarget )
       
  1463     {
       
  1464     CCELOGSTRING2("id:%d CCCECall::UnattendedTransfer():IN", iCallId);
       
  1465     TInt error = KErrNone;
       
  1466    
       
  1467     if( iTransferProvider )
       
  1468         {
       
  1469         error = iTransferProvider->UnattendedTransfer( aTarget );
       
  1470         
       
  1471         if ( error == KErrNone )
       
  1472             {
       
  1473             iActiveRequest = ECCEUnattendedTransfer;
       
  1474             }
       
  1475         }
       
  1476     else
       
  1477         {
       
  1478         error = KErrNotSupported;
       
  1479         }
       
  1480 
       
  1481     CCELOGSTRING2("id:%d CCCECall::UnattendedTransfer():OUT", iCallId);
       
  1482     return error;
       
  1483     }
       
  1484     
       
  1485 // ---------------------------------------------------------------------------
       
  1486 // AcceptTransfer( TBool /*aAccept*/ )
       
  1487 // ---------------------------------------------------------------------------
       
  1488 //
       
  1489 TInt CCCECall::AcceptTransfer( const TBool aAccept )
       
  1490     {
       
  1491     CCELOGSTRING3("id:%d CCCECall::AcceptTransfer():IN aAccept=%d", iCallId,aAccept);
       
  1492     TInt error = KErrNone;
       
  1493    
       
  1494     if( iTransferController &&
       
  1495         iTransferProvider )
       
  1496         {
       
  1497         if( CCPCall::EStateConnected == iCallState ||
       
  1498             CCPCall::EStateHold == iCallState )
       
  1499             {
       
  1500             iTransferProvider->AcceptTransfer( aAccept );
       
  1501             if( aAccept )
       
  1502                 {
       
  1503                 iTransferController->SetTransferAccepted( aAccept );    
       
  1504                 }
       
  1505             else
       
  1506                 {
       
  1507                 iTransferController->ReleaseTransferCall();    
       
  1508                 }
       
  1509             }
       
  1510         else
       
  1511             {
       
  1512             iTransferController->ReleaseTransferCall();    
       
  1513             }   
       
  1514         }
       
  1515      else
       
  1516         {
       
  1517         error = KErrNotSupported;
       
  1518         }
       
  1519     CCELOGSTRING2("id:%d CCCECall::AcceptTransfer():OUT", iCallId);
       
  1520     return error;
       
  1521     }
       
  1522     
       
  1523 // ---------------------------------------------------------------------------
       
  1524 // ForwardCallToAddressChoices()
       
  1525 // ---------------------------------------------------------------------------
       
  1526 //
       
  1527 const CDesC8Array& CCCECall::GetForwardAddressChoicesL()
       
  1528     {
       
  1529     CCELOGSTRING2("id:%d CCCECall::GetForwardAddressChoicesL()", iCallId);
       
  1530     const CDesC8Array* array = NULL;
       
  1531     
       
  1532     if( iForwardProvider )
       
  1533         {
       
  1534         array = &iForwardProvider->GetForwardAddressChoicesL();
       
  1535         }
       
  1536     else
       
  1537         {
       
  1538         User::Leave( KErrNotSupported );
       
  1539         }
       
  1540         
       
  1541     return *array;
       
  1542     }
       
  1543     
       
  1544 // ---------------------------------------------------------------------------
       
  1545 // ForwardCallToAddress( TInt /*aIndex*/ )
       
  1546 // ---------------------------------------------------------------------------
       
  1547 //    
       
  1548 void CCCECall::ForwardToAddressL( TInt aIndex )
       
  1549     {
       
  1550     CCELOGSTRING2("id:%d CCCECall::ForwardCallToAddress()", iCallId);
       
  1551     if( iForwardProvider )
       
  1552         {
       
  1553         iForwardProvider->ForwardToAddressL( aIndex );
       
  1554         }
       
  1555     else
       
  1556         {
       
  1557         User::Leave( KErrNotSupported );
       
  1558         }
       
  1559     }
       
  1560 
       
  1561 // ---------------------------------------------------------------------------
       
  1562 // From class MCCECall.
       
  1563 // Check if other call needs to placed on hold
       
  1564 // If no, continue call
       
  1565 // ---------------------------------------------------------------------------
       
  1566 //
       
  1567 TInt CCCECall::Dial( const TDesC8& aCallParams )
       
  1568     {
       
  1569     CCELOGSTRING2( "id:%d CCCECall::Dial()", iCallId );
       
  1570     TInt error = KErrNone;
       
  1571 
       
  1572     if( iCallState != CCPCall::EStateIdle )
       
  1573         {
       
  1574         return KErrNotReady;
       
  1575         }
       
  1576     
       
  1577     iCallParams = &aCallParams;
       
  1578     iActiveRequest = ECCEDial;
       
  1579     
       
  1580     // If this is unattended transfer dial
       
  1581     if( iTransferController &&
       
  1582         iCall == iTransferController->TransferCall() )      
       
  1583         {
       
  1584         CCELOGSTRING2( "id:%d CCCECall::Dial(): TransferDial", iCallId);
       
  1585         // Must wait that original call is disconnected before transfer
       
  1586         // dial can be done
       
  1587         if( MCCPCallObserver::ECCPStateDisconnecting == 
       
  1588             iTransferController->OriginatorCall()->State() )
       
  1589             {
       
  1590             error = DoPendingRequest();
       
  1591             }
       
  1592         else
       
  1593             {
       
  1594             iTransferController->SetTransferDialPending( ETrue );
       
  1595             }
       
  1596         }
       
  1597     else
       
  1598         {
       
  1599         
       
  1600         CCCECall* call = iCallContainer.GetCall( 
       
  1601                 CCPCall::EStateConnected, this);
       
  1602             
       
  1603         if(call)
       
  1604             {
       
  1605             if( 0 == iCallContainer.ConferenceCall().EnumerateCalls() )
       
  1606                 {
       
  1607                 if( (iCallContainer.GetCall( 
       
  1608                         CCPCall::EStateHold, this))  && (ECCENone != iActiveRequest))
       
  1609                     {
       
  1610                     CCELOGSTRING2( "id:%d CCCECall::Dial() failed. Too many calls. ", iCallId);
       
  1611                     error = KErrInUse;
       
  1612                     }
       
  1613                 else
       
  1614                     {
       
  1615                     error = call->HoldNoNotify();
       
  1616                     }                                     
       
  1617                 }
       
  1618             else
       
  1619                 {
       
  1620                 error = iCallContainer.ConferenceCall().Swap();
       
  1621                 }
       
  1622             }
       
  1623         else
       
  1624             {
       
  1625             // Continue dial if no other connected calls exist
       
  1626             error = DoPendingRequest();
       
  1627             }
       
  1628         }
       
  1629     return error;
       
  1630     }
       
  1631     
       
  1632 // ---------------------------------------------------------------------------
       
  1633 // From class MCCECSCall.
       
  1634 // NoFDNCheck()
       
  1635 // ---------------------------------------------------------------------------
       
  1636 //
       
  1637 void CCCECall::NoFDNCheck()
       
  1638     {
       
  1639     if ( IsCsPlugin() )    
       
  1640         {
       
  1641         static_cast<MCCPCSCall*>(iCall)->NoFDNCheck();
       
  1642         }
       
  1643     }
       
  1644     
       
  1645 // ---------------------------------------------------------------------------
       
  1646 // From class MCCECall.
       
  1647 // Answer()
       
  1648 // ---------------------------------------------------------------------------
       
  1649 //
       
  1650 TInt CCCECall::Answer()
       
  1651     {
       
  1652     CCELOGSTRING2( "id:%d CCCECall::Answer()", iCallId );
       
  1653     TInt error = KErrNone;
       
  1654     iActiveRequest = ECCEAnswer;
       
  1655 
       
  1656     CCCECall* call = iCallContainer.GetCall( 
       
  1657             CCPCall::EStateConnected, this);
       
  1658         
       
  1659     if(call)
       
  1660         {
       
  1661         if( 0 == iCallContainer.ConferenceCall().EnumerateCalls() )
       
  1662             {
       
  1663             if( (iCallContainer.GetCall(  
       
  1664                     CCPCall::EStateHold, this))  && (ECCENone != iActiveRequest))
       
  1665                 {
       
  1666                 CCELOGSTRING2( "id:%d CCCECall::Answer() failed. Too many calls. "
       
  1667                     , iCallId);
       
  1668                 error = KErrInUse;
       
  1669                 iActiveRequest = ECCENone; 
       
  1670                 }
       
  1671             else
       
  1672                 {
       
  1673                 error = call->HoldNoNotify();
       
  1674                 }                                     
       
  1675             }
       
  1676         else
       
  1677             {
       
  1678             error = iCallContainer.ConferenceCall().Swap();
       
  1679             }
       
  1680         }
       
  1681     else
       
  1682         {
       
  1683         // Continue answering if no other connected calls exist
       
  1684         error = DoPendingRequest();
       
  1685         }
       
  1686 
       
  1687     return error;
       
  1688     }
       
  1689 
       
  1690 // ---------------------------------------------------------------------------
       
  1691 // DoPendingRequest()
       
  1692 // This does the pending request. It can be called from cccecallcontainer
       
  1693 // ---------------------------------------------------------------------------
       
  1694 //
       
  1695 TInt CCCECall::DoPendingRequest()
       
  1696     {
       
  1697     CCELOGSTRING2( "id:%d CCCECall::DoPendingRequest()", iCallId );
       
  1698     TInt error = KErrNone;
       
  1699     
       
  1700     if( iActiveRequest == ECCEDial )
       
  1701         {
       
  1702         CCELOGSTRING2("id:%d CCCECall::DoDial", iCallId);
       
  1703 
       
  1704         if ( IsCsPlugin() )
       
  1705             {
       
  1706             error = static_cast<MCCPCSCall*>(iCall)->Dial(*iCallParams);
       
  1707             }
       
  1708         else if( iCall )
       
  1709             {
       
  1710             error = iCall->Dial();
       
  1711             }
       
  1712         }
       
  1713     else if( iActiveRequest == ECCEAnswer ||
       
  1714              iActiveRequest == ECCEReplaceActive )
       
  1715         {
       
  1716         CCELOGSTRING2("id:%d CCCECall::DoAnswer", iCallId);
       
  1717         error = iCall->Answer();
       
  1718         }
       
  1719     else
       
  1720         {
       
  1721         error = KErrNotFound;
       
  1722         }
       
  1723         
       
  1724     return error;
       
  1725     }
       
  1726 
       
  1727 // ---------------------------------------------------------------------------
       
  1728 // DialEmergencyCall( const TDesC16& /*aNumber*/ )
       
  1729 // ---------------------------------------------------------------------------
       
  1730 //
       
  1731 void CCCECall::DialEmergencyCall( const TDesC16& /*aNumber*/ )
       
  1732     {
       
  1733     CCELOGSTRING2("id:%d CCCECall::DialEmergencyCall()", iCallId);
       
  1734     }
       
  1735 
       
  1736 // ---------------------------------------------------------------------------
       
  1737 // From class MCCECall.
       
  1738 // Close call object
       
  1739 // ---------------------------------------------------------------------------
       
  1740 //
       
  1741 TInt CCCECall::Release()
       
  1742     {
       
  1743     CCELOGSTRING2( "id:%d CCCECall::Release()", iCallId );
       
  1744     
       
  1745     if( CCPCall::EStateIdle != iCallState )
       
  1746         {
       
  1747         iCallContainer.HandleCallStatusChange( 
       
  1748                 CCPCall::EStateIdle, 
       
  1749             this, CCECallEnums::ENotifySynchronously );    
       
  1750         }
       
  1751      
       
  1752     // Stop duration timer if it is not yet stopped.
       
  1753     iCCEDurationTimer->Stop();
       
  1754     // Reset timer observer
       
  1755     iCCEDurationTimer->SetObserver( NULL );
       
  1756      
       
  1757     // Delete converged call
       
  1758     // Release call id
       
  1759     iCallContainer.ReleaseCallInfoCallId( iCallId );
       
  1760 
       
  1761     if( iCall )
       
  1762         {
       
  1763         iCallContainer.ReleaseCall(*iCall);    
       
  1764         }
       
  1765     
       
  1766     Reset();
       
  1767 
       
  1768     return KErrNone;
       
  1769     }
       
  1770     
       
  1771 // ---------------------------------------------------------------------------
       
  1772 // Request is to an ringing/waiting state call.
       
  1773 // Active call if found is hang-up
       
  1774 // When active call goes to idle incoming call is answered
       
  1775 // ---------------------------------------------------------------------------
       
  1776 //
       
  1777 TInt CCCECall::ReplaceActive()
       
  1778     {
       
  1779     CCELOGSTRING2( "id:%d CCCECall::ReplaceActive()", iCallId );
       
  1780     TInt error = KErrNone;
       
  1781     iActiveRequest = ECCEReplaceActive;
       
  1782     CCCECall* callConnected = iCallContainer.GetCall( 
       
  1783             CCPCall::EStateConnected, this);
       
  1784         
       
  1785     if ( callConnected )
       
  1786         { 
       
  1787         if ( !iCallContainer.ConferenceCall().IsPartOfConference( *callConnected ) )
       
  1788             {    
       
  1789             error = callConnected->GetCCPCall().HangUp();                                             
       
  1790             }
       
  1791         else if ( iCallContainer.ConferenceCall().State() == 
       
  1792             MCCPConferenceCallObserver::ECCPConferenceActive )
       
  1793             {
       
  1794             error = iCallContainer.ConferenceCall().HangUp();
       
  1795             }
       
  1796             
       
  1797         if ( KErrNone != error )
       
  1798             {
       
  1799             iActiveRequest = ECCENone;
       
  1800             }
       
  1801         }
       
  1802     else
       
  1803         {
       
  1804         // Continue answering if no other connected calls exist
       
  1805         error = DoPendingRequest();
       
  1806         }
       
  1807 
       
  1808     return error;
       
  1809     }
       
  1810     
       
  1811 // ---------------------------------------------------------------------------
       
  1812 // Hold call but do not notify observer when completed
       
  1813 // ---------------------------------------------------------------------------
       
  1814 //
       
  1815 TInt CCCECall::HoldNoNotify()
       
  1816     {
       
  1817     CCELOGSTRING2( "id:%d CCCECall::HoldNoNotifyL()", iCallId );
       
  1818     
       
  1819     return iCall->Hold();
       
  1820     }
       
  1821 
       
  1822 
       
  1823 // ---------------------------------------------------------------------------
       
  1824 // Resume call but do not notify observer when completed
       
  1825 // ---------------------------------------------------------------------------
       
  1826 //
       
  1827 TInt CCCECall::ResumeNoNotify()
       
  1828     {
       
  1829     CCELOGSTRING2( "id:%d CCCECall::ResumeNoNotifyL()", iCallId );
       
  1830     
       
  1831     return iCall->Resume();
       
  1832     }
       
  1833 
       
  1834 // ---------------------------------------------------------------------------
       
  1835 // HandleTransfer()
       
  1836 // Notifies phoneengine about received transfer request from remote end
       
  1837 // ---------------------------------------------------------------------------
       
  1838 //
       
  1839 void CCCECall::HandleTransfer(const TBool aAttented, 
       
  1840     CCCETransferController& aTransferController )
       
  1841     {
       
  1842     iTransferController = &aTransferController;
       
  1843     if( iObserver )
       
  1844         {
       
  1845         iObserver->HandleTransfer( aAttented,
       
  1846             iTransferProvider->TransferTarget() );
       
  1847         }
       
  1848     else
       
  1849         {
       
  1850         CCELOGSTRING( "CCCECall::HandleTransfer: observer was NOT set!" );
       
  1851         }
       
  1852     }
       
  1853 
       
  1854 // ---------------------------------------------------------------------------
       
  1855 // SetTransferController()
       
  1856 // 
       
  1857 // ---------------------------------------------------------------------------
       
  1858 //
       
  1859 void CCCECall::SetTransferController( 
       
  1860     CCCETransferController* aTransferController )
       
  1861     {
       
  1862     iTransferController = aTransferController;
       
  1863     }
       
  1864 
       
  1865 // ---------------------------------------------------------------------------
       
  1866 // Sets call index 
       
  1867 // ---------------------------------------------------------------------------
       
  1868 //
       
  1869 void CCCECall::SetNewCallIndex()
       
  1870     {
       
  1871     if ( iCallIndex == KInvalidCallIndex )
       
  1872         {
       
  1873         TCCECallIndex callIndex( iCallContainer );
       
  1874         iCallIndex = callIndex.CurrentCallIndex();
       
  1875         }
       
  1876     }
       
  1877     
       
  1878 // ---------------------------------------------------------------------------
       
  1879 // Reset call object to initial state 
       
  1880 // ---------------------------------------------------------------------------
       
  1881 //
       
  1882 void CCCECall::Reset()
       
  1883     {
       
  1884     CCELOGSTRING2( "id:%d  CCCECall::Reset()", iCallId );
       
  1885     
       
  1886     iActiveRequest = ECCENone;
       
  1887     
       
  1888     // only one observer at the moment. Clear it.
       
  1889     if (iObserver)
       
  1890         {
       
  1891         iObserver->SetMCCECallObserver(NULL);
       
  1892         }
       
  1893      
       
  1894    
       
  1895     // This object is no longer in use.
       
  1896     iExitCode = ECCPErrorNone;
       
  1897     
       
  1898     iCallDirection = CCPCall::EDirectionUnknown;
       
  1899     iCallState    = CCPCall::EStateIdle;
       
  1900 
       
  1901     iImplementationUid.iUid = 0;
       
  1902     
       
  1903     iCall = NULL;
       
  1904     delete iCallParameters;
       
  1905     iCallParameters = NULL;
       
  1906     iCallParams = NULL;
       
  1907        
       
  1908     iDoNotReportRequest = KErrNotFound;
       
  1909 
       
  1910     iTransferProvider = NULL;
       
  1911     iTransferController = NULL;
       
  1912     
       
  1913     if( iCCEDurationTimer )
       
  1914         {
       
  1915         iCCEDurationTimer->Reset();     
       
  1916         }
       
  1917     }
       
  1918 
       
  1919 // ---------------------------------------------------------------------------
       
  1920 // GetMobileDataCallCaps( TDes8& /*aCaps*/ ) const
       
  1921 // ---------------------------------------------------------------------------
       
  1922 //
       
  1923 TInt CCCECall::GetMobileDataCallCaps( TDes8& aCaps ) const
       
  1924     {
       
  1925     CCELOGSTRING2("id:%d CCCECall::GetMobileDataCallCaps()", iCallId);
       
  1926     
       
  1927     if ( IsCsPlugin() )
       
  1928         {
       
  1929         return static_cast<MCCPCSCall*>(iCall)->GetMobileDataCallCaps(aCaps);
       
  1930         }
       
  1931     else
       
  1932         return KErrNotSupported;
       
  1933     }
       
  1934 
       
  1935 
       
  1936 // ---------------------------------------------------------------------------
       
  1937 // LogDialedNumber()
       
  1938 // ---------------------------------------------------------------------------
       
  1939 //    
       
  1940 TBool CCCECall::LogDialedNumber() const
       
  1941     {
       
  1942     // CS related 
       
  1943     CCELOGSTRING2("id:%d CCCECall::LogDialedNumber()", iCallId);
       
  1944     
       
  1945     if ( IsCsPlugin() )
       
  1946         {
       
  1947         return static_cast<MCCPCSCall*>(iCall)->LogDialedNumber();
       
  1948         }
       
  1949     // for other than CS always return true
       
  1950     return ETrue;
       
  1951     }
       
  1952 
       
  1953 // ---------------------------------------------------------------------------
       
  1954 // SwitchAlternatingCall()
       
  1955 // ---------------------------------------------------------------------------
       
  1956 //    
       
  1957 TInt CCCECall::SwitchAlternatingCall()
       
  1958     {
       
  1959     CCELOGSTRING2("id:%d CCCECall::SwitchAlternatingCall()", iCallId);
       
  1960     if ( IsCsPlugin() )
       
  1961         {
       
  1962         static_cast<MCCPCSCall*>(iCall)->SwitchAlternatingCall();
       
  1963         return KErrNone;
       
  1964         }
       
  1965     else
       
  1966         return KErrNotSupported;
       
  1967     }
       
  1968 
       
  1969 // ---------------------------------------------------------------------------
       
  1970 // ErrorOccured( TCCPCallError aError )
       
  1971 // ---------------------------------------------------------------------------
       
  1972 //
       
  1973 void CCCECall::ErrorOccurred( TCCPError aError, MCCPCall* /*aCall*/ ) 
       
  1974     {
       
  1975     if( !iCall )
       
  1976         {
       
  1977         CCELOGSTRING2("id:%d CCCECall::ErrorOccurred()::Call not active", iCallId);
       
  1978         return;
       
  1979         }
       
  1980         
       
  1981     CCELOGSTRING3("id:%d CCCECall::ErrorOccurred: Error = %d", 
       
  1982         iCallId, aError );
       
  1983 
       
  1984     iExitCode = aError;
       
  1985     iCallContainer.ErrorOccurred( this, aError );
       
  1986     
       
  1987      // Complete request to observer
       
  1988     if ( ECCENone != iActiveRequest )
       
  1989         {
       
  1990         RequestComplete( aError );
       
  1991         }
       
  1992     else
       
  1993         {
       
  1994         if( iObserver )
       
  1995             {
       
  1996             iObserver->ErrorOccurred(aError);
       
  1997             }
       
  1998         else
       
  1999             {
       
  2000             CCELOGSTRING( "CCCECall::ErrorOccurred: observer was NOT set!" );
       
  2001             }
       
  2002         }
       
  2003     
       
  2004     }
       
  2005 
       
  2006 // ---------------------------------------------------------------------------
       
  2007 // RequestComplete( TInt aError )
       
  2008 // ---------------------------------------------------------------------------
       
  2009 //
       
  2010 void CCCECall::RequestComplete( TCCPError aError )
       
  2011     {
       
  2012     CCELOGSTRING4("id:%d CCCECall::RequestComplete: Request = %d, Error = %d",iCallId
       
  2013         ,iActiveRequest, aError );
       
  2014 
       
  2015     // Complete request to observer
       
  2016     if ( ECCENone != iActiveRequest )
       
  2017         {
       
  2018         NotifyRequestComplete( iActiveRequest, aError );
       
  2019         }
       
  2020     else
       
  2021         {
       
  2022         CCELOGSTRING2("id:%d CCCECall::RequestComplete: No active request.", iCallId);
       
  2023         }
       
  2024 
       
  2025     // Reset active request
       
  2026     iActiveRequest = ECCENone;
       
  2027     }
       
  2028 
       
  2029 // ---------------------------------------------------------------------------
       
  2030 // CallEventOccurred( TCCPCallEvent aEvent )
       
  2031 // ---------------------------------------------------------------------------
       
  2032 //
       
  2033 void CCCECall::CallEventOccurred( TCCPCallEvent aEvent, MCCPCall* /*aCall*/ ) 
       
  2034     {
       
  2035     if( !iCall )
       
  2036         {
       
  2037         CCELOGSTRING2("id:%d CCCECall::CallEventOccurred()::Call not active", iCallId);
       
  2038         return;
       
  2039         }
       
  2040 
       
  2041 
       
  2042     if( !iObserver->GetMCCECallObserver() ) 
       
  2043         {
       
  2044         CCELOGSTRING( "CCCECall::CallEventOccurred: observer was NOT set!" );
       
  2045         return;
       
  2046         }
       
  2047 
       
  2048 
       
  2049     CCELOGSTRING4("id:%d CCCECall::CallEventOccurred() Event = %d CallId = %d", 
       
  2050         iCallId, aEvent, iCallId );
       
  2051 
       
  2052     switch ( aEvent )
       
  2053         {
       
  2054         /** Call has been placed on hold as a result of a local action. */
       
  2055         case ECCPLocalHold:
       
  2056             iObserver->CallEventOccurred( MCCECallObserver::ELocalHold );
       
  2057             break;
       
  2058         /** Call has been placed on hold by the remote connected party. */
       
  2059         case ECCPRemoteHold:
       
  2060             iObserver->CallEventOccurred( MCCECallObserver::ERemoteHold );
       
  2061             break;
       
  2062         /** Call has been resumed as a result of a local action. */
       
  2063         case ECCPLocalResume:
       
  2064             iObserver->CallEventOccurred( MCCECallObserver::ELocalResume );
       
  2065             break;
       
  2066         /** Call has been resumed by the remote connected party. */
       
  2067         case ECCPRemoteResume:
       
  2068             iObserver->CallEventOccurred( MCCECallObserver::ERemoteResume );
       
  2069             break;
       
  2070         /** Outgoing call has been barred by the local party. */
       
  2071         case ECCPLocalBarred:
       
  2072             iObserver->CallEventOccurred( MCCECallObserver::ELocalBarred );
       
  2073             break;
       
  2074         /** Outgoing call has been barred by the remote party. */
       
  2075         case ECCPRemoteBarred:
       
  2076             iObserver->CallEventOccurred( MCCECallObserver::ERemoteBarred );
       
  2077             break;
       
  2078         /** Call is waiting at the remote end. */
       
  2079         case ECCPRemoteWaiting:
       
  2080             iObserver->CallEventOccurred( MCCECallObserver::ERemoteWaiting );
       
  2081             break;
       
  2082         /** Call has been terminated by the remote party. */
       
  2083         case ECCPRemoteTerminated:
       
  2084             iObserver->CallEventOccurred( MCCECallObserver::ERemoteTerminated);
       
  2085             break;
       
  2086         /** Call is in queue */
       
  2087         case ECCPQueued:
       
  2088             iObserver->CallEventOccurred( MCCECallObserver::ERemoteWaiting );
       
  2089             break;
       
  2090         /** VoIP specific */
       
  2091         case ECCCSPEarlyMediaStarted:
       
  2092             iObserver->CallEventOccurred( MCCECallObserver::EVoIPEventEarlyMediaStarted );
       
  2093             break;
       
  2094         /** Call is secure */
       
  2095         case ECCPSecureCall:
       
  2096             iObserver->CallEventOccurred( MCCECallObserver::ESecureSession );
       
  2097             break;
       
  2098         /** Call is not secure */
       
  2099         case ECCPNotSecureCall:
       
  2100             iObserver->CallEventOccurred( MCCECallObserver::ENotSecureSession );
       
  2101             break;
       
  2102         /** Secure call signaling is not possible */
       
  2103         case ECCPNotSecureSessionWithSips:
       
  2104             iObserver->CallEventOccurred( MCCECallObserver::EVoIPEventNotSecureSessionWithSips );
       
  2105             break;
       
  2106         /** Call has been added to remote conference call at remote end */
       
  2107         case ECCPRemoteConferenceCreate:
       
  2108             iObserver->CallEventOccurred( MCCECallObserver::ERemoteConferenceCreate );
       
  2109             break;
       
  2110         /** CS call specific event */
       
  2111         case ECCPCSDataPortLoaned:
       
  2112             iObserver->CallEventOccurred( MCCECallObserver::ECCECSDataPortLoaned );
       
  2113             break;
       
  2114         /** CS call specific event */
       
  2115         case ECCPCSDataPortRecovered:
       
  2116             iObserver->CallEventOccurred( MCCECallObserver::ECCECSDataPortRecovered );
       
  2117             break;
       
  2118         /** Remote party info target meaning has changed */
       
  2119         case ECCPNotifyRemotePartyInfoChange:
       
  2120         	{
       
  2121             //Ho occurred, call type has changed
       
  2122             if ( FeatureManager::FeatureSupported( KFeatureIdFfVoiceCallContinuity ) )
       
  2123                 {
       
  2124                 CCELOGSTRING( "CCCECall::CallEventOccurred: ECCPNotifyRemotePartyInfoChange!" );
       
  2125                 delete iCallParameters;
       
  2126                 iCallParameters = NULL;
       
  2127                 
       
  2128                 TRAP_IGNORE( iCallParameters = iCall->Parameters().CloneL() );
       
  2129                 }           
       
  2130             iCallContainer.AirTimeDurationSwap(
       
  2131                                      iCall->Parameters().CallType() );
       
  2132             iObserver->CallEventOccurred( MCCECallObserver::ECCENotifyRemotePartyInfoChange );
       
  2133         	}
       
  2134 			break;
       
  2135         /** Call secure status cannot be determined */
       
  2136         case ECCPSecureNotSpecified:
       
  2137             iObserver->CallEventOccurred( MCCECallObserver::ECCESecureNotSpecified );
       
  2138             break;
       
  2139         default:
       
  2140             CCELOGSTRING3("id:%d CCCECall::SessionEventOccurred: Unhandled event = %d", iCallId,
       
  2141                 aEvent );
       
  2142             break;
       
  2143         }
       
  2144     }
       
  2145 
       
  2146 // ---------------------------------------------------------------------------
       
  2147 // CallCapsChanged( TUint32 aCapsFlags )
       
  2148 // ---------------------------------------------------------------------------
       
  2149 //
       
  2150 void CCCECall::CallCapsChanged( TUint32 aCapsFlags, MCCPCall* /*aCall*/ ) 
       
  2151     {
       
  2152     CCELOGSTRING2("id:%d CCCECall::CallCapsChanged()", iCallId);
       
  2153     if( !iCall )
       
  2154         {
       
  2155         CCELOGSTRING2("id:%d CCCECall::CallCapsChanged()::Call not active", iCallId);
       
  2156         return;
       
  2157         }
       
  2158         
       
  2159     if( iObserver )
       
  2160         {
       
  2161         iObserver->CallCapsChanged( (MCCECallObserver::TCCECallControlCaps)aCapsFlags );
       
  2162         }
       
  2163     else
       
  2164         {
       
  2165         CCELOGSTRING( "CCCECall::CallCapsChanged: observer was NOT set!" );
       
  2166         }
       
  2167     }
       
  2168 
       
  2169 // ---------------------------------------------------------------------------
       
  2170 // TransferEventOccurred()
       
  2171 // ---------------------------------------------------------------------------
       
  2172 //
       
  2173 void CCCECall::TransferEventOccurred( TCCPTransferEvent aEvent )
       
  2174     {
       
  2175     CCELOGSTRING2("id:%d CCCECall::TransferEventOccurred()", iCallId);
       
  2176     
       
  2177     if( !iObserver->GetMCCECallObserver() )
       
  2178         {
       
  2179         CCELOGSTRING( "CCCECall::TransferEventOccurred: observer was NOT set!" );
       
  2180         return;
       
  2181         }
       
  2182     
       
  2183     switch ( aEvent )
       
  2184         {
       
  2185        /** Call has been transferred to another remote party as a result 
       
  2186         of a local action. This is the result of transfer being succesfully 
       
  2187         completed */
       
  2188         case ECCPLocalTransfer:
       
  2189             iObserver->CallEventOccurred( MCCECallObserver::ELocalTransfer );
       
  2190             break;
       
  2191        /** Outgoing call is transfering. The transfer request has now been 
       
  2192         accepted by the current call recipient. */
       
  2193         case ECCPRemoteTransferring:
       
  2194             iObserver->CallEventOccurred( MCCECallObserver::ERemoteTransferring );
       
  2195             break;
       
  2196        /** Outgoing transfer call is alerting. Current call recipinet has sent
       
  2197         connection request to transfer target*/
       
  2198         case ECCPRemoteTransferAlerting:
       
  2199             iObserver->CallEventOccurred( MCCECallObserver::ERemoteTransferAlerting );
       
  2200             break;
       
  2201 
       
  2202         default:
       
  2203             CCELOGSTRING3("id:%d CCCECall::TransferEventOccurred: Unhandled event = %d", iCallId,
       
  2204                 aEvent );
       
  2205             break;
       
  2206         }
       
  2207     }
       
  2208 
       
  2209 // ---------------------------------------------------------------------------
       
  2210 // ForwardEventOccurred()
       
  2211 // ---------------------------------------------------------------------------
       
  2212 //
       
  2213 void CCCECall::ForwardEventOccurred( 
       
  2214     const MCCPForwardObserver::TCCPForwardEvent aEvent )
       
  2215     {
       
  2216     CCELOGSTRING2("id:%d CCCECall::ForwardEventOccurred()", iCallId);
       
  2217 
       
  2218     if( !iObserver->GetMCCECallObserver() )
       
  2219         {
       
  2220         CCELOGSTRING( "CCCECall::ForwardEventOccurred: observer was NOT set!" );
       
  2221         return;
       
  2222         }
       
  2223     
       
  2224     switch ( aEvent )
       
  2225         {
       
  2226         /** Call is being forwarded by the remote party. */
       
  2227         /** MovedTemporarily is handled as forwarding */
       
  2228         case ECCPRemoteForwarding:
       
  2229         case ECCPMovedTemporarily:
       
  2230             iObserver->CallEventOccurred( MCCECallObserver::ERemoteForwarding );
       
  2231             break;
       
  2232         /** Multiple call forward choices are available */
       
  2233         case ECCPMultipleChoices:
       
  2234             iObserver->CallEventOccurred( MCCECallObserver::EVoIPEventMultipleChoices );
       
  2235             break;
       
  2236         /** Call moved permanently */
       
  2237         case ECCPMovedPermanentlyEvent:
       
  2238             iObserver->CallEventOccurred( MCCECallObserver::EVoIPEventMovedPermanently );
       
  2239             break;
       
  2240         /** Call is forwarded */
       
  2241         case ECCPForwarded:
       
  2242         default:
       
  2243             CCELOGSTRING3("id:%d CCCECall::ForwardEventOccurred: Unhandled event = %d", iCallId,
       
  2244                 aEvent );
       
  2245             break;
       
  2246         }
       
  2247     }
       
  2248 
       
  2249 // ---------------------------------------------------------------------------
       
  2250 // CallStateChanged( TCCPCallState aState )
       
  2251 // ---------------------------------------------------------------------------
       
  2252 //
       
  2253 void CCCECall::CallStateChanged( TCCPCallState aState, MCCPCall* /*aCall*/ ) 
       
  2254     {
       
  2255     CCELOGSTRING3("id:%d CCCECall::CallStateChanged() State = %d", 
       
  2256         iCallId, aState );
       
  2257     
       
  2258     CallStateChanged( aState, EFalse );
       
  2259     }
       
  2260 
       
  2261 // ---------------------------------------------------------------------------
       
  2262 // CallStateChangedWithInband( TCCPCallState aState )
       
  2263 // ---------------------------------------------------------------------------
       
  2264 //
       
  2265 void CCCECall::CallStateChangedWithInband( TCCPCallState aState, 
       
  2266                                            MCCPCall* /*aCall*/ ) 
       
  2267     {
       
  2268     CCELOGSTRING3("id:%d CCCECall::CallStateChangedWithInband() State = %d", 
       
  2269        iCallId , aState );
       
  2270         
       
  2271     CallStateChanged( aState, ETrue );
       
  2272     }
       
  2273 
       
  2274 // ---------------------------------------------------------------------------
       
  2275 // CallStateChanged( TCCPCSCallState aState )
       
  2276 // ---------------------------------------------------------------------------
       
  2277 //
       
  2278 void CCCECall::CallStateChanged( TCCPCallState aState, TBool aInband )
       
  2279     {
       
  2280     if( !iCall )
       
  2281         {
       
  2282         CCELOGSTRING2("id:%d CCCECall::CallStateChanged()::Call not active", iCallId);
       
  2283         return;
       
  2284         }
       
  2285         
       
  2286     TInt notify = EFalse;
       
  2287     CCPCall::TCallState state( CCPCall::EStateIdle);
       
  2288         
       
  2289     switch ( aState )
       
  2290         {
       
  2291         case ECCPStateQueued:
       
  2292             CCELOGSTRING2("id:%d CCCECall::CallStateChanged: Queued", iCallId);
       
  2293             // Call index becomes available when call gets to dialling or ringing/queued state.
       
  2294             // Idle call does not have call index.
       
  2295             SetNewCallIndex();
       
  2296             if ( iCallDirection == CCPCall::EMobileTerminated )
       
  2297                 {
       
  2298                 state = CCPCall::EStateQueued;
       
  2299                 notify = ETrue;
       
  2300                 }
       
  2301             break;
       
  2302         
       
  2303         case ECCPStateDialling:
       
  2304             // Call index becomes available when call gets to dialling or ringing/queued state.
       
  2305             // Idle call does not have call index.
       
  2306             SetNewCallIndex();
       
  2307 
       
  2308             CCELOGSTRING2("id:%d CCCECall::CallStateChanged: Dialling", iCallId);
       
  2309             state = CCPCall::EStateDialling;
       
  2310             notify = ETrue;
       
  2311                 
       
  2312             break;   
       
  2313             
       
  2314         case ECCPStateAnswering:
       
  2315             CCELOGSTRING2("id:%d CCCECall::CallStateChanged: Answering", iCallId);
       
  2316             state = CCPCall::EStateAnswering;
       
  2317             notify = ETrue;
       
  2318                 
       
  2319             break;    
       
  2320    
       
  2321         case ECCPStateConnecting:
       
  2322         case ECCPStateRinging:
       
  2323             CCELOGSTRING2("id:%d CCCECall::CallStateChanged: Connecting/Ringing", iCallId);
       
  2324             if ( iCallDirection == CCPCall::EMobileTerminated )
       
  2325                 {
       
  2326                 state = CCPCall::EStateRinging;
       
  2327                 // Call index becomes available when call gets to dialling or incoming state.
       
  2328                 // Idle call does not have call index.
       
  2329                 SetNewCallIndex();
       
  2330                 }
       
  2331             else
       
  2332                 {
       
  2333                 if ( ECCEDial == iActiveRequest )
       
  2334                     {
       
  2335                     RequestComplete( ECCPErrorNone );
       
  2336                     }
       
  2337                     
       
  2338                 state = CCPCall::EStateConnecting;
       
  2339                 }
       
  2340             notify = ETrue;
       
  2341             break;
       
  2342 
       
  2343         case ECCPStateConnected:
       
  2344             CCELOGSTRING2("id:%d CCCECall::CallStateChanged: Connected", iCallId);
       
  2345             // Start call duration timer
       
  2346             iCCEDurationTimer->Start();
       
  2347 
       
  2348             // We are either dialling or answering
       
  2349             if ( ECCEAnswer == iActiveRequest ||
       
  2350                  ECCEResume == iActiveRequest ||
       
  2351                  ECCEDial == iActiveRequest ||
       
  2352                  ECCEReplaceActive == iActiveRequest ) 
       
  2353                 {
       
  2354                 RequestComplete( ECCPErrorNone );
       
  2355                 }
       
  2356                 
       
  2357             state = CCPCall::EStateConnected;
       
  2358             notify = ETrue;
       
  2359             break;
       
  2360 
       
  2361         case ECCPStateDisconnecting:
       
  2362             CCELOGSTRING2("id:%d CCCECall::CallStateChanged: Disconnecting", iCallId);
       
  2363             // Stop duration timer
       
  2364             iCCEDurationTimer->Stop();
       
  2365 
       
  2366             if ( ECCETransfer == iActiveRequest )
       
  2367                 {
       
  2368                 RequestComplete( ECCPErrorNone );
       
  2369                 }
       
  2370 
       
  2371             state = CCPCall::EStateDisconnecting;
       
  2372             notify = ETrue;
       
  2373             break;
       
  2374 
       
  2375         case ECCPStateIdle:
       
  2376             CCELOGSTRING2("id:%d CCCECall::CallStateChanged: Disconnected/Idle", iCallId);
       
  2377             // Stop duration timer
       
  2378             iCCEDurationTimer->Stop();
       
  2379 
       
  2380             // Remove call from conference before it is notified elsewhere
       
  2381             if( iCallContainer.ConferenceCall().IsPartOfConference(*this) )
       
  2382                 {
       
  2383                 MCCPConferenceCallObserver& confObserver = iCallContainer.ConferenceCall(); 
       
  2384                 confObserver.ConferenceCallEventOccurred(
       
  2385                      MCCPConferenceCallObserver::ECCPConferenceCallRemoved, iCall );
       
  2386                 }
       
  2387 
       
  2388             if ( ECCENone != iActiveRequest )
       
  2389                 {
       
  2390                 RequestComplete( ECCPErrorNone );
       
  2391                 }
       
  2392 
       
  2393             state = CCPCall::EStateIdle;
       
  2394             iCallIndex = KInvalidCallIndex; // Call index not valid anymore in idle state
       
  2395             notify = ETrue;
       
  2396            
       
  2397             if( !iObserver->GetMCCECallObserver() )
       
  2398                 {
       
  2399                 notify = EFalse;
       
  2400                 Release();
       
  2401                 
       
  2402                 }
       
  2403             break;
       
  2404 
       
  2405         case ECCPStateHold:
       
  2406             CCELOGSTRING2("id:%d CCCECall::CallStateChanged: Hold", iCallId);
       
  2407             state = CCPCall::EStateHold;
       
  2408             if ( ECCEHold == iActiveRequest )
       
  2409                 {
       
  2410                 RequestComplete( ECCPErrorNone );
       
  2411                 }
       
  2412                 
       
  2413             notify = ETrue;
       
  2414             break;
       
  2415 
       
  2416         case ECCPStateForwarding:
       
  2417             CCELOGSTRING2("id:%d CCCECall::CallStateChanged: Forwarding", iCallId);
       
  2418             // Notify observer
       
  2419             // Forwarding state is notified to upstairs but is not set
       
  2420             // to calls internal state
       
  2421             if( iObserver )
       
  2422                 {
       
  2423                 if (aInband)
       
  2424                     {
       
  2425                     iObserver->CallStateChangedWithInband(CCPCall::EStateForwarding);  
       
  2426                     }
       
  2427                 else
       
  2428                     {
       
  2429                     iObserver->CallStateChanged(CCPCall::EStateForwarding);   
       
  2430                     }
       
  2431                 
       
  2432                 }
       
  2433             break;
       
  2434 
       
  2435         case ECCPStateTransferring:
       
  2436             CCELOGSTRING2("id:%d CCCECall::CallStateChanged: Transferring", iCallId);
       
  2437             // Notify observer
       
  2438             // Transferring state is notified to upstairs but is not set
       
  2439             // to calls internal state
       
  2440            if( iObserver )
       
  2441                 {
       
  2442                 if (aInband)
       
  2443                     {
       
  2444                     iObserver->CallStateChangedWithInband(CCPCall::EStateTransferring)  ;
       
  2445                     }
       
  2446                 else
       
  2447                     {
       
  2448                     iObserver->CallStateChanged(CCPCall::EStateTransferring); 
       
  2449                     }
       
  2450                 
       
  2451                 }
       
  2452                 
       
  2453             break;
       
  2454 
       
  2455         default:
       
  2456             CCELOGSTRING3("id:%d CCCECall::CallStateChanged: Unhandled state = %d", iCallId,
       
  2457                 aState );
       
  2458             break;
       
  2459         }
       
  2460         
       
  2461     if( notify )
       
  2462         {
       
  2463         NotifyCallStatusChange( state, aInband, CCECallEnums::ENotifyAsynchronously );
       
  2464         }
       
  2465     }
       
  2466     
       
  2467 // ---------------------------------------------------------------------------
       
  2468 // Notify observers about call status change
       
  2469 // ---------------------------------------------------------------------------
       
  2470 //
       
  2471 void CCCECall::NotifyCallStatusChange( 
       
  2472     CCPCall::TCallState aCallState, 
       
  2473     TBool aInband, 
       
  2474     CCECallEnums::TNotifyType aNotify )
       
  2475     {
       
  2476     CCELOGSTRING3("id:%d CCCECall::NotifyCallStatusChange: Status = %d",iCallId, aCallState );
       
  2477     
       
  2478     if( (iCallState == aCallState) && ( aCallState == MCCPCallObserver::ECCPStateIdle ))
       
  2479         {
       
  2480         CCELOGSTRING2("id:%d CCCECall::NotifyCallStatusChange: Same status, still Idle", iCallId );
       
  2481         return;
       
  2482         }
       
  2483     
       
  2484     iCallState = aCallState;
       
  2485 
       
  2486     if( iTransferController )
       
  2487         {
       
  2488         iTransferController->HandleCallStateChanged( this, aCallState );
       
  2489         }
       
  2490    
       
  2491     // Notify observer
       
  2492     if( iObserver && (aNotify != CCECallEnums::ENoNotify))
       
  2493         {
       
  2494        if( aInband )
       
  2495             {
       
  2496             iObserver->CallStateChangedWithInband( aCallState );
       
  2497             }
       
  2498         else
       
  2499             {
       
  2500             iObserver->CallStateChanged( aCallState );
       
  2501             }
       
  2502             
       
  2503         }
       
  2504     else
       
  2505         {
       
  2506         CCELOGSTRING2("id:%d CCCECall::NotifyCallStatusChange:No observer", iCallId );
       
  2507         }
       
  2508 
       
  2509     // Notify CallContainer
       
  2510     iCallContainer.HandleCallStatusChange( aCallState, this, aNotify );
       
  2511     }
       
  2512 
       
  2513 // ---------------------------------------------------------------------------
       
  2514 // Tells if CS plugin is used
       
  2515 // ---------------------------------------------------------------------------
       
  2516 //
       
  2517 TBool CCCECall::IsCsPlugin() const
       
  2518     {
       
  2519     TBool isCsPlugin( EFalse );
       
  2520     if ( FeatureManager::FeatureSupported( KFeatureIdFfVoiceCallContinuity ) )
       
  2521         {
       
  2522         if ( iCall->Parameters().CallType() != 
       
  2523             CCPCall::ECallTypePS )
       
  2524             {
       
  2525             isCsPlugin = ETrue;
       
  2526             }
       
  2527         }
       
  2528     else
       
  2529         {
       
  2530         if( iImplementationUid == KCSProviderUid )
       
  2531             {
       
  2532             isCsPlugin = ETrue;
       
  2533             }
       
  2534         }
       
  2535     return isCsPlugin;
       
  2536     }
       
  2537 
       
  2538 // End of file