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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
16 * Part of : SIP Client
17 * Interface : SDK API, SIP Client API
29 #include "_sipcodecdefs.h"
31 // FORWARD DECLARATIONS
35 class CSIPImplementation;
43 * Class for connecting to SIP server.
45 * This class provides the connection to the SIP server and
46 * provides functions for quering supported SIP security mechanisms and
47 * the support of signalling compression (SigComp).
49 * Note that the implementation uses strings defined in the SIP Codec
50 * string pool. During instantiation the class will open SIP codec string pool
51 * for getting static strings and getting and setting dynamic strings.
53 * The user can create only one instance of this class. (a singleton class).
57 class CSIP : public CBase
59 public: // Constructors and destructor
62 * Two-phased constructor.
63 * @param aUid an unique id that identifies client
64 * @param aObserver a observer for asynchronous event
65 * @return New object, ownership is transferred
66 * @capability WriteDeviceData
68 IMPORT_C static CSIP* NewL(const TUid& aUid,
69 MSIPObserver& aObserver);
72 * Two-phased constructor.
73 * Constructs an object and adds the pointer to the cleanup stack.
74 * @param aUid an unique id that identifies client
75 * @param aObserver a observer for asynchronous event
76 * @return New object, ownership is transferred
77 * @capability WriteDeviceData
79 IMPORT_C static CSIP* NewLC(const TUid& aUid,
80 MSIPObserver& aObserver);
87 public: // New functions
90 * Gets all supported security mechanisms
91 * @return supported SIP security mechanisms names (e.g. digest);
92 * the ownership is transferred
94 IMPORT_C CDesC8Array* SupportedSecurityMechanismsL() const;
97 * Checks if the signalling compression (SigComp) is supported.
98 * Leaves on failure with a system wide error code.
99 * @return ETrue if supported, EFalse otherwise
101 IMPORT_C TBool IsSigCompSupportedL() const;
104 * Gets negotiated security mechanism with the next hop
105 * on the signaling path.
106 * @param aHop the next hop's FQDN or numeric IP address
107 * @return negotiated security mechanism or zero-pointer in case no
108 * security mechanism was negotiated with the next hop;
109 * the ownership is transferred
111 IMPORT_C HBufC8* NegotiatedSecurityMechanismL(const TDesC8& aHop);
114 * Checks if the user has a connection created for given IAP-id
115 * @param aIapId IAP-id
116 * @return sip connection or 0-pointer if connection does not exist.
117 * Ownership is not transferred.
119 IMPORT_C CSIPConnection* Connection(TUint32 aIapId) const;
122 * By default the SIP built-in security mechanisms are enabled.
123 * @param aEnabled if set to EFalse the build-in SIP security handling
124 * mechanism is disabled.
126 IMPORT_C void SetSecurityHandlingL(TBool aEnabled);
129 * Tests if SIP security handling mechanism is enabled/disabled
130 * @return ETrue if built-in mechanisms are enabled, EFalse otherwise.
132 IMPORT_C TBool IsSecurityHandlingEnabled() const;
134 public: // New functions, for internal use
137 * Returns the CSIPImplementation.
139 * @return CSIPImplementation
141 CSIPImplementation& Implementation();
143 private: // Constructors
146 void ConstructL(const TUid& aUid, MSIPObserver& aObserver);
149 CSIPImplementation* iImplementation;
151 private: // For testing purposes
154 UNIT_TEST(CSIPRegistrationBinding_Test)
155 UNIT_TEST(CSIPInviteDialogAssoc_Test)
156 UNIT_TEST(CSIPSubscribeDialogAssoc_Test)
157 UNIT_TEST(CSIPReferDialogAssoc_Test)