2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
16 * Part of : SIP Client
17 * Interface : SDK API, SIP Client API
30 // FORWARD DECLARATIONS
34 class CSIPImplementation;
42 * Class for connecting to SIP server.
44 * This class provides the connection to the SIP server and
45 * provides functions for quering supported SIP security mechanisms and
46 * the support of signalling compression (SigComp).
48 * Note that the implementation uses strings defined in the SIP Codec
49 * string pool. During instantiation the class will open SIP codec string pool
50 * for getting static strings and getting and setting dynamic strings.
52 * The user can create only one instance of this class. (a singleton class).
56 class CSIP : public CBase
58 public: // Constructors and destructor
61 * Two-phased constructor.
62 * @param aUid an unique id that identifies client
63 * @param aObserver a observer for asynchronous event
64 * @return New object, ownership is transferred
65 * @capability WriteDeviceData
67 IMPORT_C static CSIP* NewL(const TUid& aUid,
68 MSIPObserver& aObserver);
71 * Two-phased constructor.
72 * Constructs an object and adds the pointer to the cleanup stack.
73 * @param aUid an unique id that identifies client
74 * @param aObserver a observer for asynchronous event
75 * @return New object, ownership is transferred
76 * @capability WriteDeviceData
78 IMPORT_C static CSIP* NewLC(const TUid& aUid,
79 MSIPObserver& aObserver);
86 public: // New functions
89 * Gets all supported security mechanisms
90 * @return supported SIP security mechanisms names (e.g. digest);
91 * the ownership is transferred
93 IMPORT_C CDesC8Array* SupportedSecurityMechanismsL() const;
96 * Checks if the signalling compression (SigComp) is supported.
97 * Leaves on failure with a system wide error code.
98 * @return ETrue if supported, EFalse otherwise
100 IMPORT_C TBool IsSigCompSupportedL() const;
103 * Gets negotiated security mechanism with the next hop
104 * on the signaling path.
105 * @param aHop the next hop's FQDN or numeric IP address
106 * @return negotiated security mechanism or zero-pointer in case no
107 * security mechanism was negotiated with the next hop;
108 * the ownership is transferred
110 IMPORT_C HBufC8* NegotiatedSecurityMechanismL(const TDesC8& aHop);
113 * Checks if the user has a connection created for given IAP-id
114 * @param aIapId IAP-id
115 * @return sip connection or 0-pointer if connection does not exist.
116 * Ownership is not transferred.
118 IMPORT_C CSIPConnection* Connection(TUint32 aIapId) const;
121 * By default the SIP built-in security mechanisms are enabled.
122 * @param aEnabled if set to EFalse the build-in SIP security handling
123 * mechanism is disabled.
125 IMPORT_C void SetSecurityHandlingL(TBool aEnabled);
128 * Tests if SIP security handling mechanism is enabled/disabled
129 * @return ETrue if built-in mechanisms are enabled, EFalse otherwise.
131 IMPORT_C TBool IsSecurityHandlingEnabled() const;
133 public: // New functions, for internal use
136 * Returns the CSIPImplementation.
138 * @return CSIPImplementation
140 CSIPImplementation& Implementation();
142 private: // Constructors
145 void ConstructL(const TUid& aUid, MSIPObserver& aObserver);
148 CSIPImplementation* iImplementation;
150 private: // For testing purposes
152 friend class CSIP_Test;
153 friend class CSIPRegistrationBinding_Test;
154 friend class CSIPInviteDialogAssoc_Test;
155 friend class CSIPSubscribeDialogAssoc_Test;
156 friend class CSIPReferDialogAssoc_Test;
158 void __DbgTestInvariant() const;