williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
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
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
* Name : sipprofile.h
|
williamr@2
|
16 |
* Part of : SIP Profile Client
|
williamr@2
|
17 |
* Interface : SDK API, SIP Profile API
|
williamr@2
|
18 |
* The class providing profile data of SIP service provider
|
williamr@2
|
19 |
* Version : 1.0
|
williamr@2
|
20 |
*
|
williamr@2
|
21 |
*/
|
williamr@2
|
22 |
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#ifndef CSIPPROFILE_H
|
williamr@2
|
26 |
#define CSIPPROFILE_H
|
williamr@2
|
27 |
|
williamr@2
|
28 |
// INCLUDES
|
williamr@2
|
29 |
#include <e32base.h>
|
williamr@2
|
30 |
#include <e32std.h>
|
williamr@2
|
31 |
#include <badesca.h>
|
williamr@2
|
32 |
#include "sipregistrationcontext.h"
|
williamr@2
|
33 |
#include "sipprofiletypeinfo.h"
|
williamr@2
|
34 |
|
williamr@2
|
35 |
// FORWARD DECLARATIONS
|
williamr@2
|
36 |
class CSIPConcreteProfile;
|
williamr@2
|
37 |
class CSIPProfileRegistry;
|
williamr@2
|
38 |
class CSIPProfileRegistryBase;
|
williamr@2
|
39 |
|
williamr@2
|
40 |
/**
|
williamr@2
|
41 |
* SIP Profile ID which value is type of TUint32
|
williamr@2
|
42 |
*/
|
williamr@2
|
43 |
const TUint32 KSIPProfileId = 1;
|
williamr@2
|
44 |
|
williamr@2
|
45 |
/**
|
williamr@2
|
46 |
* SIP Provider Name which value is type of TDesC8
|
williamr@2
|
47 |
*/
|
williamr@2
|
48 |
const TUint32 KSIPProviderName = 2;
|
williamr@2
|
49 |
|
williamr@2
|
50 |
/**
|
williamr@2
|
51 |
* Access Point ID which value is type of TUint32
|
williamr@2
|
52 |
*/
|
williamr@2
|
53 |
const TUint32 KSIPAccessPointId = 3;
|
williamr@2
|
54 |
|
williamr@2
|
55 |
/**
|
williamr@2
|
56 |
* Signaling compression (SigComp) which value is type of TBool.
|
williamr@2
|
57 |
* ETrue indicates that SigComp is enabled
|
williamr@2
|
58 |
*/
|
williamr@2
|
59 |
const TUint32 KSIPSigComp = 4;
|
williamr@2
|
60 |
|
williamr@2
|
61 |
/**
|
williamr@2
|
62 |
* Security Negotiation which value is type of TBool. ETrue indicates that
|
williamr@2
|
63 |
* Security Negotiation is enabled
|
williamr@2
|
64 |
*/
|
williamr@2
|
65 |
const TUint32 KSIPSecurityNegotiation = 5;
|
williamr@2
|
66 |
|
williamr@2
|
67 |
/**
|
williamr@2
|
68 |
* Auto Registration which value is type of TBool. ETrue indicates that
|
williamr@2
|
69 |
* profile is enabled for auto registration
|
williamr@2
|
70 |
*/
|
williamr@2
|
71 |
const TUint32 KSIPAutoRegistration = 6;
|
williamr@2
|
72 |
|
williamr@2
|
73 |
/**
|
williamr@2
|
74 |
* Defined user's address-of-record which value is type of TDesC8
|
williamr@2
|
75 |
*/
|
williamr@2
|
76 |
const TUint32 KSIPUserAor = 7;
|
williamr@2
|
77 |
|
williamr@2
|
78 |
/**
|
williamr@2
|
79 |
* Registration which value is type of TBool. ETrue indicates that
|
williamr@2
|
80 |
* profile is registered
|
williamr@2
|
81 |
*/
|
williamr@2
|
82 |
const TUint32 KSIPProfileRegistered = 8;
|
williamr@2
|
83 |
|
williamr@2
|
84 |
/**
|
williamr@2
|
85 |
* Users's registered address-of-records which value is of type MDesC8Array.
|
williamr@2
|
86 |
* Note that array will contain AORs only in case the profile is registered.
|
williamr@2
|
87 |
*/
|
williamr@2
|
88 |
const TUint32 KSIPRegisteredAors = 9;
|
williamr@2
|
89 |
|
williamr@2
|
90 |
/**
|
williamr@2
|
91 |
* Negotiated security mechanism during registration procedure which value
|
williamr@2
|
92 |
* is of type TDesC8.
|
williamr@2
|
93 |
* Note that descriptor will contain value only in case the profile is
|
williamr@2
|
94 |
* registered.
|
williamr@2
|
95 |
*/
|
williamr@2
|
96 |
const TUint32 KSIPNegotiatedSecurityMechanism = 10;
|
williamr@2
|
97 |
|
williamr@2
|
98 |
/**
|
williamr@2
|
99 |
* Default profile which value is type of TBool.
|
williamr@2
|
100 |
* ETrue indicates that profile is default
|
williamr@2
|
101 |
*/
|
williamr@2
|
102 |
const TUint32 KSIPDefaultProfile = 11;
|
williamr@2
|
103 |
|
williamr@2
|
104 |
/**
|
williamr@2
|
105 |
* "Contact" header parameters used during registration which value
|
williamr@2
|
106 |
* is of type MDesC8Array. Each array element contains one "Contact"-header
|
williamr@2
|
107 |
* parameter.
|
williamr@2
|
108 |
*/
|
williamr@2
|
109 |
const TUint32 KSIPContactHeaderParams = 12;
|
williamr@2
|
110 |
|
williamr@2
|
111 |
/**
|
williamr@2
|
112 |
* The user's registered "Contact"-header including the whole value of the header
|
williamr@2
|
113 |
* except for the header's name ("Contact:").
|
williamr@2
|
114 |
* The value is of type TDesC8.
|
williamr@2
|
115 |
* Note that the value is available only in case the profile is registered.
|
williamr@2
|
116 |
*/
|
williamr@2
|
117 |
const TUint32 KSIPRegisteredContact = 13;
|
williamr@2
|
118 |
|
williamr@2
|
119 |
/**
|
williamr@2
|
120 |
* SNAP (Service Network Access Point) ID which value is type of TUint32.
|
williamr@2
|
121 |
* This is an optional parameter. When this parameter is configured,
|
williamr@2
|
122 |
* KSIPAccessPointId has a meaningful value only when the profile is registered.
|
williamr@2
|
123 |
* The value of KSIPSnapId must be greater than zero.
|
williamr@2
|
124 |
*/
|
williamr@2
|
125 |
const TUint32 KSIPSnapId = 14;
|
williamr@2
|
126 |
|
williamr@2
|
127 |
/**
|
williamr@2
|
128 |
* A unique Contact-header's user-part
|
williamr@2
|
129 |
* generated automatically by the SIP implementation.
|
williamr@2
|
130 |
* The value is of type TDesC8.
|
williamr@2
|
131 |
* This parameter is read-only and
|
williamr@2
|
132 |
* trying to set it will fail with KErrAccessDenied.
|
williamr@2
|
133 |
*/
|
williamr@2
|
134 |
const TUint32 KSIPContactHeaderUser = 15;
|
williamr@2
|
135 |
|
williamr@2
|
136 |
/**
|
williamr@2
|
137 |
* Sets the KSoIpTOS socket option (see in_sock.h) for
|
williamr@2
|
138 |
* all SIP signalling related to this profile.
|
williamr@2
|
139 |
* The value is of type TUint32.
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
const TUint32 KSIPSoIpTOS = 16;
|
williamr@2
|
142 |
|
williamr@2
|
143 |
/**
|
williamr@2
|
144 |
* Sets the Access Point Name.
|
williamr@2
|
145 |
* This is an Optional Parameter.
|
williamr@2
|
146 |
* Access Point Name which value is type of TDesC8,
|
williamr@2
|
147 |
*/
|
williamr@2
|
148 |
const TUint32 KSIPAccessPointName = 17;
|
williamr@2
|
149 |
|
williamr@2
|
150 |
/**
|
williamr@2
|
151 |
* Sets the SNAP Name.
|
williamr@2
|
152 |
* This is an Optional Parameter.
|
williamr@2
|
153 |
* SNAP Name which value is type of TDesC8,
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
const TUint32 KSIPSnapName = 18;
|
williamr@2
|
156 |
|
williamr@2
|
157 |
/**
|
williamr@2
|
158 |
* SIP Registrar
|
williamr@2
|
159 |
*/
|
williamr@2
|
160 |
const TUint32 KSIPRegistrar = 130;
|
williamr@2
|
161 |
|
williamr@2
|
162 |
/**
|
williamr@2
|
163 |
* SIP Outbound Proxy
|
williamr@2
|
164 |
*/
|
williamr@2
|
165 |
const TUint32 KSIPOutboundProxy = 131;
|
williamr@2
|
166 |
|
williamr@2
|
167 |
/**
|
williamr@2
|
168 |
* HTTP Digest user name which value is type of TDesC8
|
williamr@2
|
169 |
*/
|
williamr@2
|
170 |
const TUint32 KSIPDigestUserName = 150;
|
williamr@2
|
171 |
|
williamr@2
|
172 |
/**
|
williamr@2
|
173 |
* HTTP Digest realm which value is type of TDesC8
|
williamr@2
|
174 |
*/
|
williamr@2
|
175 |
const TUint32 KSIPDigestRealm = 151;
|
williamr@2
|
176 |
|
williamr@2
|
177 |
/**
|
williamr@2
|
178 |
* SIP server's address which value is of type TDesC8
|
williamr@2
|
179 |
*/
|
williamr@2
|
180 |
const TUint32 KSIPServerAddress = 152;
|
williamr@2
|
181 |
|
williamr@2
|
182 |
// CLASS DECLARATION
|
williamr@2
|
183 |
/**
|
williamr@2
|
184 |
* @publishedAll
|
williamr@2
|
185 |
* @released
|
williamr@2
|
186 |
*
|
williamr@2
|
187 |
* Class contains profile information of particular SIP service
|
williamr@2
|
188 |
* provider. Class provides functions for quering profile parameter
|
williamr@2
|
189 |
* values.
|
williamr@2
|
190 |
* @lib sipprofilecli.lib
|
williamr@2
|
191 |
*/
|
williamr@2
|
192 |
class CSIPProfile: public CBase, public MSIPRegistrationContext
|
williamr@2
|
193 |
{
|
williamr@2
|
194 |
public: // Constructors and destructor
|
williamr@2
|
195 |
/**
|
williamr@2
|
196 |
* Destructor.
|
williamr@2
|
197 |
* @capability NetworkServices
|
williamr@2
|
198 |
*/
|
williamr@2
|
199 |
IMPORT_C ~CSIPProfile();
|
williamr@2
|
200 |
|
williamr@2
|
201 |
public: // New functions
|
williamr@2
|
202 |
/**
|
williamr@2
|
203 |
* Gets profile type information
|
williamr@2
|
204 |
* @return profile type information
|
williamr@2
|
205 |
*/
|
williamr@2
|
206 |
IMPORT_C const TSIPProfileTypeInfo& Type() const;
|
williamr@2
|
207 |
|
williamr@2
|
208 |
/**
|
williamr@2
|
209 |
* Gets profile parameter
|
williamr@2
|
210 |
* @param aParam a parameter to get
|
williamr@2
|
211 |
* @param aVal on return will contain parameter value
|
williamr@2
|
212 |
* @return KErrNotFound if parameter was not found, KErrNone otherwise
|
williamr@2
|
213 |
*/
|
williamr@2
|
214 |
IMPORT_C TInt GetParameter(TUint32 aParam, TDesC8 const *& aVal) const;
|
williamr@2
|
215 |
|
williamr@2
|
216 |
/**
|
williamr@2
|
217 |
* Gets profile parameter
|
williamr@2
|
218 |
* @param aParam a parameter to get
|
williamr@2
|
219 |
* @param aVal on return will contain parameter value
|
williamr@2
|
220 |
* @return KErrNotFound if parameter was not found, KErrNone otherwise
|
williamr@2
|
221 |
*/
|
williamr@2
|
222 |
IMPORT_C TInt GetParameter(TUint32 aParam, TUint32& aVal) const;
|
williamr@2
|
223 |
|
williamr@2
|
224 |
/**
|
williamr@2
|
225 |
* Gets profile parameter
|
williamr@2
|
226 |
* @param aParam a parameter to get
|
williamr@2
|
227 |
* @param aVal on return will contain parameter value
|
williamr@2
|
228 |
* @return KErrNotFound if parameter was not found, KErrNone otherwise
|
williamr@2
|
229 |
*/
|
williamr@2
|
230 |
IMPORT_C TInt GetParameter(TUint32 aParam, TBool& aVal) const;
|
williamr@2
|
231 |
|
williamr@2
|
232 |
/**
|
williamr@2
|
233 |
* Gets profile parameter
|
williamr@2
|
234 |
* @param aParam a parameter to get
|
williamr@2
|
235 |
* @param aVal on return will contain parameter value
|
williamr@2
|
236 |
* @return KErrNotFound if parameter was not found, KErrNone otherwise
|
williamr@2
|
237 |
*/
|
williamr@2
|
238 |
IMPORT_C TInt GetParameter(TUint32 aParam, MDesC8Array const *& aVal) const;
|
williamr@2
|
239 |
|
williamr@2
|
240 |
/**
|
williamr@2
|
241 |
* Gets profile parameter that is defined for a particular SIP server
|
williamr@2
|
242 |
* @param aServer a SIP server type
|
williamr@2
|
243 |
* @param aParam a parameter to get
|
williamr@2
|
244 |
* @param aVal on return will contain parameter value
|
williamr@2
|
245 |
* @return KErrNotFound if parameter was not found, KErrNone otherwise
|
williamr@2
|
246 |
*/
|
williamr@2
|
247 |
IMPORT_C TInt GetParameter(TUint32 aServerType, TUint32 aParam, TDesC8 const *& aVal) const;
|
williamr@2
|
248 |
|
williamr@2
|
249 |
public: //Functions from base class
|
williamr@2
|
250 |
/**
|
williamr@2
|
251 |
* Tests if the registration context can be
|
williamr@2
|
252 |
* used for creating SIP messages/dialogs
|
williamr@2
|
253 |
* Profile can be used, when CSIPProfileRegistry::IsEnabled() == ETrue
|
williamr@2
|
254 |
* and Status() == ERegistered.
|
williamr@2
|
255 |
* @return ETrue if can be used, EFalse otherwise
|
williamr@2
|
256 |
* @internalComponent
|
williamr@2
|
257 |
*/
|
williamr@2
|
258 |
TBool IsContextActive() const;
|
williamr@2
|
259 |
|
williamr@2
|
260 |
/**
|
williamr@2
|
261 |
*
|
williamr@2
|
262 |
* For internal use only
|
williamr@2
|
263 |
* @return context id
|
williamr@2
|
264 |
* @internalComponent
|
williamr@2
|
265 |
*/
|
williamr@2
|
266 |
TUint32 ContextId() const;
|
williamr@2
|
267 |
|
williamr@2
|
268 |
|
williamr@2
|
269 |
public: //New functions
|
williamr@2
|
270 |
|
williamr@2
|
271 |
/**
|
williamr@2
|
272 |
* Two-phased constructor.
|
williamr@2
|
273 |
* @param aSIPRegistry a SIP profile client providing connection to SIP
|
williamr@2
|
274 |
* profile server.
|
williamr@2
|
275 |
*/
|
williamr@2
|
276 |
|
williamr@2
|
277 |
static CSIPProfile* NewL(CSIPProfileRegistry* aSIPRegistry);
|
williamr@2
|
278 |
|
williamr@2
|
279 |
/**
|
williamr@2
|
280 |
* Two-phased constructor.
|
williamr@2
|
281 |
* @param aSIPRegistry a SIP profile client providing connection to SIP
|
williamr@2
|
282 |
* profile server.
|
williamr@2
|
283 |
* Constructs an object and adds the pointer to the cleanup stack;
|
williamr@2
|
284 |
*/
|
williamr@2
|
285 |
|
williamr@2
|
286 |
static CSIPProfile* NewLC(CSIPProfileRegistry* aSIPRegistry);
|
williamr@2
|
287 |
|
williamr@2
|
288 |
/**
|
williamr@2
|
289 |
* Sets profiles enabled state
|
williamr@2
|
290 |
* @param aEnabled ETrue if enabled
|
williamr@2
|
291 |
*/
|
williamr@2
|
292 |
|
williamr@2
|
293 |
void SetEnabled(TBool aEnabled);
|
williamr@2
|
294 |
|
williamr@2
|
295 |
/**
|
williamr@2
|
296 |
* Sets concrete profile that holds actual data
|
williamr@2
|
297 |
* @param aProfile profile instance containing data
|
williamr@2
|
298 |
*/
|
williamr@2
|
299 |
|
williamr@2
|
300 |
void SetConcreteProfile(CSIPConcreteProfile* aProfile);
|
williamr@2
|
301 |
|
williamr@2
|
302 |
/**
|
williamr@2
|
303 |
* Clears concrete profile that holds actual data
|
williamr@2
|
304 |
*/
|
williamr@2
|
305 |
|
williamr@2
|
306 |
void ClearConcreteProfile();
|
williamr@2
|
307 |
|
williamr@2
|
308 |
/**
|
williamr@2
|
309 |
* Gets concrete profile that holds actual data
|
williamr@2
|
310 |
* @return concrete profile holding data
|
williamr@2
|
311 |
*/
|
williamr@2
|
312 |
|
williamr@2
|
313 |
CSIPConcreteProfile& ConcreteProfile();
|
williamr@2
|
314 |
|
williamr@2
|
315 |
/**
|
williamr@2
|
316 |
* Gets concrete profile that holds actual data
|
williamr@2
|
317 |
* @return concrete profile holding data
|
williamr@2
|
318 |
*/
|
williamr@2
|
319 |
|
williamr@2
|
320 |
const CSIPConcreteProfile& ConcreteProfile() const;
|
williamr@2
|
321 |
|
williamr@2
|
322 |
/**
|
williamr@2
|
323 |
* Checks if the profile is enabled
|
williamr@2
|
324 |
* @return ETrue if enabled, EFalse otherwise
|
williamr@2
|
325 |
*/
|
williamr@2
|
326 |
|
williamr@2
|
327 |
TBool IsEnabled() const;
|
williamr@2
|
328 |
|
williamr@2
|
329 |
/**
|
williamr@2
|
330 |
* Gets last occurred error during registration
|
williamr@2
|
331 |
* @return last occurred error code, KErrNone if no error
|
williamr@2
|
332 |
*/
|
williamr@2
|
333 |
TInt LastRegistrationError() const;
|
williamr@2
|
334 |
|
williamr@2
|
335 |
/**
|
williamr@2
|
336 |
* sets pointer to registry for profile
|
williamr@2
|
337 |
*/
|
williamr@2
|
338 |
void SetRegistry(CSIPProfileRegistryBase* aRegistry);
|
williamr@2
|
339 |
|
williamr@2
|
340 |
/**
|
williamr@2
|
341 |
* Clears pointer to registry from profile
|
williamr@2
|
342 |
*/
|
williamr@2
|
343 |
void ClearRegistry();
|
williamr@2
|
344 |
|
williamr@2
|
345 |
protected:
|
williamr@2
|
346 |
|
williamr@2
|
347 |
/**
|
williamr@2
|
348 |
* Constructor.
|
williamr@2
|
349 |
*/
|
williamr@2
|
350 |
CSIPProfile(CSIPProfileRegistryBase* aRegistry);
|
williamr@2
|
351 |
|
williamr@2
|
352 |
/**
|
williamr@2
|
353 |
* 2nd phase constructor.
|
williamr@2
|
354 |
*/
|
williamr@2
|
355 |
void ConstructL();
|
williamr@2
|
356 |
|
williamr@2
|
357 |
protected:
|
williamr@2
|
358 |
|
williamr@2
|
359 |
/**
|
williamr@2
|
360 |
* @internalComponent
|
williamr@2
|
361 |
*/
|
williamr@2
|
362 |
CSIPConcreteProfile* iSIPProfile;
|
williamr@2
|
363 |
|
williamr@2
|
364 |
/**
|
williamr@2
|
365 |
* @internalComponent
|
williamr@2
|
366 |
*/
|
williamr@2
|
367 |
CSIPProfileRegistryBase* iSIPProfileRegistry;
|
williamr@2
|
368 |
|
williamr@2
|
369 |
private:
|
williamr@2
|
370 |
|
williamr@2
|
371 |
TBool iEnabled;
|
williamr@2
|
372 |
};
|
williamr@2
|
373 |
|
williamr@2
|
374 |
#endif // CSIPPROFILE_H
|