2 * Copyright (c) 2003-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 Profile Client
17 * Interface : SDK API, SIP Profile API
18 * The class providing profile data of SIP service provider
32 #include "sipregistrationcontext.h"
33 #include "sipprofiletypeinfo.h"
35 // FORWARD DECLARATIONS
36 class CSIPConcreteProfile;
37 class CSIPProfileRegistry;
38 class CSIPProfileRegistryBase;
41 * SIP Profile ID which value is type of TUint32
43 const TUint32 KSIPProfileId = 1;
46 * SIP Provider Name which value is type of TDesC8
48 const TUint32 KSIPProviderName = 2;
51 * Access Point ID which value is type of TUint32
53 const TUint32 KSIPAccessPointId = 3;
56 * Signaling compression (SigComp) which value is type of TBool.
57 * ETrue indicates that SigComp is enabled
59 const TUint32 KSIPSigComp = 4;
62 * Security Negotiation which value is type of TBool. ETrue indicates that
63 * Security Negotiation is enabled
65 const TUint32 KSIPSecurityNegotiation = 5;
68 * Auto Registration which value is type of TBool. ETrue indicates that
69 * profile is enabled for auto registration
71 const TUint32 KSIPAutoRegistration = 6;
74 * Defined user's address-of-record which value is type of TDesC8
76 const TUint32 KSIPUserAor = 7;
79 * Registration which value is type of TBool. ETrue indicates that
80 * profile is registered
82 const TUint32 KSIPProfileRegistered = 8;
85 * Users's registered address-of-records which value is of type MDesC8Array.
86 * Note that array will contain AORs only in case the profile is registered.
88 const TUint32 KSIPRegisteredAors = 9;
91 * Negotiated security mechanism during registration procedure which value
93 * Note that descriptor will contain value only in case the profile is
96 const TUint32 KSIPNegotiatedSecurityMechanism = 10;
99 * Default profile which value is type of TBool.
100 * ETrue indicates that profile is default
102 const TUint32 KSIPDefaultProfile = 11;
105 * "Contact" header parameters used during registration which value
106 * is of type MDesC8Array. Each array element contains one "Contact"-header
109 const TUint32 KSIPContactHeaderParams = 12;
112 * The user's registered "Contact"-header including the whole value of the header
113 * except for the header's name ("Contact:").
114 * The value is of type TDesC8.
115 * Note that the value is available only in case the profile is registered.
117 const TUint32 KSIPRegisteredContact = 13;
120 * SNAP (Service Network Access Point) ID which value is type of TUint32.
121 * This is an optional parameter. When this parameter is configured,
122 * KSIPAccessPointId has a meaningful value only when the profile is registered.
123 * The value of KSIPSnapId must be greater than zero.
125 const TUint32 KSIPSnapId = 14;
128 * A unique Contact-header's user-part
129 * generated automatically by the SIP implementation.
130 * The value is of type TDesC8.
131 * This parameter is read-only and
132 * trying to set it will fail with KErrAccessDenied.
134 const TUint32 KSIPContactHeaderUser = 15;
137 * Sets the KSoIpTOS socket option (see in_sock.h) for
138 * all SIP signalling related to this profile.
139 * The value is of type TUint32.
141 const TUint32 KSIPSoIpTOS = 16;
144 * Sets the Access Point Name.
145 * This is an Optional Parameter.
146 * Access Point Name which value is type of TDesC8,
148 const TUint32 KSIPAccessPointName = 17;
151 * Sets the SNAP Name.
152 * This is an Optional Parameter.
153 * SNAP Name which value is type of TDesC8,
155 const TUint32 KSIPSnapName = 18;
158 * Proxy Resolving Feature which is type TBool.
159 * ETrue indicates that Proxy Resolving is enabled
161 const TUint32 KSIPResolveProxy = 19;
166 const TUint32 KSIPRegistrar = 130;
171 const TUint32 KSIPOutboundProxy = 131;
174 * HTTP Digest user name which value is type of TDesC8
176 const TUint32 KSIPDigestUserName = 150;
179 * HTTP Digest realm which value is type of TDesC8
181 const TUint32 KSIPDigestRealm = 151;
184 * SIP server's address which value is of type TDesC8
186 const TUint32 KSIPServerAddress = 152;
193 * Class contains profile information of particular SIP service
194 * provider. Class provides functions for quering profile parameter
196 * @lib sipprofilecli.lib
198 class CSIPProfile: public CBase, public MSIPRegistrationContext
200 public: // Constructors and destructor
203 * @capability NetworkServices
205 IMPORT_C ~CSIPProfile();
207 public: // New functions
209 * Gets profile type information
210 * @return profile type information
212 IMPORT_C const TSIPProfileTypeInfo& Type() const;
215 * Gets profile parameter
216 * @param aParam a parameter to get
217 * @param aVal on return will contain parameter value
218 * @return KErrNotFound if parameter was not found, KErrNone otherwise
220 IMPORT_C TInt GetParameter(TUint32 aParam, TDesC8 const *& aVal) const;
223 * Gets profile parameter
224 * @param aParam a parameter to get
225 * @param aVal on return will contain parameter value
226 * @return KErrNotFound if parameter was not found, KErrNone otherwise
228 IMPORT_C TInt GetParameter(TUint32 aParam, TUint32& aVal) const;
231 * Gets profile parameter
232 * @param aParam a parameter to get
233 * @param aVal on return will contain parameter value
234 * @return KErrNotFound if parameter was not found, KErrNone otherwise
236 IMPORT_C TInt GetParameter(TUint32 aParam, TBool& aVal) const;
239 * Gets profile parameter
240 * @param aParam a parameter to get
241 * @param aVal on return will contain parameter value
242 * @return KErrNotFound if parameter was not found, KErrNone otherwise
244 IMPORT_C TInt GetParameter(TUint32 aParam, MDesC8Array const *& aVal) const;
247 * Gets profile parameter that is defined for a particular SIP server
248 * @param aServer a SIP server type
249 * @param aParam a parameter to get
250 * @param aVal on return will contain parameter value
251 * @return KErrNotFound if parameter was not found, KErrNone otherwise
253 IMPORT_C TInt GetParameter(TUint32 aServerType, TUint32 aParam, TDesC8 const *& aVal) const;
255 public: //Functions from base class
257 * Tests if the registration context can be
258 * used for creating SIP messages/dialogs
259 * Profile can be used, when CSIPProfileRegistry::IsEnabled() == ETrue
260 * and Status() == ERegistered.
261 * @return ETrue if can be used, EFalse otherwise
264 TBool IsContextActive() const;
268 * For internal use only
272 TUint32 ContextId() const;
275 public: //New functions
278 * Two-phased constructor.
279 * @param aSIPRegistry a SIP profile client providing connection to SIP
283 static CSIPProfile* NewL(CSIPProfileRegistry* aSIPRegistry);
286 * Two-phased constructor.
287 * @param aSIPRegistry a SIP profile client providing connection to SIP
289 * Constructs an object and adds the pointer to the cleanup stack;
292 static CSIPProfile* NewLC(CSIPProfileRegistry* aSIPRegistry);
295 * Sets profiles enabled state
296 * @param aEnabled ETrue if enabled
299 void SetEnabled(TBool aEnabled);
302 * Sets concrete profile that holds actual data
303 * @param aProfile profile instance containing data
306 void SetConcreteProfile(CSIPConcreteProfile* aProfile);
309 * Clears concrete profile that holds actual data
312 void ClearConcreteProfile();
315 * Gets concrete profile that holds actual data
316 * @return concrete profile holding data
319 CSIPConcreteProfile& ConcreteProfile();
322 * Gets concrete profile that holds actual data
323 * @return concrete profile holding data
326 const CSIPConcreteProfile& ConcreteProfile() const;
329 * Checks if the profile is enabled
330 * @return ETrue if enabled, EFalse otherwise
333 TBool IsEnabled() const;
336 * Gets last occurred error during registration
337 * @return last occurred error code, KErrNone if no error
339 TInt LastRegistrationError() const;
342 * sets pointer to registry for profile
344 void SetRegistry(CSIPProfileRegistryBase* aRegistry);
347 * Clears pointer to registry from profile
349 void ClearRegistry();
352 * gets the Default SNAP ID from the Connectivity Settings
355 void DefaultSNAPL(TUint32& aSnapId) const;
362 CSIPProfile(CSIPProfileRegistryBase* aRegistry);
365 * 2nd phase constructor.
374 CSIPConcreteProfile* iSIPProfile;
379 CSIPProfileRegistryBase* iSIPProfileRegistry;
386 #endif // CSIPPROFILE_H