multimediacommsengine/mmcesrv/mmceserver/inc/mcecssubsession.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CMCECSSUBSESSION_H
       
    22 #define CMCECSSUBSESSION_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <stringpool.h>
       
    27 #include <sipconnection.h>
       
    28 #include "mcesrv.h"
       
    29 #include "mceclientserver.h"
       
    30 #include "mcesip.h"
       
    31 #include "fcsession.h"
       
    32 
       
    33 
       
    34 //FORWARD DECLARATION
       
    35 class CSIPProfile;
       
    36 class CMceCsSession;
       
    37 class CMceCsSessionImplementation;
       
    38 class CMceCsSubSessionReceiver;
       
    39 class CMceServerCore;
       
    40 class TMceIds;
       
    41 class CMceMsgBase;
       
    42 class CMceSipManager;
       
    43 class CMceSipConnection;
       
    44 class CSIPServerTransaction;
       
    45 class CSIPClientTransaction;
       
    46 class CSIPDialogAssocBase;
       
    47 class CSIPClientTransaction;
       
    48 class CSIPTransactionBase;
       
    49 class CSIPDialog;
       
    50 class CDesC8Array;
       
    51 class TMceStateTransitionEvent;
       
    52 class CSIPProfileRegistry;
       
    53 
       
    54 #define LAST_REQUEST_IND iPendingReceivedRequests.Count()-1
       
    55 #define CURRENT_REQUEST_IND LAST_REQUEST_IND
       
    56 
       
    57 #define CURRENT_REQUEST()\
       
    58     ( iPendingReceivedRequests.Count() == 0 ?\
       
    59       NULL : iPendingReceivedRequests[ LAST_REQUEST_IND ] )
       
    60 
       
    61 #define FIRST_REQUEST()\
       
    62     ( iPendingReceivedRequests.Count() == 0 ?\
       
    63       NULL : iPendingReceivedRequests[ 0 ] )
       
    64 
       
    65 // CLASS DECLARATION
       
    66 
       
    67 /**
       
    68 * Client-Server sub-session is the base class
       
    69 * for SIP sessions, which have created to encapsulate
       
    70 * SIP dialogs.
       
    71 * This class provides methods to handle CS subsession
       
    72 * specifig ITC functions and to receive SIP requests and 
       
    73 * responses.
       
    74 *
       
    75 *  @lib 
       
    76 *  @since
       
    77 */
       
    78 class CMceCsSubSession : public CBase
       
    79     {
       
    80 
       
    81 public: //enums
       
    82 
       
    83     enum TType
       
    84         {
       
    85         EUnknown = -1,
       
    86         EInSession,
       
    87         EOutSession,
       
    88         EOutSIPSession
       
    89         };
       
    90         
       
    91 public: // Constructors and destructor
       
    92 
       
    93 
       
    94 	/**
       
    95 	* Destructor.
       
    96 	*/
       
    97 	~CMceCsSubSession();
       
    98 
       
    99 public: // New functions
       
   100 
       
   101 
       
   102 	/**
       
   103 	* Returns client type of session.
       
   104 	* The type represents type of dialog used in session.
       
   105 	* @return client type of session
       
   106 	*/
       
   107     TMceCsSessionType ClientType() const;
       
   108 
       
   109 	/**
       
   110 	* Returns type of session
       
   111 	* @return type of session
       
   112 	*/
       
   113     TType Type() const;
       
   114     
       
   115 	/**
       
   116 	* Returns SIP connection instance
       
   117 	* @return SIP connection
       
   118 	*/
       
   119     CMceSipConnection& SIPConnection() const;
       
   120 
       
   121 	/**
       
   122 	* Returns SIP manager instance
       
   123 	* @return SIP manager
       
   124 	*/
       
   125     CMceSipManager& Manager() const;
       
   126     
       
   127 	/**
       
   128 	* Returns server core instance
       
   129 	* @return server core
       
   130 	*/
       
   131 	CMceServerCore& ServerCore() const;
       
   132 
       
   133     /**
       
   134     * Returns client
       
   135     * @return client
       
   136     */
       
   137     CMceCsSessionImplementation& Client() const;
       
   138 
       
   139 	/**
       
   140 	* Returns floor control session instance
       
   141 	* @return floor control session
       
   142 	*/
       
   143 	const CFCSession* FCSession() const;
       
   144 
       
   145 	/**
       
   146 	* Executes ITC function called by client
       
   147 	* @param aIds set of ids defining ITC call context
       
   148 	* @param aFunction ITC function to be executed
       
   149 	* @param aMessage message from the client.
       
   150 	*/
       
   151 	void ServiceL( TMceIds& aIds, 
       
   152 	               TMceItcFunctions aFunction, 
       
   153 	               const RMessage2& aMessage );
       
   154 	
       
   155 	/**
       
   156 	* Sends data via callback mechanism to client session
       
   157 	* @param aIds set of ids defining ITC callback context
       
   158 	* @return system wide error
       
   159 	*/
       
   160     TInt SendToClient( TMceIds& aIds );
       
   161     
       
   162 	/**
       
   163 	* Sends data via callback mechanism to client session
       
   164 	* @param aIds set of ids defining ITC callback context
       
   165 	* @param aContext encoded context of message
       
   166 	* @param aContent content of message
       
   167 	*/
       
   168     void SendToClientL( TMceIds& aIds, HBufC8* aContext, HBufC8* aContent );
       
   169 
       
   170 	/**
       
   171 	* Sends error via callback mechanism to client session
       
   172 	* @param aIds set of ids defining ITC callback context
       
   173 	* @param aError the error
       
   174 	* @return system wide error
       
   175 	*/
       
   176 	TInt SendErrorToClient( TMceIds& aIds, TInt aError );
       
   177 	
       
   178     
       
   179     /**
       
   180 	* Resets the initial INVITE.
       
   181 	*/
       
   182     void ResetInitialInvite();
       
   183     
       
   184     /**
       
   185 	* Controls whether the session should generate automatically event 
       
   186 	* at next state change.
       
   187 	* @param aIsEnabled
       
   188 	*/
       
   189     void SetAutoEvent( TBool aIsEnabled );
       
   190     
       
   191     /**
       
   192 	* Checks whether the session should automatically generate an event 
       
   193 	* at next state change.
       
   194 	* @return ETrue if event should be generated, otherwise EFalse
       
   195 	*/
       
   196 	TBool AutoEvent();
       
   197 	
       
   198 	/**
       
   199 	* Stores event which will be used when automatic event generation
       
   200 	* occurs. Request which is associated with the event may be defined.
       
   201 	* @param aEvent, ownership is not transferred
       
   202 	* @param aAssociatedRequest, ownership is not transferred
       
   203 	*/
       
   204 	void StoreAutoEventL( TMceStateTransitionEvent* aEvent,
       
   205 	                      CSIPServerTransaction* aAssociatedRequest );
       
   206 	
       
   207     /**
       
   208 	* Returns stored automatic event.
       
   209 	* @return event or null
       
   210 	*/
       
   211 	TMceStateTransitionEvent* StoredAutoEvent();
       
   212     
       
   213     /**
       
   214     * Checks if profile configured.
       
   215     *
       
   216     * @return return ETrue if profile configured.
       
   217     */
       
   218 	TBool ProfileConfigured() const;
       
   219 	
       
   220 	/**
       
   221     * Return profile
       
   222     *
       
   223     * @return return profile of the connection
       
   224     */
       
   225 	CSIPProfile& Profile() const;
       
   226 
       
   227     /**
       
   228     * Set profile
       
   229     *
       
   230     * @param aProfile Profile to be used
       
   231     */
       
   232     void SetProfile( CSIPProfile& aProfile );
       
   233 
       
   234     /**
       
   235     * Check Profile contact secure status 
       
   236     *
       
   237     * @return True if profile contact with sipsUri or tls
       
   238     */
       
   239 	TBool IsProfileContactSecureL();
       
   240 
       
   241 	/**
       
   242     * Return NextHop
       
   243     *
       
   244     * @return NextHop TInetAddr
       
   245     */
       
   246 	TInetAddr* NextHopL( TInetAddr& aNextHop );
       
   247 	
       
   248 	void RemoveCompletedRequests( TBool aAll = EFalse );
       
   249     
       
   250 public://SIP adaptation methods
       
   251 
       
   252 
       
   253 	/**
       
   254 	* Initializes incoming dialog
       
   255 	* @param aTransaction server transaction representing a request,
       
   256 	* which caused dialog creation
       
   257 	*/
       
   258     void InitializeIncomingDialogL( CSIPServerTransaction* aTransaction );
       
   259 
       
   260 	/**
       
   261 	* Handles SIP request, which has been received inside a dialog
       
   262 	* @param aTransaction server transaction representing a request
       
   263 	* @param aDialog dialog to wich transaction belongs
       
   264 	* @return ETrue, if session handled the request
       
   265 	*/
       
   266     TBool DialogRequestReceived( CSIPServerTransaction* aTransaction,
       
   267     											CSIPDialog& aDialog );
       
   268 
       
   269 	/**
       
   270 	* Handles SIP request, which has been received inside a dialog.
       
   271 	* this will call DialogResponseReceived
       
   272 	* @param aTransaction server transaction representing a request
       
   273 	* @param aDialogAssoc the dialog
       
   274 	*/
       
   275     void ResponseReceivedWithinDialog( CSIPClientTransaction& aTransaction,
       
   276                                        	CSIPDialogAssocBase& aDialogAssoc );
       
   277     
       
   278 	/**
       
   279 	* Handles SIP response, which has been received inside a dialog
       
   280     * @param aTransaction client transaction representing a response
       
   281 	*/
       
   282     void DialogResponseReceived( CSIPClientTransaction& aTransaction  );
       
   283 
       
   284     /**
       
   285     * Handles SIP request, which has been received outside a dialog
       
   286     * @param aTransaction server transaction representing a request
       
   287 	* @return ETrue, if session handled the request
       
   288     */
       
   289     TBool MessageRequestReceived( CSIPServerTransaction* aTransaction );
       
   290     
       
   291 	/**
       
   292 	* Handles SIP response, which has been received outside a dialog
       
   293     * @param aTransaction client transaction representing a response
       
   294 	*/
       
   295     void MessageResponseReceived( CSIPClientTransaction& aTransaction );
       
   296 
       
   297     /*
       
   298 	* Handles situation where SIP stack has completed UAC core INVITE 
       
   299 	* transaction 64*T1 seconds after the reception of the first 
       
   300 	* 2xx response. No more 2xx responses can be received to the issued 
       
   301 	* single INVITE.
       
   302     * @param aTransaction client transaction representing a response
       
   303     */
       
   304     virtual void InviteCompleted( CSIPClientTransaction& aTransaction );
       
   305     
       
   306 	/**
       
   307 	* Handles situation where SIP connection state has changed.
       
   308     * If connection state has changed to EInactive or EUnavailable,
       
   309 	* SIP stack terminates all pending SIP client transactions and no
       
   310     * errors are reported back to the client about the terminated
       
   311     * transactions.
       
   312 	* @param aState indicates the current connection state        
       
   313 	*/
       
   314     void ConnectionStateChanged( CSIPConnection::TState aState );
       
   315 
       
   316     /**
       
   317 	* Handles situation where an asynchronous error has occured 
       
   318 	* related to a request within an existing dialog.
       
   319     *
       
   320     * @param aError error code
       
   321     * @param aTransaction the transaction
       
   322     */
       
   323     virtual void ErrorOccured( TInt aError, CSIPTransactionBase& aTransaction );
       
   324 
       
   325 	/**
       
   326 	* Returns dialog id
       
   327 	* @return dialog id
       
   328 	*/
       
   329     TUint32 DialogId() const;
       
   330     
       
   331 	/**
       
   332 	* Returns ETrue, if client has called ready to receive
       
   333 	* @return ETrue, if client has called ready to receive
       
   334 	*/
       
   335     TBool ClientExists();
       
   336     
       
   337 	/**
       
   338 	* Returns SIP dialog (assoc)
       
   339 	* @return SIP dialog or NULL if it does not exist
       
   340 	*/
       
   341     virtual CSIPDialogAssocBase* Dialog() const;
       
   342     
       
   343 	/**
       
   344 	* Returns current (pending) request
       
   345 	* @return server transaction representing the request
       
   346 	*/
       
   347     CSIPServerTransaction& Request() const;
       
   348     
       
   349     /**
       
   350     * Returns initial request which caused session creation.
       
   351     * @return server transaction representing the initial request
       
   352     */
       
   353     CSIPServerTransaction& InitialRequest() const;
       
   354     
       
   355 	/**
       
   356 	* Transferes ownership of current (pending) request
       
   357 	* @return server transaction representing the request
       
   358 	*/
       
   359     CSIPServerTransaction* PopRequest();
       
   360     
       
   361 	/**
       
   362 	* Returns current (pending) response
       
   363 	* @return client transaction representing the request
       
   364 	*/
       
   365     CSIPClientTransaction& Response() const;
       
   366 
       
   367 	/**
       
   368 	* Transferes ownership of current (pending) response
       
   369 	* @return completed client transaction or NULL if there is no 
       
   370 	* pending response or transaction is not completed.
       
   371 	*/
       
   372     CSIPClientTransaction* PopResponse();
       
   373 
       
   374 	/**
       
   375 	* Stores SIP dialog 
       
   376 	* @param aType the type of session
       
   377 	* @param aDialog SIP dialog
       
   378 	* @param aDialogId generated dialog id
       
   379 	*/
       
   380     void SetDialog( TType aType, 
       
   381                     CSIPDialogAssocBase* aDialog, 
       
   382                     TUint32 aDialogId );
       
   383     
       
   384 	/**
       
   385 	* Sets client transaction which is waiting response from peer
       
   386 	* @param aTransaction the pending transaction
       
   387 	*/
       
   388     void SetPendingTransactionL( CSIPClientTransaction* aTransaction );
       
   389 
       
   390 	/**
       
   391 	* Returns ETrue, if session will consume the transaction
       
   392 	* @param aDialog SIP dialog
       
   393 	* @param aTransaction the pending transaction
       
   394 	* @return ETrue, if session will consume the transaction
       
   395 	*/
       
   396     virtual TBool Consumes( CSIPDialog& aDialog, 
       
   397                             CSIPServerTransaction& aTransaction, 
       
   398                             TBool& aAssociatesWithDialog );
       
   399 
       
   400 	/**
       
   401 	* Returns ETrue, if session will consume the transaction
       
   402 	* @param aTransaction pending or new (incoming) transaction
       
   403 	* @return ETrue, if session will consume the transaction
       
   404 	*/
       
   405     virtual TBool Consumes( CSIPTransactionBase& aTransaction );
       
   406 
       
   407 	/**
       
   408 	* Returns ETrue, if session accepts transaction
       
   409 	* @param aTransaction new (incoming) transaction
       
   410 	* @return ETrue, if session will accepts the transaction
       
   411 	*/
       
   412     virtual TBool AcceptDialogTransaction( CSIPServerTransaction& aTransaction );
       
   413 
       
   414 	/**
       
   415 	* Returns ETrue, if session accepts stand-alone transaction
       
   416 	* @param aTransaction new (incoming) stand-alone transaction
       
   417 	* @return ETrue, if session will accepts the stand-alone transaction
       
   418 	*/
       
   419     virtual TBool AcceptStandAloneTransaction( CSIPServerTransaction& aTransaction );
       
   420 
       
   421 
       
   422 	/**
       
   423 	* Returns all pending transactions
       
   424 	* @return pending transactions as an array
       
   425 	*/
       
   426     const RPointerArray<CSIPClientTransaction>& PendingTransactions();
       
   427     
       
   428     
       
   429     const RPointerArray<CSIPServerTransaction>& PendingReceivedRequests();
       
   430 
       
   431 	/**
       
   432 	* Returns pending transaction based on type
       
   433 	* @param aType type of transaction
       
   434 	* @return pending transactions or NULL. Ownership is NOT transfered
       
   435 	*/
       
   436     CSIPClientTransaction* PendingTransaction( RStringF aType );
       
   437 
       
   438     /**
       
   439     * Returns the default headers
       
   440     * @param aMethodInd the methond index in SIP strings
       
   441     * @return default headers
       
   442     */
       
   443     CDesC8Array& DefaultHeaders( TInt aMethodInd );
       
   444     
       
   445     /**
       
   446     * Stores client's message content
       
   447     * @param aClientContent the message content
       
   448     */
       
   449     void StoreClientContent( HBufC8* aClientContent );
       
   450 
       
   451     /**
       
   452     * Transferes ownership of client message content
       
   453     * @return client content
       
   454     */
       
   455     HBufC8* PopClientContent();
       
   456     
       
   457     /**
       
   458     * Removes the pending transaction.
       
   459     * @param aTransaction the transaction to be removed
       
   460     * @return ETrue if the transaction was removed.
       
   461     */
       
   462     TBool RemovePendingTrx( CSIPClientTransaction& aTransaction );
       
   463     
       
   464 public://abstract methods
       
   465 
       
   466 
       
   467 	/**
       
   468 	* Executes ITC function called by client.
       
   469 	* Default implementation leaves with KErrNotSupported
       
   470 	* @param aIds set of ids defining ITC call context
       
   471 	* @param aFunction ITC function to be executed
       
   472 	* @return aReturnMessage buffer to store message context,
       
   473 	* which will be wrote back to client
       
   474 	*/
       
   475     virtual HBufC8* DoServiceL( TMceIds& aIds, 
       
   476                                 TMceItcFunctions aFunction );
       
   477 
       
   478 	/**
       
   479 	* Executes ITC function called by client.
       
   480 	* Default implementation leaves with KErrNotSupported
       
   481 	* @param aIds set of ids defining ITC call context
       
   482 	* @param aFunction ITC function to be executed
       
   483 	* @param aMessage message context from client
       
   484 	*/
       
   485     virtual void DoServiceL( TMceIds& aIds, 
       
   486                              TMceItcFunctions aFunction, 
       
   487 		     	             const TDesC8& aMessage );
       
   488 
       
   489 	/**
       
   490 	* Executes ITC function called by client.
       
   491 	* Default implementation leaves with KErrNotSupported
       
   492 	* @param aIds set of ids defining ITC call context
       
   493 	* @param aFunction ITC function to be executed
       
   494 	* @param aMessage message context from client
       
   495 	*/
       
   496     virtual void DoServiceL( TMceIds& aIds, 
       
   497                              TMceItcFunctions aFunction, 
       
   498 		     	             TPtr8& aMessage );
       
   499 
       
   500 
       
   501 	/**
       
   502 	* Executes ITC function called by client.
       
   503 	* Default implementation leaves with KErrNotSupported
       
   504 	* @param aIds set of ids defining ITC call context
       
   505 	* @param aFunction ITC function to be executed
       
   506 	* @param aMessage decoded message context from client
       
   507 	*/
       
   508     virtual void DoServiceL( TMceIds& aIds, 
       
   509                              TMceItcFunctions aFunction, 
       
   510 		     	             CMceMsgBase& aMessage );
       
   511 	
       
   512 	/**
       
   513 	* Returns ETrue, if session can be deleted
       
   514 	* @return ETrue, if session can be deleted
       
   515 	*/
       
   516     virtual TBool CanDispose() = 0;
       
   517 
       
   518 	/**
       
   519 	* Initializes incoming dialog
       
   520 	* @param aTransaction server transaction representing a request,
       
   521 	* which caused dialog creation
       
   522 	*/
       
   523     virtual void DoInitializeIncomingDialogL( 
       
   524                             CSIPServerTransaction& aTransaction ) = 0;
       
   525     
       
   526     /**
       
   527 	* Handles situation where an asynchronous error has occured 
       
   528 	* related to a request within an existing dialog.
       
   529     *
       
   530     * @param aError error code
       
   531     * @param aTransaction the transaction
       
   532     */
       
   533     virtual void DoErrorOccured( TInt aError, 
       
   534                                  CSIPTransactionBase& aTransaction ) = 0;
       
   535     
       
   536     /**
       
   537     * Called when error has been occured within dialog
       
   538     * @param aError error code
       
   539     */
       
   540     virtual void ErrorOccured( TInt aError ) = 0;
       
   541     
       
   542     /**
       
   543 	* Handles situation where SIP connection state has changed.
       
   544     * If connection state has changed to EInactive or EUnavailable,
       
   545 	* SIP stack terminates all pending SIP client transactions and no
       
   546     * errors are reported back to the client about the terminated
       
   547     * transactions.
       
   548 	* @param aIsActive indicates if the current connection is active
       
   549     */
       
   550     virtual void DoConnectionStateChanged( TBool aIsActive ) = 0;
       
   551 
       
   552 
       
   553     /**
       
   554     * Handles situation where incoming INVITE was 
       
   555     * canceled with the CANCEL
       
   556     */
       
   557     virtual void Canceled() = 0;
       
   558 
       
   559     /**
       
   560     * Handles situation where session must be forcefully terminated
       
   561     * @return ETrue, if session can be deleted. If there are 
       
   562     * pending operations, which cannot be done within this call, EFalse
       
   563     * is returned.
       
   564     */
       
   565     virtual TBool Terminate() = 0;
       
   566     
       
   567     /**
       
   568     * Creates new incoming dialog (association)
       
   569     * @param aInitialRequest request causing creation
       
   570     * @return created dialog association
       
   571     */
       
   572     virtual CSIPDialogAssocBase* CreateIncomingDialogL( 
       
   573                                 CSIPServerTransaction& aInitialRequest ) = 0;
       
   574 
       
   575     /**
       
   576     * Creates new outgoing dialog (association) from existing dialog
       
   577     * @param aDialogType type of new dialog
       
   578     * @param aParams parameters for creation
       
   579     * @param aExistingDialog existing dialog
       
   580     * @return created dialog association
       
   581     */
       
   582     virtual CSIPDialogAssocBase* CreateOutgoingDialogL( 
       
   583                                     TMceDialogType aDialogType, 
       
   584                                     CDesC8Array& aParams,
       
   585                                     CSIPDialog& aExistingDialog ) = 0;
       
   586 
       
   587     /**
       
   588     * Creates outgoing dialog (association) based on given parameters 
       
   589     * @param aDialogType type of new dialog
       
   590     * @param aParams parameters for creation
       
   591     * @return created dialog association
       
   592     */
       
   593     virtual CSIPDialogAssocBase* CreateOutgoingDialogL( 
       
   594                                     TMceDialogType aDialogType,
       
   595                                     CDesC8Array& aParams ) = 0;
       
   596 
       
   597     /**
       
   598     * Checks if session accepts method of incoming request
       
   599     * @param aMethod the method
       
   600     * @return ETrue, if session will accept
       
   601     */
       
   602     virtual TBool AcceptMethod( RStringF aMethod ) = 0;
       
   603     
       
   604 
       
   605     /**
       
   606     * Called when request has been received. 
       
   607     * Request can be obtained by calling Request() method
       
   608     * @param aInsideDialog tells whether request was received inside dialog
       
   609     */
       
   610     virtual void RequestReceived( TBool aInsideDialog, CSIPDialog& aDialog  ) = 0;
       
   611 
       
   612     
       
   613     /**
       
   614     * Called when response (2XX) has been received to pending transaction.
       
   615     * Response can be obtained by calling Response() method
       
   616     */
       
   617     virtual void ResponseReceived() = 0;
       
   618     
       
   619     /**
       
   620     * Called when response (1XX) has been received to pending transaction.
       
   621     * Response can be obtained by calling Response() method
       
   622     */
       
   623     virtual void ProvisionalResponseReceived() = 0;
       
   624     
       
   625     /**
       
   626     * Called when response (3XX) has been received to pending transaction.
       
   627     * Response can be obtained by calling Response() method
       
   628     */
       
   629     virtual void RedirectionResponseReceived() = 0;
       
   630      
       
   631     /**
       
   632     * Called when error response (4XX-7XX) has been received 
       
   633     * to pending transaction. 
       
   634     * Response can be obtained by calling Response() method
       
   635     */
       
   636     virtual void ErrorResponseReceived() = 0;
       
   637     
       
   638     /**
       
   639     * Called when stand-alone request has been received.
       
   640     * Request can be obtained by calling Request() method
       
   641     */
       
   642     virtual void StandAloneRequestReceived() = 0;
       
   643     
       
   644     /**
       
   645     * Called when stand-alone response (any) has been received 
       
   646     * to pending transaction. 
       
   647     * Response can be obtained by calling Response() method
       
   648     * @param aResponseType response type
       
   649     */
       
   650     virtual void StandAloneResponseReceived( 
       
   651                             TMceSipResponseType aResponseType ) = 0;
       
   652     
       
   653 
       
   654     
       
   655 protected: 
       
   656 
       
   657 	CMceCsSubSession ( TMceCsSessionType aType,
       
   658                        CMceCsSession& aClientSession,
       
   659 	                   CMceSipConnection& aSIPConnection );
       
   660 
       
   661 	CMceCsSubSession ( TMceCsSessionType aType,
       
   662                        CMceCsSession& aClientSession,
       
   663 	                   CMceSipConnection& aSIPConnection,
       
   664 	                   CSIPProfile& aProfile );
       
   665 
       
   666 	void ConstructL( CMceCsSession& aClientSession );
       
   667     TBool IsOrphan();
       
   668     
       
   669     TBool HasInitialInviteTransactionBeenCompleted() const; 
       
   670 	
       
   671 private:
       
   672 
       
   673     void DoServiceL( TMceIds& aIds, 
       
   674                      TMceItcFunctions aFunction, 
       
   675 		     	     const RMessage2& aMessage );
       
   676 	void ClientReadyToReceiveL( const RMessage2& aMessage );
       
   677 	void CancelClientReceiveL();
       
   678 	void ReceiveL( const RMessage2& aMessage );
       
   679 
       
   680     void SetClient( CMceCsSessionImplementation& aClient );
       
   681     void SetSessionReceiver( CMceCsSubSessionReceiver* aSessionReceiver );
       
   682     void SetResponse( CSIPClientTransaction& aTransaction );
       
   683     TBool RemovePendingCompletedTrx( CSIPClientTransaction& aTransaction );
       
   684     void RegisterDialogAssoc( CSIPDialogAssocBase& aDialogAssoc );
       
   685     
       
   686     
       
   687 private:// Owned Data    
       
   688 
       
   689     //type of session
       
   690     TType iType;
       
   691     //client type of session
       
   692     TMceCsSessionType iClientType;
       
   693     //receiver    
       
   694 	CMceCsSubSessionReceiver* iReceiver;
       
   695     //dialog id
       
   696     TUint32 iDialogId;
       
   697     //current response
       
   698     CSIPClientTransaction* iResponse;
       
   699     //first outgoing invite
       
   700     CSIPClientTransaction* iInitialInvite;
       
   701     //does client exist
       
   702     TBool iClientExists;
       
   703     //client message content
       
   704 	HBufC8* iClientContent;
       
   705 
       
   706 protected: // Owned Data
       
   707     
       
   708     //SIP dialog
       
   709     CSIPDialogAssocBase* iDialog;
       
   710     //pending transactions
       
   711     RPointerArray<CSIPClientTransaction> iPendingTransactions;
       
   712     //pending received requests
       
   713     RPointerArray<CSIPServerTransaction> iPendingReceivedRequests;
       
   714     
       
   715     //data for automatic event
       
   716     //        
       
   717     TBool iAutoEventEnabled;
       
   718     TMceStateTransitionEvent* iAutoEvent;
       
   719     CMceMsgBase* iAutoEventMsg;
       
   720     TMceIds* iAutoEventIds;
       
   721     CSIPServerTransaction* iAutoEventAssociatedRequest;
       
   722     TMceStateTransitionEvent* iCurrentlyProcessedAutoEvent;
       
   723 
       
   724 protected: // NOT Owned Data
       
   725     
       
   726     //current dialog, if forking has been happend
       
   727     CSIPDialogAssocBase* iCurrentDialog;
       
   728     
       
   729 
       
   730 private:// NOT owned Data
       
   731 
       
   732     //client    
       
   733 	CMceCsSessionImplementation* iClientSession;
       
   734 	//SIP connection
       
   735 	CMceSipConnection& iSIPConnection;
       
   736 	//MCE server core
       
   737 	CMceServerCore& iServerCore;
       
   738 	
       
   739 	// Sip Profile
       
   740     CSIPProfile* iProfile;
       
   741     //CSIPProfileRegistry* iProfileRegistry;
       
   742     
       
   743     	
       
   744 protected:// NOT owned Data
       
   745 	
       
   746 	//floor control session
       
   747 	CFCSession* iFCSession;
       
   748 
       
   749 
       
   750     friend class TMceFCActionSet;
       
   751     friend class CMceSipManager;
       
   752 
       
   753 	//definitions for unit testing
       
   754 	MCESRV_UT_DEFINITIONS
       
   755 
       
   756 
       
   757 	};
       
   758 
       
   759 #endif 
       
   760 
       
   761 // End of File