multimediacommsengine/tsrc/testdriver/siptester/src/TCmdGetChallenge.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 "CTcSIPHttpDigestContainer.h"
       
    20 #include "SIPConstants.h"
       
    21 #include "TCmdGetChallenge.h"
       
    22 
       
    23 /**
       
    24  * INPUT:
       
    25  *   Headers:		-
       
    26  *   Parameters:	Timeout*
       
    27  *   IDs:			-
       
    28  *
       
    29  * OUTPUT:
       
    30  *   Parameters:	DigestRealm
       
    31  *   IDs:			-
       
    32  */
       
    33 void TCmdGetChallenge::ExecuteL()
       
    34 	{
       
    35 	// Get an item off the receive queue (waits until timeout if none is present)
       
    36 	TInt timeout = ExtractIntegerL( KParamTimeout, KDefaultReceiveTimeout, EFalse );	
       
    37 	HBufC8* realm = iContext.DigestContainerL().ReceivedChallengeL( timeout );
       
    38 	if( realm )
       
    39 	    {
       
    40 	    CleanupStack::PushL( realm );
       
    41 	    AddTextResponseL( KParamDigestRealm, *realm ); //makes a copy of realm
       
    42 	    CleanupStack::PopAndDestroy(); // realm
       
    43 	    }
       
    44 	
       
    45 	}
       
    46 
       
    47 TBool TCmdGetChallenge::Match( const TTcIdentifier& aId )
       
    48 	{
       
    49 	return TTcSIPCommandBase::Match( aId, _L8("GetChallenge") );
       
    50 	}
       
    51 
       
    52 TTcCommandBase* TCmdGetChallenge::CreateL( MTcTestContext& aContext )
       
    53 	{
       
    54 	return new( ELeave ) TCmdGetChallenge( aContext );
       
    55 	}