williamr@2: /* williamr@2: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * Name : sip.h williamr@2: * Part of : SIP Client williamr@2: * Interface : SDK API, SIP Client API williamr@2: * Version : 2.0 williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: #ifndef CSIP_H williamr@2: #define CSIP_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include "_sipcodecdefs.h" williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CDesC8Array; williamr@2: class MSIPObserver; williamr@2: class CSIPConnection; williamr@2: class CSIPImplementation; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * @publishedAll williamr@2: * @released williamr@2: * williamr@2: * Class for connecting to SIP server. williamr@2: * williamr@2: * This class provides the connection to the SIP server and williamr@2: * provides functions for quering supported SIP security mechanisms and williamr@2: * the support of signalling compression (SigComp). williamr@2: * williamr@2: * Note that the implementation uses strings defined in the SIP Codec williamr@2: * string pool. During instantiation the class will open SIP codec string pool williamr@2: * for getting static strings and getting and setting dynamic strings. williamr@2: * williamr@2: * The user can create only one instance of this class. (a singleton class). williamr@2: * williamr@2: * @lib sipclient.lib williamr@2: */ williamr@2: class CSIP : public CBase williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: * @param aUid an unique id that identifies client williamr@2: * @param aObserver a observer for asynchronous event williamr@2: * @return New object, ownership is transferred williamr@2: * @capability WriteDeviceData williamr@2: */ williamr@2: IMPORT_C static CSIP* NewL(const TUid& aUid, williamr@2: MSIPObserver& aObserver); williamr@2: williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: * Constructs an object and adds the pointer to the cleanup stack. williamr@2: * @param aUid an unique id that identifies client williamr@2: * @param aObserver a observer for asynchronous event williamr@2: * @return New object, ownership is transferred williamr@2: * @capability WriteDeviceData williamr@2: */ williamr@2: IMPORT_C static CSIP* NewLC(const TUid& aUid, williamr@2: MSIPObserver& aObserver); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C ~CSIP(); williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Gets all supported security mechanisms williamr@2: * @return supported SIP security mechanisms names (e.g. digest); williamr@2: * the ownership is transferred williamr@2: */ williamr@2: IMPORT_C CDesC8Array* SupportedSecurityMechanismsL() const; williamr@2: williamr@2: /** williamr@2: * Checks if the signalling compression (SigComp) is supported. williamr@2: * Leaves on failure with a system wide error code. williamr@2: * @return ETrue if supported, EFalse otherwise williamr@2: */ williamr@2: IMPORT_C TBool IsSigCompSupportedL() const; williamr@2: williamr@2: /** williamr@2: * Gets negotiated security mechanism with the next hop williamr@2: * on the signaling path. williamr@2: * @param aHop the next hop's FQDN or numeric IP address williamr@2: * @return negotiated security mechanism or zero-pointer in case no williamr@2: * security mechanism was negotiated with the next hop; williamr@2: * the ownership is transferred williamr@2: */ williamr@2: IMPORT_C HBufC8* NegotiatedSecurityMechanismL(const TDesC8& aHop); williamr@2: williamr@2: /** williamr@2: * Checks if the user has a connection created for given IAP-id williamr@2: * @param aIapId IAP-id williamr@2: * @return sip connection or 0-pointer if connection does not exist. williamr@2: * Ownership is not transferred. williamr@2: */ williamr@2: IMPORT_C CSIPConnection* Connection(TUint32 aIapId) const; williamr@2: williamr@2: /* williamr@2: * By default the SIP built-in security mechanisms are enabled. williamr@2: * @param aEnabled if set to EFalse the build-in SIP security handling williamr@2: * mechanism is disabled. williamr@2: */ williamr@2: IMPORT_C void SetSecurityHandlingL(TBool aEnabled); williamr@2: williamr@2: /* williamr@2: * Tests if SIP security handling mechanism is enabled/disabled williamr@2: * @return ETrue if built-in mechanisms are enabled, EFalse otherwise. williamr@2: */ williamr@2: IMPORT_C TBool IsSecurityHandlingEnabled() const; williamr@2: williamr@2: public: // New functions, for internal use williamr@2: williamr@2: /** williamr@2: * Returns the CSIPImplementation. williamr@2: * williamr@2: * @return CSIPImplementation williamr@2: */ williamr@2: CSIPImplementation& Implementation(); williamr@2: williamr@2: private: // Constructors williamr@2: CSIP(); williamr@2: williamr@2: void ConstructL(const TUid& aUid, MSIPObserver& aObserver); williamr@2: williamr@2: private: // Data williamr@2: CSIPImplementation* iImplementation; williamr@2: williamr@2: private: // For testing purposes williamr@2: williamr@2: UNIT_TEST(CSIP_Test) williamr@2: UNIT_TEST(CSIPRegistrationBinding_Test) williamr@2: UNIT_TEST(CSIPInviteDialogAssoc_Test) williamr@2: UNIT_TEST(CSIPSubscribeDialogAssoc_Test) williamr@2: UNIT_TEST(CSIPReferDialogAssoc_Test) williamr@2: williamr@2: __DECLARE_TEST; williamr@2: }; williamr@2: williamr@2: #endif