multimediacommsengine/tsrc/testdriver/siptester/src/TCmdSendNonTargetRefreshRequest.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 <sipclienttransaction.h>
       
    19 #include <sipdialogassocbase.h>
       
    20 #include <sipmessageelements.h>
       
    21 #include <sipstrings.h>
       
    22 #include <stringpool.h>
       
    23 #include <_sipcodecdefs.h>
       
    24 
       
    25 #include "TCmdSendNonTargetRefreshRequest.h"
       
    26 #include "SIPConstants.h"
       
    27 
       
    28 /**
       
    29  * INPUT:
       
    30  *   Headers:		To, Contact, From*, Content-Type*, Content-Encoding*,
       
    31  *					Expires*, Security-Client*
       
    32  *   Parameters:	Content*
       
    33  *   IDs:			InviteDialogId*, SubscribeDialogId*
       
    34  *
       
    35  * OUTPUT:
       
    36  *   Parameters:	-
       
    37  *   IDs:			TransactionId
       
    38  */
       
    39 void TCmdSendNonTargetRefreshRequest::ExecuteL()
       
    40 	{
       
    41 	// -- Setup ---------------------------------------------------------------
       
    42 
       
    43 	// Get SIP objects from registry
       
    44 	CSIPDialogAssocBase* dialogAssoc = GetAnyDialogAssocL();
       
    45 
       
    46 	// Get request method
       
    47 	TPtrC8 methodPtr = ExtractTextL( KParamMethod );
       
    48 	RStringF methodStr = SIPStrings::Pool().OpenFStringL(methodPtr);
       
    49 	CleanupClosePushL(methodStr);
       
    50 
       
    51 	// Extract both headers (that are still left) and content.
       
    52 	CSIPMessageElements* elements = ExtractHeadersAndContentLC();
       
    53 
       
    54 	// -- Execution -----------------------------------------------------------
       
    55 
       
    56 	// Start SIP Request transaction.
       
    57 	CSIPClientTransaction* transaction =
       
    58 			 dialogAssoc->SendNonTargetRefreshRequestL( methodStr, elements );
       
    59 	CleanupStack::Pop( elements );
       
    60 	CleanupStack::PopAndDestroy(); // methodStr
       
    61 
       
    62 	// -- Response creation ---------------------------------------------------
       
    63 
       
    64 	AddIdResponseL( KTransactionId, transaction );
       
    65 	}
       
    66 
       
    67 TBool TCmdSendNonTargetRefreshRequest::Match( const TTcIdentifier& aId )
       
    68 	{
       
    69 	return TTcSIPCommandBase::Match( aId, _L8("SendNonTargetRefreshRequest") );
       
    70 	}
       
    71 
       
    72 TTcCommandBase* TCmdSendNonTargetRefreshRequest::CreateL( MTcTestContext& aContext )
       
    73 	{
       
    74 	return new( ELeave ) TCmdSendNonTargetRefreshRequest( aContext );
       
    75 	}
       
    76