multimediacommsengine/tsrc/testdriver/siptester/src/TCmdGetRefresh.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Implementation
       
    15 *
       
    16 */
       
    17 
       
    18 #include "CTcSIPContext.h"
       
    19 #include "SIPConstants.h"
       
    20 #include "TCmdGetRefresh.h"
       
    21 
       
    22 #include <sipclienttransaction.h>
       
    23 #include <siprefresh.h>
       
    24 
       
    25 /**
       
    26  * INPUT:
       
    27  *   Headers:		-
       
    28  *   Parameters:	-
       
    29  *   IDs:			TransactionId
       
    30  *
       
    31  * OUTPUT:
       
    32  *   Parameters:	-
       
    33  *   IDs:			RefreshId
       
    34  */
       
    35 void TCmdGetRefresh::ExecuteL()
       
    36 	{
       
    37 	// -- Setup ---------------------------------------------------------------
       
    38 
       
    39 	// Get SIP objects from registry
       
    40 	const CSIPClientTransaction* transaction = GetClientTransactionL();
       
    41 
       
    42 	// -- Execution -----------------------------------------------------------
       
    43 
       
    44 	// Get refresh for the client transaction
       
    45 	const CSIPRefresh* refresh = transaction->Refresh();
       
    46 	if( !refresh )
       
    47 		{
       
    48 		// Report if it was not found
       
    49 		User::Leave( KErrNotFound );
       
    50 		}
       
    51 
       
    52 	// Ownership is not transferred, specify by-reference
       
    53 	iContext.Registry().AddObjectL( *refresh );
       
    54 
       
    55 	// -- Response creation ---------------------------------------------------
       
    56 
       
    57 	AddIdResponseL( KRefreshId, refresh );
       
    58 	}
       
    59 
       
    60 TBool TCmdGetRefresh::Match( const TTcIdentifier& aId )
       
    61 	{
       
    62 	return TTcSIPCommandBase::Match( aId, _L8("GetRefresh") );
       
    63 	}
       
    64 
       
    65 TTcCommandBase* TCmdGetRefresh::CreateL( MTcTestContext& aContext )
       
    66 	{
       
    67 	return new( ELeave ) TCmdGetRefresh( aContext );
       
    68 	}