realtimenetprots/sipfw/SIP/Registration/inc/CSIPResponseUtility.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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:
       
    15 * Name          : CSIPResponseUtility.h
       
    16 * Part of       : SIP Registrations
       
    17 * Version       : SIP/6.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 #ifndef CSIPRESPONSEUTILITY_H
       
    29 #define CSIPRESPONSEUTILITY_H
       
    30 
       
    31 // INCLUDES
       
    32 #include <e32base.h>
       
    33 
       
    34 // FORWARD DELARATION
       
    35 class CSIPResponse;
       
    36 class CSIPContactHeader;
       
    37 class CSIPURI;
       
    38 class MRegistrationContext;
       
    39 class CSIPViaHeader;
       
    40 
       
    41 
       
    42 class CSIPResponseUtility : public CBase
       
    43 	{
       
    44 public:
       
    45 
       
    46    /** 
       
    47     * @ param aSIPResponse; a CSIPResponse.
       
    48 	* @ return ETrue if the response code is 3xx-6xx, EFalse otherwise.
       
    49 	*/ 
       
    50 	static TBool IsError(CSIPResponse& aSIPResponse);
       
    51 
       
    52    /** 
       
    53 	* Get the contact header by comparing the uri of contact in response
       
    54 	* and the uri in binding. there maybe more than one contact 
       
    55 	* headers in response. only the one which uri equals the uri 
       
    56 	* of Contact in binding is returned.
       
    57 	*
       
    58 	* @param aContactInBinding; contact header in binding.
       
    59 	* @param aSIPResponse; a CSIPResponse.
       
    60 	* @return CSIPContactHeader object. it can be 0 if the contact
       
    61 	*          can not be found from the corresponding binding or
       
    62 	*          there is no contact header in response.
       
    63 	*/ 
       
    64 	static CSIPContactHeader* ContactHeader(
       
    65 		CSIPContactHeader& aContactInBinding,
       
    66 		CSIPResponse&      aSIPResponse);
       
    67 
       
    68    /** 
       
    69 	* Get the callId from response. leave if there is no callId header
       
    70 	* in response.
       
    71 	*
       
    72 	* @ param aSIPResponse; a CSIPResponse.
       
    73 	*/ 
       
    74 	static HBufC8* CallIdL(CSIPResponse& aSIPResponse);
       
    75 
       
    76    /** 
       
    77 	* Get the CSeqNumber from response. 
       
    78 	* leave if there is no CSIPCSeqHeader in response.
       
    79 	*
       
    80 	* @param aSIPResponse; a CSIPResponse.
       
    81 	*/
       
    82 	static TUint CSeqValueL(CSIPResponse& aSIPResponse);
       
    83 
       
    84    /** 
       
    85 	* Get Expires value. function first checks the expires parameter
       
    86 	* from contact header of response, if there is no expires parameter,
       
    87 	* function checks the expires header from response, if there is expires
       
    88 	* header, it copies the expires header to expires parameter and remove 
       
    89 	* expires header. if there is no expires header neither, function copies
       
    90 	* the expires parameter from binding.
       
    91 	*
       
    92 	* @param aBindingContact.
       
    93 	* @param aSIPResponse.
       
    94 	* @return KErrNone, if the response is ok, 
       
    95 	*         otherwise corresponding error code.
       
    96 	*/
       
    97 	static TUint ExpireValueL(CSIPContactHeader& aBindingContact,
       
    98 		                      CSIPResponse&      aSIPResponse);
       
    99 
       
   100 	static TInt Check2XXResponse(MRegistrationContext& aRegistration,
       
   101 		                         CSIPResponse& aResponse);
       
   102 	};
       
   103 
       
   104 #endif // CSIPRESPONSEUTILITY_H
       
   105 
       
   106 // End of File