multimediacommsengine/tsrc/testdriver/siptester/src/TCmdGetDefaultProfile.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 "TCmdGetDefaultProfile.h"
       
    21 #include "CTcSIPProfileContainer.h"
       
    22 
       
    23 #include <sipmanagedprofile.h>
       
    24 #include <sipmanagedprofileregistry.h>
       
    25 #include <sipprofile.h>
       
    26 #include <sipprofiletypeinfo.h>
       
    27 
       
    28 /**
       
    29  * INPUT:
       
    30  *   Headers:		-
       
    31  *   Parameters:	-
       
    32  *   IDs:			RegistryId
       
    33  *
       
    34  * OUTPUT:
       
    35  *	 Parameters:	Type, IapId, AORs, PrivateIdentity, Name, SigComp, 
       
    36  *					AutoRegistration, SecurityNegotiation, Server,
       
    37  *					ServerParameter, ServerExtensionParameter, 
       
    38  *					ExtensionParameter, Default, Enabled
       
    39  *	 IDs:			ProfileId
       
    40  */
       
    41 void TCmdGetDefaultProfile::ExecuteL()
       
    42 	{
       
    43 	// -- Setup ---------------------------------------------------------------
       
    44 
       
    45 	// Get selected registry
       
    46     CTcSIPProfileContainer& container = SelectProfileL();
       
    47 
       
    48 	// Get profile from the profile registry
       
    49 	CSIPManagedProfile& profile = container.GetDefaultProfileL();
       
    50 
       
    51 	
       
    52 	// -- Execution -----------------------------------------------------------
       
    53 
       
    54 
       
    55 	// -- Response creation ---------------------------------------------------
       
    56 
       
    57 	GetProfileParamsL( container, &profile );
       
    58 
       
    59 	// Add ProfileId to response
       
    60 	TUint32 profileId( 0 );
       
    61 	User::LeaveIfError( profile.GetParameter( KSIPProfileId, profileId ) );
       
    62 	AddIntegerResponseL( KParamProfileId, profileId );
       
    63 	}
       
    64 
       
    65 
       
    66 TBool TCmdGetDefaultProfile::Match( const TTcIdentifier& aId )
       
    67 	{
       
    68 	return TTcSIPCommandBase::Match( aId, _L8("GetDefaultProfile") );
       
    69 	}
       
    70 
       
    71 TTcCommandBase* TCmdGetDefaultProfile::CreateL( MTcTestContext& aContext )
       
    72 	{
       
    73 	return new( ELeave ) TCmdGetDefaultProfile( aContext );
       
    74 	}
       
    75 
       
    76