sipproviderplugins/sipprovider/sipstatemachine/src/StateSessionTerminate.cpp
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 // CStateSessionTerminate implementation file.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22  
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 
       
    26 #include "StateSessionTerminate.h"
       
    27 
       
    28 CStateSessionTerminate * CStateSessionTerminate::NewL( CSipStateMachine * aStateMachine )
       
    29 /**
       
    30 Instantiaion static function
       
    31 */
       
    32 	{
       
    33 	return new(ELeave) CStateSessionTerminate (aStateMachine);
       
    34 	}
       
    35 
       
    36 CStateSessionTerminate::CStateSessionTerminate ( CSipStateMachine * aStateMachine ) :
       
    37 CSipStateBase (aStateMachine, TSipHLConsts::EStateSessionTerminated)
       
    38 /**
       
    39 Constuctor
       
    40 */
       
    41 	{
       
    42 	// Open Logs
       
    43 	__FLOG_OPEN(_L8("SipStateMachine"), _L8("StateSessionTerminate"));
       
    44 	__FLOG_1(_L("[StateSessionTerminate]:[%x]::CStateSessionTerminate() "), this);
       
    45 	}
       
    46 
       
    47 CStateSessionTerminate::~CStateSessionTerminate ()
       
    48 /**
       
    49 Destructor
       
    50 */	
       
    51 	{
       
    52 	// Close Logging
       
    53 	__FLOG_0(_L("[StateSessionTerminate]: CStateSessionTerminate::~CStateSessionTerminate()"));
       
    54 	__FLOG_CLOSE;
       
    55 	}
       
    56 
       
    57 CSipStateBase * CStateSessionTerminate::ProcessClientL(TRequestStatus & aStatus)
       
    58 /**
       
    59 Function which process the request and responses from the client
       
    60 */
       
    61 	{
       
    62 	__FLOG_1(_L("[StateSessionTerminate]:CStateSessionTerminate[%x]::ProcessClientL()"), this);
       
    63 	iSipSM->Cleanup();
       
    64 	iSipSM->CallTerminateCallback();
       
    65 	iSipSM->SetSuspendRequest(ETrue);
       
    66 	TRequestStatus * stat = &aStatus;
       
    67 	User::RequestComplete(stat, KErrNone);
       
    68 	// This will tell the state machine that the work has been completed 
       
    69 	// and the state can be deleted
       
    70 	__FLOG_1(_L("[StateSessionTerminate]:CStateSessionTerminate[%x]::ProcessClientL() <<Next State --> NULL>> "), this);
       
    71 	return (iNext = NULL);
       
    72 	}
       
    73 
       
    74 CSipStateBase * CStateSessionTerminate::ProcessServerL( TRequestStatus & aStatus )
       
    75 /**
       
    76 Function which process the request and responses from the Server
       
    77 */
       
    78 	{
       
    79 	__FLOG_1(_L("[StateSessionTerminate]:CStateSessionTerminate[%x]::ProcessServerL()"), this);
       
    80 	// Cleanup
       
    81 	iSipSM->Cleanup();
       
    82 	iSipSM->CallTerminateCallback();
       
    83 	iSipSM->SetSuspendRequest(ETrue);
       
    84 	TRequestStatus * stat = &aStatus;
       
    85 	User::RequestComplete(stat, KErrNone);
       
    86 	__FLOG_1(_L("[StateSessionTerminate]:CStateSessionTerminate[%x]::ProcessServerL() <<Next State --> NULL>> "), this);	
       
    87 	return (iNext = NULL);	
       
    88 	}
       
    89 
       
    90 CSipStateBase * CStateSessionTerminate::ProcessServerErrorL(TRequestStatus & aStatus)
       
    91 /**
       
    92 Function which process the request and responses from the Server in case of error
       
    93 */
       
    94 	{
       
    95 	__FLOG_1(_L("[StateSessionTerminate]:CStateSessionTerminate[%x]::ProcessServerErrorL()"), this);
       
    96 	// call the callback and let off
       
    97 	iSipSM->CallTerminateCallback();
       
    98 	TRequestStatus * stat = &aStatus;
       
    99 	User::RequestComplete(stat, KErrNone);
       
   100 	__FLOG_1(_L("[StateSessionTerminate]:CStateSessionTerminate[%x]::ProcessErrorServerL() <<Next State --> NULL>> "), this);	
       
   101 	return NULL;
       
   102 	}
       
   103