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