multimediacommsengine/tsrc/testdriver/siptester/src/TCmdGetDialogFrom.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 <sipaddress.h>
       
    19 #include <sipdialog.h>
       
    20 #include <sipdialogassocbase.h>
       
    21 #include <sipfromheader.h>
       
    22 
       
    23 #include "TCmdGetDialogFrom.h"
       
    24 #include "SIPConstants.h"
       
    25 
       
    26 /**
       
    27  * INPUT:
       
    28  *   Headers:		-
       
    29  *   Parameters:	-
       
    30  *   IDs:			InviteDialogId*, SubscribeDialogId*
       
    31  *
       
    32  * OUTPUT:
       
    33  *   Parameters:	-
       
    34  *   IDs:			Address
       
    35  */
       
    36 void TCmdGetDialogFrom::ExecuteL()
       
    37 	{
       
    38 	// -- Setup ---------------------------------------------------------------
       
    39 
       
    40 	// Get SIP objects from registry
       
    41 	CSIPDialogAssocBase* dialogAssoc = GetAnyDialogAssocL();
       
    42 
       
    43 	// -- Execution -----------------------------------------------------------
       
    44 
       
    45 	// Get dialog From address
       
    46 	HBufC8* from = dialogAssoc->Dialog().FromHeader().SIPAddress().ToTextLC();
       
    47 
       
    48 	// -- Response creation ---------------------------------------------------
       
    49 
       
    50 	AddTextResponseL( KParamAddress, from->Des() );
       
    51 	CleanupStack::PopAndDestroy( from );
       
    52 	}
       
    53 
       
    54 TBool TCmdGetDialogFrom::Match( const TTcIdentifier& aId )
       
    55 	{
       
    56 	return TTcSIPCommandBase::Match( aId, _L8("GetDialogFrom") );
       
    57 	}
       
    58 
       
    59 TTcCommandBase* TCmdGetDialogFrom::CreateL( MTcTestContext& aContext )
       
    60 	{
       
    61 	return new( ELeave ) TCmdGetDialogFrom( aContext );
       
    62 	}