realtimenetprots/sipfw/SIP/ConnectionMgr/inc/CErrorHandler.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2002-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          : CErrorHandler.h
       
    16 * Part of       : ConnectionMgr
       
    17 * Version       : SIP/4.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 #ifndef __CERRORHANDLER_H__
       
    29 #define __CERRORHANDLER_H__
       
    30 
       
    31 #include <e32base.h>
       
    32 #include <in_sock.h>
       
    33 #include "SipStackServerDefs.h"
       
    34 
       
    35 class CTransportBase;
       
    36 class CSIPMessage;
       
    37 class CSIPResponse;
       
    38 class RStringF;
       
    39 class TSIPTransportParams;
       
    40 
       
    41 class CTransportErrorHandler : public CActive
       
    42 	{
       
    43 public:
       
    44 	static CTransportErrorHandler* NewL(CTransportBase& aTransport);
       
    45 	static CTransportErrorHandler* NewLC(CTransportBase& aTransport);
       
    46 
       
    47 	void SendErrorResponseL(const TSIPTransportParams& aParams,
       
    48 	                        TUint aResponseCode,	
       
    49 							RStringF aReasonPhrase, 
       
    50 							CSIPMessage& aMessage,
       
    51 							const TInetAddr& aAddr);
       
    52 
       
    53 	void RunL();
       
    54 	void DoCancel();
       
    55 	TInt RunError(TInt aError);
       
    56 
       
    57 	~CTransportErrorHandler();
       
    58 private:
       
    59 	void SetViaToResL(CSIPMessage& aMessage);
       
    60 	void SetToToResL(CSIPMessage& aMessage);
       
    61 	void SetFromToResL(CSIPMessage& aMessage);
       
    62 	void SetCallIdToResL(CSIPMessage& aMessage);
       
    63 	void SetCSeqToResL(CSIPMessage& aMessage);
       
    64 	void CreateResponseL(TUint aResponseCode,	
       
    65 							RStringF aReasonPhrase, 
       
    66 							CSIPMessage& aMessage);
       
    67 
       
    68 	CTransportErrorHandler(CTransportBase& aTransport);
       
    69 	
       
    70 	CTransportBase* iTransport;
       
    71 	CSIPResponse* iResponse;
       
    72 	TInetAddr iAddr;
       
    73 	TTransactionId iId;
       
    74 private: //For testing purposes
       
    75 #ifdef CPPUNIT_TEST
       
    76 	friend class CTransErrorHandlerTest;
       
    77 #endif
       
    78 	};
       
    79 
       
    80 #endif // end of __CERRORHANDLER_H__
       
    81 
       
    82 // End of File