telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmconferencecalltsy.cpp
changeset 0 3553901f7fa8
child 7 fe8b59ab9fa0
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 //INCLUDE FILES
       
    19 #include "cmmconferencecalltsy.h"
       
    20 #include "cmmphonetsy.h"
       
    21 #include "cmmtsyreqhandlestore.h"
       
    22 #include "MmTsy_numberOfSlots.h"
       
    23 #include "CMmCommonStaticUtility.h"
       
    24 #include "cmmconferencecallgsmwcdmaext.h"
       
    25 #include "cmmvoicecalltsy.h"
       
    26 #include "cmmcallgsmwcdmaext.h"
       
    27 #include "cmmcalllist.h"
       
    28 #include "cmmmessagemanagerbase.h"
       
    29 #include <ctsy/serviceapi/gsmerror.h>
       
    30 #include <etelmmerr.h> // etel error codes
       
    31 
       
    32 
       
    33 // ======== MEMBER FUNCTIONS ========
       
    34 
       
    35 CMmConferenceCallTsy::CMmConferenceCallTsy()
       
    36     {
       
    37     }
       
    38     
       
    39 CMmConferenceCallTsy* CMmConferenceCallTsy::NewL(
       
    40     CMmPhoneTsy* aMmPhone )
       
    41     {
       
    42     CMmConferenceCallTsy* conferenceCallTsy = NULL;
       
    43     
       
    44     if ( aMmPhone != NULL )
       
    45         {
       
    46         conferenceCallTsy  = new (ELeave) CMmConferenceCallTsy();
       
    47         CleanupClosePushL( *conferenceCallTsy );
       
    48         conferenceCallTsy->iMmPhone = aMmPhone;
       
    49         conferenceCallTsy->ConstructL();
       
    50         CleanupStack::Pop();
       
    51         }
       
    52 
       
    53     return conferenceCallTsy;
       
    54 
       
    55     }
       
    56 
       
    57 
       
    58 void CMmConferenceCallTsy::ConstructL()
       
    59     {
       
    60 
       
    61 #ifdef REQHANDLE_TIMER
       
    62     //create req handle store
       
    63     iTsyReqHandleStore = CMmTsyReqHandleStore::NewL( this, iMmPhone,
       
    64         EMultimodeConferenceCallMaxNumOfRequests, iConferenceCallReqHandles );
       
    65 #else
       
    66     //create req handle store
       
    67     iTsyReqHandleStore = CMmTsyReqHandleStore::NewL(
       
    68         EMultimodeConferenceCallMaxNumOfRequests, iConferenceCallReqHandles );
       
    69 #endif
       
    70 
       
    71     //Create conference call extension
       
    72     iMmConferenceCallExtInterface = 
       
    73                                 CMmConferenceCallGsmWcdmaExt::NewL( this );
       
    74 
       
    75     //Initialise internal attributes...
       
    76     ResetAttributes();
       
    77 
       
    78     //Check if conference call creation is already possible. If possible,
       
    79     //capabilities are updated by the extension.
       
    80     CheckConferenceCapability();
       
    81 
       
    82     //register conference call tsy in the message manager
       
    83     iMmPhone->MessageManager()->RegisterTsyObject(
       
    84         CMmMessageManagerBase::EConferenceCallTsy, this );
       
    85 
       
    86     }
       
    87 
       
    88 CMmConferenceCallTsy::~CMmConferenceCallTsy()
       
    89     {
       
    90 
       
    91     TFLOGSTRING("TSY: CMmConferenceCallTsy::~CMmConferenceCallTsy");
       
    92 
       
    93     if ( iMmPhone )
       
    94         {
       
    95         // deregister tsy object from message manager
       
    96         iMmPhone->MessageManager()->DeregisterTsyObject(this);        
       
    97         //set phone tsy's pointer to CC object to NULL
       
    98         iMmPhone->SetConferenceCall( NULL );
       
    99         }
       
   100 
       
   101     //if conference is active, close all calls that are part of the conference 
       
   102     //call. send request using transaction id 0x00.
       
   103     if ( RMobileConferenceCall::EConferenceIdle != iStatus )
       
   104         {
       
   105         //We can't do nothing if release request fails here, because CC
       
   106         //sub-session is closing down.
       
   107 		TInt trapError = KErrNone;
       
   108 		TRAP( trapError, 
       
   109 	        iMmConferenceCallExtInterface->HangUpL( iStatus );
       
   110 			);
       
   111         }
       
   112 
       
   113     if ( iTsyReqHandleStore )
       
   114         {
       
   115         delete iTsyReqHandleStore;
       
   116         }
       
   117 
       
   118     //delete conference call extensions
       
   119     if ( iMmConferenceCallExtInterface )
       
   120         {
       
   121         delete iMmConferenceCallExtInterface;
       
   122         }
       
   123 	iMmConferenceCallExtInterface = NULL;
       
   124 
       
   125 	iMmPhone = NULL;
       
   126 	iTsyReqHandleStore = NULL;
       
   127 	iRetCaps = NULL;
       
   128 	iRetStatus = NULL;
       
   129 	iRetConferenceEventCallName = NULL;
       
   130 	iRetConferenceEvent = NULL;
       
   131 	iConnectedCall = NULL;
       
   132 	iHoldCall = NULL;
       
   133     }
       
   134     
       
   135 // ---------------------------------------------------------------------------
       
   136 // CMmConferenceCallTsy::OpenNewObjectByNameL
       
   137 // This method is not supported.
       
   138 // (other items were commented in a header).
       
   139 // ---------------------------------------------------------------------------
       
   140 //
       
   141 CTelObject* CMmConferenceCallTsy::OpenNewObjectByNameL(
       
   142     const TDesC& )
       
   143     {
       
   144     User::Leave( KErrNotSupported );
       
   145 	//lint -e{527} "unreachable code"
       
   146     return NULL;
       
   147     }
       
   148 
       
   149 // ---------------------------------------------------------------------------
       
   150 // CMmConferenceCallTsy::OpenNewObjectL
       
   151 // This method is not supported.
       
   152 // (other items were commented in a header).
       
   153 // ---------------------------------------------------------------------------
       
   154 //
       
   155 CTelObject* CMmConferenceCallTsy::OpenNewObjectL(
       
   156     TDes& )
       
   157     {
       
   158     User::Leave( KErrNotSupported );
       
   159     return NULL;
       
   160     }
       
   161 
       
   162 // ---------------------------------------------------------------------------
       
   163 // CMmConferenceCallTsy::ExtFunc
       
   164 // Dispatches extension function requests. All functions that are not 
       
   165 // part of the core function set, are routed via the ExtFunc method. 
       
   166 // At the beginning of this method, packaged pointers are unpacked. Then 
       
   167 // the correct function is selected using the IPC number.
       
   168 // (other items were commented in a header).
       
   169 // ---------------------------------------------------------------------------
       
   170 //
       
   171 TInt CMmConferenceCallTsy::ExtFunc(
       
   172     const TTsyReqHandle aTsyReqHandle,
       
   173     const TInt aIpc,
       
   174     const TDataPackage& aPackage )
       
   175     {
       
   176     TInt ret( KErrNone );
       
   177     TInt trapError( KErrNone );
       
   178 
       
   179     //reset last tsy request type
       
   180     iReqHandleType = EMultimodeConferenceCallReqHandleUnknown;
       
   181 
       
   182     //Original code continues here.
       
   183     TRAP( trapError, ret = DoExtFuncL( aTsyReqHandle, aIpc, aPackage ); );
       
   184 
       
   185     if ( trapError != KErrNone )
       
   186         {
       
   187         //error handling. Object cannot be created.
       
   188         ReqCompleted( 0, trapError );
       
   189         }
       
   190     //if return value is not KErrNone
       
   191     else if ( ret != KErrNone )
       
   192         {
       
   193         //Complete request with this error value
       
   194         ReqCompleted( aTsyReqHandle, ret );
       
   195         }
       
   196 
       
   197     //save request handle
       
   198     if ( EMultimodeConferenceCallReqHandleUnknown != iReqHandleType )
       
   199         {
       
   200 #ifdef REQHANDLE_TIMER
       
   201         SetTypeOfResponse ( iReqHandleType, aTsyReqHandle );
       
   202 #else
       
   203         iTsyReqHandleStore->SetTsyReqHandle( iReqHandleType, aTsyReqHandle );
       
   204 #endif
       
   205         }
       
   206 
       
   207     return KErrNone;
       
   208 
       
   209     }
       
   210 
       
   211 // ---------------------------------------------------------------------------
       
   212 // CMmConferenceCallTsy::DoExtFuncL
       
   213 // ExtFunc is called by the server when it has a "extended", 
       
   214 // i.e. non-core ETel request for the TSY. To process a request handle, 
       
   215 // request type and request data are passed to the TSY.
       
   216 // (other items were commented in a header).
       
   217 // ---------------------------------------------------------------------------
       
   218 //
       
   219 TInt CMmConferenceCallTsy::DoExtFuncL(
       
   220     const TTsyReqHandle aTsyReqHandle,
       
   221     const TInt aIpc,
       
   222     const TDataPackage& aPackage )
       
   223     {
       
   224 	TFLOGSTRING3("TSY: CMmConferenceCallTsy::DoExtFuncL.\n  \t\t\t IPC:%d\n  \t\t\t Handle:%d",
       
   225         aIpc, aTsyReqHandle);
       
   226 
       
   227     TInt ret( KErrNotSupported );
       
   228 
       
   229     TAny* dataPtr = aPackage.Ptr1();
       
   230 
       
   231     // The request data has to extracted from TDataPackage and the TAny* 
       
   232     // pointers have to be "cast" to the expected request data type
       
   233     switch( aIpc )
       
   234         {     
       
   235         case EMobileConferenceCallGetCaps:
       
   236             ret = GetCaps( aTsyReqHandle, 
       
   237                 reinterpret_cast<TUint32*>( dataPtr ) );
       
   238             break;
       
   239         case EMobileConferenceCallNotifyCapsChange:
       
   240             ret = NotifyCapsChange( reinterpret_cast<TUint32*>( dataPtr ) );
       
   241             break;
       
   242         case EMobileConferenceCallCreateConference:
       
   243             ret = CreateConferenceL( aTsyReqHandle );
       
   244             break;
       
   245         case EMobileConferenceCallAddCall:
       
   246             ret = AddCallL( aTsyReqHandle, 
       
   247 				reinterpret_cast<TName*>( aPackage.Des1u() ) );
       
   248             break;
       
   249         case EMobileConferenceCallSwap:
       
   250             ret = SwapL( aTsyReqHandle );
       
   251             break;
       
   252         case EMobileConferenceCallHangUp:
       
   253             ret = HangUpL( aTsyReqHandle );
       
   254             break;
       
   255         case EMobileConferenceCallEnumerateCalls:
       
   256             ret = EnumerateCalls( aTsyReqHandle, 
       
   257                 reinterpret_cast<TInt*>( dataPtr ) );
       
   258             break;
       
   259         case EMobileConferenceCallGetMobileCallInfo:
       
   260             ret = GetMobileCallInfo( aTsyReqHandle, 
       
   261                 reinterpret_cast<TInt*>( dataPtr ),
       
   262                 aPackage.Des2n() );
       
   263             break;
       
   264         case EMobileConferenceCallGetConferenceStatus:
       
   265             ret = GetConferenceStatus( aTsyReqHandle, 
       
   266 				reinterpret_cast<RMobileConferenceCall::TMobileConferenceStatus*>(
       
   267 					dataPtr ) );
       
   268             break;
       
   269         case EMobileConferenceCallNotifyConferenceStatusChange:
       
   270             ret = NotifyConferenceStatusChange(
       
   271 				reinterpret_cast<RMobileConferenceCall::TMobileConferenceStatus*>(
       
   272 					dataPtr ) );
       
   273             break;
       
   274         case EMobileConferenceCallNotifyConferenceEvent:
       
   275             ret = NotifyConferenceEvent(
       
   276 				reinterpret_cast<RMobileConferenceCall::TMobileConferenceEvent*>(
       
   277 					dataPtr ), reinterpret_cast<TName*>( aPackage.Des2u() ) );
       
   278             break;
       
   279         default:
       
   280             ret = KErrNotSupported;
       
   281             break;
       
   282         }
       
   283 
       
   284     return ret;
       
   285 
       
   286     }
       
   287 
       
   288 // ---------------------------------------------------------------------------
       
   289 // CMmConferenceCallTsy::ReqModeL
       
   290 // ReqModeL is called from the server's CTelObject::ReqAnalyserL
       
   291 // in order to check the type of request it has.
       
   292 // (other items were commented in a header).
       
   293 // ---------------------------------------------------------------------------
       
   294 //
       
   295 CTelObject::TReqMode CMmConferenceCallTsy::ReqModeL(
       
   296     const TInt aIpc )
       
   297     {
       
   298     CTelObject::TReqMode ret( 0 ); // default return value
       
   299   
       
   300     switch ( aIpc )
       
   301         {
       
   302         // No Flow Control
       
   303         // All disabled
       
   304         // TSYs wishing to implement their own buffering algorithm will place
       
   305         // all requests in this category.
       
   306         // This category will also be used by the RecoverDataPort request that
       
   307         // must be passed to the TSY to indicate that it may use the
       
   308         // communications port after a loan.
       
   309 
       
   310         //Get methods that do not use DOS and return immediately.
       
   311         //Flow control not required.
       
   312         case EMobileConferenceCallGetCaps:
       
   313         case EMobileConferenceCallGetMobileCallInfo:
       
   314         case EMobileConferenceCallGetConferenceStatus:
       
   315         //Other methods that do not use DOS and return immediately.
       
   316         //Flow control not required.        
       
   317         case EMobileConferenceCallEnumerateCalls:
       
   318 
       
   319         //Methods that can propably take a long time and cannot therefore be
       
   320         //flow controlled. Solution: All these methods must check req handle
       
   321         //table before handling the request. In case that the request table
       
   322         //indicates that same method has been called and has not been
       
   323         //completed, the method should return KErrServerBusy.
       
   324         case EMobileConferenceCallHangUp:
       
   325             break;
       
   326 
       
   327         // Flow Controlled Services
       
   328         // KReqModeFlowControlObeyed
       
   329         // Commands that change the state of the phone, e.g. clearing the AoC
       
   330         // counter; are commands that TSY should only deal with one at a time.
       
   331  
       
   332         //Voice call related methods that should be handled only
       
   333         //one at the time.
       
   334         case EMobileConferenceCallCreateConference:
       
   335         case EMobileConferenceCallSwap:
       
   336         case EMobileConferenceCallAddCall:
       
   337             ret = KReqModeFlowControlObeyed;
       
   338             break;
       
   339         // ReqModePostImmediately
       
   340         // Requests that notify a client about a change of state, where the 
       
   341         // TSY needs to distinguish between different clients.
       
   342         //*******************************************************************
       
   343         // (TAN) DO NOT USE THIS if not absolutely certain how to handle the 
       
   344         // corresponding method in TSY. Differs from all other situations!!! 
       
   345         //********************************************************************
       
   346             //ret=KReqModeRePostImmediately;
       
   347 
       
   348         // KReqModeMultipleCompletionEnabled
       
   349         // (a) commands that may take some time, but which the TSY can handle
       
   350         // more than one of concurrently, or 
       
   351         // (b) notifications that the TSY does not wish to be re-posted
       
   352         // immediately, so the server does no buffering.
       
   353             //ret=KReqModeMultipleCompletionEnabled;
       
   354 
       
   355         // KReqModeMultipleCompletionEnabled | KReqModeFlowControlObeyed
       
   356         // A command that may take some time and which the TSY can only deal
       
   357         // with one at a time.
       
   358         //case EEtelCallSetFaxSettings:
       
   359         //    ret = KReqModeMultipleCompletionEnabled |
       
   360         //        KReqModeFlowControlObeyed;
       
   361         //    break;
       
   362 
       
   363         //Notifications
       
   364         //KReqModeMultipleCompletionEnabled | ReqModePostImmediately
       
   365         //Requests that notify a client about a change of state.
       
   366         //Since these requests do not require the issuing of any modem
       
   367         //commands, they do not have to obey flow control.
       
   368         //The TSY never gets more than one of these outstanding per CTelObject
       
   369         case EMobileConferenceCallNotifyCapsChange:
       
   370         case EMobileConferenceCallNotifyConferenceStatusChange:
       
   371         case EMobileConferenceCallNotifyConferenceEvent:
       
   372             ret = KReqModeMultipleCompletionEnabled | 
       
   373                                                     KReqModeRePostImmediately;
       
   374             break;
       
   375         //Cancel Requests
       
   376         //It is not necessary to include the Cancel methods in ReqModeL at all
       
   377         //The ETel server never calls ReqModeL with a Cancel IPC.
       
   378 
       
   379         // Other variations of return values are unusable
       
   380         default:
       
   381             // Unknown or invalid Call IPC
       
   382             User::Leave( KErrNotSupported );
       
   383             break;
       
   384         }
       
   385 
       
   386     return ret;
       
   387 
       
   388     }
       
   389 
       
   390 // ---------------------------------------------------------------------------
       
   391 // CMmConferenceCallTsy::NumberOfSlotsL
       
   392 // NumberOfSlotsL is called by the server when it is registering a 
       
   393 // new NOTIFICATION. It enables the TSY to tell the server 
       
   394 // how many buffer slots to allocate for "repost immediately" notifications 
       
   395 // that may trigger before clients collect them.
       
   396 // (other items were commented in a header).
       
   397 // ---------------------------------------------------------------------------
       
   398 //
       
   399 TInt CMmConferenceCallTsy::NumberOfSlotsL(
       
   400     const TInt aIpc )
       
   401     {
       
   402     // There is a buffer in the ETel server for each type of NOTIFICATION and
       
   403     // the size of the buffer is determined by the TSY. When the ETel server
       
   404     // discovers that a request is "repost immediately" it will ask the TSY 
       
   405     // how big a buffer it wants by calling CTelObject::NumberOfSlotsL( ).
       
   406     //
       
   407     // It is up to the TSY developer's judgement how many buffer slots this
       
   408     // method returns for each notification. If there is a danger that a
       
   409     // particular notification could trigger frequently and in rapid 
       
   410     // succession (e.g. call group change notification) then at least 10 or 20 
       
   411     // slots may be required. For a notification that triggers rarely, perhaps 
       
   412     // 1 or 2 slots is enough.
       
   413     //
       
   414     // So if the ETel server has stored a few occurrences of a particular
       
   415     // notification, when client subsequently calls that notification request,
       
   416     // the ETel server will complete the client's request with the saved data.
       
   417 
       
   418     TInt numberOfSlots = 1;
       
   419 
       
   420     switch ( aIpc ) 
       
   421         {
       
   422         case EMobileConferenceCallNotifyCapsChange:
       
   423             numberOfSlots = KMmConferenceCallCapsChangeSlots;
       
   424             break;
       
   425         case EMobileConferenceCallNotifyConferenceStatusChange:
       
   426             numberOfSlots = KMmConferenceCallStatusChangeSlots;
       
   427             break;
       
   428         case EMobileConferenceCallNotifyConferenceEvent:
       
   429             numberOfSlots = KMmConferenceCallEventSlots;
       
   430             break;
       
   431         default:
       
   432             // Unknown or invalid Call IPC
       
   433             User::Leave( KErrNotSupported );
       
   434             break;
       
   435         }
       
   436 
       
   437     return numberOfSlots;
       
   438 
       
   439     }
       
   440 
       
   441 // ---------------------------------------------------------------------------
       
   442 // CMmConferenceCallTsy::CancelService
       
   443 // CancelService is called by the server when it is 
       
   444 // "cleaning-up" any still outstanding asynchronous requests before closing 
       
   445 // a client's sub-session. This will happen if a client closes its R-class 
       
   446 // handle without cancelling outstanding asynchronous requests. Only 
       
   447 // Mobile API requests are handled here.
       
   448 // (other items were commented in a header).
       
   449 // ---------------------------------------------------------------------------
       
   450 //
       
   451 TInt CMmConferenceCallTsy::CancelService(
       
   452     const TInt aIpc,
       
   453     const TTsyReqHandle aTsyReqHandle )
       
   454     {
       
   455     //When the clients close their sub-sessions (eg. by calling RPhone::Close)
       
   456     //they may not have cancelled all their outstanding asynchronous requests
       
   457     //before closing. It is up to the ETel server to clean up in this
       
   458     //situation, so the server will find the list of outstanding requests
       
   459     //related to that sub-session object and pass these outstanding IPC req.
       
   460     //numbers, one at a time, to the CancelService function in the TSY.
       
   461     
       
   462     TInt ret( KErrNone );
       
   463 
       
   464     switch( aIpc )
       
   465         {
       
   466         //TSY has started a request and it is not possible to then cancel
       
   467         //this request. The best thing for the TSY to do in this case is
       
   468         //to proceed as though the Cancel never happened. The server's call
       
   469         //to the TSY cancel function will return synchronously. The TSY then
       
   470         //continues to wait for the original acknowledgement and when it
       
   471         //receives it, the TSY will complete the original request.
       
   472         case EMobileConferenceCallCreateConference:
       
   473         case EMobileConferenceCallAddCall:
       
   474         case EMobileConferenceCallSwap:
       
   475         case EMobileConferenceCallHangUp:
       
   476             break;
       
   477 
       
   478 
       
   479         //Cancel methods that are not supported
       
   480         //case XXX
       
   481         //    ret = KErrNotSupported;
       
   482         //    break;
       
   483 
       
   484         //Notification Cancels, no special requirements.
       
   485         case EMobileConferenceCallNotifyCapsChange:
       
   486             ret = NotifyCapsChangeCancel( aTsyReqHandle );
       
   487             break;
       
   488         case EMobileConferenceCallNotifyConferenceStatusChange:
       
   489             ret = NotifyConferenceStatusChangeCancel( aTsyReqHandle );
       
   490             break;
       
   491         case EMobileConferenceCallNotifyConferenceEvent:
       
   492             ret = NotifyConferenceEventCancel( aTsyReqHandle );
       
   493             break;
       
   494         //Everything is taken care in the method implementation.
       
   495         //Just direct the request to the method.
       
   496         //case
       
   497         //  none
       
   498 
       
   499         //Default case
       
   500         default:
       
   501             ret = KErrNotFound;
       
   502             break;
       
   503         }
       
   504 
       
   505     return ret;
       
   506 
       
   507     }
       
   508 
       
   509 // ---------------------------------------------------------------------------
       
   510 // CMmConferenceCallTsy::Init
       
   511 // Initialisation method that is called from ETel Server.
       
   512 // ---------------------------------------------------------------------------
       
   513 //
       
   514 void CMmConferenceCallTsy::Init()
       
   515     {
       
   516 
       
   517     // None
       
   518 
       
   519     }
       
   520 
       
   521 // ---------------------------------------------------------------------------
       
   522 // CMmConferenceCallTsy::RegisterNotification
       
   523 // RegisterNotification is called when the server recognises 
       
   524 // that this notification is being posted for the first time on this 
       
   525 // sub-session object. It enables the TSY to "turn on" any regular 
       
   526 // notification messages that it may receive from DOS. Currently does not 
       
   527 // really do anything but returns KErrNone to ETel server in case of known 
       
   528 // notification request type. 
       
   529 // (other items were commented in a header).
       
   530 // ---------------------------------------------------------------------------
       
   531 //
       
   532 TInt CMmConferenceCallTsy::RegisterNotification(
       
   533     const TInt aIpc )
       
   534     {
       
   535     TInt ret( KErrNotSupported );
       
   536     
       
   537     switch( aIpc )
       
   538         {
       
   539         case EMobileConferenceCallNotifyCapsChange:
       
   540         case EMobileConferenceCallNotifyConferenceStatusChange:
       
   541         case EMobileConferenceCallNotifyConferenceEvent:
       
   542             ret = KErrNone;
       
   543             break;
       
   544         default:
       
   545             // Unknown or invalid IPC
       
   546             ret = KErrNotSupported;
       
   547             break;
       
   548         }
       
   549 
       
   550     return ret;
       
   551 
       
   552     }
       
   553 
       
   554 // ---------------------------------------------------------------------------
       
   555 // CMmConferenceCallTsy::DeregisterNotification
       
   556 // DeregisterNotification is called when the server recognises 
       
   557 // that this notification will not be posted again because the last client 
       
   558 // to have a handle on this sub-session object has just closed the handle. 
       
   559 // It enables the TSY to "turn off" any regular notification messages that 
       
   560 // it may receive from DOS. Currently does not really do anything but returns 
       
   561 // KErrNone to ETel server in case of known notification request type.
       
   562 // (other items were commented in a header).
       
   563 // ---------------------------------------------------------------------------
       
   564 //
       
   565 TInt CMmConferenceCallTsy::DeregisterNotification(
       
   566     const TInt aIpc )
       
   567     {
       
   568     TInt ret( KErrNotSupported );
       
   569     
       
   570     switch( aIpc )
       
   571         {
       
   572         case EMobileConferenceCallNotifyCapsChange:
       
   573         case EMobileConferenceCallNotifyConferenceStatusChange:
       
   574         case EMobileConferenceCallNotifyConferenceEvent:
       
   575             ret = KErrNone;
       
   576             break;
       
   577         default:
       
   578             // Unknown or invalid IPC
       
   579             ret = KErrNotSupported;
       
   580             break;
       
   581         }
       
   582 
       
   583     return ret;
       
   584 
       
   585     }
       
   586 
       
   587 // ---------------------------------------------------------------------------
       
   588 // CMmConferenceCallTsy::GetCaps
       
   589 // This method returns the current capabilities of the conference call.
       
   590 // (other items were commented in a header).
       
   591 // ---------------------------------------------------------------------------
       
   592 //
       
   593 TInt CMmConferenceCallTsy::GetCaps(
       
   594     const TTsyReqHandle aTsyReqHandle,
       
   595     TUint32* aCaps )
       
   596     {
       
   597     //Conference caps
       
   598     *aCaps = iConferenceCaps;
       
   599     //Complete the request 
       
   600     ReqCompleted( aTsyReqHandle, KErrNone );
       
   601 
       
   602     return KErrNone;
       
   603     }
       
   604 
       
   605 // ---------------------------------------------------------------------------
       
   606 // CMmConferenceCallTsy::NotifyCapsChange
       
   607 // This method allows clients to be notified when the conference 
       
   608 // call capabilities change.
       
   609 // (other items were commented in a header).
       
   610 // ---------------------------------------------------------------------------
       
   611 //
       
   612 TInt CMmConferenceCallTsy::NotifyCapsChange(
       
   613     TUint32* aCaps )
       
   614     {
       
   615     //save pointer where to copy the changed value
       
   616     iRetCaps = aCaps;
       
   617     //save req handle type
       
   618     iReqHandleType = EMultimodeConferenceCallCapsChangeNotification;
       
   619 
       
   620     return KErrNone;
       
   621     }
       
   622 
       
   623 // ---------------------------------------------------------------------------
       
   624 // CMmConferenceCallTsy::NotifyCapsChangeCancel
       
   625 // Cancels an outstanding asynchronous NotifyCapsChange request.
       
   626 // (other items were commented in a header).
       
   627 // ---------------------------------------------------------------------------
       
   628 //
       
   629 TInt CMmConferenceCallTsy::NotifyCapsChangeCancel(
       
   630     const TTsyReqHandle aTsyReqHandle )
       
   631     {
       
   632     //set pointer to NULL
       
   633     iRetCaps = NULL;
       
   634     //reset req handle
       
   635     iTsyReqHandleStore->ResetTsyReqHandle(
       
   636         EMultimodeConferenceCallCapsChangeNotification );
       
   637 
       
   638     //Complete request
       
   639     ReqCompleted( aTsyReqHandle, KErrCancel );
       
   640 
       
   641     return KErrNone;
       
   642     }
       
   643 
       
   644 
       
   645 // ---------------------------------------------------------------------------
       
   646 // CMmConferenceCallTsy::CompleteNotifyCapsChange
       
   647 // Completes NotifyCapsChange request when capabilities change.
       
   648 // (other items were commented in a header).
       
   649 // ---------------------------------------------------------------------------
       
   650 //
       
   651 void CMmConferenceCallTsy::CompleteNotifyCapsChange(
       
   652     TUint32 aCaps )
       
   653     {
       
   654     //update internal capabilities
       
   655     iConferenceCaps = aCaps;
       
   656 
       
   657     //reset req handle. Returns the deleted req handle
       
   658     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
       
   659         EMultimodeConferenceCallCapsChangeNotification );
       
   660 
       
   661     //if req handle was found
       
   662     if ( EMultimodeConferenceCallReqHandleUnknown != reqHandle )
       
   663         {
       
   664         //copy conference caps to requested location
       
   665         *iRetCaps = iConferenceCaps;
       
   666         //complete request
       
   667         ReqCompleted( reqHandle, KErrNone );
       
   668         }
       
   669 
       
   670     }
       
   671 
       
   672 // ---------------------------------------------------------------------------
       
   673 // CMmConferenceCallTsy::CreateConferenceL
       
   674 // Allows clients to create the initial conference call.
       
   675 // (other items were commented in a header).
       
   676 // ---------------------------------------------------------------------------
       
   677 //
       
   678 TInt CMmConferenceCallTsy::CreateConferenceL(
       
   679     const TTsyReqHandle aTsyReqHandle )
       
   680     {
       
   681 TFLOGSTRING("TSY: CMmConferenceCallTsy::CreateConferenceL");
       
   682     //Store call object with status connected
       
   683 	iConnectedCall = 
       
   684 		iMmPhone->CallList()->GetMmCallByStatus( RMobileCall::EStatusConnected );
       
   685     
       
   686     //Store call object with status hold        
       
   687   	iHoldCall = 
       
   688   		iMmPhone->CallList()->GetMmCallByStatus( RMobileCall::EStatusHold );
       
   689   		
       
   690     //Let extension try to create conference call
       
   691     TInt ret = iMmConferenceCallExtInterface->CreateConferenceL( iStatus );
       
   692 
       
   693     if ( ret != KErrNone )
       
   694         {
       
   695         //request failed.
       
   696         ReqCompleted( aTsyReqHandle, ret );
       
   697         }
       
   698     else
       
   699         {
       
   700         //save req handle type
       
   701         iReqHandleType = EMultimodeConferenceCallCreateConference;
       
   702         }
       
   703 
       
   704     return KErrNone;
       
   705 
       
   706     }
       
   707 
       
   708 // ---------------------------------------------------------------------------
       
   709 // CMmConferenceCallTsy::CompleteCreateConference
       
   710 // Complete creation of conference call.
       
   711 // (other items were commented in a header).
       
   712 // ---------------------------------------------------------------------------
       
   713 //
       
   714 void CMmConferenceCallTsy::CompleteCreateConference(
       
   715     TInt aResult )
       
   716     {
       
   717 TFLOGSTRING("TSY: CMmConferenceCallTsy::CompleteCreateConference");
       
   718     //reset req handle. Returns the deleted req handle
       
   719     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
       
   720         EMultimodeConferenceCallCreateConference );
       
   721 
       
   722     //if req handle was available
       
   723     if ( EMultimodeConferenceCallReqHandleUnknown != reqHandle )
       
   724         {
       
   725         //complete caps after successfully creating conference
       
   726 		if ( KErrNone == aResult )
       
   727             {
       
   728             //hangup and swap are now possible
       
   729             iConferenceCaps = RMobileConferenceCall::KCapsSwap |
       
   730                 RMobileConferenceCall::KCapsHangUp;
       
   731 
       
   732             //set flag telling that caps have changed
       
   733             iCapsChanged = ETrue;
       
   734             
       
   735             if( iConnectedCall && iHoldCall )
       
   736             	{
       
   737             	TName connectedCall = iConnectedCall->CallName();
       
   738             	TName holdCall = iHoldCall->CallName();
       
   739             	
       
   740             	if( connectedCall.Length() != 0 && holdCall.Length() != 0 )
       
   741             		{
       
   742             		// Create object including call names
       
   743             		// wich were first ones in conference 
       
   744             		TName callsInConference;
       
   745             		callsInConference.Zero();
       
   746             		callsInConference.Append( connectedCall );
       
   747             		callsInConference.Append( KDelimiter );
       
   748             		callsInConference.Append( holdCall );
       
   749             		//Complete event
       
   750             		CompleteNotifyConferenceEvent( callsInConference,
       
   751             					RMobileConferenceCall::EConferenceBuilt );            		
       
   752             		}
       
   753 
       
   754             	}
       
   755             }
       
   756 
       
   757         //complete request
       
   758         ReqCompleted( reqHandle, aResult );
       
   759         }
       
   760 
       
   761     }
       
   762 
       
   763 // ---------------------------------------------------------------------------
       
   764 // CMmConferenceCallTsy::AddCallL
       
   765 // Adds the single voice call specified by the aCallName parameter 
       
   766 // to an existing conference call
       
   767 // (other items were commented in a header).
       
   768 // ---------------------------------------------------------------------------
       
   769 //
       
   770 TInt CMmConferenceCallTsy::AddCallL(
       
   771     const TTsyReqHandle aTsyReqHandle,
       
   772     const TName* aCallName )
       
   773     {
       
   774 TFLOGSTRING("TSY: CMmConferenceCallTsy::AddCallL");    
       
   775     //set return value to KErrNotFound
       
   776     TInt ret( KErrNotFound );
       
   777     
       
   778     //copy the name of the call to be added, will be used when request is
       
   779     //later completed
       
   780     iAddCallName = *aCallName;
       
   781 
       
   782     //start adding a call to conference call
       
   783     ret = iMmConferenceCallExtInterface->AddCallL( 
       
   784         &iAddCallName, iStatus, iMmPhone->CallList() );
       
   785 
       
   786     if ( ret != KErrNone )
       
   787         {
       
   788         //request failed, complete with error value
       
   789         ReqCompleted( aTsyReqHandle, ret );
       
   790         }
       
   791     else
       
   792         {
       
   793         // Store the request handle
       
   794         iReqHandleType = EMultimodeConferenceCallAddCall;
       
   795         }
       
   796 
       
   797     return KErrNone;
       
   798 
       
   799     }
       
   800 
       
   801 // ---------------------------------------------------------------------------
       
   802 // CMmConferenceCallTsy::CompleteAddCall
       
   803 // Complete addition of a new call to the conference call
       
   804 // (other items were commented in a header).
       
   805 // ---------------------------------------------------------------------------
       
   806 //
       
   807 void CMmConferenceCallTsy::CompleteAddCall(
       
   808     TInt aResult )
       
   809     {
       
   810 TFLOGSTRING2("TSY: CMmConferenceCallTsy::CompleteAddCall, Result: %d", aResult );
       
   811 
       
   812     //reset req handle. Returns the deleted req handle
       
   813     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
       
   814         EMultimodeConferenceCallAddCall );
       
   815 
       
   816     //successful case, call added to the conference call.
       
   817     if ( EMultimodeConferenceCallReqHandleUnknown != reqHandle )
       
   818         {
       
   819         if ( (KErrNone == aResult) && (iAddCallName.Length() > 0) )
       
   820             {
       
   821 TFLOGSTRING("TSY: AddCall succeeded. AddCall request completed");
       
   822             //notify call added using the call name received with AddCall
       
   823             //request
       
   824             CompleteNotifyConferenceEvent( iAddCallName,
       
   825                 RMobileConferenceCall::EConferenceCallAdded );
       
   826 
       
   827             //Name of the call to be added to Conference call
       
   828             iAddCallName.Zero();
       
   829 
       
   830 			RemoveNonParticipatingCall();
       
   831             }
       
   832 		else
       
   833 			{
       
   834 			//something special is needed here to handle a case where 
       
   835 			//CompleteAddCall fails
       
   836 			TFLOGSTRING("TSY: AddCall failed");
       
   837 			TFLOGSTRING2("TSY: # of CC participants: %d", iNumOfCallsInConferenceCall );
       
   838 			if ( 2 == iNumOfCallsInConferenceCall )
       
   839 				{
       
   840 				TFLOGSTRING("TSY: FIX FOR A ADDCALL & MT RELEASE CASE");
       
   841 				CMmCallTsy* mmCall = NULL;
       
   842 				CMmCallList* callList = iMmPhone->CallList();
       
   843 				CMmCallGsmWcdmaExt* mmCallGsmWcdmaExt = NULL;
       
   844 				RMobileCall::TMobileCallStatus status( RMobileCall::EStatusIdle );
       
   845 
       
   846 				//now check all calls
       
   847 				for ( TInt i = 0; i < callList->GetNumberOfObjects(); i++ )
       
   848 					{
       
   849 					mmCall = callList->GetMmCallByIndex(i);
       
   850 					status = mmCall->MobileCallStatus();
       
   851 
       
   852 					TFLOGSTRING2("TSY: Handling call, Call ID: %d", mmCall->CallId() );
       
   853 
       
   854 					if ( status == RMobileCall::EStatusHold ||
       
   855 						status == RMobileCall::EStatusConnected )
       
   856 						{
       
   857 						TFLOGSTRING("TSY: Status was Held or Connected, reconstructing capabilities");
       
   858 
       
   859 						// Fetch the active call extension
       
   860 						mmCallGsmWcdmaExt = static_cast<CMmCallGsmWcdmaExt*>(
       
   861 							mmCall->ActiveCallExtension() )
       
   862 														;
       
   863 						//set caps to be added;
       
   864 						TUint32 caps = RMobileCall::KCapsHangUp
       
   865 							| RMobileCall::KCapsJoin 
       
   866 							| RMobileCall::KCapsTransfer
       
   867 							| RMobileCall::KCapsSwap;
       
   868 						//add Join caps
       
   869 						mmCallGsmWcdmaExt->AddGSMCallCaps( caps );
       
   870 						//complete caps change notification
       
   871 						mmCall->CompleteNotifyMobileCallCapsChange( KErrNone );
       
   872 						}
       
   873 					}
       
   874 				//Clear conference call
       
   875 				//Check if conference call is possible to build
       
   876 				CheckConferenceCapability();
       
   877 				//rebuild capabilities of individual calls
       
   878 				}
       
   879 			else
       
   880 				{
       
   881 				TFLOGSTRING("TSY: normal AddCall failure");
       
   882 				}
       
   883 			}
       
   884         ReqCompleted( reqHandle, aResult );
       
   885         }
       
   886 
       
   887     }
       
   888 
       
   889 // ---------------------------------------------------------------------------
       
   890 // CMmConferenceCallTsy::RemoveNonParticipatingCall()
       
   891 // Removes call wich is not participant in conference 
       
   892 // (other items were commented in a header).
       
   893 // ---------------------------------------------------------------------------
       
   894 //
       
   895 
       
   896 void CMmConferenceCallTsy::RemoveNonParticipatingCall()
       
   897 	{
       
   898 
       
   899 	TFLOGSTRING("TSY: CMmConferenceCallTsy::RemoveNonParticipatingCall");
       
   900 
       
   901 	RMobileCall::TMobileCallStatus statusOfCallsInConference(
       
   902 		RMobileCall::EStatusConnected);
       
   903 	CMmCallTsy* mmCall = NULL;
       
   904 	CMmCallList* callList = iMmPhone->CallList();
       
   905 	RMobileCall::TMobileCallStatus status (RMobileCall::EStatusIdle);
       
   906 	TInt numberOfCallInConference(0);
       
   907 	TBool callReleased = EFalse;
       
   908 
       
   909 	TFLOGSTRING2("TSY: Conference status: %d", iStatus);
       
   910 
       
   911 	if ( iStatus == RMobileConferenceCall::EConferenceHold )
       
   912 		{
       
   913 		statusOfCallsInConference = RMobileCall::EStatusHold;
       
   914 		}
       
   915 
       
   916 	//now check all calls
       
   917 	for ( TInt c = 0; c < callList->GetNumberOfObjects(); c++ )
       
   918 		{
       
   919 		mmCall = callList->GetMmCallByIndex(c);
       
   920 		status = mmCall->MobileCallStatus();
       
   921 
       
   922 		if ( mmCall->IsPartOfConference() &&
       
   923 			status != statusOfCallsInConference )
       
   924 			{
       
   925 			//send removed event
       
   926 			CompleteNotifyConferenceEvent( 
       
   927 				mmCall->CallName(), 
       
   928 				RMobileConferenceCall::EConferenceCallRemoved );
       
   929 TFLOGSTRING("TSY: Call removed from conference." );
       
   930 			}
       
   931 		else if ( status == statusOfCallsInConference )
       
   932 			{
       
   933 			numberOfCallInConference++;
       
   934 			
       
   935 			}
       
   936 		if ( mmCall->IsRemoteReleasedCall() )
       
   937 			{
       
   938 TFLOGSTRING("TSY: One call is remote released");
       
   939 			callReleased = ETrue;
       
   940 			}
       
   941 		}
       
   942 		if ( numberOfCallInConference == 2 &&
       
   943 			iNumOfCallsInConferenceCall == 3 && callReleased )
       
   944 			{
       
   945 			iNumOfCallsInConferenceCall--;
       
   946 			TFLOGSTRING("TSY: number of calls in conference decremented");
       
   947 		}
       
   948 
       
   949 	}
       
   950 
       
   951 
       
   952 // ---------------------------------------------------------------------------
       
   953 // CMmConferenceCallTsy::SwapL
       
   954 // Allows a client to switch a conference call between "Active" and
       
   955 // "Hold" states.
       
   956 // (other items were commented in a header).
       
   957 // ---------------------------------------------------------------------------
       
   958 //
       
   959 TInt CMmConferenceCallTsy::SwapL(
       
   960     const TTsyReqHandle aTsyReqHandle )
       
   961     {
       
   962 TFLOGSTRING("TSY: CMmConferenceCallTsy::SwapL");      
       
   963     //direct request to extension
       
   964     TInt ret = iMmConferenceCallExtInterface->SwapL(
       
   965         iStatus, iMmPhone->CallList() );
       
   966 
       
   967     if ( ret != KErrNone )
       
   968         {
       
   969         //complete request with error value
       
   970         ReqCompleted( aTsyReqHandle, ret );
       
   971         }
       
   972     else
       
   973         {
       
   974         // Store the request handle
       
   975         iReqHandleType = EMultimodeConferenceCallSwap;
       
   976         }
       
   977 
       
   978     return KErrNone;
       
   979 
       
   980     }
       
   981         
       
   982 // ---------------------------------------------------------------------------
       
   983 // CMmConferenceCallTsy::CompleteSwap
       
   984 // Complete the ongoing swap request.
       
   985 // (other items were commented in a header).
       
   986 // ---------------------------------------------------------------------------
       
   987 //
       
   988 void CMmConferenceCallTsy::CompleteSwap(
       
   989     TInt aResult )
       
   990     {
       
   991 TFLOGSTRING("TSY: CMmConferenceCallTsy::CompleteSwap");      
       
   992     //reset req handle. Returns the deleted req handle
       
   993     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
       
   994         EMultimodeConferenceCallSwap );
       
   995 
       
   996     if ( EMultimodeConferenceCallReqHandleUnknown != reqHandle )
       
   997         {
       
   998 #ifdef USING_CTSY_DISPATCHER
       
   999         if (aResult == KErrNone) // Conference event should only be completed if swap was successful
       
  1000         	{
       
  1001 #endif // USING_CTSY_DISPATCHER
       
  1002         TName emptyBuf;
       
  1003         emptyBuf.Zero();
       
  1004         CompleteNotifyConferenceEvent( emptyBuf,
       
  1005             				RMobileConferenceCall::EConferenceSwapped );
       
  1006 #ifdef USING_CTSY_DISPATCHER
       
  1007         	}
       
  1008 #endif // USING_CTSY_DISPATCHER         
       
  1009         //complete request
       
  1010         ReqCompleted( reqHandle, aResult );
       
  1011         }
       
  1012     }
       
  1013 
       
  1014 // ---------------------------------------------------------------------------
       
  1015 // CMmConferenceCallTsy::HangUpL
       
  1016 // Terminates the whole conference call (all calls participating in the 
       
  1017 // conference call)
       
  1018 // (other items were commented in a header).
       
  1019 // ---------------------------------------------------------------------------
       
  1020 //
       
  1021 TInt CMmConferenceCallTsy::HangUpL(
       
  1022     const TTsyReqHandle aTsyReqHandle )
       
  1023     {
       
  1024 	TInt ret( KErrServerBusy );
       
  1025 
       
  1026 	// Check if request handle already exists
       
  1027     TTsyReqHandle conferenceCallHangUpHandle = iTsyReqHandleStore->
       
  1028         GetTsyReqHandle( EMultimodeConferenceCallHangUp );
       
  1029 
       
  1030     if ( conferenceCallHangUpHandle != EMultimodeConferenceCallReqHandleUnknown )
       
  1031         {
       
  1032         ReqCompleted( aTsyReqHandle, ret );
       
  1033         }
       
  1034     else
       
  1035 	{
       
  1036         //Close all calls that are part of the conference call. Held call 
       
  1037         //is not released if there is one...
       
  1038         ret = iMmConferenceCallExtInterface->HangUpL( iStatus );
       
  1039 
       
  1040         //if request failed
       
  1041         if ( ret != KErrNone )
       
  1042             {
       
  1043             //complete request with error value
       
  1044             ReqCompleted( aTsyReqHandle, ret );
       
  1045             }
       
  1046         else
       
  1047             {
       
  1048             //save last request type
       
  1049             iReqHandleType = EMultimodeConferenceCallHangUp;
       
  1050             }
       
  1051 	}
       
  1052 	
       
  1053 	//Reset pointer
       
  1054     iHoldCall = NULL;
       
  1055 	//Reset pointer
       
  1056 	iConnectedCall = NULL;
       
  1057 
       
  1058     return KErrNone;
       
  1059 
       
  1060     }
       
  1061 
       
  1062 // ---------------------------------------------------------------------------
       
  1063 // CMmConferenceCallTsy::CompleteHangUp
       
  1064 // Completes call hangup.
       
  1065 // (other items were commented in a header).
       
  1066 // ---------------------------------------------------------------------------
       
  1067 //
       
  1068 void CMmConferenceCallTsy::CompleteHangUp(
       
  1069     TInt aResult )
       
  1070     {
       
  1071     //reset req handle. Returns the deleted req handle
       
  1072     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
       
  1073         EMultimodeConferenceCallHangUp );
       
  1074 
       
  1075     if ( EMultimodeConferenceCallReqHandleUnknown != reqHandle )
       
  1076         {
       
  1077         // ignore KErrGsmReleaseByUser, which means that the call ended
       
  1078         // because the local user released the call, and must be treated
       
  1079         // as a normal return code from the LTSY
       
  1080         TInt ret = ( (aResult == KErrGsmReleaseByUser) ? KErrNone : aResult );
       
  1081         
       
  1082         //complete request
       
  1083         ReqCompleted( reqHandle, ret );
       
  1084         }
       
  1085 
       
  1086     }
       
  1087 
       
  1088 // ---------------------------------------------------------------------------
       
  1089 // CMmConferenceCallTsy::EnumerateCalls
       
  1090 // This method returns the number of calls that are currently 
       
  1091 // part of the conference call.
       
  1092 // (other items were commented in a header).
       
  1093 // ---------------------------------------------------------------------------
       
  1094 //
       
  1095 TInt CMmConferenceCallTsy::EnumerateCalls(
       
  1096     const TTsyReqHandle aTsyReqHandle,
       
  1097     TInt* aCount )
       
  1098     {
       
  1099     *aCount = iNumOfCallsInConferenceCall;
       
  1100 
       
  1101     ReqCompleted( aTsyReqHandle, KErrNone );
       
  1102     return KErrNone;
       
  1103 
       
  1104     }
       
  1105 
       
  1106 // ---------------------------------------------------------------------------
       
  1107 // CMmConferenceCallTsy::GetMobileCallInfo
       
  1108 // This method returns a current snapshot of the call 
       
  1109 // information associated with the call specified by the aIndex parameter.
       
  1110 // NOTE! Conference call has to be in active state (Held or Active) before
       
  1111 // this method can return anything. Idle conference call is not considered 
       
  1112 // to contain any calls.
       
  1113 // (other items were commented in a header).
       
  1114 // ---------------------------------------------------------------------------
       
  1115 //
       
  1116 TInt CMmConferenceCallTsy::GetMobileCallInfo(
       
  1117     const TTsyReqHandle aTsyReqHandle,
       
  1118     TInt* aIndex,
       
  1119     TDes8* aCallInfo )
       
  1120     {
       
  1121     TInt ret( KErrNotReady );
       
  1122 
       
  1123     if ( RMobileConferenceCall::EConferenceIdle != iStatus )
       
  1124         {
       
  1125         //Let extension get the information
       
  1126         ret = iMmConferenceCallExtInterface->GetMobileCallInfo( 
       
  1127             aIndex, aCallInfo, iMmPhone->CallList(), iStatus );
       
  1128         }
       
  1129 
       
  1130     ReqCompleted( aTsyReqHandle, ret );
       
  1131     return KErrNone;
       
  1132 
       
  1133     }
       
  1134 
       
  1135 // ---------------------------------------------------------------------------
       
  1136 // CMmConferenceCallTsy::GetConferenceStatus
       
  1137 // Allows clients to retrieve the current status of the conference call.
       
  1138 // (other items were commented in a header).
       
  1139 // ---------------------------------------------------------------------------
       
  1140 //
       
  1141 TInt CMmConferenceCallTsy::GetConferenceStatus(
       
  1142     const TTsyReqHandle aTsyReqHandle,
       
  1143     RMobileConferenceCall::TMobileConferenceStatus* aStatus )
       
  1144     {
       
  1145 TFLOGSTRING2("TSY: CMmConferenceCallTsy::GetConferenceStatus. iStatus:%d", iStatus );     
       
  1146     *aStatus = iStatus;
       
  1147 
       
  1148     ReqCompleted( aTsyReqHandle, KErrNone );
       
  1149     return KErrNone;
       
  1150 
       
  1151     }
       
  1152 
       
  1153 // ---------------------------------------------------------------------------
       
  1154 // CMmConferenceCallTsy::Status
       
  1155 // This function returns conference call status. For internal use.
       
  1156 // (other items were commented in a header).
       
  1157 // ---------------------------------------------------------------------------
       
  1158 //
       
  1159 RMobileConferenceCall::TMobileConferenceStatus CMmConferenceCallTsy::Status() const
       
  1160     {
       
  1161 
       
  1162     //return conference call status
       
  1163     return iStatus;
       
  1164  
       
  1165     }
       
  1166     
       
  1167 // ---------------------------------------------------------------------------
       
  1168 // CMmConferenceCallTsy::NotifyConferenceStatusChange
       
  1169 // Allows clients to be notified of a change in the status of a 
       
  1170 // conference call.
       
  1171 // (other items were commented in a header).
       
  1172 // ---------------------------------------------------------------------------
       
  1173 //
       
  1174 TInt CMmConferenceCallTsy::NotifyConferenceStatusChange(
       
  1175     RMobileConferenceCall::TMobileConferenceStatus* aStatus )
       
  1176     {
       
  1177     iRetStatus = aStatus;
       
  1178     iReqHandleType = EMultimodeConferenceCallStatusChangeNotification;
       
  1179 
       
  1180     return KErrNone;
       
  1181 
       
  1182     }
       
  1183 
       
  1184 // ---------------------------------------------------------------------------
       
  1185 // CMmConferenceCallTsy::NotifyConferenceStatusChangeCancel
       
  1186 // Cancels an outstanding asynchronous NotifyConferenceStatusChange request.
       
  1187 // (other items were commented in a header).
       
  1188 // ---------------------------------------------------------------------------
       
  1189 //
       
  1190 TInt CMmConferenceCallTsy::NotifyConferenceStatusChangeCancel(
       
  1191     const TTsyReqHandle aTsyReqHandle )
       
  1192     {
       
  1193     iRetStatus = NULL;
       
  1194 
       
  1195     iTsyReqHandleStore->ResetTsyReqHandle( 
       
  1196         EMultimodeConferenceCallStatusChangeNotification );
       
  1197 
       
  1198     ReqCompleted( aTsyReqHandle, KErrCancel );
       
  1199     return KErrNone;
       
  1200 
       
  1201     }
       
  1202 
       
  1203 // ---------------------------------------------------------------------------
       
  1204 // CMmConferenceCallTsy::CompleteNotifyConferenceStatusChange
       
  1205 // Completes conference status change notification. Extension
       
  1206 // should already have updated status so this method retrieves the new 
       
  1207 // status from the extension and does the actions required by new and old 
       
  1208 // statuses.
       
  1209 // (other items were commented in a header).
       
  1210 // ---------------------------------------------------------------------------
       
  1211 //
       
  1212 void CMmConferenceCallTsy::CompleteNotifyConferenceStatusChange()
       
  1213     {
       
  1214     TBool conferenceStatusChanged( EFalse );
       
  1215 
       
  1216     RMobileConferenceCall::TMobileConferenceStatus oldStatus = iStatus;
       
  1217 TFLOGSTRING2("TSY: CMmConferenceCallTsy::CompleteNotifyConferenceStatusChange. oldStatus:%d", oldStatus );    
       
  1218     iMmConferenceCallExtInterface->GetNewStatus( &iStatus );
       
  1219 
       
  1220     switch( iStatus )
       
  1221         {
       
  1222         //new status is EConferenceIdle
       
  1223         case RMobileConferenceCall::EConferenceIdle:
       
  1224             //This might be caused by HangUp
       
  1225             CompleteHangUp( KErrNone );
       
  1226             //caps have changed
       
  1227             iCapsChanged = ETrue;
       
  1228             //status has changed
       
  1229             conferenceStatusChanged = ETrue;
       
  1230             //reset internal attributes
       
  1231             ResetAttributes();
       
  1232             break;
       
  1233         //new status is EConferenceActive
       
  1234         case RMobileConferenceCall::EConferenceActive:
       
  1235             // if previous status was EConferenceIdle
       
  1236             if ( oldStatus == RMobileConferenceCall::EConferenceIdle )
       
  1237                 {
       
  1238                 //is CreateConference request pending
       
  1239                 if ( iTsyReqHandleStore->GetTsyReqHandle( 
       
  1240                             EMultimodeConferenceCallCreateConference ) > 0 )
       
  1241                     {
       
  1242                     //CreateConference handling
       
  1243                     CompleteCreateConference( KErrNone );
       
  1244                     }
       
  1245                 //status has changed
       
  1246                 conferenceStatusChanged = ETrue;
       
  1247                 }
       
  1248             //if previous state was EConferenceHold
       
  1249             else if ( oldStatus == RMobileConferenceCall::EConferenceHold )
       
  1250                 {
       
  1251                 //is AddCall request pending
       
  1252                 if ( iTsyReqHandleStore->
       
  1253                     GetTsyReqHandle( EMultimodeConferenceCallAddCall ) > 0 )
       
  1254                     {
       
  1255                     //AddCall handling
       
  1256                     CompleteAddCall ( KErrNone );
       
  1257                     }
       
  1258                 //is Swap request pending.
       
  1259                 else if ( iTsyReqHandleStore->
       
  1260                     GetTsyReqHandle( EMultimodeConferenceCallSwap ) > 0 )
       
  1261                     {
       
  1262                     //resuming held conference call.
       
  1263                     CompleteSwap ( KErrNone );
       
  1264                     }
       
  1265                 //status has changed
       
  1266                 conferenceStatusChanged = ETrue;
       
  1267                 }
       
  1268             break;
       
  1269         //new status is EConferenceHold
       
  1270         case RMobileConferenceCall::EConferenceHold:
       
  1271             //Complete Swap
       
  1272             CompleteSwap ( KErrNone );
       
  1273             //status has changed
       
  1274             conferenceStatusChanged = ETrue;
       
  1275             break;
       
  1276         default:
       
  1277             //nothing to do
       
  1278             break;
       
  1279         }
       
  1280 
       
  1281     //get TSY req handle. 
       
  1282     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
       
  1283         EMultimodeConferenceCallStatusChangeNotification );
       
  1284 
       
  1285     if ( ( EMultimodeConferenceCallReqHandleUnknown != reqHandle ) &&
       
  1286         conferenceStatusChanged )
       
  1287         {
       
  1288 TFLOGSTRING2("TSY: CMmConferenceCallTsy::CompleteNotifyConferenceStatusChange. Cur. iStatus:%d", iStatus );         
       
  1289         //reset req handle.
       
  1290         iTsyReqHandleStore->ResetTsyReqHandle(
       
  1291             EMultimodeConferenceCallStatusChangeNotification );
       
  1292         *iRetStatus = iStatus;            
       
  1293         ReqCompleted( reqHandle, KErrNone );
       
  1294         }
       
  1295 
       
  1296     if ( iCapsChanged )
       
  1297         {
       
  1298         //if conference caps are not 0, notify it
       
  1299         if ( 0 != iConferenceCaps )
       
  1300             {
       
  1301             CompleteNotifyCapsChange( iConferenceCaps );
       
  1302             }
       
  1303         else
       
  1304             {
       
  1305             //Otherwise we still have to check that is Conference creation
       
  1306             //now possible
       
  1307             CheckConferenceCapability();
       
  1308             //If CreateConference is now possible, iConferenceCaps is not 0.
       
  1309             //Completion has already been done.
       
  1310             if ( 0 == iConferenceCaps )
       
  1311                 {
       
  1312                 //Otherwise we have to complete the caps change with 0 value.
       
  1313                 CompleteNotifyCapsChange( iConferenceCaps );
       
  1314                 }
       
  1315             }
       
  1316 
       
  1317         iCapsChanged = EFalse;
       
  1318         }
       
  1319 
       
  1320     }
       
  1321 
       
  1322 // ---------------------------------------------------------------------------
       
  1323 // CMmConferenceCallTsy::NotifyConferenceEvent
       
  1324 // Allows a client to be notified when a conference call event occurs.
       
  1325 // (other items were commented in a header).
       
  1326 // ---------------------------------------------------------------------------
       
  1327 //
       
  1328 TInt CMmConferenceCallTsy::NotifyConferenceEvent(
       
  1329     RMobileConferenceCall::TMobileConferenceEvent* aEvent,
       
  1330     TName* aCallName )
       
  1331     {
       
  1332     iRetConferenceEventCallName = aCallName; 
       
  1333     iRetConferenceEvent = aEvent;
       
  1334 
       
  1335     iReqHandleType = EMultimodeConferenceCallConferenceEventNotification;
       
  1336 
       
  1337     return KErrNone;
       
  1338 
       
  1339     }
       
  1340 
       
  1341 // ---------------------------------------------------------------------------
       
  1342 // CMmConferenceCallTsy::NotifyConferenceEventCancel
       
  1343 // Cancels an outstanding asynchronous NotifyConferenceEvent request.
       
  1344 // (other items were commented in a header).
       
  1345 // ---------------------------------------------------------------------------
       
  1346 //
       
  1347 TInt CMmConferenceCallTsy::NotifyConferenceEventCancel(
       
  1348     const TTsyReqHandle aTsyReqHandle )
       
  1349     {
       
  1350     iRetConferenceEventCallName = NULL; 
       
  1351     iRetConferenceEvent = NULL;
       
  1352 
       
  1353     iTsyReqHandleStore->ResetTsyReqHandle( 
       
  1354         EMultimodeConferenceCallConferenceEventNotification );
       
  1355 
       
  1356     ReqCompleted( aTsyReqHandle, KErrCancel );
       
  1357     return KErrNone;
       
  1358 
       
  1359     }
       
  1360 
       
  1361 // ---------------------------------------------------------------------------
       
  1362 // CMmConferenceCallTsy::CompleteNotifyConferenceEvent
       
  1363 // Completes conference event notification.
       
  1364 // (other items were commented in a header).
       
  1365 // ---------------------------------------------------------------------------
       
  1366 //
       
  1367 void CMmConferenceCallTsy::CompleteNotifyConferenceEvent(
       
  1368     const TName& aName,
       
  1369     RMobileConferenceCall::TMobileConferenceEvent aEvent )
       
  1370     {
       
  1371 TFLOGSTRING2("TSY: CMmConferenceCallTsy::CompleteNotifyConferenceEvent.aEvent:%d", aEvent );
       
  1372     //reset req handle. Returns the deleted req handle
       
  1373     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
       
  1374         EMultimodeConferenceCallConferenceEventNotification );
       
  1375 
       
  1376     //if req handle was set
       
  1377     if ( EMultimodeConferenceCallReqHandleUnknown != reqHandle )
       
  1378         {    
       
  1379         //copy name of the call to which the event happened to the requested
       
  1380         //address
       
  1381         iRetConferenceEventCallName->Copy( aName );
       
  1382         //copy event to the requested address
       
  1383         *iRetConferenceEvent = aEvent;
       
  1384    
       
  1385         ReqCompleted( reqHandle, KErrNone );
       
  1386         }
       
  1387 
       
  1388     //if event was add
       
  1389     if ( aEvent == RMobileConferenceCall::EConferenceCallAdded )
       
  1390         {
       
  1391 
       
  1392 		// inform the call object that it is now part of the conference
       
  1393 		CMmCallTsy* addedCall = iMmPhone->CallList()-> GetMmCallByName(
       
  1394             &aName );
       
  1395 		if ( addedCall )
       
  1396 			{
       
  1397 			addedCall->SetPartOfConference( ETrue );
       
  1398 			}
       
  1399 
       
  1400         //increment iNumOfCallsInConferenceCall
       
  1401         iNumOfCallsInConferenceCall++;
       
  1402         }
       
  1403 
       
  1404     //if event was removed
       
  1405     else if ( aEvent == RMobileConferenceCall::EConferenceCallRemoved )
       
  1406         {
       
  1407 
       
  1408 		// inform the call object that it is not part of the conference anymore
       
  1409 		CMmCallTsy* removedCall = iMmPhone->CallList()->GetMmCallByName(
       
  1410             &aName );
       
  1411 		if ( removedCall )
       
  1412 			{
       
  1413 			removedCall->SetPartOfConference( EFalse );
       
  1414 			}
       
  1415 
       
  1416         //decrement iNumOfCallsInConferenceCall
       
  1417         iNumOfCallsInConferenceCall--;
       
  1418         }
       
  1419 
       
  1420     }
       
  1421 
       
  1422 // ---------------------------------------------------------------------------
       
  1423 // CMmConferenceCallTsy::IsGoOneToOneSupported
       
  1424 // Checks if given call can be splitted from the conference call.
       
  1425 // (other items were commented in a header).
       
  1426 // ---------------------------------------------------------------------------
       
  1427 //
       
  1428 TBool CMmConferenceCallTsy::IsGoOneToOneSupported(
       
  1429     TInt aCallId )
       
  1430     {
       
  1431     TBool supported( EFalse );
       
  1432 
       
  1433     //The action is only valid if the MS is in GSM mode, the selected call 
       
  1434     //is a voice call and it is a member of an ongoing conference call.
       
  1435     TInt ret = iMmConferenceCallExtInterface->IsGoOneToOneSupported( 
       
  1436         aCallId, iStatus, iMmPhone->CallList() );
       
  1437 
       
  1438     if ( KErrNone == ret )
       
  1439         {
       
  1440         //GoOneToOne is supported to this call
       
  1441         supported = ETrue;
       
  1442         }
       
  1443 
       
  1444     return supported;
       
  1445 
       
  1446     }
       
  1447 
       
  1448 // ---------------------------------------------------------------------------
       
  1449 // CMmConferenceCallTsy::GetActiveConferenceCallExtension
       
  1450 // Returns a pointer to the active conference call extension.
       
  1451 // (other items were commented in a header).
       
  1452 // ---------------------------------------------------------------------------
       
  1453 //
       
  1454 CMmConferenceCallExtInterface* CMmConferenceCallTsy::GetActiveConferenceCallExtension()
       
  1455     {
       
  1456 
       
  1457     return iMmConferenceCallExtInterface;
       
  1458     
       
  1459     }
       
  1460 
       
  1461 
       
  1462 // ---------------------------------------------------------------------------
       
  1463 // CMmConferenceCallTsy::SetActiveConferenceCallExtension
       
  1464 // Sets active Conference call extension.
       
  1465 // (other items were commented in a header).
       
  1466 // ---------------------------------------------------------------------------
       
  1467 //
       
  1468 TInt CMmConferenceCallTsy::SetActiveConferenceCallExtension(
       
  1469     CMmConferenceCallExtInterface* aMmConferenceCallExt )
       
  1470     {
       
  1471     // Used if active conference call extension pointer is NULL
       
  1472     TInt ret( KErrGeneral );
       
  1473 
       
  1474     //if not null
       
  1475     if ( aMmConferenceCallExt )
       
  1476         {
       
  1477         //set pointer
       
  1478         iMmConferenceCallExtInterface = aMmConferenceCallExt;
       
  1479         ret = KErrNone;
       
  1480         }
       
  1481 
       
  1482     return ret;
       
  1483 
       
  1484     }
       
  1485 
       
  1486 // ---------------------------------------------------------------------------
       
  1487 // CMmConferenceCallTsy::CheckConferenceCapability
       
  1488 // Checks if conference call creation is possible. The request 
       
  1489 // is directed to the active extension which can make the decision.
       
  1490 // (other items were commented in a header).
       
  1491 // ---------------------------------------------------------------------------
       
  1492 //
       
  1493 void CMmConferenceCallTsy::CheckConferenceCapability()
       
  1494     {
       
  1495 
       
  1496     //Let extension decide if conference call creation is possible. 
       
  1497     iMmConferenceCallExtInterface->CheckConferenceCapability( 
       
  1498         iStatus, iMmPhone->CallList() );
       
  1499 
       
  1500     }
       
  1501 
       
  1502 // ---------------------------------------------------------------------------
       
  1503 // CMmConferenceCallTsy::NumberOfCallsInConference
       
  1504 // This method returns the number of calls that are currently part of 
       
  1505 // the conference call. For internal use.
       
  1506 // (other items were commented in a header).
       
  1507 // ---------------------------------------------------------------------------
       
  1508 //
       
  1509 TInt CMmConferenceCallTsy::NumberOfCallsInConference() const
       
  1510     {
       
  1511 
       
  1512     return iNumOfCallsInConferenceCall;
       
  1513 
       
  1514     }
       
  1515 
       
  1516 // ---------------------------------------------------------------------------
       
  1517 // CMmConferenceCallTsy::ServiceRequested
       
  1518 // Returns ETrue if this service is pending on conference call object
       
  1519 // (other items were commented in a header).
       
  1520 // ---------------------------------------------------------------------------
       
  1521 //
       
  1522 TBool CMmConferenceCallTsy::ServiceRequested(
       
  1523     CMmConferenceCallTsy::TConferenceCallRequestTypes aReqType )
       
  1524     {
       
  1525     TBool ret( EFalse );
       
  1526 
       
  1527     //if req handle is found from req handle store
       
  1528     if ( CMmConferenceCallTsy::EMultimodeConferenceCallReqHandleUnknown != 
       
  1529         iTsyReqHandleStore->GetTsyReqHandle( aReqType ) )
       
  1530         {
       
  1531         //set value to ETrue -> request is pending
       
  1532         ret = ETrue;
       
  1533         }
       
  1534 
       
  1535     return ret;
       
  1536 
       
  1537     }
       
  1538 
       
  1539 // ---------------------------------------------------------------------------
       
  1540 // CMmConferenceCallTsy::CallStatusChanged
       
  1541 // After the status of a single call has changed, extension decides if
       
  1542 // the status of the conference call should be changed as well.
       
  1543 // (other items were commented in a header).
       
  1544 // ---------------------------------------------------------------------------
       
  1545 //
       
  1546 void CMmConferenceCallTsy::CallStatusChanged(
       
  1547     RMobileCall::TMobileCallStatus aNewStatus,
       
  1548     TInt aCallId )
       
  1549     {
       
  1550 	// only releasing, holding and connecting a call can cause a change
       
  1551 	// of conference status
       
  1552 	if ( ( RMobileCall::EStatusIdle == aNewStatus ) ||
       
  1553 		 ( RMobileCall::EStatusHold == aNewStatus ) ||
       
  1554 		 ( RMobileCall::EStatusConnected == aNewStatus ) )
       
  1555 		{
       
  1556 		TBool conferenceStatusChanged = iMmConferenceCallExtInterface->
       
  1557 			CallStatusChanged( aNewStatus, aCallId );
       
  1558 
       
  1559 		if ( conferenceStatusChanged )
       
  1560 			{
       
  1561 			CompleteNotifyConferenceStatusChange();
       
  1562 			}
       
  1563 		}
       
  1564 
       
  1565 	//conference call creation might be possible, check it.
       
  1566 	CheckConferenceCapability();
       
  1567 
       
  1568 	}
       
  1569 
       
  1570 // ---------------------------------------------------------------------------
       
  1571 // CMmConferenceCallTsy::Phone
       
  1572 // Returns pointer to the Multimode Phone object. For internal use.
       
  1573 // (other items were commented in a header).
       
  1574 // ---------------------------------------------------------------------------
       
  1575 //
       
  1576 CMmPhoneTsy* CMmConferenceCallTsy::Phone()
       
  1577     {
       
  1578 
       
  1579     return iMmPhone;
       
  1580 
       
  1581     }
       
  1582 
       
  1583 // ---------------------------------------------------------------------------
       
  1584 // CMmConferenceCallTsy::ResetAttributes
       
  1585 // Resets internal attributes of Conference call object. Calls also protocol 
       
  1586 // extension to do the same.
       
  1587 // (other items were commented in a header).
       
  1588 // ---------------------------------------------------------------------------
       
  1589 //
       
  1590 void CMmConferenceCallTsy::ResetAttributes()
       
  1591     {
       
  1592 TFLOGSTRING("TSY: CMmConferenceCallTsy::ResetAttributes." );    
       
  1593     //Name of the call to be added to Conference call
       
  1594     iAddCallName.Zero();
       
  1595     //Conference call capabilities
       
  1596     iConferenceCaps = 0;
       
  1597     //Number of calls in conference call
       
  1598     iNumOfCallsInConferenceCall = 0;
       
  1599     //Last used req handle type
       
  1600     iReqHandleType = EMultimodeConferenceCallReqHandleUnknown;
       
  1601     //Conference call status
       
  1602     iStatus = RMobileConferenceCall::EConferenceIdle;
       
  1603     //Reset pointer
       
  1604     iHoldCall = NULL;
       
  1605 	//Reset pointer
       
  1606 	iConnectedCall = NULL;
       
  1607 
       
  1608     if ( 0 != iTsyReqHandleStore->GetTsyReqHandle( 
       
  1609         EMultimodeConferenceCallAddCall ) )
       
  1610         {
       
  1611 		TInt error = CMmCommonStaticUtility::EpocErrorCode(
       
  1612             KErrEtelCallNotActive, KErrMMEtelCallTerminated );
       
  1613         CompleteAddCall( error );
       
  1614         }
       
  1615     if ( 0 != iTsyReqHandleStore->GetTsyReqHandle( 
       
  1616         EMultimodeConferenceCallCreateConference ) )
       
  1617         {
       
  1618 		TInt error = CMmCommonStaticUtility::EpocErrorCode(
       
  1619             KErrEtelCallNotActive, KErrMMEtelCallTerminated );
       
  1620         CompleteCreateConference( error );
       
  1621         }
       
  1622     if ( 0 != iTsyReqHandleStore->GetTsyReqHandle( 
       
  1623         EMultimodeConferenceCallSwap ) )
       
  1624         {
       
  1625 		TInt error = CMmCommonStaticUtility::EpocErrorCode(
       
  1626             KErrEtelCallNotActive, KErrMMEtelCallTerminated );
       
  1627         CompleteSwap( error );
       
  1628         }
       
  1629 
       
  1630     //Direct reset also to the extension
       
  1631     iMmConferenceCallExtInterface->ResetAttributes();
       
  1632 
       
  1633     }
       
  1634 
       
  1635 // ---------------------------------------------------------------------------
       
  1636 // CMmConferenceCallTsy::Caps
       
  1637 // This function returns conference call capabilities. For internal use.
       
  1638 // (other items were commented in a header).
       
  1639 // ---------------------------------------------------------------------------
       
  1640 //
       
  1641 TUint32 CMmConferenceCallTsy::Caps() const
       
  1642     {
       
  1643 
       
  1644     //return conference call caps
       
  1645     return iConferenceCaps;
       
  1646  
       
  1647     }
       
  1648 
       
  1649 #ifdef REQHANDLE_TIMER
       
  1650 // ---------------------------------------------------------------------------
       
  1651 // CMmConferenceCallTsy::SetTypeOfResponse
       
  1652 // Sets the type of response for a given Handle. Automatic
       
  1653 // mode includes an automatic response in case of no response
       
  1654 // from the DOS in a specified time
       
  1655 // ---------------------------------------------------------------------------
       
  1656 //
       
  1657 void CMmConferenceCallTsy::SetTypeOfResponse(
       
  1658     const TInt aReqHandleType,
       
  1659     const TTsyReqHandle aTsyReqHandle )
       
  1660     {
       
  1661     TInt timeOut( 0 );
       
  1662 
       
  1663     switch ( aReqHandleType )
       
  1664         {
       
  1665         case EMultimodeConferenceCallCreateConference:
       
  1666             timeOut = KMmConferenceCallCreateConferenceTimeOut;
       
  1667             break;
       
  1668         case EMultimodeConferenceCallAddCall:
       
  1669             timeOut = KMmConferenceCallAddCallTimeOut;
       
  1670             break;
       
  1671         case EMultimodeConferenceCallSwap:
       
  1672             timeOut = KMmConferenceCallSwapTimeOut;
       
  1673             break;
       
  1674         case EMultimodeConferenceCallHangUp:
       
  1675             timeOut = KMmConferenceCallHangUpTimeOut;
       
  1676             break;
       
  1677         //Can't use timer:
       
  1678         // - all notifications
       
  1679             //case EMultimodeConferenceCallStatusChangeNotification: 
       
  1680             //case EMultimodeConferenceCallCapsChangeNotification:
       
  1681             //case EMultimodeConferenceCallConferenceEventNotification:
       
  1682         default:
       
  1683             iTsyReqHandleStore->SetTsyReqHandle( 
       
  1684                 aReqHandleType, aTsyReqHandle );
       
  1685             break;
       
  1686         }
       
  1687 
       
  1688     //if timeout is requested
       
  1689     if ( timeOut > 0 )
       
  1690         {
       
  1691         //set time out
       
  1692         iTsyReqHandleStore->SetTsyReqHandle(
       
  1693             aReqHandleType, aTsyReqHandle, timeOut );
       
  1694         }
       
  1695 
       
  1696     }
       
  1697 
       
  1698 // ---------------------------------------------------------------------------
       
  1699 // CMmConferenceCallTsy::Complete
       
  1700 // Completes the request due timer expiration.
       
  1701 // (other items were commented in a header).
       
  1702 // ---------------------------------------------------------------------------
       
  1703 //
       
  1704 void CMmConferenceCallTsy::Complete(
       
  1705     TInt aReqHandleType,
       
  1706     TInt aError )
       
  1707     {
       
  1708     //All possible TSY req handle types of Conference call are listed in the
       
  1709     //switch case below. 
       
  1710 
       
  1711     switch( aReqHandleType )
       
  1712         {
       
  1713         case EMultimodeConferenceCallCreateConference:
       
  1714 			CompleteCreateConference( aError );
       
  1715             break;
       
  1716         case EMultimodeConferenceCallAddCall:
       
  1717 			CompleteAddCall( aError );
       
  1718             break;
       
  1719         case EMultimodeConferenceCallSwap:
       
  1720 			CompleteSwap( aError );
       
  1721             break;
       
  1722         case EMultimodeConferenceCallHangUp:
       
  1723 			CompleteHangUp( aError );
       
  1724             break;
       
  1725         //Can't use timer:
       
  1726         // - all notifications
       
  1727             //case EMultimodeConferenceCallStatusChangeNotification: 
       
  1728             //case EMultimodeConferenceCallCapsChangeNotification:
       
  1729             //case EMultimodeConferenceCallConferenceEventNotification:
       
  1730         default:
       
  1731             ReqCompleted( iTsyReqHandleStore->ResetTsyReqHandle( 
       
  1732                 aReqHandleType ), aError );
       
  1733             break;
       
  1734         }
       
  1735     
       
  1736     }
       
  1737 #endif // REQHANDLE_TIMER
       
  1738 
       
  1739 #ifdef TF_LOGGING_ENABLED
       
  1740 // ---------------------------------------------------------------------------
       
  1741 // CMmConferenceCallTsy::ReqCompleted
       
  1742 // Overrides CTelObject::ReqCompleted for test logging purposes. 
       
  1743 // It prints the aTsyReqHandle and aError variable in the log file and then 
       
  1744 // calls CTelObject::ReqCompleted.
       
  1745 // (other items were commented in a header).
       
  1746 // ---------------------------------------------------------------------------
       
  1747 //
       
  1748 void CMmConferenceCallTsy::ReqCompleted(
       
  1749     const TTsyReqHandle aTsyReqHandle,
       
  1750     const TInt aError )
       
  1751     {
       
  1752 	TFLOGSTRING3("TSY: CMmConferenceCallTsy::Request Completed. \n\t\t\tHandle:%d\n\t\t\t Error:%d",
       
  1753         aTsyReqHandle, aError);
       
  1754 
       
  1755     //call original ReqCompleted from CTelObject
       
  1756     CTelObject::ReqCompleted( aTsyReqHandle, aError );
       
  1757 
       
  1758     }
       
  1759 #endif // TF_LOGGING_ENABLED
       
  1760 
       
  1761 
       
  1762 //  End of File