multimediacommsengine/tsrc/testdriver/siptester/src/TCmdCreateConnection.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 "CTcSIPConnectionContainer.h"
       
    19 #include "SIPConstants.h"
       
    20 #include "TCmdCreateConnection.h"
       
    21 #include "CTcSIPContext.h"
       
    22 
       
    23 /**
       
    24  * INPUT:
       
    25  *   Headers:		-
       
    26  *   Parameters:	IAPName
       
    27  *   IDs:			-
       
    28  *
       
    29  * OUTPUT:
       
    30  *   Parameters:	-
       
    31  *   IDs:			ConnectionId
       
    32  */
       
    33 void TCmdCreateConnection::ExecuteL()
       
    34 	{
       
    35 	// -- Setup ---------------------------------------------------------------
       
    36 
       
    37 	// Get mandatory IAPName
       
    38 	TPtrC8 name = ExtractTextL( KParamIAPName );
       
    39 
       
    40 	// -- Execution -----------------------------------------------------------
       
    41     CTcSIPConnectionContainer* conn = NULL;
       
    42     if ( iContext.GetMandatoryValue() )
       
    43         {
       
    44 	    conn = iContext.CreateSipStack( name );
       
    45         }
       
    46 
       
    47 	// -- Response creation ---------------------------------------------------
       
    48 
       
    49 	AddIdResponseL( KConnectionId, *conn ); //ownership is not transferred
       
    50 	}
       
    51 
       
    52 TBool TCmdCreateConnection::Match( const TTcIdentifier& aId )
       
    53 	{
       
    54 	return TTcSIPCommandBase::Match( aId, _L8("CreateConnection") );
       
    55 	}
       
    56 
       
    57 TTcCommandBase* TCmdCreateConnection::CreateL( MTcTestContext& aContext )
       
    58 	{
       
    59 	return new( ELeave ) TCmdCreateConnection( aContext );
       
    60 	}