1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/sip.h Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,162 @@
1.4 +/*
1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* Name : sip.h
1.19 +* Part of : SIP Client
1.20 +* Interface : SDK API, SIP Client API
1.21 +* Version : 2.0
1.22 +*
1.23 +*/
1.24 +
1.25 +
1.26 +
1.27 +#ifndef CSIP_H
1.28 +#define CSIP_H
1.29 +
1.30 +// INCLUDES
1.31 +#include <e32base.h>
1.32 +#include "_sipcodecdefs.h"
1.33 +
1.34 +// FORWARD DECLARATIONS
1.35 +class CDesC8Array;
1.36 +class MSIPObserver;
1.37 +class CSIPConnection;
1.38 +class CSIPImplementation;
1.39 +
1.40 +// CLASS DECLARATION
1.41 +
1.42 +/**
1.43 +* @publishedAll
1.44 +* @released
1.45 +*
1.46 +* Class for connecting to SIP server.
1.47 +*
1.48 +* This class provides the connection to the SIP server and
1.49 +* provides functions for quering supported SIP security mechanisms and
1.50 +* the support of signalling compression (SigComp).
1.51 +*
1.52 +* Note that the implementation uses strings defined in the SIP Codec
1.53 +* string pool. During instantiation the class will open SIP codec string pool
1.54 +* for getting static strings and getting and setting dynamic strings.
1.55 +*
1.56 +* The user can create only one instance of this class. (a singleton class).
1.57 +*
1.58 +* @lib sipclient.lib
1.59 +*/
1.60 +class CSIP : public CBase
1.61 + {
1.62 + public: // Constructors and destructor
1.63 +
1.64 + /**
1.65 + * Two-phased constructor.
1.66 + * @param aUid an unique id that identifies client
1.67 + * @param aObserver a observer for asynchronous event
1.68 + * @return New object, ownership is transferred
1.69 + * @capability WriteDeviceData
1.70 + */
1.71 + IMPORT_C static CSIP* NewL(const TUid& aUid,
1.72 + MSIPObserver& aObserver);
1.73 +
1.74 + /**
1.75 + * Two-phased constructor.
1.76 + * Constructs an object and adds the pointer to the cleanup stack.
1.77 + * @param aUid an unique id that identifies client
1.78 + * @param aObserver a observer for asynchronous event
1.79 + * @return New object, ownership is transferred
1.80 + * @capability WriteDeviceData
1.81 + */
1.82 + IMPORT_C static CSIP* NewLC(const TUid& aUid,
1.83 + MSIPObserver& aObserver);
1.84 +
1.85 + /**
1.86 + * Destructor.
1.87 + */
1.88 + IMPORT_C ~CSIP();
1.89 +
1.90 + public: // New functions
1.91 +
1.92 + /**
1.93 + * Gets all supported security mechanisms
1.94 + * @return supported SIP security mechanisms names (e.g. digest);
1.95 + * the ownership is transferred
1.96 + */
1.97 + IMPORT_C CDesC8Array* SupportedSecurityMechanismsL() const;
1.98 +
1.99 + /**
1.100 + * Checks if the signalling compression (SigComp) is supported.
1.101 + * Leaves on failure with a system wide error code.
1.102 + * @return ETrue if supported, EFalse otherwise
1.103 + */
1.104 + IMPORT_C TBool IsSigCompSupportedL() const;
1.105 +
1.106 + /**
1.107 + * Gets negotiated security mechanism with the next hop
1.108 + * on the signaling path.
1.109 + * @param aHop the next hop's FQDN or numeric IP address
1.110 + * @return negotiated security mechanism or zero-pointer in case no
1.111 + * security mechanism was negotiated with the next hop;
1.112 + * the ownership is transferred
1.113 + */
1.114 + IMPORT_C HBufC8* NegotiatedSecurityMechanismL(const TDesC8& aHop);
1.115 +
1.116 + /**
1.117 + * Checks if the user has a connection created for given IAP-id
1.118 + * @param aIapId IAP-id
1.119 + * @return sip connection or 0-pointer if connection does not exist.
1.120 + * Ownership is not transferred.
1.121 + */
1.122 + IMPORT_C CSIPConnection* Connection(TUint32 aIapId) const;
1.123 +
1.124 + /*
1.125 + * By default the SIP built-in security mechanisms are enabled.
1.126 + * @param aEnabled if set to EFalse the build-in SIP security handling
1.127 + * mechanism is disabled.
1.128 + */
1.129 + IMPORT_C void SetSecurityHandlingL(TBool aEnabled);
1.130 +
1.131 + /*
1.132 + * Tests if SIP security handling mechanism is enabled/disabled
1.133 + * @return ETrue if built-in mechanisms are enabled, EFalse otherwise.
1.134 + */
1.135 + IMPORT_C TBool IsSecurityHandlingEnabled() const;
1.136 +
1.137 + public: // New functions, for internal use
1.138 +
1.139 + /**
1.140 + * Returns the CSIPImplementation.
1.141 + *
1.142 + * @return CSIPImplementation
1.143 + */
1.144 + CSIPImplementation& Implementation();
1.145 +
1.146 + private: // Constructors
1.147 + CSIP();
1.148 +
1.149 + void ConstructL(const TUid& aUid, MSIPObserver& aObserver);
1.150 +
1.151 + private: // Data
1.152 + CSIPImplementation* iImplementation;
1.153 +
1.154 + private: // For testing purposes
1.155 +
1.156 + UNIT_TEST(CSIP_Test)
1.157 + UNIT_TEST(CSIPRegistrationBinding_Test)
1.158 + UNIT_TEST(CSIPInviteDialogAssoc_Test)
1.159 + UNIT_TEST(CSIPSubscribeDialogAssoc_Test)
1.160 + UNIT_TEST(CSIPReferDialogAssoc_Test)
1.161 +
1.162 + __DECLARE_TEST;
1.163 + };
1.164 +
1.165 +#endif