multimediacommsengine/tsrc/testdriver/siptester/src/TTcSIPCommandBase.h
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:  See class definition below.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __TTCSIPCOMMANDBASE_H__
       
    19 #define __TTCSIPCOMMANDBASE_H__
       
    20 
       
    21 // INCLUDES
       
    22 #include "TTcCommandBase.h"
       
    23 
       
    24 #include <sipheaderbase.h>
       
    25 #include <_sipcodecdefs.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CSIPAddress;
       
    29 class CSIPClientTransaction;
       
    30 class CSIPContactHeader;
       
    31 class CSIPDialog;
       
    32 class CSIPDialogAssocBase;
       
    33 class CSIPExpiresHeader;
       
    34 class CSIPFromHeader;
       
    35 class CSIPHeaderBase;
       
    36 class CSIPInviteDialogAssoc;
       
    37 class CSIPManagedProfile;
       
    38 class CSIPMessageElements;
       
    39 class CSIPProfile;
       
    40 class CSIPRefresh;
       
    41 class CSIPRegistrationBinding;
       
    42 class CSIPRouteHeader;
       
    43 class CSIPServerTransaction;
       
    44 class CSIPSubscribeDialogAssoc;
       
    45 class CSIPToHeader;
       
    46 class CSIPURI;
       
    47 class CTcSIPConnectionContainer;
       
    48 class CTcSIPProfileContainer;
       
    49 class CTcSIPContext;
       
    50 class CSIPNotifyDialogAssoc;
       
    51 class CSIPReferDialogAssoc;
       
    52 class CSIPSubscriptionStateHeader;
       
    53 class CSIPEventHeader;
       
    54 class CSIPReferToHeader;
       
    55 class CSIPContentTypeHeader;
       
    56 class CUri8;
       
    57 
       
    58 
       
    59 // CLASS DEFINITION
       
    60 /**
       
    61  * TTcSIPCommandBase implements the base class for all SIP commands.
       
    62  * It provides common SIP related functionality for
       
    63  * accessing request and creating responses.
       
    64  */
       
    65 class TTcSIPCommandBase
       
    66 	: public TTcCommandBase
       
    67 	{
       
    68 	protected:	// Constructors and destructor
       
    69 
       
    70 		/**
       
    71 		 * Constructor.
       
    72 		 *
       
    73 		 * @param aContext SIP test context
       
    74 		 */
       
    75 		TTcSIPCommandBase( MTcTestContext& aContext );
       
    76 
       
    77 	protected: // New methods
       
    78 
       
    79 		/**
       
    80 		 * Finds and extracts a SIP To-header parameter from the CTRL
       
    81 		 * request. Leaves pointer to cleanup stack if header is found.
       
    82 		 *
       
    83 		 * @param aIsMandatory ETrue if the Header is required.
       
    84 		 * @return SIP header object, or NULL if aIsMandatory = EFalse
       
    85 		 *		   and header was not found.
       
    86 		 * @exceptions Leaves with KTcErrMandatoryHeaderNotFound if
       
    87 		 *			   a required Header cannot be found.
       
    88 		 */
       
    89 		CSIPToHeader* ExtractToHeaderLC( TBool aIsMandatory = ETrue );
       
    90 
       
    91 		/**
       
    92 		 * Finds and extracts a SIP Contact-header parameter from the CTRL
       
    93 		 * request. Leaves pointer to cleanup stack if header is found
       
    94 		 *
       
    95 		 * @param aIsMandatory ETrue if the Header is required.
       
    96 		 * @return SIP header object, or NULL if aIsMandatory = EFalse
       
    97 		 *		   and header was not found.
       
    98 		 * @exceptions Leaves with KTcErrMandatoryHeaderNotFound if
       
    99 		 *			   a required Header cannot be found.
       
   100 		 */
       
   101 		CSIPContactHeader* ExtractContactHeaderLC(
       
   102 												TBool aIsMandatory = ETrue );
       
   103 
       
   104 		/**
       
   105 		 * Finds and extracts a SIP Route-header parameter from the CTRL
       
   106 		 * request. Leaves pointer to cleanup stack if header is found
       
   107 		 *
       
   108 		 * @param aIsMandatory ETrue if the Header is required.
       
   109 		 * @return SIP header object, or NULL if aIsMandatory = EFalse
       
   110 		 *		   and header was not found.
       
   111 		 * @exceptions Leaves with KTcErrMandatoryHeaderNotFound if
       
   112 		 *			   a required Header cannot be found.
       
   113 		 */
       
   114 		CSIPRouteHeader* ExtractRouteHeaderLC( TBool aIsMandatory = ETrue );
       
   115 
       
   116 		/**
       
   117 		 * Finds and extracts a SIP From-header parameter from the CTRL
       
   118 		 * request. Leaves pointer to cleanup stack if header is found
       
   119 		 *
       
   120 		 * @param aIsMandatory ETrue if the Header is required.
       
   121 		 * @return SIP header object, or NULL if aIsMandatory = EFalse
       
   122 		 *		   and header was not found.
       
   123 		 * @exceptions Leaves with KTcErrMandatoryHeaderNotFound if
       
   124 		 *			   a required Header cannot be found.
       
   125 		 */
       
   126 		CSIPFromHeader* ExtractFromHeaderLC( TBool aIsMandatory = ETrue );
       
   127 
       
   128 		/**
       
   129 		 * Finds and extracts a SIP Expires-header parameter from the CTRL
       
   130 		 * request. Leaves pointer to cleanup stack if header is found
       
   131 		 *
       
   132 		 * @param aIsMandatory ETrue if the Header is required.
       
   133 		 * @return SIP header object, or NULL if aIsMandatory = EFalse
       
   134 		 *		   and header was not found.
       
   135 		 * @exceptions Leaves with KTcErrMandatoryHeaderNotFound if
       
   136 		 *			   a required Header cannot be found.
       
   137 		 */
       
   138 		CSIPExpiresHeader* ExtractExpiresHeaderLC(
       
   139 												TBool aIsMandatory = ETrue );
       
   140 
       
   141 		/**
       
   142 		 * Finds and extracts a SIP ReferTo-header parameter from 
       
   143 		 * the CTRL request. 
       
   144 		 * Leaves pointer to cleanup stack if header is found
       
   145 		 *
       
   146 		 * @param aIsMandatory ETrue if the Header is required.
       
   147 		 * @return SIP header object, or NULL if aIsMandatory = EFalse
       
   148 		 *		   and header was not found.
       
   149 		 * @exceptions Leaves with KTcErrMandatoryHeaderNotFound if
       
   150 		 *			   a required Header cannot be found.
       
   151 		 */
       
   152 		CSIPReferToHeader* ExtractReferToHeaderLC( 
       
   153 												TBool aIsMandatory = ETrue );
       
   154 		
       
   155 		/**
       
   156 		 * Finds and extracts a SIP Subscriptionstate-header parameter from 
       
   157 		 * the CTRL request. 
       
   158 		 * Leaves pointer to cleanup stack if header is found
       
   159 		 *
       
   160 		 * @param aIsMandatory ETrue if the Header is required.
       
   161 		 * @return SIP header object, or NULL if aIsMandatory = EFalse
       
   162 		 *		   and header was not found.
       
   163 		 * @exceptions Leaves with KTcErrMandatoryHeaderNotFound if
       
   164 		 *			   a required Header cannot be found.
       
   165 		 */
       
   166 		CSIPSubscriptionStateHeader* ExtractSubStateHeaderLC(
       
   167 												TBool aIsMandatory = ETrue );
       
   168 
       
   169 		/**
       
   170 		 * Finds and extracts a SIP Event-header parameter from the CTRL
       
   171 		 * request. Leaves pointer to cleanup stack if header is found
       
   172 		 *
       
   173 		 * @param aIsMandatory ETrue if the Header is required.
       
   174 		 * @return SIP header object, or NULL if aIsMandatory = EFalse
       
   175 		 *		   and header was not found.
       
   176 		 * @exceptions Leaves with KTcErrMandatoryHeaderNotFound if
       
   177 		 *			   a required Header cannot be found.
       
   178 		 */
       
   179 		CSIPEventHeader* ExtractEventHeaderLC( TBool aIsMandatory = ETrue );
       
   180 
       
   181         
       
   182         /**
       
   183 		 * Finds and extracts a SIP ContentType-header parameter from the CTRL
       
   184 		 * request. Leaves pointer to cleanup stack if header is found
       
   185 		 *
       
   186 		 * @param aIsMandatory ETrue if the Header is required.
       
   187 		 * @return SIP header object, or NULL if aIsMandatory = EFalse
       
   188 		 *		   and header was not found.
       
   189 		 * @exceptions Leaves with KTcErrMandatoryHeaderNotFound if
       
   190 		 *			   a required Header cannot be found.
       
   191 		 */
       
   192 		CSIPContentTypeHeader* ExtractContentTypeHeaderLC( TBool aIsMandatory = ETrue );
       
   193 		
       
   194 		/**
       
   195 		 * Extracts any and all headers that are still left in the CTRL
       
   196 		 * request (ExtractXXXHeaderLC() functions have removed found
       
   197 		 * headers). Creates a SIP message elements object to contain
       
   198 		 * the headers (it's created even if there are not headers).
       
   199 		 *
       
   200 		 * Uses ExtractHeadersAndContentL() with the created elements
       
   201 		 * container.
       
   202 		 *
       
   203 		 * @return SIP message elements object.
       
   204 		 */
       
   205 		CSIPMessageElements* ExtractHeadersAndContentLC();
       
   206 
       
   207 		/**
       
   208 		 * Extracts any and all headers that are still left in the CTRL
       
   209 		 * request (ExtractXXXHeaderLC() functions have removed found
       
   210 		 * headers) to an existing message elements container.
       
   211 		 *
       
   212 		 * Uses also ExtractContentL() to get Content + Content-Type from
       
   213 		 * CTRL request.
       
   214 		 *
       
   215 		 * @param aElements Container to be populated.
       
   216 		 */
       
   217 		void ExtractHeadersAndContentL( CSIPMessageElements& aElements );
       
   218 
       
   219 		/**
       
   220 		 * Search for a "Refresh" parameter from the CTRL request.
       
   221 		 * Create a SIP refresh object if the parameter is found.
       
   222 		 * Leaves pointer to cleanup stack if object is created.
       
   223 		 *
       
   224 		 * @return SIP refresh object or NULL if parameter cannot be found.
       
   225 		 */
       
   226 		CSIPRefresh* ExtractRefreshLC();
       
   227 
       
   228 		/**
       
   229 		 * Search for a "RemoteURI" parameter from the CTRL request.
       
   230 		 * Create a SIP URI object if the parameter is found.
       
   231 		 * Leaves pointer to cleanup stack if object is created.
       
   232 		 *
       
   233 		 * @return SIP URI object or NULL if parameter cannot be found.
       
   234 		 * or leave if aIsMandatory is true and parameter cannot be found
       
   235 		 */
       
   236 		CUri8* ExtractRemoteURILC( TBool aIsMandatory = EFalse );
       
   237 
       
   238         /**
       
   239 		 * Search for a "Proxy" parameter from the CTRL request.
       
   240 		 * Create a SIP RouteHeader object if the parameter is found.
       
   241 		 * Leaves pointer to cleanup stack if object is created.
       
   242 		 *
       
   243 		 * @return SIP RouteHeader object or NULL if parameter cannot be found.
       
   244 		 */
       
   245 		CSIPRouteHeader* ExtractProxyLC();
       
   246 		
       
   247 		/**
       
   248 		 * Search for a aParamName parameter from the CTRL request.
       
   249 		 * Extract the value of a found parameter to a heap descriptor
       
   250 		 * and return it.
       
   251 		 *
       
   252 		 * @param aParamName Parameter name to be searched for
       
   253 		 * @return Created heap descriptor or NULL
       
   254 		 */
       
   255 		HBufC8* ExtractHBufLC( const TDesC8& aParamName );
       
   256 
       
   257         /**
       
   258          * Extracts profileId and returns it as a integer
       
   259          *
       
   260          * @return profileId
       
   261          */
       
   262         TInt ExtractProfileIdL();
       
   263         
       
   264         /**
       
   265          * Extracts Uid
       
   266          *
       
   267          * @return uid
       
   268          */
       
   269         TUid ExtractUidL( const TDesC8& aName, TBool aIsMandatory = ETrue  );
       
   270         
       
   271 		/**
       
   272 		 * Returns the default connection, or a user defined connection
       
   273 		 * if a ConnectionId is present in the CTLR request.
       
   274 		 *
       
   275 		 * @return Reference to a connection container.
       
   276 		 */
       
   277 		CTcSIPConnectionContainer& SelectConnectionL();
       
   278 
       
   279 		/**
       
   280 		 * Returns the default profile, or a user defined connection
       
   281 		 * if a RegistryId is present in the CTLR request.
       
   282 		 *
       
   283 		 * @return Reference to a profile container.
       
   284 		 */
       
   285 		CTcSIPProfileContainer& SelectProfileL();
       
   286 
       
   287 		/**
       
   288 		 * Adds a TestClientId item to the CTRL response. Ownership is
       
   289 		 * is transferred.
       
   290 		 *
       
   291 		 * NOTE!! This function uses CleanupStack for safe array insertion.
       
   292 		 * You must not call CleanupStack::PushL()/Pop() when calling this!!
       
   293 		 *
       
   294 		 * @param aName Id name (e.g. "RequestId")
       
   295 		 * @param aObject Id of this object is looked up from the registry
       
   296 		 *				  and added to the response. aObject is registered
       
   297 		 *				  if it's not already in the registry.
       
   298 		 */
       
   299 		void AddIdResponseL( const TDesC8& aName, const CBase* aObject );
       
   300 
       
   301         /**
       
   302 		 * Adds a TestClientId item to the CTRL response. Ownership is
       
   303 		 * is NOT transferred.
       
   304 		 *
       
   305 		 * @param aName Id name (e.g. "RequestId")
       
   306 		 * @param aObject Id of this object is looked up from the registry
       
   307 		 *				  and added to the response. aObject is registered
       
   308 		 *				  if it's not already in the registry.
       
   309 		 */
       
   310         void AddIdResponseL( const TDesC8& aName, const CBase& aObject );
       
   311         
       
   312 		/**
       
   313 		 * Adds a ProfileId item to the CTRL response. Ownership is
       
   314 		 * is transferred.
       
   315 		 *
       
   316 		 * @param aProfile Profile Id of this object is looked added
       
   317 		 *				   to the response. aProfile is registered
       
   318 		 *				   if it's not already in the registry.
       
   319 		 */
       
   320 		void AddProfileIdResponseL( CSIPProfile* aProfile );
       
   321 		
       
   322 		/**
       
   323 		 * Adds a ProfileId item to the CTRL response. Ownership is
       
   324 		 * is NOT transferred.
       
   325 		 *
       
   326 		 * @param aProfile Profile Id of this object is looked added
       
   327 		 *				   to the response. aProfile is registered
       
   328 		 *				   if it's not already in the registry.
       
   329 		 */
       
   330 		void AddProfileIdResponseL( CSIPProfile& aProfile );
       
   331 
       
   332 		/**
       
   333 		 * Try to find an existing TestClientIds structure from the
       
   334 		 * CTRL response. Create one if it cannot be found and add
       
   335 		 * all possible Id items to it.
       
   336 		 *
       
   337 		 * @return Reference to the structure parameter containing
       
   338 		 *		   pre-created TestClient Ids.
       
   339 		 */
       
   340 		CTcStructure& FindCreateTestClientIdsL();
       
   341 
       
   342 		/**
       
   343 		 * Searches for a DialogId field from the CTRL request. Fetches the
       
   344 		 * associated SIP object from the test context's object registry.
       
   345 		 *
       
   346 		 * @param aIsMandatory ETrue if the object is required.
       
   347 		 * @return SIP object, or NULL if aIsMandatory = EFalse
       
   348 		 *		   and object id was not found.
       
   349 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   350 		 *			   a required object or object id cannot be found.
       
   351 		 */
       
   352 		CSIPDialog* GetDialogL( TBool aIsMandatory = ETrue );
       
   353 
       
   354 		/**
       
   355 		 * Searches for a InviteDialogId or SubscribeDialogId field from
       
   356 		 * the CTRL request. Fetches the associated SIP object from
       
   357 		 * the test context's object registry.
       
   358 		 *
       
   359 		 * @param aIsMandatory ETrue if the object is required.
       
   360 		 * @return SIP object, or NULL if aIsMandatory = EFalse
       
   361 		 *		   and object id was not found.
       
   362 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   363 		 *			   a required object or object id cannot be found.
       
   364 		 */
       
   365 		CSIPDialogAssocBase* GetAnyDialogAssocL( TBool aIsMandatory = ETrue );
       
   366 
       
   367 		/**
       
   368 		 * Searches for a InviteDialogId field from the CTRL request. Fetches
       
   369 		 * the associated SIP object from the test context's object registry.
       
   370 		 *
       
   371 		 * @param aIsMandatory ETrue if the object is required.
       
   372 		 * @return SIP object, or NULL if aIsMandatory = EFalse
       
   373 		 *		   and object id was not found.
       
   374 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   375 		 *			   a required object or object id cannot be found.
       
   376 		 */
       
   377 		CSIPInviteDialogAssoc* GetInviteDialogAssocL(
       
   378 												TBool aIsMandatory = ETrue );
       
   379 
       
   380 		/**
       
   381 		 * Searches for a SubscribeDialogId field from the CTRL request.
       
   382 		 * Fetches the associated SIP object from the test context's object
       
   383 		 * registry.
       
   384 		 *
       
   385 		 * @param aIsMandatory ETrue if the object is required.
       
   386 		 * @return SIP object, or NULL if aIsMandatory = EFalse
       
   387 		 *		   and object id was not found.
       
   388 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   389 		 *			   a required object or object id cannot be found.
       
   390 		 */
       
   391 		CSIPSubscribeDialogAssoc* GetSubscribeDialogAssocL(
       
   392 												TBool aIsMandatory = ETrue );
       
   393 
       
   394 		/**
       
   395 		 * Searches for a CSIPNotifyDialogAssoc field from the CTRL request.
       
   396 		 * Fetches the associated SIP object from the test context's object
       
   397 		 * registry.
       
   398 		 *
       
   399 		 * @param aIsMandatory ETrue if the object is required.
       
   400 		 * @return SIP object, or NULL if aIsMandatory = EFalse
       
   401 		 *		   and object id was not found.
       
   402 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   403 		 *			   a required object or object id cannot be found.
       
   404 		 */
       
   405 		CSIPNotifyDialogAssoc* GetNotifyDialogAssocL(
       
   406 												TBool aIsMandatory = ETrue );
       
   407 
       
   408 		/**
       
   409 		 * Searches for a CSIPReferDialogAssoc field from the CTRL request.
       
   410 		 * Fetches the associated SIP object from the test context's object
       
   411 		 * registry.
       
   412 		 *
       
   413 		 * @param aIsMandatory ETrue if the object is required.
       
   414 		 * @return SIP object, or NULL if aIsMandatory = EFalse
       
   415 		 *		   and object id was not found.
       
   416 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   417 		 *			   a required object or object id cannot be found.
       
   418 		 */
       
   419 		CSIPReferDialogAssoc* GetReferDialogAssocL(
       
   420 												TBool aIsMandatory = ETrue );
       
   421 
       
   422 		/**
       
   423 		 * Searches for a TransactionId field from the CTRL request. Fetches
       
   424 		 * the associated SIP object from the test context's object registry.
       
   425 		 *
       
   426 		 * @param aIsMandatory ETrue if the object is required.
       
   427 		 * @return SIP object, or NULL if aIsMandatory = EFalse
       
   428 		 *		   and object id was not found.
       
   429 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   430 		 *			   a required object or object id cannot be found.
       
   431 		 */
       
   432 		CSIPClientTransaction* GetClientTransactionL(
       
   433 												TBool aIsMandatory = ETrue );
       
   434 
       
   435 		/**
       
   436 		 * Searches for a ServerTransactionId field from the CTRL request.
       
   437 		 * Fetches the associated SIP object from the test context's object
       
   438 		 * registry.
       
   439 		 *
       
   440 		 * @param aIsMandatory ETrue if the object is required.
       
   441 		 * @return SIP object, or NULL if aIsMandatory = EFalse
       
   442 		 *		   and object id was not found.
       
   443 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   444 		 *			   a required object or object id cannot be found.
       
   445 		 */
       
   446 		CSIPServerTransaction* GetServerTransactionL(
       
   447 												TBool aIsMandatory = ETrue );
       
   448 
       
   449 		/**
       
   450 		 * Searches for a RegistrationId field from the CTRL request. Fetches
       
   451 		 * the associated SIP object from the test context's object registry.
       
   452 		 *
       
   453 		 * @param aIsMandatory ETrue if the object is required.
       
   454 		 * @return SIP object, or NULL if aIsMandatory = EFalse
       
   455 		 *		   and object id was not found.
       
   456 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   457 		 *			   a required object or object id cannot be found.
       
   458 		 */
       
   459 		CSIPRegistrationBinding* GetRegistrationL( TBool aIsMandatory = ETrue );
       
   460 
       
   461 		/**
       
   462 		 * Searches for a RefreshId field from the CTRL request. Fetches
       
   463 		 * the associated SIP object from the test context's object registry.
       
   464 		 *
       
   465 		 * @param aIsMandatory ETrue if the object is required.
       
   466 		 * @return SIP object, or NULL if aIsMandatory = EFalse
       
   467 		 *		   and object id was not found.
       
   468 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   469 		 *			   a required object or object id cannot be found.
       
   470 		 */
       
   471 		CSIPRefresh* GetRefreshL( TBool aIsMandatory = ETrue );
       
   472 
       
   473 		/**
       
   474 		 * Searches for a ProfileId field from the CTRL request. Fetches
       
   475 		 * the associated ManagerProfile object from the test context's managed
       
   476 		 * profile registry.
       
   477 		 *
       
   478 		 * @param aIsMandatory ETrue if the object is required.
       
   479 		 * @return reference to Profile object or leaves if profile for wanted
       
   480 		 *         id is not found
       
   481 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   482 		 *			   a required object or object id cannot be found.
       
   483 		 */
       
   484 		CSIPManagedProfile& GetManagedProfileL( CTcSIPProfileContainer& aProfileContainer );
       
   485 
       
   486 		/**
       
   487 		 * Searches for a ProfileId field from the CTRL request. Fetches
       
   488 		 * the associated Profile object from the test context's managed
       
   489 		 * profile registry.
       
   490 		 *
       
   491 		 * @return reference to Profile object or leaves if profile for wanted
       
   492 		 *         id is not found
       
   493 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   494 		 *			   a required object or object id cannot be found.
       
   495 		 */
       
   496 		CSIPProfile& GetProfileL( CTcSIPProfileContainer& aProfileContainer );
       
   497 		
       
   498 		/**
       
   499 		 * Searches for a ProfileId field from the CTRL request. Fetches
       
   500 		 * the associated Profile object from the test context's managed
       
   501 		 * profile registry.
       
   502 		 *
       
   503 		 * @param aIsMandatory ETrue if the object is required.
       
   504 		 * @return pointer to Profile object or NULL
       
   505 		 * @exceptions Leaves with KTcErrMandatoryIdNotFound if
       
   506 		 *			   a required object or object id cannot be found.
       
   507 		 */
       
   508 		CSIPProfile* GetProfileL( CTcSIPProfileContainer& aProfileContainer, TBool aIsMandatory );
       
   509 
       
   510 		/**
       
   511 		 * Returns a SIP profile if a ProfileId is present in the CTLR request.
       
   512 		 *
       
   513 		 * @return pointer to Profile object or NULL, 
       
   514 		 *         the ownership is not transferred.
       
   515 		 */
       
   516 		CSIPProfile* GetProfileL();
       
   517 
       
   518 
       
   519 	private: // New methods
       
   520 
       
   521 		/**
       
   522 		 * Search for a "Content" parameter from the CTRL request.
       
   523 		 * Create a SIP content object if the parameter is found and
       
   524 		 * pass it to the provided CSIPMessageElements object.
       
   525 		 *
       
   526 		 * @param aElements Reference to an initialized SIP message elements
       
   527 		 *					container. Found content is placed here.
       
   528 		 */
       
   529 		void ExtractContentL( CSIPMessageElements& aElements );
       
   530 
       
   531 		/**
       
   532 		 * Extracts the named SIP header from the CTRL request parameters.
       
   533 		 *
       
   534 		 * @param aHeaderName SIP header name (e.g. "To")
       
   535 		 * @param aIsMandatory ETrue if the header is required.
       
   536 		 * @return SIP header object, or NULL if aIsMandatory = EFalse
       
   537 		 *		   and header was not found.
       
   538 		 * @exceptions Leaves with KTcErrMandatoryHeaderNotFound if a required
       
   539 		 *			   header cannot be found.
       
   540 		 */
       
   541 		CSIPHeaderBase* ExtractHeaderLC( const TDesC8& aHeaderName,
       
   542 										 TBool aIsMandatory );
       
   543 
       
   544 		/**
       
   545 		 * Extracts all user/extension headers from the CTRL request.
       
   546 		 * Used by ExtractUserHeadersLC() to do the work.
       
   547 		 *
       
   548 		 * @param aHeaders Reference to a CTRL request header array
       
   549 		 * @param aHeaderArray Reference to a SIP header array
       
   550 		 */
       
   551 		void ExtractUserHeadersL(
       
   552 								CTcArray& aHeaders,
       
   553 								RPointerArray< CSIPHeaderBase >& aHeaderArray );
       
   554 
       
   555         
       
   556 		/**
       
   557 		 * Extract the Name field from a SIP header
       
   558 		 *
       
   559 		 * @param aHeader Complete SIP header (e.g. "To: <sip:jesse@dot.net>"
       
   560 		 * @return Pointer descriptor to Name field (e.g. "To")
       
   561 		 */
       
   562 		TPtrC8 NameFromHeader( const TDesC8& aHeader ) const;
       
   563 
       
   564 		/**
       
   565 		 * Extract the Value field from a SIP header
       
   566 		 *
       
   567 		 * @param aHeader Complete SIP header (e.g. "To: <sip:jesse@dot.net>"
       
   568 		 * @return Pointer descriptor to Value field (e.g. "<sip:jesse@dot.net>")
       
   569 		 */
       
   570 		TPtrC8 ValueFromHeader( const TDesC8& aHeader ) const;
       
   571 
       
   572 		/**
       
   573 		 * Check if the specified SIP header is allowed to be passed through
       
   574 		 * the SIP API.
       
   575 		 *
       
   576 		 * @param aName Header full name (e.g. "From")
       
   577 		 * @return ETrue if header is allowed, EFalse if it is not allowed
       
   578 		 *		   (i.e. it is private to the SIP stack)
       
   579 		 */
       
   580 		TBool IsHeaderAllowed( RStringF aName ) ;
       
   581 
       
   582 	protected:	// Data
       
   583 
       
   584 		/// Reference to the SIP test context. Not owned.
       
   585 		CTcSIPContext& iContext;
       
   586 
       
   587 		/// CleanupStack push count
       
   588 		TInt iPushed;
       
   589 
       
   590 	};
       
   591 
       
   592 #endif // __TTCSIPCOMMANDBASE_H__