sipproviderplugins/sipprovider/sipstatemachine/inc/SipStateMachine.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2005-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 // CSipStateMachine definition file
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 
       
    24 #ifndef SIP_STATEMACHINE_H
       
    25 #define SIP_STATEMACHINE_H
       
    26 
       
    27 #include "transitionengine.h"
       
    28 #include "SipStateBase.h"
       
    29 #include "siphlcommontypes.h"
       
    30 
       
    31 #ifdef __FLOG_ACTIVE
       
    32 	// This will do the logging if logging is enabled
       
    33     #include <comms-infras/ss_log.h>
       
    34 #endif
       
    35 
       
    36 
       
    37 // Forward Declarations
       
    38 class CStateIdle;
       
    39 class CStateSessionInitiation;
       
    40 class CStateSessionEstablished;
       
    41 class CStateSessionTerminate;
       
    42 class CSipStateMachine;
       
    43 
       
    44 
       
    45 class TCommandContext
       
    46 /**This class represents the Handles of the SIP stack that is required
       
    47 for a particular state machine. Using these handles the State machine
       
    48 interact with the Stack to achieve a particular functionality
       
    49 
       
    50 @internalComponent
       
    51 @released since v9.2
       
    52  */
       
    53 	{
       
    54 public:
       
    55 	CSipStateBase * 			iCommandState;
       
    56 	CSIPClientTransaction*		iClientTx;
       
    57 	CSIPClientTransaction*		iCancelClientTx;
       
    58 	CSIPServerTransaction*		iServerTx;
       
    59 	CSIPInviteDialogAssoc*		iDialogAssoc;
       
    60 	CSIPRegistrationBinding*	iRegBinding;
       
    61 	CSIPSubscribeDialogAssoc*	iSubsDialogAssoc;
       
    62 	TBool						iAckCancel;
       
    63 	};
       
    64 
       
    65 class TCallTerminateCode
       
    66 /** This class will contain the call termiated error codes that needs to be sent to
       
    67 the calling application
       
    68 */
       
    69 	{
       
    70 public:
       
    71 	TInt	iErrorCode;
       
    72 	TInt	iSipCode;
       
    73 	};
       
    74 
       
    75 
       
    76 class MSIPStateMachineClient
       
    77 /**
       
    78 To be implemented by whoever uses CSipStateMachine and wishes to
       
    79 be notified about completions and events.
       
    80 
       
    81 @internalComponent
       
    82 @released since v9.2
       
    83 */
       
    84 	{
       
    85 	public:
       
    86 
       
    87 	/**
       
    88 	Called by the State Machine that call has been established
       
    89 	*/
       
    90 	virtual void CallEstablished() = 0;
       
    91 
       
    92 	/**
       
    93 	Called by the State Machine when the running or being established
       
    94 	call has been terminated. Can either:
       
    95 	- acknowledge local termination
       
    96 	- flag termination by the peer
       
    97 	- flag error during the call or during its establishment
       
    98 
       
    99 	@param aError system wide error, SIP proprietary error or KErrNoError if no error.
       
   100 	*/
       
   101 	virtual void CallTerminated(TInt aError, TInt aSipCode) = 0;
       
   102 
       
   103 	/**
       
   104 	Called by the State Machine to flag that a peer is calling.
       
   105 
       
   106     @param aCallParams the description of the call.
       
   107 	*/
       
   108 	virtual void IncomingCall(TIncomingCallParameters& aCallParams) = 0;
       
   109 
       
   110 	/**
       
   111 	Called by the State Machine to flag that credentials are
       
   112 	required for the pending call to proceed.
       
   113 
       
   114     @param aRealm the description of the credentials
       
   115 	*/
       
   116 	virtual void CredentialsRequired(const TDesC8 & aRealm) = 0;
       
   117 
       
   118 	/**
       
   119 	Called by the state machine when some notifications arrived
       
   120 
       
   121 	@param aNotification contains notification Information
       
   122 	*/
       
   123 	virtual void ReceiveNotification(TDesC8 & aNotification) = 0;
       
   124 	};
       
   125 
       
   126 
       
   127 class CSipStateMachine : public CActive
       
   128 /**
       
   129 This class contains the complete logic for all SIP realted functionalities supported
       
   130 by this release of High Level API.
       
   131 
       
   132 @internalComponent
       
   133 @released since v9.2
       
   134 */
       
   135 
       
   136 	{
       
   137 public:
       
   138 	/**
       
   139 	Static Member furnction to give life to Sip State Machine
       
   140 
       
   141 	@param aTe Handle to the Transition engine, whicn encapsulated the sip stack.
       
   142 	@param aClient, Handle to the Notification client for callback notifications
       
   143 	*/
       
   144 	IMPORT_C static CSipStateMachine * NewL(CSIPTransitionEngine * aTe, MSIPStateMachineClient* aClient, TBool aSMDirection );
       
   145 
       
   146 	/**
       
   147 	This method is responsible for Answering an Incoming call. With call to this
       
   148 	method the client is accepting a call, and call will be established. After this
       
   149 	only StopCall() will work, not RejectCall();
       
   150 	*/
       
   151 	IMPORT_C TInt AcceptCall();
       
   152 
       
   153 	/**
       
   154 	This method is responsible Starting an outgoing call.
       
   155 	*/
       
   156 	IMPORT_C TInt StartCall();
       
   157 
       
   158 	/**
       
   159 	This method is responsible to terminate an ongoing call.
       
   160 	*/
       
   161 	IMPORT_C TInt StopCall();
       
   162 
       
   163 	/**
       
   164 	This method Rejects an incoming call.
       
   165 	*/
       
   166 	IMPORT_C TInt RejectCall();
       
   167 
       
   168 	/**
       
   169 	This function will Return the handle to the Sip Paramters of the state machine
       
   170 	*/
       
   171 	IMPORT_C TSipParams & GetSipParams();
       
   172 
       
   173 	/**
       
   174 	This method paves the way for the state machine to delete itself
       
   175 	*/
       
   176 	IMPORT_C void DeleteWhenReady();
       
   177 
       
   178 	/**
       
   179     Implementing Pure virtual of Base class , cancels any outstanding request
       
   180     */
       
   181    	virtual void DoCancel();
       
   182 
       
   183    	/**
       
   184     Implementing Pure virtual of Base class. This function calls the functionality
       
   185     associated with the states
       
   186     */
       
   187 	virtual void RunL();
       
   188 
       
   189 	/**
       
   190 	Overriding the base member function, will get called in case of an error
       
   191 	*/
       
   192 	virtual TInt RunError(TInt aError);
       
   193 
       
   194 	/**
       
   195     Set the suspend state of the State machine. Using this call one can bring
       
   196     state machine into suspended mode from active mode and vice versa
       
   197 
       
   198     @param aSuspendRequest Tells whether to put state machine into suspended or active mode
       
   199     */
       
   200     void SetSuspendRequest(TBool aSuspendRequest);
       
   201 
       
   202     /**
       
   203     This function will actually start the SIP State machine.
       
   204 
       
   205     @param aClientStatus Current status of the State machine Task
       
   206     @param aErrorEvent currently not implemented, for future use
       
   207     */
       
   208     void Start( TRequestStatus* aClientStatus, CSipStateBase* aErrorEvent);
       
   209 
       
   210 	/**
       
   211 	Function will be called in The RunL gets executed in event of an
       
   212 	error
       
   213 	*/
       
   214 	void OnError();
       
   215 
       
   216 	/**
       
   217 	This function is meant for cleanup activities and get called when the
       
   218 	state machine is about to complete.
       
   219 	*/
       
   220 	void OnCompletion();
       
   221 
       
   222 	/**
       
   223 	This function gets triggered from the TE in case a SIP Response comes for
       
   224 	this state machine.
       
   225 
       
   226 	@param aMsgBundle Message specific to Handle SIP request or response
       
   227 	*/
       
   228 	void IncomingResponse(TSipMsgBundle aMsgBundle);
       
   229 
       
   230 	/**
       
   231 	This function gets triggered from the TE in case a SIP Request comes for
       
   232 	this state machine.
       
   233 
       
   234 	@param aMsgBundle Message specific to Handle SIP request or response
       
   235 	*/
       
   236 	void IncomingRequest(TSipMsgBundle aMsgBundle);
       
   237 
       
   238 	/**
       
   239 	This function gets triggered from the TE when an error is encounterd pertaining
       
   240 	to this state machine request or response.
       
   241 
       
   242 	@param aErrBundle Message specific to Handle SIP request or response
       
   243 	*/
       
   244 	void ErrorOccured(TSipMsgBundle aErrBundle);
       
   245 
       
   246 	/**
       
   247 	This function gets triggered from the TE after around 3-4 minutes when a call is
       
   248 	established. This is meant for cleaning up of the client transaction. In some case
       
   249 	a call can ne terminated before this function can gets called. In that case the client
       
   250 	transaction will be deleted before call termination and this function implementation
       
   251 	will not make any sense.
       
   252 
       
   253 	@param aTransaction Handle to the client transaction that should be deleted
       
   254 	*/
       
   255 	void InviteCompleted(CSIPClientTransaction& aTransaction);
       
   256 
       
   257 	/**
       
   258 	This function will generate the response for the incoming invite
       
   259 
       
   260 	@param aTransaction Sever Transaction using which the response must be sent
       
   261 	@param aType The type of responses that must be sent by this function call
       
   262 	*/
       
   263 	void GenerateInviteResponseL(CSIPServerTransaction *& aTransaction,TSipHLConsts::SIP_RESPONSE_TYPE aType);
       
   264 
       
   265 	/**
       
   266 	This function will generate the response for the incoming subscribe method
       
   267 
       
   268 	@param aTransaction Sever Transaction using which the response must be sent
       
   269 	@param aType The type of responses that must be sent by this function call
       
   270 	*/
       
   271 	void GenerateSubscribeResponseL(CSIPServerTransaction *& aTransaction,TSipHLConsts::SIP_RESPONSE_TYPE aType);
       
   272 
       
   273 	/**
       
   274 	This function will get called in case any request comes when a dialog is
       
   275 	established, and the incoming request matched to the existing dialog
       
   276 
       
   277 	@param aMsgBundle Message specific to Handle SIP request or response
       
   278 	*/
       
   279 	void IncomingRequestInsideDialog(TSipMsgBundle aMsgBundle);
       
   280 
       
   281 	/**
       
   282 	This function will get called in case any request comes doesnt matches
       
   283 	with any of the existing dialog
       
   284 
       
   285 	@param aMsgBundle Message specific to Handle SIP request or response
       
   286 	*/
       
   287 	void IncomingRequestOutsideDialog(TSipMsgBundle & aMsgBundle);
       
   288 
       
   289 	/**
       
   290 	This function will scheduler the state machine RunL to be called in next cycle
       
   291 	in not alreay active
       
   292 	*/
       
   293 	void MakeActive ();
       
   294 
       
   295 	/**
       
   296 	This function will issue a request complete onto itself and force the RunL method
       
   297 	of the state machine to get called
       
   298 
       
   299 	@param aErrCode Current status of the state machine
       
   300 	*/
       
   301 	void MarkRequestComplete(TInt aErrCode);
       
   302 
       
   303 	/**
       
   304 	This function will return the Handle to the Transition engine that is with
       
   305 	the current state machine
       
   306 	*/
       
   307 	CSIPTransitionEngine *GetTe();
       
   308 
       
   309 	/**
       
   310 	This function will return the pointer to the currently active state
       
   311 	*/
       
   312 	CSipStateBase * GetActiveState();
       
   313 
       
   314 	/**
       
   315 	This function will call the terminated callback to the application client
       
   316 	*/
       
   317 	void CallTerminateCallback();
       
   318 
       
   319 	/**
       
   320 	This function will notify the client about incoming calls
       
   321 	*/
       
   322 	void CallIncomingCallback();
       
   323 
       
   324 	/**
       
   325 	This function will call the extablished callback onto the client
       
   326 	*/
       
   327 	void CallEstablishedCallback();
       
   328 
       
   329 	/**
       
   330 	This functin will call the notification callback onto the client
       
   331 	*/
       
   332 	void CallNotificationCallback(TPtrC8 aNotifyData);
       
   333 
       
   334 	/**
       
   335 	This function will returns the handle to the state requested
       
   336 
       
   337 	@param aNextState Handle to the request which is to be returned
       
   338 	*/
       
   339 	CSipStateBase * GetNextState (TSipHLConsts::SIP_STATES aNextState);
       
   340 
       
   341 	/**
       
   342 	This function returns the First/Oldesst element of the SIP message Bundle
       
   343 	*/
       
   344 	TSipMsgBundle	GetSipMessageBundle();
       
   345 
       
   346 	/**
       
   347 	This function tells the state machine that it is being called from upper layer
       
   348 	or the lower layer. Upper Layer being the client which instantiated the state
       
   349 	machine and lower layer is the TE, which call State machine to either give some
       
   350 	information to the user or to get some functionality done
       
   351 
       
   352 	@param aStimulus Identifier of the upper or lower layer
       
   353 	*/
       
   354 	void	SetSIPStimulus(TSipHLConsts::SIP_SM_STIMULUS aStimulus);
       
   355 
       
   356 	/**
       
   357 	This function will return the command context of the state machine
       
   358 	*/
       
   359 	TCommandContext & GetCommandContext();
       
   360 
       
   361 	/**
       
   362 	This function will return whether the state machine is for handling incoming call
       
   363 	*/
       
   364 	TBool GetIncomingStatus();
       
   365 
       
   366 	/**
       
   367 	This function will return ETrue if thsi state machine represents
       
   368 	the current active outgoing session
       
   369 	*/
       
   370 	TBool GetOutgoingStatus();
       
   371 
       
   372 	/**
       
   373 	This function will reset the outgoing status of the state machine
       
   374 	*/
       
   375 	void SetOutgoingStatus(TBool aStatus);
       
   376 
       
   377 	/**
       
   378 	This function will do cleanup activities before terminting the state machine
       
   379 	*/
       
   380 	void Cleanup();
       
   381 
       
   382 	/**
       
   383 	This function will invite the functionalities of doing a sip registration
       
   384 	*/
       
   385 	void SendRegisterMessageL();
       
   386 
       
   387 	/**
       
   388 	This function will invite the functionalities of doing a sip Unregistration
       
   389 	*/
       
   390 	void SendUnRegisterMessageL();
       
   391 
       
   392 	/**
       
   393 	This function will invite the functionalities of doing a sip Invite
       
   394 	*/
       
   395 	void SendInviteMessageL();
       
   396 
       
   397 	/**
       
   398 	This function will Send the acknowledgement of the Sucess response of
       
   399 	the Invitation.
       
   400 	*/
       
   401 	void SendAckForInviteL();
       
   402 
       
   403 	/**
       
   404 	This function will send the cancellation for the onging invite
       
   405 	*/
       
   406 	void SendCancelL();
       
   407 
       
   408 	/**
       
   409 	This function will terminte the ongoing session by sending a SIP
       
   410 	bye
       
   411 	*/
       
   412 	void SendByeL();
       
   413 
       
   414 	/**
       
   415 	This function will send the response of an incoming bye from remote user
       
   416 	*/
       
   417 	void SendByeResponseL();
       
   418 
       
   419 	/**
       
   420 	This function will invite the functionalities of doing a sip Subscribe
       
   421 	*/
       
   422 	void SendSubscribeMessageL();
       
   423 
       
   424 	/**
       
   425 	This function will invite the functionalities of doing a sip UnSubscribe
       
   426 	*/
       
   427 	void SendUnSubscribeMessageL();
       
   428 	/**
       
   429 	This function will set the status of call terminate call back
       
   430 
       
   431 	@param aCallTerminateCallBack
       
   432 	*/
       
   433 	void SetCallTerminateCallBack(TBool aCallTerminateCallback);
       
   434 
       
   435 	/**
       
   436 	This method is called by the TransditionEngine when
       
   437 	it ignores a challenge recieved on a session represented by
       
   438 	this StateMachine
       
   439 
       
   440 	@param aRealm - The realm on which the challenge was recieved
       
   441 	*/
       
   442 	void	ChallengeIgnored(const TDesC8& aRealm);
       
   443 
       
   444 	/**
       
   445 	This function will set the error that occurred in processing of SIP Message
       
   446 
       
   447 	@param aError - SIP Error Message
       
   448 	*/
       
   449 	void SetGeneralError(TInt aError);
       
   450 
       
   451 	/**
       
   452 	This function will set the SIP Specific codes
       
   453 
       
   454 	@param aError - SIP Message code
       
   455 	*/
       
   456 	void SetSIPError(TInt aError);
       
   457 
       
   458 	/**
       
   459 	This function copy the notification data from the Server Transaction
       
   460 	*/
       
   461 	HBufC8 * GenerateNotificationData();
       
   462 
       
   463 	/**
       
   464 	Destructor of the class
       
   465 	*/
       
   466 	~CSipStateMachine();
       
   467 
       
   468 private:
       
   469 
       
   470 	/**
       
   471 	The constructor of the class.
       
   472 
       
   473 	@param aTe Handle to the Transition Engine
       
   474 	@param aClient Handle to the callback Notifications
       
   475 	*/
       
   476 	CSipStateMachine(CSIPTransitionEngine * aTe, MSIPStateMachineClient* aClient, TBool aSmDirection);
       
   477 
       
   478 	/**
       
   479 	2nd Phase construction method of the State machine, which actually starts the
       
   480 	state machine
       
   481 	*/
       
   482 	void ConstructL();
       
   483 
       
   484 	/**
       
   485 	This method is to give instructions pertaining to SIP request to the state
       
   486 	machine
       
   487 
       
   488 	@param aRequest Enumeration which defines a set of Requests that are supported
       
   489 	*/
       
   490 	TInt SendSIPRequest(TSipHLConsts::SIP_REQUESTS aRequest);
       
   491 
       
   492 	/**
       
   493 	This method is to respond for any incoming request that comes to the client
       
   494 	and need user response, e.g Answering an Incoming call
       
   495 
       
   496 	@param aResponse Enumeration which defines a set of supported responses
       
   497 	*/
       
   498 	TInt SendSIPResponse(TSipHLConsts::SIP_RESPONSES aResponse);
       
   499 
       
   500 	/**
       
   501 	This function will Create the TO header from the descriptor
       
   502 
       
   503 	@param aSipUri The Uri which sould constitute the to header
       
   504 	*/
       
   505 	CSIPToHeader* CreateToHeaderLC( const TDesC8& aSipUri );
       
   506 
       
   507 	/**
       
   508 	This function will Create the From header from the descriptor
       
   509 
       
   510 	@param aSipUri The Uri which sould constitute the from header
       
   511 	*/
       
   512 	CSIPFromHeader* CreateFromHeaderLC( const TDesC8& aSipUri );
       
   513 
       
   514 	/**
       
   515 	This function will Create SDP body from the CSdpDocument
       
   516 
       
   517 	@param aContent The pointer from which content body should be made
       
   518 	*/
       
   519 	HBufC8* GetContentBodyL( CSdpDocument* aContent );
       
   520 
       
   521 	/**
       
   522 	This function generates the incoming call parameters from the server
       
   523 	transaction available with the current state machine
       
   524 
       
   525 	@param aParam store the incoming call parameters
       
   526 	*/
       
   527 	void GenerateIncomingCallParameters(TIncomingCallParameters & aParam);
       
   528 
       
   529 
       
   530 private:
       
   531 	// For Logging
       
   532 	__FLOG_DECLARATION_MEMBER;
       
   533 
       
   534 	// True when the SM recieves call from the client
       
   535 	TBool iClientStimulus;
       
   536 
       
   537 	// True when the SM recieves the call from TE
       
   538 	TBool iServerStimulus;
       
   539 
       
   540 	// True in case of error, can be either through client or TE
       
   541 	TBool iServerErrorStimulus;
       
   542 
       
   543 	// set the status of the State machine
       
   544 	TBool iSuspendRequest;
       
   545 
       
   546 	// Array of Sip Message bundles
       
   547 	RArray <TSipMsgBundle> 	iSipMsgBundle;
       
   548 
       
   549 	// Current Request Status of the state machine
       
   550 	TRequestStatus * iClientStatus;
       
   551 
       
   552 	// Handle to the active state of the state machine
       
   553 	CSipStateBase  * iActiveState;
       
   554 
       
   555 	// handle to the error state of the state machine
       
   556 	CSipStateBase  * iErrorState;
       
   557 
       
   558 	// handle to the command context of this state machine
       
   559 	TCommandContext iCommandCntx;
       
   560 
       
   561 	// Handle to the current parameter set for this state machine
       
   562 	TSipParams	iSipParams;
       
   563 
       
   564 	// Handle to the Transition engine
       
   565 	CSIPTransitionEngine 	 * iTe;
       
   566 
       
   567 	// handle to the Idle State
       
   568 	CStateIdle  			 * iStateIdle;
       
   569 
       
   570 	// handle to the Session Initialisation State
       
   571 	CStateSessionInitiation  * iStateSessionInit;
       
   572 
       
   573 	// handle to the Session Established State
       
   574 	CStateSessionEstablished * iStateSessionEstablished;
       
   575 
       
   576 	// handle to the Terminated state
       
   577 	CStateSessionTerminate	 * iStateSessionTerminate;
       
   578 
       
   579 	// Handle to the callback clinet for SIP notifications
       
   580 	MSIPStateMachineClient		 * iClient;
       
   581 
       
   582 	// Handle to Values that should be passed onto the client
       
   583 	TUriHolder	iUriValues;
       
   584 
       
   585 	// This contains the Error values to be sent to Calling application
       
   586 	TCallTerminateCode	iCallTerminateCode;
       
   587 
       
   588 	// This variable will mark the state machine to be used only
       
   589 	// for incoming calls
       
   590 	TBool	iIncomingStateMachine;
       
   591 
       
   592 	// This variable will tell whther to call the Terminate notification
       
   593 	// when the state is going to terminated state
       
   594 	TBool	iCallTerminateCallback;
       
   595 
       
   596 	//This flag indicates if this StateMachine represents the current
       
   597 	//active outgoing session
       
   598 	TBool 	isActiveOutgoingSession;
       
   599 
       
   600 	// This flag will tell whether the state machine is a Invite state machine
       
   601 	TBool	isInviteSM;
       
   602 
       
   603 	// This flag will tell whether the state machine is a subscribe state machine
       
   604 	TBool	isSubscribeSM;
       
   605 
       
   606 	// This flag will tell the state machine whether to delete it or not
       
   607 	TBool	iDeleteMeNow;
       
   608 	};
       
   609 
       
   610 
       
   611 
       
   612 inline void CSipStateMachine::SetSuspendRequest( TBool aSuspendRequest )
       
   613 /**
       
   614  */
       
   615    {
       
   616    iSuspendRequest = aSuspendRequest;
       
   617    }
       
   618 
       
   619 
       
   620 inline TSipMsgBundle CSipStateMachine::GetSipMessageBundle()
       
   621 /**
       
   622  */
       
   623  	{
       
   624  	TSipMsgBundle  CurrBundle;
       
   625 	CurrBundle.iStatusCode = 0;
       
   626         CurrBundle.iErrCode = 0;
       
   627 	CurrBundle.iRequest = TSipHLConsts::ERequestNone;
       
   628 	CurrBundle.iResponse = TSipHLConsts::EResponseNone;
       
   629 	CurrBundle.iServTransaction = 0;
       
   630 	CurrBundle.iClientTransaction = 0;
       
   631 	CurrBundle.iDialog = 0;
       
   632  	if (iSipMsgBundle.Count() > 0)
       
   633  		{
       
   634  		CurrBundle = iSipMsgBundle[0];
       
   635  		iSipMsgBundle.Remove(0);
       
   636  		}
       
   637  	else
       
   638  		{
       
   639  		CurrBundle.iStatusCode = -1;
       
   640  		}
       
   641  	return CurrBundle;
       
   642  	}
       
   643 
       
   644 inline void	CSipStateMachine::SetSIPStimulus(TSipHLConsts::SIP_SM_STIMULUS aStimulus)
       
   645 /**
       
   646  */
       
   647 	{
       
   648 	if (aStimulus == TSipHLConsts::EClientStimulus)
       
   649 		{
       
   650 		iClientStimulus = ETrue;
       
   651 		}
       
   652 	if (aStimulus == TSipHLConsts::EServerStimulus)
       
   653 		{
       
   654 		iServerStimulus = ETrue;
       
   655 		}
       
   656 	}
       
   657 
       
   658 
       
   659 inline TCommandContext & CSipStateMachine::GetCommandContext()
       
   660 /**
       
   661  */
       
   662  	{
       
   663  	return iCommandCntx;
       
   664  	}
       
   665 
       
   666 inline void CSipStateMachine::SetCallTerminateCallBack(TBool aCallTerminateCallBack)
       
   667 /**
       
   668  */
       
   669 	{
       
   670 	iCallTerminateCallback = aCallTerminateCallBack;
       
   671 	}
       
   672 
       
   673 inline void CSipStateMachine::SetGeneralError(TInt aError)
       
   674 /**
       
   675  */
       
   676  	{
       
   677  	iCallTerminateCode.iErrorCode = aError;
       
   678  	}
       
   679 
       
   680 inline void CSipStateMachine::SetSIPError(TInt aError)
       
   681 /**
       
   682  */
       
   683  	{
       
   684  	iCallTerminateCode.iSipCode = aError;
       
   685  	}
       
   686 
       
   687 
       
   688 #endif
       
   689