|
1 /* |
|
2 * Copyright (c) 2002-2008 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 "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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Device Management SIP Adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <utf.h> |
|
21 #include <ecom/implementationproxy.h> // For TImplementationProxy definition |
|
22 #include <sipprofile.h> |
|
23 #include <sipprofiletypeinfo.h> |
|
24 #include <sipstrings.h> |
|
25 #include <sipstrconsts.h> |
|
26 #include <f32file.h> |
|
27 #include <sysutil.h> |
|
28 #include <escapeutils.h> |
|
29 |
|
30 #include <sipmanagedprofile.h> |
|
31 #include <sipprofileregistryobserver.h> |
|
32 #include <sipmanagedprofileregistry.h> |
|
33 #include <sipaddress.h> |
|
34 #include <nsmldmiapmatcher.h> |
|
35 #include <mmf/common/mmfcontrollerpluginresolver.h> |
|
36 |
|
37 #include <cmmanagerext.h> |
|
38 #include <cmdestinationext.h> |
|
39 #include <cmmanagerdef.h> |
|
40 |
|
41 #include "nsmldmsipadapter.h" |
|
42 #include "smldmsipadapterconstants.h" |
|
43 #include "smldmsipadapterdebug.h" |
|
44 |
|
45 // CONSTANTS |
|
46 _LIT8( KEscaped, "%" ); |
|
47 |
|
48 // --------------------------------------------------------------------------- |
|
49 // CNSmlDmSIPAdapter* CNSmlDmSIPAdapter::NewL |
|
50 // |
|
51 // --------------------------------------------------------------------------- |
|
52 // |
|
53 CNSmlDmSIPAdapter* CNSmlDmSIPAdapter::NewL( |
|
54 MSmlDmCallback* aDmCallback ) |
|
55 { |
|
56 DBG_PRINT("CNSmlDmSIPAdapter::NewL(): begin"); |
|
57 CNSmlDmSIPAdapter* self = NewLC( aDmCallback ); |
|
58 CleanupStack::Pop( self ); |
|
59 DBG_PRINT("CNSmlDmSIPAdapter::NewL(): end"); |
|
60 return self; |
|
61 } |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // CNSmlDmSIPAdapter* CNSmlDmSIPAdapter::NewLC |
|
65 // |
|
66 // --------------------------------------------------------------------------- |
|
67 // |
|
68 CNSmlDmSIPAdapter* CNSmlDmSIPAdapter::NewLC( |
|
69 MSmlDmCallback* aDmCallback ) |
|
70 { |
|
71 DBG_PRINT("CNSmlDmSIPAdapter::NewLC(): begin"); |
|
72 CNSmlDmSIPAdapter* self = new (ELeave) CNSmlDmSIPAdapter( aDmCallback ); |
|
73 CleanupStack::PushL( self ); |
|
74 self->ConstructL(); |
|
75 self->iDmCallback = aDmCallback; |
|
76 DBG_PRINT("CNSmlDmSIPAdapter::NewLC(): end"); |
|
77 return self; |
|
78 } |
|
79 |
|
80 // --------------------------------------------------------------------------- |
|
81 // CNSmlDmSIPAdapter::ConstructL |
|
82 // |
|
83 // --------------------------------------------------------------------------- |
|
84 // |
|
85 void CNSmlDmSIPAdapter::ConstructL() |
|
86 { |
|
87 DBG_PRINT("CNSmlDmSIPAdapter::ConstructL(): begin"); |
|
88 |
|
89 // Open sip strings for methods that use it. |
|
90 SIPStrings::OpenL(); |
|
91 DBG_PRINT("CNSmlDmSIPAdapter::ConstructL(): end"); |
|
92 } |
|
93 |
|
94 // --------------------------------------------------------------------------- |
|
95 // CNSmlDmSIPAdapter::~CNSmlDmSIPAdapter |
|
96 // |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 CNSmlDmSIPAdapter::~CNSmlDmSIPAdapter() |
|
100 { |
|
101 DBG_PRINT("CNSmlDmSIPAdapter::~CNSmlDmSIPAdapter(): begin"); |
|
102 if ( iProfiles ) |
|
103 { |
|
104 iProfiles->ResetAndDestroy(); |
|
105 delete iProfiles; |
|
106 } |
|
107 |
|
108 if ( iSIPManagedProfileRegistry ) |
|
109 { |
|
110 delete iSIPManagedProfileRegistry; |
|
111 } |
|
112 |
|
113 if ( iResults ) |
|
114 { |
|
115 delete iResults; |
|
116 } |
|
117 iModifications.Reset(); |
|
118 SIPStrings::Close(); |
|
119 DBG_PRINT("CNSmlDmSIPAdapter::~CNSmlDmSIPAdapter(): end"); |
|
120 } |
|
121 |
|
122 // --------------------------------------------------------------------------- |
|
123 // CNSmlDmSIPAdapter::CNSmlDmSIPAdapter |
|
124 // C++ default constructor can NOT contain any code, that |
|
125 // might leave. |
|
126 // --------------------------------------------------------------------------- |
|
127 // |
|
128 CNSmlDmSIPAdapter::CNSmlDmSIPAdapter( TAny* aEcomArguments ) : CSmlDmAdapter( |
|
129 aEcomArguments ) |
|
130 { |
|
131 DBG_PRINT("CNSmlDmSIPAdapter::CNSmlDmSIPAdapter(aEcomArguments): begin"); |
|
132 DBG_PRINT("CNSmlDmSIPAdapter::CNSmlDmSIPAdapter(aEcomArguments): end"); |
|
133 } |
|
134 |
|
135 // --------------------------------------------------------------------------- |
|
136 // CNSmlDmSIPAdapter::LoadProfilesL |
|
137 // Loads all profile information to memory. |
|
138 // --------------------------------------------------------------------------- |
|
139 // |
|
140 void CNSmlDmSIPAdapter::LoadProfilesL() |
|
141 { |
|
142 DBG_PRINT("CNSmlDmSIPAdapter::LoadProfilesL(): begin"); |
|
143 |
|
144 // Create needed instances. |
|
145 iSIPManagedProfileRegistry = CSIPManagedProfileRegistry::NewL( *this ); |
|
146 |
|
147 RArray<TSIPProfileTypeInfo> profileTypes; |
|
148 CleanupClosePushL( profileTypes ); // CS:1 |
|
149 |
|
150 // Get the supported profile types |
|
151 iSIPManagedProfileRegistry->SupportedProfileTypesL( profileTypes ); |
|
152 |
|
153 // Create the profile pointer array. |
|
154 iProfiles = new ( ELeave ) CArrayPtrFlat<CSIPManagedProfile>( 5 ); |
|
155 |
|
156 RPointerArray<CSIPProfile> profilePointerArray; |
|
157 CleanupResetAndDestroyPushL( profilePointerArray ); // CS:2 |
|
158 |
|
159 // Get all profiles based on profile types. |
|
160 const TInt profileTypecount = profileTypes.Count(); |
|
161 for ( TInt i = 0; i < profileTypecount; i++ ) |
|
162 { |
|
163 iSIPManagedProfileRegistry->ProfilesL( |
|
164 profileTypes[i], profilePointerArray ); |
|
165 const TInt profileCount = profilePointerArray.Count(); |
|
166 for ( TInt j = 0; j < profileCount; j++ ) |
|
167 { |
|
168 CSIPManagedProfile* profile = |
|
169 static_cast<CSIPManagedProfile*>( profilePointerArray[j] ); |
|
170 iProfiles->AppendL( profile ); |
|
171 } |
|
172 profilePointerArray.Reset(); |
|
173 } |
|
174 // &profilePointerArray, &profileTypes |
|
175 CleanupStack::PopAndDestroy( 2, &profileTypes ); // CS:0 |
|
176 DBG_PRINT("CNSmlDmSIPAdapter::LoadProfilesL(): end"); |
|
177 } |
|
178 |
|
179 // --------------------------------------------------------------------------- |
|
180 // CNSmlDmSIPAdapter::DDFVersionL |
|
181 // Inserts DDF version of the adapter to aDDFVersion |
|
182 // (other items were commented in a header). |
|
183 // --------------------------------------------------------------------------- |
|
184 // |
|
185 void CNSmlDmSIPAdapter::DDFVersionL( |
|
186 CBufBase& aDDFVersion ) |
|
187 { |
|
188 DBG_PRINT("CNSmlDmSIPAdapter::DDFVersionL(TDes& aDDFVersion): begin"); |
|
189 aDDFVersion.InsertL( 0, KNSmlDMSIPDDFVersion ); |
|
190 DBG_PRINT("CNSmlDmSIPAdapter::DDFVersionL(TDes& aDDFVersion): end"); |
|
191 } |
|
192 |
|
193 // --------------------------------------------------------------------------- |
|
194 // CNSmlDmSIPAdapter::DDFStructureL |
|
195 // Builds the DDF structure of adapter |
|
196 // (other items were commented in a header). |
|
197 // --------------------------------------------------------------------------- |
|
198 // |
|
199 void CNSmlDmSIPAdapter::DDFStructureL( MSmlDmDDFObject& aDDF ) |
|
200 { |
|
201 DBG_PRINT("CNSmlDmSIPAdapter::DDFStructureL(): begin"); |
|
202 |
|
203 TSmlDmAccessTypes accessTypesGet; |
|
204 accessTypesGet.SetGet(); |
|
205 |
|
206 TSmlDmAccessTypes accessTypesGetAdd; |
|
207 accessTypesGetAdd.SetGet(); |
|
208 accessTypesGetAdd.SetAdd(); |
|
209 |
|
210 TSmlDmAccessTypes accessTypesGetReplaceAdd; |
|
211 accessTypesGetReplaceAdd.SetGet(); |
|
212 accessTypesGetReplaceAdd.SetReplace(); |
|
213 accessTypesGetReplaceAdd.SetAdd(); |
|
214 |
|
215 TSmlDmAccessTypes accessTypesReplaceAdd; |
|
216 accessTypesReplaceAdd.SetReplace(); |
|
217 accessTypesReplaceAdd.SetAdd(); |
|
218 |
|
219 TSmlDmAccessTypes accessTypesAll; |
|
220 accessTypesAll.SetGet(); |
|
221 accessTypesAll.SetDelete(); |
|
222 accessTypesAll.SetAdd(); |
|
223 accessTypesAll.SetReplace(); |
|
224 |
|
225 // SIP |
|
226 MSmlDmDDFObject& sip = aDDF.AddChildObjectL( KNSmlDMSIPNodeName ); |
|
227 sip.SetAccessTypesL( accessTypesGet ); |
|
228 sip.SetOccurenceL( MSmlDmDDFObject::EOne ); |
|
229 sip.SetScopeL( MSmlDmDDFObject::EPermanent ); |
|
230 sip.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
231 sip.SetDescriptionL( KNSmlDMSIPNodeNameExp ); |
|
232 |
|
233 // dynamic settings ID node |
|
234 MSmlDmDDFObject& idNode = sip.AddChildObjectGroupL(); |
|
235 idNode.SetAccessTypesL( accessTypesAll ); |
|
236 idNode.SetOccurenceL( MSmlDmDDFObject::EZeroOrMore ); |
|
237 idNode.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
238 idNode.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
239 idNode.SetDescriptionL( KNSmlDMSIPDynamicNodeExp ); |
|
240 |
|
241 // SipID |
|
242 MSmlDmDDFObject& sipID = idNode.AddChildObjectL( KNSmlDMSIPSipID ); |
|
243 sipID.SetAccessTypesL( accessTypesGet ); |
|
244 sipID.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
245 sipID.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
246 sipID.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
247 sipID.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
248 sipID.SetDescriptionL( KNSmlDMSIPSipIDExp ); |
|
249 |
|
250 // Name |
|
251 MSmlDmDDFObject& name = idNode.AddChildObjectL( KNSmlDMSIPName ); |
|
252 name.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
253 name.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
254 name.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
255 name.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
256 name.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
257 name.SetDescriptionL( KNSmlDMSIPNameExp ); |
|
258 |
|
259 // ProfileType |
|
260 MSmlDmDDFObject& profType = idNode.AddChildObjectL( |
|
261 KNSmlDMSIPProfileType ); |
|
262 profType.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
263 profType.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
264 profType.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
265 profType.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
266 profType.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
267 profType.SetDescriptionL( KNSmlDMSIPProfileTypeExp ); |
|
268 |
|
269 // Address Of Record |
|
270 MSmlDmDDFObject& aor = idNode.AddChildObjectL( KNSmlDMSIPAOR ); |
|
271 aor.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
272 aor.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
273 aor.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
274 aor.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
275 aor.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
276 aor.SetDescriptionL( KNSmlDMSIPAORExp ); |
|
277 |
|
278 // OutboundProxy Node |
|
279 MSmlDmDDFObject& obProxy = idNode.AddChildObjectL( |
|
280 KNSmlDMSIPOutboundProxy ); |
|
281 obProxy.SetAccessTypesL( accessTypesGetAdd ); |
|
282 obProxy.SetOccurenceL( MSmlDmDDFObject::EOne ); |
|
283 obProxy.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
284 obProxy.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
285 obProxy.SetDescriptionL( KNSmlDMSIPOutboundProxyExp ); |
|
286 |
|
287 // OutboundProxy/Host |
|
288 MSmlDmDDFObject& obHost = obProxy.AddChildObjectL( KNSmlDMSIPHost ); |
|
289 obHost.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
290 obHost.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
291 obHost.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
292 obHost.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
293 obHost.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
294 obHost.SetDescriptionL( KNSmlDMSIPHostExp ); |
|
295 |
|
296 // OutboundProxy/Port |
|
297 MSmlDmDDFObject& obPort = obProxy.AddChildObjectL( KNSmlDMSIPPort ); |
|
298 obPort.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
299 obPort.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
300 obPort.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
301 obPort.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
302 obPort.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
303 obPort.SetDescriptionL( KNSmlDMSIPPortExp ); |
|
304 |
|
305 // OutboundProxy/Transport |
|
306 MSmlDmDDFObject& obTransport = obProxy.AddChildObjectL( |
|
307 KNSmlDMSIPTransport ); |
|
308 obTransport.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
309 obTransport.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
310 obTransport.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
311 obTransport.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
312 obTransport.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
313 obTransport.SetDescriptionL( KNSmlDMSIPTransportExp ); |
|
314 |
|
315 // OutboundProxy/Username |
|
316 MSmlDmDDFObject& obUsername = obProxy.AddChildObjectL( |
|
317 KNSmlDMSIPUsername ); |
|
318 obUsername.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
319 obUsername.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
320 obUsername.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
321 obUsername.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
322 obUsername.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
323 obUsername.SetDescriptionL( KNSmlDMSIPUsernameExp ); |
|
324 |
|
325 // OutboundProxy/Passwd |
|
326 MSmlDmDDFObject& obPasswd = obProxy.AddChildObjectL( KNSmlDMSIPPasswd ); |
|
327 obPasswd.SetAccessTypesL( accessTypesReplaceAdd ); |
|
328 obPasswd.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
329 obPasswd.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
330 obPasswd.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
331 obPasswd.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
332 obPasswd.SetDescriptionL( KNSmlDMSIPPasswdExp ); |
|
333 |
|
334 // OutboundProxy/Realm |
|
335 MSmlDmDDFObject& obRealm = obProxy.AddChildObjectL( KNSmlDMSIPRealm ); |
|
336 obRealm.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
337 obRealm.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
338 obRealm.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
339 obRealm.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
340 obRealm.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
341 obRealm.SetDescriptionL( KNSmlDMSIPRealmExp ); |
|
342 |
|
343 // RegistrarServer Node |
|
344 MSmlDmDDFObject& regProxy = idNode.AddChildObjectL( |
|
345 KNSmlDMSIPRegistrarServer ); |
|
346 regProxy.SetAccessTypesL( accessTypesGetAdd ); |
|
347 regProxy.SetOccurenceL( MSmlDmDDFObject::EOne ); |
|
348 regProxy.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
349 regProxy.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
350 regProxy.SetDescriptionL( KNSmlDMSIPRegistrarServerExp ); |
|
351 |
|
352 // RegistrarServer/Host |
|
353 MSmlDmDDFObject& regHost = regProxy.AddChildObjectL( KNSmlDMSIPHost ); |
|
354 regHost.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
355 regHost.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
356 regHost.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
357 regHost.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
358 regHost.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
359 regHost.SetDescriptionL( KNSmlDMSIPHostExp ); |
|
360 |
|
361 // RegistrarServer/Port |
|
362 MSmlDmDDFObject& regPort = regProxy.AddChildObjectL( KNSmlDMSIPPort ); |
|
363 regPort.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
364 regPort.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
365 regPort.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
366 regPort.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
367 regPort.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
368 regPort.SetDescriptionL( KNSmlDMSIPPortExp ); |
|
369 |
|
370 // RegistrarServer/Transport |
|
371 MSmlDmDDFObject& regTransport = regProxy.AddChildObjectL( |
|
372 KNSmlDMSIPTransport ); |
|
373 regTransport.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
374 regTransport.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
375 regTransport.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
376 regTransport.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
377 regTransport.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
378 regTransport.SetDescriptionL( KNSmlDMSIPTransportExp ); |
|
379 |
|
380 // RegistrarServer/Username |
|
381 MSmlDmDDFObject& regUsername = regProxy.AddChildObjectL( |
|
382 KNSmlDMSIPUsername ); |
|
383 regUsername.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
384 regUsername.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
385 regUsername.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
386 regUsername.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
387 regUsername.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
388 regUsername.SetDescriptionL( KNSmlDMSIPUsernameExp ); |
|
389 |
|
390 // RegistrarServer/PrivateIdentity |
|
391 MSmlDmDDFObject& regPrivateIdentity = regProxy.AddChildObjectL( |
|
392 KNSmlDMSIPPrivateIdentity ); |
|
393 regPrivateIdentity.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
394 regPrivateIdentity.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
395 regPrivateIdentity.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
396 regPrivateIdentity.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
397 regPrivateIdentity.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
398 regPrivateIdentity.SetDescriptionL( KNSmlDMSIPPrivateIdentityExp ); |
|
399 |
|
400 // RegistrarServer/Passwd |
|
401 MSmlDmDDFObject& regPasswd = regProxy.AddChildObjectL( KNSmlDMSIPPasswd ); |
|
402 regPasswd.SetAccessTypesL( accessTypesReplaceAdd ); |
|
403 regPasswd.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
404 regPasswd.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
405 regPasswd.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
406 regPasswd.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
407 regPasswd.SetDescriptionL( KNSmlDMSIPPasswdExp ); |
|
408 |
|
409 // RegistrarServer/Realm |
|
410 MSmlDmDDFObject& regRealm = regProxy.AddChildObjectL( KNSmlDMSIPRealm ); |
|
411 regRealm.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
412 regRealm.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
413 regRealm.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
414 regRealm.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
415 regRealm.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
416 regRealm.SetDescriptionL( KNSmlDMSIPRealmExp ); |
|
417 |
|
418 // Default |
|
419 MSmlDmDDFObject& def = idNode.AddChildObjectL( KNSmlDMSIPDefault ); |
|
420 def.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
421 def.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
422 def.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
423 def.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
424 def.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
425 def.SetDescriptionL( KNSmlDMSIPDefaultExp ); |
|
426 |
|
427 // LooseRouting |
|
428 MSmlDmDDFObject& lr = idNode.AddChildObjectL( KNSmlDMSIPLooseRouting ); |
|
429 lr.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
430 lr.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
431 lr.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
432 lr.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
433 lr.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
434 lr.SetDescriptionL( KNSmlDMSIPLooseRoutingExp ); |
|
435 |
|
436 // EnableSecurityNegotiation |
|
437 MSmlDmDDFObject& enSecNeg = idNode.AddChildObjectL( |
|
438 KNSmlDMSIPEnableSecurityNegotiation ); |
|
439 enSecNeg.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
440 enSecNeg.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
441 enSecNeg.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
442 enSecNeg.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
443 enSecNeg.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
444 enSecNeg.SetDescriptionL( KNSmlDMSIPEnableSecurityNegotiationExp ); |
|
445 |
|
446 // EnableSigComp |
|
447 MSmlDmDDFObject& enSigComp = idNode.AddChildObjectL( |
|
448 KNSmlDMSIPEnableSigComp ); |
|
449 enSigComp.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
450 enSigComp.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
451 enSigComp.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
452 enSigComp.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
453 enSigComp.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
454 enSigComp.SetDescriptionL( KNSmlDMSIPEnableSigCompExp ); |
|
455 |
|
456 // EnableAutoRegistration |
|
457 MSmlDmDDFObject& enAutoReg = idNode.AddChildObjectL( |
|
458 KNSmlDMSIPEnableAutoRegistration ); |
|
459 enAutoReg.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
460 enAutoReg.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
461 enAutoReg.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
462 enAutoReg.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
463 enAutoReg.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
464 enAutoReg.SetDescriptionL( KNSmlDMSIPEnableAutoRegistrationExp ); |
|
465 |
|
466 // PrefConRef |
|
467 MSmlDmDDFObject& toNapId = idNode.AddChildObjectL( KNSmlDMSIPConRef ); |
|
468 toNapId.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
469 toNapId.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
470 toNapId.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
471 toNapId.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
472 toNapId.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
473 toNapId.SetDescriptionL( KNSmlDMSIPConRefExp ); |
|
474 |
|
475 // ProfileLock |
|
476 MSmlDmDDFObject& profileLock = idNode.AddChildObjectL( |
|
477 KNSmlDMSIPProfileLock ); |
|
478 profileLock.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
479 profileLock.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
480 profileLock.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
481 profileLock.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
482 profileLock.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
483 profileLock.SetDescriptionL( KNSmlDMSIPProfileLockExp ); |
|
484 |
|
485 // DestinationNetwork |
|
486 MSmlDmDDFObject& toSnapId = idNode.AddChildObjectL( KNSmlDMSIPSnap ); |
|
487 toSnapId.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
488 toSnapId.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
489 toSnapId.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
490 toSnapId.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
491 toSnapId.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
492 toSnapId.SetDescriptionL( KNSmlDMSIPSnapExp ); |
|
493 |
|
494 // SignalingQoS |
|
495 MSmlDmDDFObject& sigQos = idNode.AddChildObjectL( KNSmlDMSIPSigQos ); |
|
496 sigQos.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
497 sigQos.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
498 sigQos.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
499 sigQos.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
500 sigQos.AddDFTypeMimeTypeL( KNSmlDMSIPTextPlain ); |
|
501 sigQos.SetDescriptionL( KNSmlDMSIPSigQosExp ); |
|
502 |
|
503 DBG_PRINT("CNSmlDmSIPAdapter::DDFStructureL(): end"); |
|
504 } |
|
505 |
|
506 // --------------------------------------------------------------------------- |
|
507 // CNSmlDmSIPAdapter::UpdateLeafObjectL |
|
508 // Updates value of a leaf object |
|
509 // (other items were commented in a header). |
|
510 // --------------------------------------------------------------------------- |
|
511 // |
|
512 void CNSmlDmSIPAdapter::UpdateLeafObjectL( |
|
513 const TDesC8& aURI, |
|
514 const TDesC8& aLUID, |
|
515 const TDesC8& aObject, |
|
516 const TDesC8& /*aType*/, |
|
517 const TInt aStatusRef ) |
|
518 { |
|
519 DBG_PRINT("CNSmlDmSIPAdapter::UpdateLeafObjectL(): begin"); |
|
520 |
|
521 // Load profile information if not loaded yet |
|
522 if ( !iProfiles ) |
|
523 { |
|
524 LoadProfilesL(); |
|
525 } |
|
526 |
|
527 CSmlDmAdapter::TError status = EOk; |
|
528 TPtrC8 lastUriSeg = LastURISeg( aURI ); |
|
529 TPtrC8 uriTmp = RemoveLastURISeg( aURI ); |
|
530 TPtrC8 secondLastUriSeg = LastURISeg( uriTmp ); |
|
531 TInt err ( 0 ); |
|
532 |
|
533 // Check that luid mapping exist |
|
534 if ( !aLUID.Length() > 0 ) |
|
535 { |
|
536 iDmCallback->SetStatusL( aStatusRef,CSmlDmAdapter::EError ); |
|
537 DBG_PRINT("CNSmlDmSIPAdapter::UpdateLeafObjectL(): no LUID, end"); |
|
538 return; |
|
539 } |
|
540 |
|
541 // Find profile from array. |
|
542 TInt profileID = FindHexProfile ( aLUID ); |
|
543 if ( KErrNotFound == profileID ) |
|
544 { |
|
545 status = CSmlDmAdapter::ENotFound; |
|
546 iDmCallback->SetStatusL( aStatusRef, status ); |
|
547 DBG_PRINT("CNSmlDmSIPAdapter::UpdateLeafObjectL(): ENotFound end"); |
|
548 return; |
|
549 } |
|
550 |
|
551 // Check that profile going to be modified is not in use |
|
552 TBool used ( iSIPManagedProfileRegistry->IsInUseL ( |
|
553 *iProfiles->At ( profileID ))); |
|
554 if ( used ) |
|
555 { |
|
556 status = CSmlDmAdapter::EObjectInUse; |
|
557 iDmCallback->SetStatusL( aStatusRef, status ); |
|
558 DBG_PRINT("CNSmlDmSIPAdapter::UpdateLeafObjectL(): EObjectInUse end"); |
|
559 return; |
|
560 } |
|
561 |
|
562 // Check that profile is not allready to be saved. |
|
563 if ( KErrNotFound == iModifications.Find( profileID ) ) |
|
564 { |
|
565 iModifications.Insert( profileID, iModifications.Count() ); |
|
566 } |
|
567 |
|
568 // ============================== |
|
569 // SIP/x/ node |
|
570 // ============================== |
|
571 // |
|
572 |
|
573 // SIP/x/Name |
|
574 if ( KNSmlDMSIPName() == lastUriSeg ) |
|
575 { |
|
576 if ( aObject.Length() < KMaxProviderNameLength ) |
|
577 { |
|
578 err = iProfiles->At( profileID )->SetParameter( |
|
579 KSIPProviderName, aObject ); |
|
580 CheckDuplicateNameL( *iProfiles->At( profileID ), profileID ); |
|
581 } |
|
582 else |
|
583 { |
|
584 status = CSmlDmAdapter::EInvalidObject; |
|
585 } |
|
586 } |
|
587 |
|
588 // SIP/x/ProfileType |
|
589 if ( KNSmlDMSIPProfileType() == lastUriSeg ) |
|
590 { |
|
591 RArray<TSIPProfileTypeInfo> profileTypes; |
|
592 CleanupClosePushL( profileTypes ); // CS:1 |
|
593 |
|
594 // Get the supported profile types |
|
595 iSIPManagedProfileRegistry->SupportedProfileTypesL( profileTypes ); |
|
596 |
|
597 TSIPProfileTypeInfo type; |
|
598 if ( KPTypeIMS() == aObject ) |
|
599 { |
|
600 type.iSIPProfileClass = TSIPProfileTypeInfo::EIms; |
|
601 type.iSIPProfileName = KPTypeIMS; |
|
602 if ( KErrNotFound != profileTypes.Find( type ) ) |
|
603 { |
|
604 iProfiles->At( profileID )->SetType( type ); |
|
605 } |
|
606 else |
|
607 { |
|
608 status = CSmlDmAdapter::EInvalidObject; |
|
609 } |
|
610 } |
|
611 else if ( KPTypeIETF() == aObject ) |
|
612 { |
|
613 type.iSIPProfileClass = TSIPProfileTypeInfo::EInternet; |
|
614 type.iSIPProfileName = KPTypeIETF; |
|
615 if ( KErrNotFound != profileTypes.Find( type ) ) |
|
616 { |
|
617 iProfiles->At( profileID )->SetType( type ); |
|
618 } |
|
619 else |
|
620 { |
|
621 status = CSmlDmAdapter::EInvalidObject; |
|
622 } |
|
623 } |
|
624 else if ( KPTypeOther() == aObject ) |
|
625 { |
|
626 type.iSIPProfileClass = TSIPProfileTypeInfo::EOther; |
|
627 type.iSIPProfileName = KPTypeOther; |
|
628 if ( KErrNotFound != profileTypes.Find( type ) ) |
|
629 { |
|
630 iProfiles->At( profileID )->SetType( type ); |
|
631 } |
|
632 else |
|
633 { |
|
634 status = CSmlDmAdapter::EInvalidObject; |
|
635 } |
|
636 } |
|
637 else |
|
638 { |
|
639 status = CSmlDmAdapter::EInvalidObject; |
|
640 } |
|
641 CleanupStack::PopAndDestroy( &profileTypes ); // CS:0 |
|
642 } |
|
643 |
|
644 // SIP/x/AddressOfRecord |
|
645 if ( KNSmlDMSIPAOR() == lastUriSeg ) |
|
646 { |
|
647 // Supports one AOR for profile. |
|
648 |
|
649 if ( KErrNotFound == aObject.Find( KEscaped() ) ) |
|
650 { |
|
651 HBufC8* encoded = EscapeUtils::EscapeEncodeL( aObject, |
|
652 EscapeUtils::EEscapeNormal ); |
|
653 err = iProfiles->At( profileID )->SetParameter( KSIPUserAor, |
|
654 *encoded ); |
|
655 delete encoded; |
|
656 } |
|
657 else |
|
658 { |
|
659 err = iProfiles->At( profileID )->SetParameter( |
|
660 KSIPUserAor, aObject ); |
|
661 } |
|
662 } |
|
663 |
|
664 // SIP/x/Default |
|
665 // Only setting as True allowed. SIP stack sets other profiles as False. |
|
666 if ( KNSmlDMSIPDefault() == lastUriSeg ) |
|
667 { |
|
668 if ( KNSmlDMSIPValueTrue() == aObject ) |
|
669 { |
|
670 err = iProfiles->At( profileID )->SetParameter( |
|
671 KSIPDefaultProfile, ETrue ); |
|
672 } |
|
673 else |
|
674 { |
|
675 status = CSmlDmAdapter::EInvalidObject; |
|
676 } |
|
677 } |
|
678 |
|
679 // SIP/x/LooseRouting |
|
680 if ( KNSmlDMSIPLooseRouting() == lastUriSeg ) |
|
681 { |
|
682 // get OutboundProxy SIP uri. |
|
683 const TDesC8* uri = 0; |
|
684 iProfiles->At( profileID )->GetParameter( KSIPOutboundProxy, |
|
685 KSIPServerAddress, uri ); |
|
686 TUriParser8 parser; |
|
687 err = parser.Parse( *uri ); |
|
688 |
|
689 TBuf8<KUriPathMaxLength> tempPathLr; |
|
690 |
|
691 CUri8* tempUri = CUri8::NewLC( parser ); |
|
692 tempPathLr.Copy( tempUri->Uri().Extract( EUriPath ) ); |
|
693 tempPathLr.LowerCase(); |
|
694 |
|
695 |
|
696 if ( KNSmlDMSIPValueTrue() == aObject ) |
|
697 { |
|
698 if ( KErrNotFound == tempPathLr.Find( KSIPlr ) ) |
|
699 { |
|
700 tempPathLr.Append( KSIPlr ); |
|
701 tempUri->SetComponentL( tempPathLr, EUriPath ); |
|
702 } |
|
703 } |
|
704 |
|
705 else if ( KNSmlDMSIPValueFalse() == aObject ) |
|
706 { |
|
707 TInt pos = tempPathLr.Find( KSIPlr ); |
|
708 if ( KErrNotFound != pos ) |
|
709 { |
|
710 tempPathLr.Delete( pos, KSIPlr().Length() ); |
|
711 tempUri->SetComponentL( tempPathLr, EUriPath ); |
|
712 } |
|
713 } |
|
714 else |
|
715 { |
|
716 status = CSmlDmAdapter::EInvalidObject; |
|
717 } |
|
718 |
|
719 // Set tempUri back to original sipURI if it validates. |
|
720 if ( status == CSmlDmAdapter::EOk ) |
|
721 { |
|
722 // Set outboundproxy parameters according to sipURI. |
|
723 err = iProfiles->At( profileID )->SetParameter( KSIPOutboundProxy, |
|
724 KSIPServerAddress, tempUri->Uri().UriDes() ); |
|
725 } |
|
726 else |
|
727 { |
|
728 status = CSmlDmAdapter::EInvalidObject; |
|
729 } |
|
730 CleanupStack::PopAndDestroy( tempUri ); |
|
731 } |
|
732 |
|
733 // SIP/x/EnableSecurityNegotiation |
|
734 if ( KNSmlDMSIPEnableSecurityNegotiation() == lastUriSeg ) |
|
735 { |
|
736 if ( KNSmlDMSIPValueTrue() == aObject ) |
|
737 { |
|
738 err = iProfiles->At( profileID )->SetParameter( |
|
739 KSIPSecurityNegotiation, ETrue ); |
|
740 } |
|
741 else if ( KNSmlDMSIPValueFalse() == aObject ) |
|
742 { |
|
743 err = iProfiles->At( profileID )->SetParameter( |
|
744 KSIPSecurityNegotiation, EFalse ); |
|
745 } |
|
746 else |
|
747 { |
|
748 status = CSmlDmAdapter::EInvalidObject; |
|
749 } |
|
750 } |
|
751 |
|
752 // SIP/x/EnableSigComp |
|
753 if ( KNSmlDMSIPEnableSigComp() == lastUriSeg ) |
|
754 { |
|
755 if ( aObject == KNSmlDMSIPValueTrue ) |
|
756 { |
|
757 err = iProfiles->At( profileID )->SetParameter( |
|
758 KSIPSigComp, ETrue ); |
|
759 } |
|
760 else if ( aObject == KNSmlDMSIPValueFalse ) |
|
761 { |
|
762 err = iProfiles->At( profileID )->SetParameter( |
|
763 KSIPSigComp, EFalse ); |
|
764 } |
|
765 else |
|
766 { |
|
767 status = CSmlDmAdapter::EInvalidObject; |
|
768 } |
|
769 } |
|
770 |
|
771 // SIP/x/EnableAutoRegistration |
|
772 if ( KNSmlDMSIPEnableAutoRegistration() == lastUriSeg ) |
|
773 { |
|
774 if ( KNSmlDMSIPValueTrue() == aObject ) |
|
775 { |
|
776 err = iProfiles->At( profileID )->SetParameter( |
|
777 KSIPAutoRegistration, ETrue ); |
|
778 } |
|
779 else if ( KNSmlDMSIPValueFalse() == aObject ) |
|
780 { |
|
781 err = iProfiles->At( profileID )->SetParameter( |
|
782 KSIPAutoRegistration, EFalse ); |
|
783 } |
|
784 else |
|
785 { |
|
786 status = CSmlDmAdapter::EInvalidObject; |
|
787 } |
|
788 } |
|
789 |
|
790 // SIP/x/PrefConRef |
|
791 if ( KNSmlDMSIPConRef() == lastUriSeg ) |
|
792 { |
|
793 TInt lIAPId = SetConRefL( aObject, profileID ); // IAPid from CommsDB. |
|
794 if ( lIAPId != KErrNotFound ) |
|
795 { |
|
796 status = CSmlDmAdapter::EOk; |
|
797 } |
|
798 else |
|
799 { |
|
800 status = CSmlDmAdapter::EInvalidObject; |
|
801 } |
|
802 } |
|
803 |
|
804 // SIP/x/ProfileLock |
|
805 if ( KNSmlDMSIPProfileLock() == lastUriSeg ) |
|
806 { |
|
807 if ( KNSmlDMSIPValueTrue() == aObject ) |
|
808 { |
|
809 err = iProfiles->At( profileID )->SetParameter( |
|
810 KSIPProfileLocked, ETrue ); |
|
811 } |
|
812 else if ( KNSmlDMSIPValueFalse() == aObject ) |
|
813 { |
|
814 err = iProfiles->At( profileID )->SetParameter( |
|
815 KSIPProfileLocked, EFalse ); |
|
816 } |
|
817 else |
|
818 { |
|
819 status = CSmlDmAdapter::EInvalidObject; |
|
820 } |
|
821 } |
|
822 |
|
823 // SIP/x/DestinationNetwork |
|
824 if ( KNSmlDMSIPSnap() == lastUriSeg ) |
|
825 { |
|
826 TUint32 snapId = SnapIdL( aObject ); |
|
827 if ( snapId ) |
|
828 { |
|
829 err = iProfiles->At( profileID )->SetParameter( |
|
830 KSIPSnapId, snapId ); |
|
831 } |
|
832 else |
|
833 { |
|
834 status = CSmlDmAdapter::EInvalidObject; |
|
835 } |
|
836 } |
|
837 // SIP/x/SignalingQoS |
|
838 if ( KNSmlDMSIPSigQos() == lastUriSeg ) |
|
839 { |
|
840 TUint32 sigQos = DesToInt( aObject ); |
|
841 if ( sigQos <= KMaxSigQosValue ) |
|
842 { |
|
843 // We need to do bitshifting on the IP TOS, because it's the |
|
844 // upper 6 bits that are set and settings provide us the IP TOS as |
|
845 // the lower 6 bits. The lower 2 bits are reserver for explicit |
|
846 // congestion notification. |
|
847 // See also more from: |
|
848 // Symbian DevLib / in_sock.h Global variables / KSoIpTOS |
|
849 sigQos <<= 2; |
|
850 err = iProfiles->At( profileID )->SetParameter( |
|
851 KSIPSoIpTOS, sigQos ); |
|
852 } |
|
853 else |
|
854 { |
|
855 status = CSmlDmAdapter::EInvalidObject; |
|
856 } |
|
857 } |
|
858 |
|
859 // ============================== |
|
860 // OutboundProxy settings node |
|
861 // ============================== |
|
862 // |
|
863 |
|
864 // SIP/x/OutboundProxy |
|
865 if ( KNSmlDMSIPOutboundProxy() == secondLastUriSeg ) |
|
866 { |
|
867 status = UpdateOutboundProxyNodeL( profileID, lastUriSeg, aObject ); |
|
868 } |
|
869 |
|
870 // ============================== |
|
871 // RegistrarServer settings node |
|
872 // ============================== |
|
873 // |
|
874 |
|
875 // SIP/x/RegistrarServer |
|
876 if ( KNSmlDMSIPRegistrarServer() == secondLastUriSeg ) |
|
877 { |
|
878 status = UpdateRegistrarServerNodeL( profileID, lastUriSeg, aObject ); |
|
879 } |
|
880 |
|
881 if ( err ) |
|
882 { |
|
883 status = CSmlDmAdapter::EError; |
|
884 } |
|
885 |
|
886 iDmCallback->SetStatusL( aStatusRef, status ); |
|
887 DBG_PRINT("CNSmlDmSIPAdapter::UpdateLeafObjectL(): end"); |
|
888 } |
|
889 |
|
890 // --------------------------------------------------------------------------- |
|
891 // CNSmlDmSIPAdapter::DeleteObjectL |
|
892 // Deletes SIP profiles. |
|
893 // (other items were commented in a header). |
|
894 // --------------------------------------------------------------------------- |
|
895 // |
|
896 void CNSmlDmSIPAdapter::DeleteObjectL( |
|
897 const TDesC8& aURI, |
|
898 const TDesC8& aLUID, |
|
899 const TInt aStatusRef ) |
|
900 { |
|
901 DBG_PRINT("CNSmlDmSIPAdapter::DeleteObjectL(): begin"); |
|
902 |
|
903 // Load profile information if not loaded yet |
|
904 if ( !iProfiles ) |
|
905 { |
|
906 LoadProfilesL(); |
|
907 } |
|
908 |
|
909 CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk; |
|
910 TBuf8 <KNSmlSIPMaxUriLength> uri = aURI; |
|
911 |
|
912 // Copy LUID as last segment if exists. |
|
913 if ( 0 != aLUID.Length() ) |
|
914 { |
|
915 uri.Copy( aLUID ); |
|
916 } |
|
917 else |
|
918 { |
|
919 retValue = CSmlDmAdapter::ENotFound; |
|
920 } |
|
921 |
|
922 if ( aLUID.Length() > 0 && NumOfURISegs( aURI ) == 2 ) |
|
923 { |
|
924 TInt profileID = FindHexProfile( uri ); |
|
925 |
|
926 if ( KErrNotFound == profileID ) |
|
927 { |
|
928 retValue = CSmlDmAdapter::ENotFound; |
|
929 iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
930 DBG_PRINT("CNSmlDmSIPAdapter::DeleteObjectL(): ENotFound end"); |
|
931 return; |
|
932 } |
|
933 |
|
934 // Delete allowed only if profile is not registered. |
|
935 TBool registered( EFalse ); |
|
936 iProfiles->At( profileID )->GetParameter( |
|
937 KSIPProfileRegistered, registered ); |
|
938 |
|
939 if ( !registered ) |
|
940 { |
|
941 // Delete profile from permanent store. |
|
942 iSIPManagedProfileRegistry->DestroyL( |
|
943 *iProfiles->At( profileID ) ); |
|
944 |
|
945 // Delete profile also from memory and compress array. |
|
946 delete iProfiles->At( profileID ); |
|
947 iProfiles->Delete( profileID ); |
|
948 iProfiles->Compress(); |
|
949 retValue = CSmlDmAdapter::EOk; |
|
950 } |
|
951 else |
|
952 { |
|
953 retValue = CSmlDmAdapter::EObjectInUse; |
|
954 } |
|
955 } |
|
956 else |
|
957 { |
|
958 retValue = CSmlDmAdapter::EInvalidObject; |
|
959 } |
|
960 iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
961 DBG_PRINT("CNSmlDmSIPAdapter::DeleteObjectL(): end"); |
|
962 } |
|
963 |
|
964 // --------------------------------------------------------------------------- |
|
965 // CNSmlDmSIPAdapter::FetchLeafObjectL |
|
966 // Fetches the values of leaf objects. |
|
967 // (other items were commented in a header). |
|
968 // --------------------------------------------------------------------------- |
|
969 // |
|
970 void CNSmlDmSIPAdapter::FetchLeafObjectL( |
|
971 const TDesC8& aURI, |
|
972 const TDesC8& aLUID, |
|
973 const TDesC8& aType, |
|
974 const TInt aResultsRef, |
|
975 const TInt aStatusRef ) |
|
976 { |
|
977 DBG_PRINT("CNSmlDmSIPAdapter::FetchLeafObjectL(): begin"); |
|
978 |
|
979 // Load profile information if not loaded yet. |
|
980 if ( !iProfiles ) |
|
981 { |
|
982 LoadProfilesL(); |
|
983 } |
|
984 |
|
985 CBufBase *result = CBufFlat::NewL( KDefaultResultSize ); |
|
986 CleanupStack::PushL( result ); |
|
987 CSmlDmAdapter::TError status = FetchObjectL( aURI, aLUID, *result ); |
|
988 |
|
989 if ( status == CSmlDmAdapter::EOk ) |
|
990 { |
|
991 iDmCallback->SetResultsL( aResultsRef, *result, aType ); |
|
992 } |
|
993 iDmCallback->SetStatusL( aStatusRef, status ); |
|
994 |
|
995 CleanupStack::PopAndDestroy( result ); |
|
996 DBG_PRINT("CNSmlDmSIPAdapter::FetchLeafObjectL(): end"); |
|
997 } |
|
998 |
|
999 // --------------------------------------------------------------------------- |
|
1000 // CNSmlDmSIPAdapter::FetchObjectL |
|
1001 // Fetches the values of leaf objects. |
|
1002 // (other items were commented in a header). |
|
1003 // --------------------------------------------------------------------------- |
|
1004 // |
|
1005 CSmlDmAdapter::TError CNSmlDmSIPAdapter::FetchObjectL( |
|
1006 const TDesC8& aURI, |
|
1007 const TDesC8& aLUID, |
|
1008 CBufBase& aResult ) |
|
1009 { |
|
1010 DBG_PRINT("CNSmlDmSIPAdapter::FetchObjectL(): begin"); |
|
1011 CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk; |
|
1012 |
|
1013 // Check that luid mapping exist |
|
1014 if ( !aLUID.Length() > 0 ) |
|
1015 { |
|
1016 DBG_PRINT("CNSmlDmSIPAdapter::FetchObjectL: ENotFound end"); |
|
1017 return CSmlDmAdapter::ENotFound; |
|
1018 } |
|
1019 |
|
1020 TBuf8<KNSmlSIPMaxResultLength> segmentResult; |
|
1021 TInt err ( 0 ); |
|
1022 |
|
1023 const TDesC8* paramResult = 0; |
|
1024 TBool boolVal ( EFalse ); |
|
1025 |
|
1026 TPtrC8 lastUriSeg = LastURISeg( aURI ); |
|
1027 TPtrC8 uriTmp = RemoveLastURISeg( aURI ); |
|
1028 TPtrC8 secondLastUriSeg = LastURISeg( uriTmp ); |
|
1029 |
|
1030 // Find profile from iProfiles. If not found, set error. |
|
1031 TInt profileID = FindHexProfile ( aLUID ); |
|
1032 if ( KErrNotFound == profileID ) |
|
1033 { |
|
1034 retValue = CSmlDmAdapter::ENotFound; |
|
1035 DBG_PRINT("CNSmlDmSIPAdapter::FetchObjectL: ENotFound end"); |
|
1036 return retValue; |
|
1037 } |
|
1038 |
|
1039 // SIP/x/SIPId |
|
1040 if ( KNSmlDMSIPSipID() == lastUriSeg ) |
|
1041 { |
|
1042 TUint32 val( 0 ); |
|
1043 err = iProfiles->At( profileID )->GetParameter( KSIPProfileId, val ); |
|
1044 segmentResult.Num( val ); |
|
1045 } |
|
1046 |
|
1047 // SIP/x/Provider |
|
1048 if ( KNSmlDMSIPName() == lastUriSeg ) |
|
1049 { |
|
1050 err = iProfiles->At( profileID )-> |
|
1051 GetParameter( KSIPProviderName, paramResult ); |
|
1052 segmentResult.Copy( *paramResult ); |
|
1053 } |
|
1054 |
|
1055 // SIP/x/Type |
|
1056 if ( KNSmlDMSIPProfileType() == lastUriSeg ) |
|
1057 { |
|
1058 TSIPProfileTypeInfo type; |
|
1059 type = iProfiles->At( profileID )->Type(); |
|
1060 if ( type.iSIPProfileClass == TSIPProfileTypeInfo::EIms ) |
|
1061 { |
|
1062 segmentResult.Copy( KPTypeIMS ); |
|
1063 } |
|
1064 if ( type.iSIPProfileClass == TSIPProfileTypeInfo::EInternet ) |
|
1065 { |
|
1066 segmentResult.Copy( KPTypeIETF ); |
|
1067 } |
|
1068 if ( type.iSIPProfileClass == TSIPProfileTypeInfo::EOther ) |
|
1069 { |
|
1070 segmentResult.Copy( KPTypeOther ); |
|
1071 } |
|
1072 } |
|
1073 |
|
1074 // SIP/x/ProfileLock |
|
1075 if ( KNSmlDMSIPProfileLock() == lastUriSeg ) |
|
1076 { |
|
1077 TBool boolVal( EFalse ); |
|
1078 err = iProfiles->At( profileID )->GetParameter( |
|
1079 KSIPProfileLocked, boolVal ); |
|
1080 if ( boolVal ) |
|
1081 { |
|
1082 segmentResult.Copy( KNSmlDMSIPValueTrue ); |
|
1083 } |
|
1084 else |
|
1085 { |
|
1086 segmentResult.Copy( KNSmlDMSIPValueFalse ); |
|
1087 } |
|
1088 } |
|
1089 |
|
1090 // SIP/x/AddressOfRecord |
|
1091 if ( KNSmlDMSIPAOR() == lastUriSeg ) |
|
1092 { |
|
1093 // Supports one AOR for profile. |
|
1094 err = iProfiles->At( profileID )->GetParameter( |
|
1095 KSIPUserAor, paramResult ); |
|
1096 segmentResult.Copy( *paramResult ); |
|
1097 } |
|
1098 |
|
1099 // SIP/x/OutboundProxy |
|
1100 if ( KNSmlDMSIPOutboundProxy() == secondLastUriSeg ) |
|
1101 { |
|
1102 retValue = FetchOutboundProxyNodeL( profileID, lastUriSeg, |
|
1103 segmentResult ); |
|
1104 } |
|
1105 |
|
1106 // SIP/x/RegistrarServer |
|
1107 if ( KNSmlDMSIPRegistrarServer() == secondLastUriSeg ) |
|
1108 { |
|
1109 retValue = FetchRegistrarServerNodeL( profileID, lastUriSeg, |
|
1110 segmentResult ); |
|
1111 } |
|
1112 |
|
1113 // SIP/x/Default |
|
1114 if ( KNSmlDMSIPDefault() == lastUriSeg ) |
|
1115 { |
|
1116 err = iProfiles->At( profileID )->GetParameter( |
|
1117 KSIPDefaultProfile, boolVal ); |
|
1118 if ( boolVal ) |
|
1119 { |
|
1120 segmentResult.Copy( KNSmlDMSIPValueTrue ); |
|
1121 } |
|
1122 else |
|
1123 { |
|
1124 segmentResult.Copy( KNSmlDMSIPValueFalse ); |
|
1125 } |
|
1126 } |
|
1127 |
|
1128 // SIP/x/LooseRouting |
|
1129 if ( KNSmlDMSIPLooseRouting() == lastUriSeg ) |
|
1130 { |
|
1131 // Get OutboundProxy SIP uri. |
|
1132 const TDesC8* uri = 0; |
|
1133 err = iProfiles->At( profileID )->GetParameter( |
|
1134 KSIPOutboundProxy, KSIPServerAddress, uri ); |
|
1135 |
|
1136 CSIPAddress* sipURI = 0; |
|
1137 if ( 0 < uri->Length() ) |
|
1138 { |
|
1139 sipURI = CSIPAddress::DecodeL( *uri ); |
|
1140 } |
|
1141 // The whole SIP URI is empty so return ENotFound. |
|
1142 else |
|
1143 { |
|
1144 retValue = CSmlDmAdapter::ENotFound; |
|
1145 DBG_PRINT("CNSmlDmSIPAdapter::FetchObjectL: No SIP URI end"); |
|
1146 return retValue; |
|
1147 } |
|
1148 |
|
1149 CleanupStack::PushL( sipURI ); |
|
1150 TBuf8<KUriPathMaxLength> tempPathLr; |
|
1151 tempPathLr.Copy( sipURI->Uri8().Uri().Extract( EUriPath ) ); |
|
1152 tempPathLr.LowerCase(); |
|
1153 |
|
1154 if ( KErrNotFound != sipURI->Uri8().Uri().Extract( EUriPath ).Find( |
|
1155 KSIPlr ) ) |
|
1156 { |
|
1157 segmentResult.Copy( KNSmlDMSIPValueTrue ); |
|
1158 } |
|
1159 else |
|
1160 { |
|
1161 segmentResult.Copy( KNSmlDMSIPValueFalse ); |
|
1162 } |
|
1163 CleanupStack::PopAndDestroy( sipURI ); |
|
1164 } |
|
1165 |
|
1166 // SIP/x/EnableSecurityNegotiation |
|
1167 if ( KNSmlDMSIPEnableSecurityNegotiation() == lastUriSeg ) |
|
1168 { |
|
1169 err = iProfiles->At( profileID )->GetParameter( |
|
1170 KSIPSecurityNegotiation, boolVal ); |
|
1171 if ( boolVal ) |
|
1172 { |
|
1173 segmentResult.Copy( KNSmlDMSIPValueTrue ); |
|
1174 } |
|
1175 else |
|
1176 { |
|
1177 segmentResult.Copy( KNSmlDMSIPValueFalse ); |
|
1178 } |
|
1179 } |
|
1180 |
|
1181 // SIP/x/EnableSigComp |
|
1182 if ( KNSmlDMSIPEnableSigComp() == lastUriSeg ) |
|
1183 { |
|
1184 err = iProfiles->At( profileID )->GetParameter( |
|
1185 KSIPSigComp, boolVal ); |
|
1186 if ( boolVal ) |
|
1187 { |
|
1188 segmentResult.Copy( KNSmlDMSIPValueTrue ); |
|
1189 } |
|
1190 else |
|
1191 { |
|
1192 segmentResult.Copy( KNSmlDMSIPValueFalse ); |
|
1193 } |
|
1194 } |
|
1195 |
|
1196 // SIP/x/AutoRegistration |
|
1197 if ( KNSmlDMSIPEnableAutoRegistration() == lastUriSeg ) |
|
1198 { |
|
1199 err = iProfiles->At( profileID )->GetParameter( |
|
1200 KSIPAutoRegistration, boolVal ); |
|
1201 if ( boolVal ) |
|
1202 { |
|
1203 segmentResult.Copy( KNSmlDMSIPValueTrue ); |
|
1204 } |
|
1205 else |
|
1206 { |
|
1207 segmentResult.Copy( KNSmlDMSIPValueFalse ); |
|
1208 } |
|
1209 } |
|
1210 |
|
1211 // SIP/x/ConRef |
|
1212 if ( KNSmlDMSIPConRef() == lastUriSeg ) |
|
1213 { |
|
1214 TBool conref = GetConRefL( aResult, profileID ); |
|
1215 if ( !conref ) |
|
1216 { |
|
1217 aResult.Reset(); |
|
1218 retValue = CSmlDmAdapter::ENotFound; |
|
1219 DBG_PRINT("CNSmlDmSIPAdapter::FetchObjectL(): \ |
|
1220 PrefConRef not found end"); |
|
1221 return retValue; |
|
1222 } |
|
1223 } |
|
1224 |
|
1225 // SIP/x/DestinationNetwork |
|
1226 if ( KNSmlDMSIPSnap() == lastUriSeg ) |
|
1227 { |
|
1228 TUint32 snapId( KErrNone ); |
|
1229 err = iProfiles->At( profileID )->GetParameter( |
|
1230 KSIPSnapId, snapId ); |
|
1231 if ( snapId ) |
|
1232 { |
|
1233 TBuf8<KNSmlSIPMaxUriLength> snapUri; |
|
1234 retValue = GetSnapUriL( snapUri, snapId ); |
|
1235 if ( CSmlDmAdapter::EOk == retValue ) |
|
1236 { |
|
1237 segmentResult.Copy( snapUri ); |
|
1238 } |
|
1239 else if ( CSmlDmAdapter::ENotFound == retValue ) |
|
1240 { |
|
1241 DBG_PRINT( "CNSmlDmSIPAdapter::FetchObjectL(): \ |
|
1242 SNAP not found end" ); |
|
1243 return retValue; |
|
1244 } |
|
1245 } |
|
1246 } |
|
1247 |
|
1248 // SIP/x/SignalingQoS |
|
1249 if ( KNSmlDMSIPSigQos() == lastUriSeg ) |
|
1250 { |
|
1251 TUint32 sigQos; |
|
1252 err = iProfiles->At( profileID )->GetParameter( |
|
1253 KSIPSoIpTOS, sigQos ); |
|
1254 // We need to do bitshifting on the IP TOS, because it's the upper 6 |
|
1255 // bits that are set and settings provide us the IP TOS as the lower 6 |
|
1256 // bits. The lower 2 bits are reserver for explicit congestion |
|
1257 // notification. |
|
1258 // See also more from: |
|
1259 // Symbian Developer Library / in_sock.h Global variables / KSoIpTOS |
|
1260 sigQos >>= 2; |
|
1261 segmentResult.Num( sigQos ); |
|
1262 } |
|
1263 |
|
1264 // Set error if fetch failed. |
|
1265 if ( -1 > err ) |
|
1266 { |
|
1267 retValue = CSmlDmAdapter::EError; |
|
1268 } |
|
1269 |
|
1270 if ( EOk == retValue ) |
|
1271 { |
|
1272 aResult.InsertL( aResult.Size(), segmentResult ); |
|
1273 } |
|
1274 |
|
1275 DBG_PRINT("CNSmlDmSIPAdapter::FetchObjectL(): end"); |
|
1276 return retValue; |
|
1277 } |
|
1278 |
|
1279 // --------------------------------------------------------------------------- |
|
1280 // CNSmlDmSIPAdapter::FindHexProfile |
|
1281 // Parses profileID from aURI and returns it in TInt |
|
1282 // Returns: TInt: profile location in profile array |
|
1283 // --------------------------------------------------------------------------- |
|
1284 // |
|
1285 TInt CNSmlDmSIPAdapter::FindHexProfile( |
|
1286 const TDesC8& aURI ) |
|
1287 { |
|
1288 TInt id (0); |
|
1289 id = aURI.Find( KSIPHexPrefix ); |
|
1290 if ( id != KErrNotFound ) |
|
1291 { |
|
1292 TLex8 lexer ( aURI.Mid( id + KSIPPrefix().Length() + 2, 8 ) ); |
|
1293 TRadix radix = EHex; |
|
1294 TUint32 tempVal( 0 ); |
|
1295 if ( KErrNone == lexer.Val ( tempVal, radix ) ) |
|
1296 { |
|
1297 for ( TInt counter = 0 ; counter < iProfiles->Count() ; counter++ ) |
|
1298 { |
|
1299 TUint32 val ( 0 ); |
|
1300 iProfiles->At( counter )->GetParameter( KSIPProfileId, val ); |
|
1301 if ( tempVal == val ) |
|
1302 { |
|
1303 return counter; |
|
1304 } |
|
1305 } |
|
1306 } |
|
1307 } |
|
1308 return KErrNotFound; |
|
1309 } |
|
1310 |
|
1311 // --------------------------------------------------------------------------- |
|
1312 // CNSmlDmSIPAdapter::ChildURIListL |
|
1313 // Asks for the list of children objects of the node |
|
1314 // (other items were commented in a header). |
|
1315 // --------------------------------------------------------------------------- |
|
1316 // |
|
1317 void CNSmlDmSIPAdapter::ChildURIListL( |
|
1318 const TDesC8& aURI, |
|
1319 const TDesC8& aLUID, |
|
1320 const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, |
|
1321 const TInt aResultsRef, |
|
1322 const TInt aStatusRef ) |
|
1323 { |
|
1324 DBG_PRINT( "CNSmlDmSIPAdapter::ChildURIListL(): start" ); |
|
1325 |
|
1326 // Load profile information if not loaded yet. |
|
1327 if ( !iProfiles ) |
|
1328 { |
|
1329 LoadProfilesL(); |
|
1330 } |
|
1331 |
|
1332 CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk; |
|
1333 |
|
1334 CBufBase *currentURISegmentList = CBufFlat::NewL( KDefaultResultSize ); |
|
1335 CleanupStack::PushL( currentURISegmentList ); |
|
1336 |
|
1337 TBuf8 <KNSmlSIPMaxUriLength> uri = aURI; |
|
1338 |
|
1339 // Use LUID mapping if exist. |
|
1340 if ( 0 < aLUID.Length() ) |
|
1341 { |
|
1342 uri.Copy( aLUID ); |
|
1343 } |
|
1344 |
|
1345 // Get last URI segment. |
|
1346 TBuf8< KSmlMaxURISegLen > segment = LastURISeg( aURI ); |
|
1347 TBuf8< KSmlMaxURISegLen > segmentName; |
|
1348 |
|
1349 TInt howManyObjects = iProfiles->Count(); |
|
1350 |
|
1351 if ( KNSmlDMSIPNodeName() == segment ) // ./SIP |
|
1352 { |
|
1353 for ( TInt counter = 0; counter < howManyObjects ; counter++ ) |
|
1354 { |
|
1355 TBool notInList = ETrue; |
|
1356 TInt currentline = 0; |
|
1357 TUint32 ddId ( 0 ); |
|
1358 iProfiles->At( counter )->GetParameter( KSIPProfileId, ddId ); |
|
1359 while ( notInList && |
|
1360 currentline < aPreviousURISegmentList.Count() ) |
|
1361 { |
|
1362 TInt profileLocation = FindHexProfile( |
|
1363 aPreviousURISegmentList.At( currentline ).iURISegLUID ); |
|
1364 TUint32 profileID ( 0 ); |
|
1365 if ( profileLocation != KErrNotFound ) |
|
1366 { |
|
1367 iProfiles->At( profileLocation )->GetParameter( |
|
1368 KSIPProfileId, profileID ); |
|
1369 } |
|
1370 if ( profileID == ddId ) |
|
1371 { |
|
1372 notInList = EFalse; |
|
1373 break; |
|
1374 } |
|
1375 currentline++; |
|
1376 } |
|
1377 if ( notInList ) |
|
1378 { |
|
1379 // SIP/x |
|
1380 TUint32 val ( 0 ); |
|
1381 iProfiles->At( counter )->GetParameter( KSIPProfileId, val ); |
|
1382 segmentName.Copy( KSIPPrefix ); |
|
1383 segmentName.Append( KHexPrefix ); |
|
1384 segmentName.AppendNumFixedWidthUC( val, EHex, 8 ); |
|
1385 currentURISegmentList->InsertL( currentURISegmentList-> |
|
1386 Size(), segmentName ); |
|
1387 currentURISegmentList->InsertL( currentURISegmentList-> |
|
1388 Size(), KNSmlDMSIPSeparator8 ); |
|
1389 |
|
1390 // Set LUID mapping to DM module. |
|
1391 TBuf8<KMaxMappingLength> mappingInfo; |
|
1392 mappingInfo.Copy ( KSIPPrefix ); |
|
1393 mappingInfo.Append ( KHexPrefix ); |
|
1394 mappingInfo.AppendNumFixedWidthUC( val, EHex, 8 ); |
|
1395 segmentName.Copy( KNSmlDMSIPNodeName ); |
|
1396 segmentName.Append ( KNSmlDMSIPSeparator8 ); |
|
1397 segmentName.Append ( KSIPPrefix ); |
|
1398 segmentName.Append( KHexPrefix ); |
|
1399 segmentName.AppendNumFixedWidthUC( val, EHex, 8 ); |
|
1400 iDmCallback->SetMappingL( segmentName, mappingInfo ); |
|
1401 } |
|
1402 else |
|
1403 { // Add those in PreviousList which are on database. |
|
1404 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1405 aPreviousURISegmentList.At(currentline).iURISeg ); |
|
1406 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1407 KNSmlDMSIPSeparator8 ); |
|
1408 } |
|
1409 } |
|
1410 retValue = CSmlDmAdapter::EOk; |
|
1411 iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
1412 iDmCallback->SetResultsL( aResultsRef, *currentURISegmentList, |
|
1413 KNullDesC8 ); |
|
1414 CleanupStack::PopAndDestroy( currentURISegmentList ); |
|
1415 currentURISegmentList = NULL; |
|
1416 DBG_PRINT("CNSmlDmSIPAdapter::ChildURIListL(): end"); |
|
1417 return; |
|
1418 } |
|
1419 |
|
1420 // Find profile from array. Return if not found. |
|
1421 TInt profileID = FindHexProfile ( uri ); |
|
1422 if ( KErrNotFound == profileID ) |
|
1423 { |
|
1424 retValue = CSmlDmAdapter::ENotFound; |
|
1425 CleanupStack::PopAndDestroy( currentURISegmentList ); |
|
1426 iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
1427 DBG_PRINT("CNSmlDmSIPAdapter::ChildURIListL(): end"); |
|
1428 return; |
|
1429 } |
|
1430 |
|
1431 // SIP/SIPId |
|
1432 if ( 2 == NumOfURISegs( aURI ) ) |
|
1433 { |
|
1434 segmentName.Copy( KNSmlDMSIPSipID ); |
|
1435 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1436 segmentName ); |
|
1437 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1438 KNSmlDMSIPSeparator8 ); |
|
1439 |
|
1440 segmentName.Copy( KNSmlDMSIPName ); |
|
1441 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1442 segmentName ); |
|
1443 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1444 KNSmlDMSIPSeparator8 ); |
|
1445 |
|
1446 segmentName.Copy( KNSmlDMSIPProfileType ); |
|
1447 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1448 segmentName ); |
|
1449 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1450 KNSmlDMSIPSeparator8 ); |
|
1451 |
|
1452 segmentName.Copy( KNSmlDMSIPAOR ); |
|
1453 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1454 segmentName ); |
|
1455 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1456 KNSmlDMSIPSeparator8 ); |
|
1457 |
|
1458 segmentName.Copy( KNSmlDMSIPOutboundProxy ); |
|
1459 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1460 segmentName ); |
|
1461 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1462 KNSmlDMSIPSeparator8 ); |
|
1463 |
|
1464 segmentName.Copy( KNSmlDMSIPRegistrarServer ); |
|
1465 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1466 segmentName ); |
|
1467 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1468 KNSmlDMSIPSeparator8 ); |
|
1469 |
|
1470 segmentName.Copy( KNSmlDMSIPDefault ); |
|
1471 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1472 segmentName ); |
|
1473 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1474 KNSmlDMSIPSeparator8 ); |
|
1475 |
|
1476 segmentName.Copy( KNSmlDMSIPLooseRouting ); |
|
1477 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1478 segmentName ); |
|
1479 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1480 KNSmlDMSIPSeparator8 ); |
|
1481 |
|
1482 segmentName.Copy( KNSmlDMSIPEnableSecurityNegotiation ); |
|
1483 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1484 segmentName ); |
|
1485 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1486 KNSmlDMSIPSeparator8 ); |
|
1487 |
|
1488 segmentName.Copy( KNSmlDMSIPEnableSigComp ); |
|
1489 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1490 segmentName ); |
|
1491 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1492 KNSmlDMSIPSeparator8 ); |
|
1493 |
|
1494 segmentName.Copy( KNSmlDMSIPEnableAutoRegistration ); |
|
1495 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1496 segmentName ); |
|
1497 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1498 KNSmlDMSIPSeparator8 ); |
|
1499 |
|
1500 segmentName.Copy( KNSmlDMSIPConRef ); |
|
1501 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1502 segmentName ); |
|
1503 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1504 KNSmlDMSIPSeparator8 ); |
|
1505 |
|
1506 segmentName.Copy( KNSmlDMSIPProfileLock ); |
|
1507 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1508 segmentName ); |
|
1509 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1510 KNSmlDMSIPSeparator8 ); |
|
1511 |
|
1512 segmentName.Copy( KNSmlDMSIPSnap ); |
|
1513 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1514 segmentName ); |
|
1515 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1516 KNSmlDMSIPSeparator8 ); |
|
1517 |
|
1518 segmentName.Copy( KNSmlDMSIPSigQos ); |
|
1519 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1520 segmentName ); |
|
1521 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1522 KNSmlDMSIPSeparator8 ); |
|
1523 } |
|
1524 |
|
1525 // SIP/x/OutboundProxy |
|
1526 else if ( KNSmlDMSIPOutboundProxy() == LastURISeg( aURI ) ) |
|
1527 { |
|
1528 segmentName.Copy( KNSmlDMSIPHost ); |
|
1529 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1530 segmentName ); |
|
1531 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1532 KNSmlDMSIPSeparator8 ); |
|
1533 |
|
1534 segmentName.Copy( KNSmlDMSIPPort ); |
|
1535 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1536 segmentName ); |
|
1537 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1538 KNSmlDMSIPSeparator8 ); |
|
1539 |
|
1540 segmentName.Copy( KNSmlDMSIPTransport ); |
|
1541 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1542 segmentName ); |
|
1543 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1544 KNSmlDMSIPSeparator8 ); |
|
1545 |
|
1546 segmentName.Copy( KNSmlDMSIPUsername ); |
|
1547 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1548 segmentName ); |
|
1549 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1550 KNSmlDMSIPSeparator8 ); |
|
1551 |
|
1552 segmentName.Copy( KNSmlDMSIPPasswd ); |
|
1553 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1554 segmentName ); |
|
1555 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1556 KNSmlDMSIPSeparator8 ); |
|
1557 |
|
1558 segmentName.Copy( KNSmlDMSIPRealm ); |
|
1559 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1560 segmentName ); |
|
1561 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1562 KNSmlDMSIPSeparator8 ); |
|
1563 } |
|
1564 |
|
1565 // SIP/x/RegistrarServer |
|
1566 else if ( KNSmlDMSIPRegistrarServer() == LastURISeg( aURI ) ) |
|
1567 { |
|
1568 segmentName.Copy( KNSmlDMSIPHost ); |
|
1569 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1570 segmentName ); |
|
1571 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1572 KNSmlDMSIPSeparator8 ); |
|
1573 |
|
1574 segmentName.Copy( KNSmlDMSIPPort ); |
|
1575 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1576 segmentName ); |
|
1577 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1578 KNSmlDMSIPSeparator8 ); |
|
1579 |
|
1580 segmentName.Copy( KNSmlDMSIPTransport ); |
|
1581 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1582 segmentName ); |
|
1583 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1584 KNSmlDMSIPSeparator8 ); |
|
1585 |
|
1586 segmentName.Copy( KNSmlDMSIPUsername ); |
|
1587 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1588 segmentName ); |
|
1589 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1590 KNSmlDMSIPSeparator8 ); |
|
1591 |
|
1592 segmentName.Copy( KNSmlDMSIPPrivateIdentity ); |
|
1593 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1594 segmentName ); |
|
1595 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1596 KNSmlDMSIPSeparator8 ); |
|
1597 |
|
1598 segmentName.Copy( KNSmlDMSIPPasswd ); |
|
1599 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1600 segmentName ); |
|
1601 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1602 KNSmlDMSIPSeparator8 ); |
|
1603 |
|
1604 segmentName.Copy( KNSmlDMSIPRealm ); |
|
1605 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1606 segmentName ); |
|
1607 currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
1608 KNSmlDMSIPSeparator8 ); |
|
1609 } |
|
1610 else |
|
1611 { |
|
1612 // If none of asked nodes found return error. |
|
1613 retValue = CSmlDmAdapter::ENotFound; |
|
1614 } |
|
1615 |
|
1616 iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
1617 iDmCallback->SetResultsL( aResultsRef, *currentURISegmentList, |
|
1618 KNullDesC8 ); |
|
1619 CleanupStack::PopAndDestroy( currentURISegmentList ); |
|
1620 DBG_PRINT("CNSmlDmSIPAdapter::ChildURIListL(): end"); |
|
1621 } |
|
1622 |
|
1623 // --------------------------------------------------------------------------- |
|
1624 // CNSmlDmSIPAdapter::CheckDuplicateNameL |
|
1625 // Checks if duplicate named sip profiles. Renames if same. |
|
1626 // --------------------------------------------------------------------------- |
|
1627 // |
|
1628 void CNSmlDmSIPAdapter::CheckDuplicateNameL( CSIPManagedProfile& aProfile, |
|
1629 const TInt& aProfileId ) |
|
1630 { |
|
1631 DBG_PRINT("CNSmlDmSIPAdapter::CheckDuplicateNameL(): begin"); |
|
1632 const TDesC8* name; |
|
1633 aProfile.GetParameter( KSIPProviderName, name ); |
|
1634 HBufC8* newName = HBufC8::NewLC( KMaxProviderNameLength ); |
|
1635 newName->Des().Copy( *name ); |
|
1636 |
|
1637 TInt count( iProfiles->Count() ); |
|
1638 |
|
1639 for ( TInt n = 0; n < count; n++ ) |
|
1640 { |
|
1641 // Skip profile currently being checked. |
|
1642 if ( aProfileId != n ) |
|
1643 { |
|
1644 const TDesC8* existingName; |
|
1645 iProfiles->At( n )->GetParameter( KSIPProviderName, |
|
1646 existingName ); |
|
1647 if ( existingName->Compare( *name ) == 0 ) |
|
1648 { |
|
1649 TBool isUnique( EFalse ); |
|
1650 for ( TInt i = 1; !isUnique; i++ ) |
|
1651 { |
|
1652 TBool found( EFalse ); |
|
1653 newName->Des().Zero(); |
|
1654 newName->Des().Append( *name ); |
|
1655 newName->Des().Append( KOpenParenthesis() ); |
|
1656 newName->Des().AppendNum( i ); |
|
1657 newName->Des().Append( KClosedParenthesis() ); |
|
1658 for ( TInt m = 0; m < count; m++ ) |
|
1659 { |
|
1660 iProfiles->At( m )->GetParameter( |
|
1661 KSIPProviderName, existingName ); |
|
1662 if ( existingName->Compare( newName->Des() ) == 0 ) |
|
1663 { |
|
1664 found = ETrue; |
|
1665 } |
|
1666 } |
|
1667 if ( !found ) |
|
1668 { |
|
1669 isUnique = ETrue; |
|
1670 } |
|
1671 } |
|
1672 } |
|
1673 } |
|
1674 } |
|
1675 |
|
1676 aProfile.SetParameter( KSIPProviderName, newName->Des() ); |
|
1677 CleanupStack::PopAndDestroy( newName ); |
|
1678 DBG_PRINT("CNSmlDmSIPAdapter::CheckDuplicateNameL(): end"); |
|
1679 } |
|
1680 |
|
1681 // --------------------------------------------------------------------------- |
|
1682 // CNSmlDmSIPAdapter::AddNodeObjectL |
|
1683 // Adds a new SIP profile |
|
1684 // (other items were commented in a header). |
|
1685 // --------------------------------------------------------------------------- |
|
1686 // |
|
1687 void CNSmlDmSIPAdapter::AddNodeObjectL( |
|
1688 const TDesC8& aURI, |
|
1689 const TDesC8& aParentLUID, |
|
1690 const TInt aStatusRef ) |
|
1691 { |
|
1692 DBG_PRINT("CNSmlDmSIPAdapter::AddNodeObjectL(): begin"); |
|
1693 CSmlDmAdapter::TError status = EOk; |
|
1694 |
|
1695 // Load profile information if not loaded yet. |
|
1696 if ( !iProfiles ) |
|
1697 { |
|
1698 LoadProfilesL(); |
|
1699 } |
|
1700 |
|
1701 // Find profile from array, profile deleted from elsewhere if not found. |
|
1702 if ( aParentLUID.Length() > 0 ) |
|
1703 { |
|
1704 TInt profileID = FindHexProfile ( aParentLUID ); |
|
1705 if ( KErrNotFound == profileID ) |
|
1706 { |
|
1707 status = CSmlDmAdapter::ENotFound; |
|
1708 } |
|
1709 else |
|
1710 { |
|
1711 status = CSmlDmAdapter::EAlreadyExists; |
|
1712 } |
|
1713 } |
|
1714 |
|
1715 if ( NumOfURISegs( aURI ) == 2 |
|
1716 && ( status == EOk || status == ENotFound ) ) |
|
1717 { |
|
1718 status = EOk; |
|
1719 // Check OOD before saving new profile. |
|
1720 RFs fs; |
|
1721 User::LeaveIfError( fs.Connect() ); |
|
1722 CleanupClosePushL( fs ); |
|
1723 |
|
1724 // SIP settings are stored in one file |
|
1725 if ( SysUtil::FFSSpaceBelowCriticalLevelL( |
|
1726 &fs, KNSmlDMFatMinimumFileSize ) ) |
|
1727 { |
|
1728 // Prevent writing in OOD. |
|
1729 CleanupStack::PopAndDestroy( &fs ); |
|
1730 iDmCallback->SetStatusL( aStatusRef, CSmlDmAdapter::EDiskFull ); |
|
1731 DBG_PRINT("CNSmlDmSIPAdapter::AddNodeObjectL(): DISK FULL end"); |
|
1732 return; |
|
1733 } |
|
1734 CleanupStack::PopAndDestroy( &fs ); |
|
1735 TSIPProfileTypeInfo type; |
|
1736 type.iSIPProfileClass = TSIPProfileTypeInfo::EInternet; |
|
1737 type.iSIPProfileName = KPTypeIETF; |
|
1738 |
|
1739 // Need to create a new profile. |
|
1740 CSIPManagedProfile* profile = iSIPManagedProfileRegistry->CreateL( |
|
1741 type ); |
|
1742 CleanupStack::PushL( profile ); |
|
1743 if ( LastURISeg( aURI ).Length() < KMaxProviderNameLength ) |
|
1744 { |
|
1745 profile->SetParameter( KSIPProviderName, LastURISeg( aURI ) ); |
|
1746 } |
|
1747 |
|
1748 // Check for name duplicates, this profile has not yet been added to |
|
1749 // iProfiles. |
|
1750 CheckDuplicateNameL( *profile, KErrNotFound ); |
|
1751 |
|
1752 // Default value for Signaling QoS is 40. |
|
1753 TUint32 sigQos = 40; |
|
1754 // We need to do bitshifting on the IP TOS, because it's the upper 6 |
|
1755 // bits that are set and settings provide us the IP TOS as the lower 6 |
|
1756 // bits. |
|
1757 // The lower 2 bits are reserver for explicit congestion notification. |
|
1758 // See also more from: |
|
1759 // Symbian Developer Library / in_sock.h Global variables / KSoIpTOS |
|
1760 sigQos <<= 2; |
|
1761 profile->SetParameter( KSIPSoIpTOS, sigQos ); |
|
1762 |
|
1763 // Add profile to iProfiles and save it also to permanent storage. |
|
1764 iSIPManagedProfileRegistry->SaveL( *profile ); |
|
1765 iProfiles->AppendL( profile ); |
|
1766 |
|
1767 // Set LUID mapping to DM module. |
|
1768 TUint32 val ( 0 ); |
|
1769 profile->GetParameter( KSIPProfileId, val ); |
|
1770 TBuf8<KSmlMaxURISegLen> mappingInfo; |
|
1771 mappingInfo.Copy ( KSIPPrefix ); |
|
1772 mappingInfo.Append ( KHexPrefix ); |
|
1773 mappingInfo.AppendNumFixedWidthUC( val, EHex, 8 ); |
|
1774 CleanupStack::Pop( profile ); |
|
1775 iDmCallback->SetMappingL( aURI, mappingInfo ); |
|
1776 } |
|
1777 |
|
1778 // Allow add for existing OutboundProxy and RegistrarServer nodes. |
|
1779 else if ( aParentLUID.Length() > 0 && NumOfURISegs( aURI ) == 3 |
|
1780 && ( LastURISeg( aURI ) == KNSmlDMSIPOutboundProxy |
|
1781 || LastURISeg( aURI ) == KNSmlDMSIPRegistrarServer ) ) |
|
1782 { |
|
1783 status = CSmlDmAdapter::EOk; |
|
1784 } |
|
1785 |
|
1786 iDmCallback->SetStatusL( aStatusRef, status ); |
|
1787 DBG_PRINT("CNSmlDmSIPAdapter::AddNodeObjectL(): end"); |
|
1788 } |
|
1789 |
|
1790 // --------------------------------------------------------------------------- |
|
1791 // CNSmlDmSIPAdapter::DesToInt |
|
1792 // Converts a 8 bit descriptor to int. |
|
1793 // Returns: TInt: |
|
1794 // --------------------------------------------------------------------------- |
|
1795 // |
|
1796 TInt CNSmlDmSIPAdapter::DesToInt( const TDesC8& aDes ) |
|
1797 { |
|
1798 TLex8 lex( aDes ); |
|
1799 TInt value = 0; |
|
1800 lex.Val( value ); |
|
1801 return value; |
|
1802 } |
|
1803 |
|
1804 // --------------------------------------------------------------------------- |
|
1805 // CNSmlDmSIPAdapter::RemoveLastURISeg |
|
1806 // returns parent uri, i.e. removes last uri segment |
|
1807 // Returns: TPtrC16: pointer to aURI before last / mark |
|
1808 // --------------------------------------------------------------------------- |
|
1809 // |
|
1810 TPtrC8 CNSmlDmSIPAdapter::RemoveLastURISeg( const TDesC8& aURI ) |
|
1811 { |
|
1812 TInt i ( 0 ); |
|
1813 // Check that aURI exists. |
|
1814 if ( 0 < aURI.Length() ) |
|
1815 { |
|
1816 for ( i = aURI.Length() - 1; i >= 0; i-- ) |
|
1817 { |
|
1818 if ( KDMSIPSeparator == aURI[i] ) |
|
1819 { |
|
1820 break; |
|
1821 } |
|
1822 } |
|
1823 } |
|
1824 return aURI.Left( i ); |
|
1825 } |
|
1826 |
|
1827 // --------------------------------------------------------------------------- |
|
1828 // CNSmlDmSIPAdapter::NumOfURISegs |
|
1829 // For getting the number of uri segs |
|
1830 // Returns: TInt: number of uri segments |
|
1831 // --------------------------------------------------------------------------- |
|
1832 // |
|
1833 TInt CNSmlDmSIPAdapter::NumOfURISegs( const TDesC8& aURI ) |
|
1834 { |
|
1835 TInt numOfURISegs ( 1 ); |
|
1836 for ( TInt i = 0; i < aURI.Length(); i++ ) |
|
1837 { |
|
1838 if ( KDMSIPSeparator == aURI[i] ) |
|
1839 { |
|
1840 numOfURISegs++; |
|
1841 } |
|
1842 } |
|
1843 return numOfURISegs; |
|
1844 } |
|
1845 |
|
1846 // --------------------------------------------------------------------------- |
|
1847 // CNSmlDmSIPAdapter::LastURISeg |
|
1848 // Returns only the last uri segment |
|
1849 // Returns: TPtrC16: pointer to last uri segment |
|
1850 // --------------------------------------------------------------------------- |
|
1851 // |
|
1852 TPtrC8 CNSmlDmSIPAdapter::LastURISeg( const TDesC8& aURI ) |
|
1853 { |
|
1854 TInt i ( 0 ); |
|
1855 // Check that aURI exists |
|
1856 if ( 0 < aURI.Length() ) |
|
1857 { |
|
1858 for ( i = aURI.Length() - 1; i >= 0; i-- ) |
|
1859 { |
|
1860 if ( KDMSIPSeparator == aURI[i] ) |
|
1861 { |
|
1862 break; |
|
1863 } |
|
1864 } |
|
1865 } |
|
1866 if ( 0 == i ) |
|
1867 { |
|
1868 return aURI; |
|
1869 } |
|
1870 else |
|
1871 { |
|
1872 return aURI.Mid( i+1 ); |
|
1873 } |
|
1874 } |
|
1875 |
|
1876 // --------------------------------------------------------------------------- |
|
1877 // CNSmlDmSIPAdapter::RemoveDotSlash |
|
1878 // return uri without dot and slash in start |
|
1879 // Returns: TPtrC8: pointer to last uri segment |
|
1880 // --------------------------------------------------------------------------- |
|
1881 // |
|
1882 TPtrC8 CNSmlDmSIPAdapter::RemoveDotSlash( const TDesC8& aURI ) |
|
1883 { |
|
1884 if ( 0 == aURI.Find( KNSmlSIPUriDotSlash ) ) |
|
1885 { |
|
1886 return aURI.Right( aURI.Length()-KNSmlSIPUriDotSlash().Length() ); |
|
1887 } |
|
1888 else |
|
1889 { |
|
1890 return aURI; |
|
1891 } |
|
1892 } |
|
1893 |
|
1894 // --------------------------------------------------------------------------- |
|
1895 // CNSmlDmSIPAdapter::GetConRefL |
|
1896 // Get URI for given accesspoint ID. |
|
1897 // Returns: TBool: True if connection reference found |
|
1898 // --------------------------------------------------------------------------- |
|
1899 // |
|
1900 TBool CNSmlDmSIPAdapter::GetConRefL( CBufBase& aObject, |
|
1901 const TInt& aProfileid ) |
|
1902 { |
|
1903 DBG_PRINT("CNSmlDmSIPAdapter::GetConRefL() : begin"); |
|
1904 TBool found = EFalse; |
|
1905 |
|
1906 CNSmlDMIAPMatcher* iapmatch = CNSmlDMIAPMatcher::NewL( iDmCallback ); |
|
1907 CleanupStack::PushL( iapmatch ); |
|
1908 |
|
1909 // Get current access point ID. |
|
1910 TUint32 profIAPid; |
|
1911 iProfiles->At( aProfileid )->GetParameter( |
|
1912 KSIPAccessPointId, profIAPid ); |
|
1913 |
|
1914 HBufC8* uri8 = iapmatch->URIFromIAPIdL( profIAPid ); |
|
1915 CleanupStack::PushL( uri8 ); |
|
1916 if ( uri8 ) |
|
1917 { |
|
1918 aObject.InsertL( aObject.Size(),uri8->Des() ); |
|
1919 found = ETrue; |
|
1920 } |
|
1921 CleanupStack::PopAndDestroy( uri8 ); |
|
1922 CleanupStack::PopAndDestroy( iapmatch ); |
|
1923 DBG_PRINT("CNSmlDmSIPAdapter::GetConRefL() : end"); |
|
1924 return found; |
|
1925 } |
|
1926 |
|
1927 // --------------------------------------------------------------------------- |
|
1928 // CNSmlDmSIPAdapter::SetConRefL |
|
1929 // Set conref value. |
|
1930 // Status : Draft/Proposal/Approved |
|
1931 // --------------------------------------------------------------------------- |
|
1932 // |
|
1933 TInt CNSmlDmSIPAdapter::SetConRefL( const TDesC8& aObject, |
|
1934 const TInt& aProfileid ) |
|
1935 { |
|
1936 DBG_PRINT("CNSmlDmSIPAdapter::SetConRefL() : begin"); |
|
1937 CNSmlDMIAPMatcher* iapmatch = CNSmlDMIAPMatcher::NewL( iDmCallback ); |
|
1938 CleanupStack::PushL( iapmatch ); |
|
1939 TInt lIAPid = iapmatch->IAPIdFromURIL( aObject ); |
|
1940 if ( lIAPid != KErrNotFound ) |
|
1941 { |
|
1942 iProfiles->At( aProfileid )->SetParameter( |
|
1943 KSIPAccessPointId, ( TUint32 )lIAPid ); |
|
1944 } |
|
1945 CleanupStack::PopAndDestroy( iapmatch ); |
|
1946 DBG_PRINT("CNSmlDmSIPAdapter::SetConRefL() : end"); |
|
1947 return lIAPid; |
|
1948 } |
|
1949 |
|
1950 // --------------------------------------------------------------------------- |
|
1951 // CNSmlDmSIPAdapter::ExecuteCommandL |
|
1952 // (Not supported, see smldmadapter.h) |
|
1953 // --------------------------------------------------------------------------- |
|
1954 // |
|
1955 void CNSmlDmSIPAdapter::ExecuteCommandL( |
|
1956 const TDesC8& /*aURI*/, |
|
1957 const TDesC8& /*aLUID*/, |
|
1958 const TDesC8& /*aArgument*/, |
|
1959 const TDesC8& /*aType*/, |
|
1960 const TInt aStatusRef ) |
|
1961 { |
|
1962 DBG_PRINT("CNSmlDmSIPAdapter::ExecuteCommandL(): begin"); |
|
1963 iDmCallback->SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
1964 DBG_PRINT("CNSmlDmSIPAdapter::ExecuteCommandL(): end"); |
|
1965 } |
|
1966 |
|
1967 // --------------------------------------------------------------------------- |
|
1968 // CNSmlDmSIPAdapter::ExecuteCommandL |
|
1969 // (Not supported, see smldmadapter.h) |
|
1970 // --------------------------------------------------------------------------- |
|
1971 // |
|
1972 void CNSmlDmSIPAdapter::ExecuteCommandL( |
|
1973 const TDesC8& /*aURI*/, |
|
1974 const TDesC8& /*aParentLUID*/, |
|
1975 RWriteStream*& /*aStream*/, |
|
1976 const TDesC8& /*aType*/, |
|
1977 const TInt aStatusRef ) |
|
1978 { |
|
1979 DBG_PRINT("CNSmlDmSIPAdapter::ExecuteCommandL(): stream: begin"); |
|
1980 iDmCallback->SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
1981 DBG_PRINT("CNSmlDmSIPAdapter::ExecuteCommandL(): stream: end"); |
|
1982 } |
|
1983 |
|
1984 // --------------------------------------------------------------------------- |
|
1985 // CNSmlDmSIPAdapter::CopyCommandL |
|
1986 // (Not supported, see smldmadapter.h) |
|
1987 // --------------------------------------------------------------------------- |
|
1988 // |
|
1989 void CNSmlDmSIPAdapter::CopyCommandL( |
|
1990 const TDesC8& /*aTargetURI*/, |
|
1991 const TDesC8& /*aTargetLUID*/, |
|
1992 const TDesC8& /*aSourceURI*/, |
|
1993 const TDesC8& /*aSourceLUID*/, |
|
1994 const TDesC8& /*aType*/, |
|
1995 TInt aStatusRef ) |
|
1996 { |
|
1997 DBG_PRINT("CNSmlDmSIPAdapter::CopyCommandL(): begin"); |
|
1998 iDmCallback->SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
1999 DBG_PRINT("CNSmlDmSIPAdapter::CopyCommandL(): end"); |
|
2000 } |
|
2001 |
|
2002 // --------------------------------------------------------------------------- |
|
2003 // CNSmlDmSIPAdapter::StartAtomicL |
|
2004 // (Not supported, see smldmadapter.h) |
|
2005 // --------------------------------------------------------------------------- |
|
2006 // |
|
2007 void CNSmlDmSIPAdapter::StartAtomicL() |
|
2008 { |
|
2009 DBG_PRINT("CNSmlDmSIPAdapter::StartAtomicL(): begin"); |
|
2010 DBG_PRINT("CNSmlDmSIPAdapter::StartAtomicL(): end"); |
|
2011 } |
|
2012 |
|
2013 // --------------------------------------------------------------------------- |
|
2014 // CNSmlDmSIPAdapter::CommitAtomicL |
|
2015 // (Not supported, see smldmadapter.h) |
|
2016 // --------------------------------------------------------------------------- |
|
2017 // |
|
2018 void CNSmlDmSIPAdapter::CommitAtomicL() |
|
2019 { |
|
2020 DBG_PRINT("CNSmlDmSIPAdapter::CommitAtomicL(): begin"); |
|
2021 DBG_PRINT("CNSmlDmSIPAdapter::CommitAtomicL(): end"); |
|
2022 } |
|
2023 |
|
2024 // --------------------------------------------------------------------------- |
|
2025 // CNSmlDmSIPAdapter::RollbackAtomicL |
|
2026 // (Not supported, see smldmadapter.h) |
|
2027 // --------------------------------------------------------------------------- |
|
2028 // |
|
2029 void CNSmlDmSIPAdapter::RollbackAtomicL() |
|
2030 { |
|
2031 DBG_PRINT("CNSmlDmSIPAdapter::RollbackAtomicL(): begin"); |
|
2032 DBG_PRINT("CNSmlDmSIPAdapter::RollbackAtomicL(): end"); |
|
2033 } |
|
2034 |
|
2035 // --------------------------------------------------------------------------- |
|
2036 // CNSmlDmSIPAdapter::StreamingSupport |
|
2037 // (Not supported, see smldmadapter.h) |
|
2038 // --------------------------------------------------------------------------- |
|
2039 // |
|
2040 TBool CNSmlDmSIPAdapter::StreamingSupport( TInt& /*aItemSize*/ ) |
|
2041 { |
|
2042 DBG_PRINT("CNSmlDmSIPAdapter::StreamingSupport(): begin"); |
|
2043 DBG_PRINT("CNSmlDmSIPAdapter::StreamingSupport(): end"); |
|
2044 return EFalse; |
|
2045 } |
|
2046 |
|
2047 // --------------------------------------------------------------------------- |
|
2048 // CNSmlDmSIPAdapter::StreamCommittedL |
|
2049 // (Not supported, see smldmadapter.h) |
|
2050 // --------------------------------------------------------------------------- |
|
2051 // |
|
2052 void CNSmlDmSIPAdapter::StreamCommittedL() |
|
2053 { |
|
2054 DBG_PRINT("CNSmlDmSIPAdapter::StreamCommittedL(): begin"); |
|
2055 DBG_PRINT("CNSmlDmSIPAdapter::StreamCommittedL(): end"); |
|
2056 } |
|
2057 |
|
2058 // --------------------------------------------------------------------------- |
|
2059 // CNSmlDmSIPAdapter::CompleteOutstandingCmdsL |
|
2060 // Saves modified profiles back to permanent store |
|
2061 // --------------------------------------------------------------------------- |
|
2062 // |
|
2063 void CNSmlDmSIPAdapter::CompleteOutstandingCmdsL() |
|
2064 { |
|
2065 DBG_PRINT("CNSmlDmSIPAdapter::CompleteOutstandingCmdsL(): begin"); |
|
2066 |
|
2067 // Check if profiles exist and some modifications are done. |
|
2068 // Save only profiles that have changed. |
|
2069 if ( iProfiles ) |
|
2070 { |
|
2071 for (TInt i = 0 ; i < iModifications.Count() ; i++ ) |
|
2072 { |
|
2073 TUint32 tIAPId( 0 ); |
|
2074 iProfiles->At( iModifications[ i ] )-> |
|
2075 GetParameter( KSIPAccessPointId, tIAPId ); |
|
2076 |
|
2077 TBool autoreg( EFalse ); |
|
2078 iProfiles->At( iModifications[ i ] )-> |
|
2079 GetParameter( KSIPAutoRegistration, autoreg ); |
|
2080 |
|
2081 // Save changes to permanent storage. |
|
2082 iSIPManagedProfileRegistry->SaveL( |
|
2083 *iProfiles->At( iModifications[ i ] ) ); |
|
2084 } |
|
2085 iModifications.Reset(); |
|
2086 } |
|
2087 DBG_PRINT("CNSmlDmSIPAdapter::CompleteOutstandingCmdsL(): end"); |
|
2088 } |
|
2089 |
|
2090 // --------------------------------------------------------------------------- |
|
2091 // CNSmlDmSIPAdapter::FetchLeafObjectSizeL |
|
2092 // Fetches size of a leaf object |
|
2093 // --------------------------------------------------------------------------- |
|
2094 // |
|
2095 void CNSmlDmSIPAdapter::FetchLeafObjectSizeL( |
|
2096 const TDesC8& aURI, |
|
2097 const TDesC8& aLUID, |
|
2098 const TDesC8& aType, |
|
2099 const TInt aResultsRef, |
|
2100 const TInt aStatusRef ) |
|
2101 { |
|
2102 DBG_PRINT("CNSmlDmSIPAdapter::FetchLeafObjectSizeL(): begin"); |
|
2103 |
|
2104 CBufBase *object = CBufFlat::NewL( 1 ); |
|
2105 CleanupStack::PushL( object ); |
|
2106 CSmlDmAdapter::TError retValue = FetchObjectL( aURI, aLUID, *object ); |
|
2107 |
|
2108 TInt objSizeInBytes = object->Size(); |
|
2109 TBuf8<16> stringObjSizeInBytes; |
|
2110 stringObjSizeInBytes.Num( objSizeInBytes ); |
|
2111 object->Reset(); |
|
2112 object->InsertL( 0, stringObjSizeInBytes ); |
|
2113 |
|
2114 iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
2115 iDmCallback->SetResultsL( aResultsRef, *object, aType ); |
|
2116 CleanupStack::PopAndDestroy( object ); |
|
2117 DBG_PRINT("CNSmlDmSIPAdapter::FetchLeafObjectSizeL(): end"); |
|
2118 } |
|
2119 |
|
2120 // --------------------------------------------------------------------------- |
|
2121 // CNSmlDmSIPAdapter::UpdateLeafObjectL |
|
2122 // (Not supported, see smldmadapter.h) |
|
2123 // --------------------------------------------------------------------------- |
|
2124 // |
|
2125 void CNSmlDmSIPAdapter::UpdateLeafObjectL( |
|
2126 const TDesC8& /*aURI*/, |
|
2127 const TDesC8& /*aLUID*/, |
|
2128 RWriteStream*& /*aStream*/, |
|
2129 const TDesC8& /*aType*/, |
|
2130 const TInt aStatusRef ) |
|
2131 { |
|
2132 DBG_PRINT("CNSmlDmSIPAdapter::UpdateLeafObjectL(): stream: begin"); |
|
2133 iDmCallback->SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
2134 DBG_PRINT("CNSmlDmSIPAdapter::UpdateLeafObjectL(): stream: end"); |
|
2135 } |
|
2136 |
|
2137 // --------------------------------------------------------------------------- |
|
2138 // CNSmlDmSIPAdapter::ProfileRegistryEventOccurred |
|
2139 // for MSIPProfileRegistryObserver |
|
2140 // --------------------------------------------------------------------------- |
|
2141 // |
|
2142 void CNSmlDmSIPAdapter::ProfileRegistryEventOccurred( |
|
2143 TUint32 /*aProfileId*/, |
|
2144 TEvent /*aEvent*/) |
|
2145 { |
|
2146 } |
|
2147 |
|
2148 // --------------------------------------------------------------------------- |
|
2149 // CNSmlDmSIPAdapter::ProfileRegistryEventOccurred |
|
2150 // for MSIPProfileRegistryObserver |
|
2151 // --------------------------------------------------------------------------- |
|
2152 // |
|
2153 void CNSmlDmSIPAdapter::ProfileRegistryErrorOccurred( |
|
2154 TUint32 /*aProfileId*/, |
|
2155 TInt /*aError*/) |
|
2156 { |
|
2157 } |
|
2158 |
|
2159 // --------------------------------------------------------------------------- |
|
2160 // CNSmlDmSIPAdapter::SnapIdL |
|
2161 // Gets SNAP ID based on URI. |
|
2162 // --------------------------------------------------------------------------- |
|
2163 // |
|
2164 TUint32 CNSmlDmSIPAdapter::SnapIdL( const TDesC8& aUri ) |
|
2165 { |
|
2166 DBG_PRINT( "CNSmlDmSIPAdapter::SnapIdL - begin" ); |
|
2167 TUint32 snapId( KErrNone ); |
|
2168 |
|
2169 HBufC8* luid = HBufC8::NewLC( KNSmlSIPMaxUriLength ); // CS:1 |
|
2170 luid->Des().Copy( iDmCallback->GetLuidAllocL( aUri )->Des() ); |
|
2171 |
|
2172 if ( luid->Des().Length() ) |
|
2173 { |
|
2174 snapId = DesToInt( LastURISeg( luid->Des() ) ); |
|
2175 } |
|
2176 CleanupStack::PopAndDestroy( luid ); // CS:0 |
|
2177 DBG_PRINT( "CNSmlDmSIPAdapter::SnapIdL - end" ); |
|
2178 return snapId; |
|
2179 } |
|
2180 |
|
2181 // --------------------------------------------------------------------------- |
|
2182 // CNSmlDmSIPAdapter::GetSnapUriL |
|
2183 // Set SNAP URI based on SNAP ID. |
|
2184 // --------------------------------------------------------------------------- |
|
2185 // |
|
2186 MSmlDmAdapter::TError CNSmlDmSIPAdapter::GetSnapUriL( TDes8& aObject, |
|
2187 TUint32 aSnapId ) |
|
2188 { |
|
2189 __ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
2190 |
|
2191 DBG_PRINT( "CNSmlDmSIPAdapter::GetSnapUriL - begin" ); |
|
2192 |
|
2193 CBufBase* result = CBufFlat::NewL( 1 ); |
|
2194 CleanupStack::PushL( result ); // CS:1 |
|
2195 CSmlDmAdapter::TError status; |
|
2196 |
|
2197 // Get URIs to all SNAP settings. |
|
2198 iDmCallback->FetchLinkL( KNSmlDMSIPSnapUriPrefix(), *result, status ); |
|
2199 |
|
2200 if ( CSmlDmAdapter::EOk != status ) |
|
2201 { |
|
2202 CleanupStack::PopAndDestroy( result ); |
|
2203 DBG_PRINT( "CNSmlDmSIPAdapter::GetSnapUriL - Fetch SNAP error end" ); |
|
2204 return status; |
|
2205 } |
|
2206 |
|
2207 result->Compress(); |
|
2208 HBufC8* childList = HBufC8::NewLC( result->Size() ); // CS:2 |
|
2209 TInt uriSegCount( 0 ); |
|
2210 |
|
2211 if ( result->Size() ) |
|
2212 { |
|
2213 childList->Des().Copy( result->Ptr( 0 ) ); |
|
2214 uriSegCount = NumOfURISegs( childList->Des() ); |
|
2215 } |
|
2216 |
|
2217 // Get LUIDs for URIs. |
|
2218 for ( TInt index = 0; index < uriSegCount; index++ ) |
|
2219 { |
|
2220 HBufC8* uri = HBufC8::NewLC( KNSmlSIPMaxUriLength ); // CS:3 |
|
2221 HBufC8* luid = HBufC8::NewLC( KNSmlSIPMaxUriLength ); // CS:4 |
|
2222 |
|
2223 uri->Des().Copy( KNSmlDMSIPSnapUriPrefix() ); |
|
2224 uri->Des().Append( KNSmlDMSIPSeparator8() ); |
|
2225 uri->Des().Append( LastURISeg( childList->Des() ) ); |
|
2226 luid->Des().Copy( iDmCallback->GetLuidAllocL( uri->Des() )->Des() ); |
|
2227 if ( luid->Des().Length() && |
|
2228 aSnapId == DesToInt( LastURISeg( luid->Des() ) ) ) |
|
2229 { |
|
2230 aObject.Copy( uri->Des() ); |
|
2231 CleanupStack::PopAndDestroy( luid ); // CS:3 |
|
2232 CleanupStack::PopAndDestroy( uri ); // CS:2 |
|
2233 break; |
|
2234 } |
|
2235 childList->Des().Copy( RemoveLastURISeg( childList->Des() ) ); |
|
2236 CleanupStack::PopAndDestroy( luid ); // CS:3 |
|
2237 CleanupStack::PopAndDestroy( uri ); // CS:2 |
|
2238 } |
|
2239 CleanupStack::PopAndDestroy( childList ); // CS:1 |
|
2240 CleanupStack::PopAndDestroy( result ); // CS:0 |
|
2241 DBG_PRINT( "CNSmlDmSIPAdapter::GetSnapUriL - end" ); |
|
2242 return status; |
|
2243 } |
|
2244 |
|
2245 // --------------------------------------------------------------------------- |
|
2246 // CNSmlDmSIPAdapter::UpdateOutboundProxyNodeL |
|
2247 // Updater method for OutboundProxy node. |
|
2248 // --------------------------------------------------------------------------- |
|
2249 // |
|
2250 MSmlDmAdapter::TError CNSmlDmSIPAdapter::UpdateOutboundProxyNodeL( |
|
2251 TUint32 aProfileId, const TDesC8& aUri, const TDesC8& aObject ) |
|
2252 { |
|
2253 DBG_PRINT( "CNSmlDmSIPAdapter::UpdateOutboundProxyNodeL - begin" ); |
|
2254 MSmlDmAdapter::TError status = EOk; |
|
2255 |
|
2256 // Get OutboundProxy SIP URI. |
|
2257 const TDesC8* uri = 0; |
|
2258 iProfiles->At( aProfileId )->GetParameter( KSIPOutboundProxy, |
|
2259 KSIPServerAddress, uri ); |
|
2260 TUriParser8 parser; |
|
2261 TInt err = parser.Parse( *uri ); |
|
2262 if ( KErrNone != err ) |
|
2263 { |
|
2264 DBG_PRINT( "CNSmlDmSIPAdapter::UpdateOutboundProxyNodeL - URI parse \ |
|
2265 error end" ); |
|
2266 return CSmlDmAdapter::EError; |
|
2267 } |
|
2268 CUri8* tempUri = CUri8::NewLC( parser ); |
|
2269 |
|
2270 // Start of outboundproxy parameters. |
|
2271 |
|
2272 // SIP/x/OutboundProxy/Host |
|
2273 // When host is cleared, whole proxy address needs to be cleared. |
|
2274 if ( KNSmlDMSIPHost() == aUri ) |
|
2275 { |
|
2276 if ( aObject == KNullDesC8 ) |
|
2277 { |
|
2278 tempUri->RemoveComponentL( EUriScheme ); |
|
2279 tempUri->RemoveComponentL( EUriUserinfo ); |
|
2280 tempUri->RemoveComponentL( EUriHost ); |
|
2281 tempUri->RemoveComponentL( EUriPort ); |
|
2282 tempUri->RemoveComponentL( EUriPath ); |
|
2283 tempUri->RemoveComponentL( EUriQuery ); |
|
2284 tempUri->RemoveComponentL( EUriFragment ); |
|
2285 } |
|
2286 else |
|
2287 { |
|
2288 HBufC8* scheme = HBufC8::NewLC( KMaxSchemeLength ); |
|
2289 if ( 0 == aObject.Find( KNSmlDMSIPSIPPrefix() ) ) |
|
2290 { |
|
2291 scheme->Des().Copy( KNSmlDMSIPSip() ); |
|
2292 } |
|
2293 else if ( 0 == aObject.Find( KNSmlDMSIPSIPSPrefix() ) ) |
|
2294 { |
|
2295 scheme->Des().Copy( KNSmlDMSIPSips() ); |
|
2296 } |
|
2297 if ( scheme->Des().Length() > 0 ) |
|
2298 { |
|
2299 tempUri->SetComponentL( scheme->Des(), EUriScheme ); |
|
2300 if ( aObject.Length() > scheme->Des().Length() ) |
|
2301 { |
|
2302 tempUri->SetComponentL( aObject.Mid( scheme-> |
|
2303 Des().Length() + 1 ), EUriHost ); |
|
2304 } |
|
2305 else |
|
2306 { |
|
2307 // No host entered at all, remove host component. |
|
2308 tempUri->RemoveComponentL( EUriHost ); |
|
2309 } |
|
2310 } |
|
2311 else |
|
2312 { |
|
2313 scheme->Des().Copy( tempUri->Uri().Extract( |
|
2314 EUriScheme ) ); |
|
2315 if ( 0 == scheme->Des().Length() ) |
|
2316 { |
|
2317 scheme->Des().Copy( KNSmlDMSIPSip() ); |
|
2318 } |
|
2319 tempUri->SetComponentL( scheme->Des(), EUriScheme ); |
|
2320 // Set host component, no scheme in parameter. |
|
2321 tempUri->SetComponentL( aObject, EUriHost ); |
|
2322 } |
|
2323 CleanupStack::PopAndDestroy( scheme ); |
|
2324 } |
|
2325 } |
|
2326 |
|
2327 // SIP/x/OutboundProxy/Port |
|
2328 if ( KNSmlDMSIPPort() == aUri ) |
|
2329 { |
|
2330 if ( aObject == KNullDesC8 ) |
|
2331 { |
|
2332 tempUri->RemoveComponentL( EUriPort ); |
|
2333 } |
|
2334 else |
|
2335 { |
|
2336 tempUri->SetComponentL( aObject, EUriPort ); |
|
2337 } |
|
2338 } |
|
2339 |
|
2340 // SIP/x/OutboundProxy/Transport |
|
2341 if ( KNSmlDMSIPTransport() == aUri ) |
|
2342 { |
|
2343 TBuf8<KUriPathMaxLength> tempPathTp; |
|
2344 tempPathTp.Copy( tempUri->Uri().Extract( EUriPath ) ); |
|
2345 tempPathTp.LowerCase(); |
|
2346 |
|
2347 // SIP/x/OutboundProxy/Transport |
|
2348 if ( KNSmlDMSIPTransportTCP() == aObject ) |
|
2349 { |
|
2350 TInt pos = tempPathTp.Find( KSIPTransportPrefix ); |
|
2351 if ( KErrNotFound != pos ) |
|
2352 { |
|
2353 tempPathTp.Delete( pos, ( tempPathTp.Length() - pos ) ); |
|
2354 tempPathTp.Append( KSIPTransportTCP ); |
|
2355 } |
|
2356 else |
|
2357 { |
|
2358 tempPathTp.Append( KSIPTransportTCP ); |
|
2359 } |
|
2360 tempUri->SetComponentL( tempPathTp, EUriPath ); |
|
2361 } |
|
2362 |
|
2363 // SIP/x/OutboundProxy/Transport |
|
2364 else if ( KNSmlDMSIPTransportUDP() == aObject ) |
|
2365 { |
|
2366 TInt pos = tempPathTp.Find( KSIPTransportPrefix ); |
|
2367 if ( KErrNotFound != pos ) |
|
2368 { |
|
2369 tempPathTp.Delete( pos, ( tempPathTp.Length() - pos ) ); |
|
2370 tempPathTp.Append( KSIPTransportUDP ); |
|
2371 } |
|
2372 else |
|
2373 { |
|
2374 tempPathTp.Append( KSIPTransportUDP ); |
|
2375 } |
|
2376 tempUri->SetComponentL( tempPathTp, EUriPath ); |
|
2377 } |
|
2378 |
|
2379 // SIP/x/OutboundProxy/Transport |
|
2380 else if ( KNSmlDMSIPTransportAuto() == aObject ) |
|
2381 { |
|
2382 TInt pos = tempPathTp.Find( KSIPTransportPrefix ); |
|
2383 if ( KErrNotFound != pos ) |
|
2384 { |
|
2385 tempPathTp.Delete( pos, ( tempPathTp.Length() - pos ) ); |
|
2386 } |
|
2387 tempUri->SetComponentL( tempPathTp, EUriPath ); |
|
2388 } |
|
2389 else |
|
2390 { |
|
2391 status = CSmlDmAdapter::EInvalidObject; |
|
2392 } |
|
2393 } |
|
2394 |
|
2395 // SIP/x/OutboundProxy/Username |
|
2396 if ( KNSmlDMSIPUsername() == aUri ) |
|
2397 { |
|
2398 TSIPProfileTypeInfo type; |
|
2399 type = iProfiles->At( aProfileId )->Type(); |
|
2400 |
|
2401 // Set Username if profile type is IETF. |
|
2402 if ( type.iSIPProfileClass == TSIPProfileTypeInfo::EInternet ) |
|
2403 { |
|
2404 if ( KErrNotFound == aObject.Find( KEscaped() ) ) |
|
2405 { |
|
2406 HBufC8* encoded = EscapeUtils::EscapeEncodeL( aObject, |
|
2407 EscapeUtils::EEscapeNormal ); |
|
2408 err = iProfiles->At( aProfileId )->SetParameter( |
|
2409 KSIPOutboundProxy, KSIPDigestUserName, *encoded ); |
|
2410 delete encoded; |
|
2411 } |
|
2412 else |
|
2413 { |
|
2414 err = iProfiles->At( aProfileId )->SetParameter( |
|
2415 KSIPOutboundProxy, KSIPDigestUserName, aObject ); |
|
2416 } |
|
2417 } |
|
2418 |
|
2419 // Set PrivateIdentity if profiletype is IMS or other. |
|
2420 else if ( type.iSIPProfileClass == TSIPProfileTypeInfo::EIms || |
|
2421 type.iSIPProfileClass == TSIPProfileTypeInfo::EOther ) |
|
2422 { |
|
2423 if ( KErrNotFound == aObject.Find( KEscaped() ) ) |
|
2424 { |
|
2425 HBufC8* encoded = EscapeUtils::EscapeEncodeL( aObject, |
|
2426 EscapeUtils::EEscapeNormal ); |
|
2427 err = iProfiles->At( aProfileId )->SetParameter( |
|
2428 KSIPPrivateIdentity, *encoded ); |
|
2429 delete encoded; |
|
2430 } |
|
2431 else |
|
2432 { |
|
2433 err = iProfiles->At( aProfileId )->SetParameter( |
|
2434 KSIPPrivateIdentity, aObject ); |
|
2435 } |
|
2436 } |
|
2437 |
|
2438 else |
|
2439 { |
|
2440 status = CSmlDmAdapter::EInvalidObject; |
|
2441 } |
|
2442 } |
|
2443 |
|
2444 // SIP/x/OutboundProxy/Passwd |
|
2445 if ( KNSmlDMSIPPasswd() == aUri ) |
|
2446 { |
|
2447 err = iProfiles->At( aProfileId )->SetParameter( |
|
2448 KSIPOutboundProxy, KSIPDigestPassword, aObject ); |
|
2449 } |
|
2450 |
|
2451 // SIP/x/OutboundProxy/Realm |
|
2452 if ( KNSmlDMSIPRealm() == aUri ) |
|
2453 { |
|
2454 err = iProfiles->At( aProfileId )->SetParameter( |
|
2455 KSIPOutboundProxy, KSIPDigestRealm, aObject ); |
|
2456 } |
|
2457 |
|
2458 // Set tempUri back to original sipURI. |
|
2459 if ( status == CSmlDmAdapter::EOk ) |
|
2460 { |
|
2461 err = iProfiles->At( aProfileId )->SetParameter( |
|
2462 KSIPOutboundProxy, KSIPServerAddress, |
|
2463 tempUri->Uri().UriDes() ); |
|
2464 } |
|
2465 else |
|
2466 { |
|
2467 status = CSmlDmAdapter::EError; |
|
2468 } |
|
2469 CleanupStack::PopAndDestroy( tempUri ); |
|
2470 |
|
2471 if ( KErrNone != err ) |
|
2472 { |
|
2473 status = CSmlDmAdapter::EError; |
|
2474 } |
|
2475 |
|
2476 DBG_PRINT( "CNSmlDmSIPAdapter::UpdateOutboundProxyNodeL - end" ); |
|
2477 return status; |
|
2478 } |
|
2479 |
|
2480 // --------------------------------------------------------------------------- |
|
2481 // CNSmlDmSIPAdapter::UpdateRegistrarServerNodeL |
|
2482 // Updater method for RegistrarServer node. |
|
2483 // --------------------------------------------------------------------------- |
|
2484 // |
|
2485 MSmlDmAdapter::TError CNSmlDmSIPAdapter::UpdateRegistrarServerNodeL( |
|
2486 TUint32 aProfileId, const TDesC8& aUri, const TDesC8& aObject ) |
|
2487 { |
|
2488 DBG_PRINT( "CNSmlDmSIPAdapter::UpdateRegistrarServerNodeL - begin" ); |
|
2489 MSmlDmAdapter::TError status = EOk; |
|
2490 |
|
2491 // Get RegistrarServer SIP URI. |
|
2492 const TDesC8* uri = 0; |
|
2493 iProfiles->At( aProfileId )->GetParameter ( KSIPRegistrar, |
|
2494 KSIPServerAddress, uri ); |
|
2495 TUriParser8 parser; |
|
2496 TInt err = parser.Parse( *uri ); |
|
2497 if ( KErrNone != err ) |
|
2498 { |
|
2499 DBG_PRINT( "CNSmlDmSIPAdapter::UpdateRegistrarServerNodeL - URI \ |
|
2500 parse error end" ); |
|
2501 return CSmlDmAdapter::EError; |
|
2502 } |
|
2503 CUri8* tempUri = CUri8::NewLC( parser ); |
|
2504 |
|
2505 // SIP/x/RegistrarServer/Host |
|
2506 if ( KNSmlDMSIPHost() == aUri ) |
|
2507 { |
|
2508 if ( aObject == KNullDesC8 ) |
|
2509 { |
|
2510 tempUri->RemoveComponentL( EUriHost ); |
|
2511 } |
|
2512 else |
|
2513 { |
|
2514 HBufC8* scheme = HBufC8::NewLC( KMaxSchemeLength ); |
|
2515 if ( 0 == aObject.Find( KNSmlDMSIPSIPPrefix() ) ) |
|
2516 { |
|
2517 scheme->Des().Copy( KNSmlDMSIPSip() ); |
|
2518 } |
|
2519 else if ( 0 == aObject.Find( KNSmlDMSIPSIPSPrefix() ) ) |
|
2520 { |
|
2521 scheme->Des().Copy( KNSmlDMSIPSips() ); |
|
2522 } |
|
2523 if ( scheme->Des().Length() > 0 ) |
|
2524 { |
|
2525 // Set scheme if exists in host parameter. |
|
2526 tempUri->SetComponentL( scheme->Des(), EUriScheme ); |
|
2527 if ( aObject.Length() > scheme->Des().Length() ) |
|
2528 { |
|
2529 tempUri->SetComponentL( aObject.Mid( scheme-> |
|
2530 Des().Length() + 1 ), EUriHost ); |
|
2531 } |
|
2532 else |
|
2533 { |
|
2534 // No host entered at all, remove host component. |
|
2535 tempUri->RemoveComponentL( EUriHost ); |
|
2536 } |
|
2537 } |
|
2538 else |
|
2539 { |
|
2540 scheme->Des().Copy( tempUri->Uri().Extract( |
|
2541 EUriScheme ) ); |
|
2542 if ( 0 == scheme->Des().Length() ) |
|
2543 { |
|
2544 scheme->Des().Copy( KNSmlDMSIPSip() ); |
|
2545 } |
|
2546 tempUri->SetComponentL( scheme->Des(), EUriScheme ); |
|
2547 // Set host component, no scheme in parameter. |
|
2548 tempUri->SetComponentL( aObject, EUriHost ); |
|
2549 } |
|
2550 CleanupStack::PopAndDestroy( scheme ); |
|
2551 } |
|
2552 } |
|
2553 |
|
2554 // SIP/x/RegistrarServer/Port |
|
2555 if ( KNSmlDMSIPPort() == aUri ) |
|
2556 { |
|
2557 if ( aObject == KNullDesC8 ) |
|
2558 { |
|
2559 tempUri->RemoveComponentL( EUriPort ); |
|
2560 } |
|
2561 else |
|
2562 { |
|
2563 tempUri->SetComponentL( aObject, EUriPort ); |
|
2564 } |
|
2565 } |
|
2566 |
|
2567 // SIP/x/RegistrarServer/Transport |
|
2568 if ( KNSmlDMSIPTransport() == aUri ) |
|
2569 { |
|
2570 TBuf8<KUriPathMaxLength> tempPathReg; |
|
2571 tempPathReg.Copy( tempUri->Uri().Extract( EUriPath ) ); |
|
2572 tempPathReg.LowerCase(); |
|
2573 |
|
2574 if ( KNSmlDMSIPTransportTCP() == aObject ) |
|
2575 { |
|
2576 TInt pos = tempPathReg.Find( KSIPTransportPrefix ); |
|
2577 if ( KErrNotFound != pos ) |
|
2578 { |
|
2579 tempPathReg.Delete( pos, ( tempPathReg.Length() - pos ) ); |
|
2580 tempPathReg.Append( KSIPTransportTCP ); |
|
2581 } |
|
2582 else |
|
2583 { |
|
2584 tempPathReg.Append( KSIPTransportTCP ); |
|
2585 } |
|
2586 tempUri->SetComponentL( tempPathReg, EUriPath ); |
|
2587 } |
|
2588 |
|
2589 else if ( KNSmlDMSIPTransportUDP() == aObject ) |
|
2590 { |
|
2591 TInt pos = tempPathReg.Find( KSIPTransportPrefix ); |
|
2592 if ( KErrNotFound != pos ) |
|
2593 { |
|
2594 tempPathReg.Delete( pos, ( tempPathReg.Length() - pos ) ); |
|
2595 tempPathReg.Append( KSIPTransportUDP ); |
|
2596 } |
|
2597 else |
|
2598 { |
|
2599 tempPathReg.Append( KSIPTransportUDP ); |
|
2600 } |
|
2601 tempUri->SetComponentL( tempPathReg, EUriPath ); |
|
2602 } |
|
2603 |
|
2604 else if ( KNSmlDMSIPTransportAuto() == aObject ) |
|
2605 { |
|
2606 TInt pos = tempPathReg.Find( KSIPTransportPrefix ); |
|
2607 if ( KErrNotFound != pos ) |
|
2608 { |
|
2609 tempPathReg.Delete( pos, ( tempPathReg.Length() - pos ) ); |
|
2610 } |
|
2611 tempUri->SetComponentL( tempPathReg, EUriPath ); |
|
2612 } |
|
2613 |
|
2614 else |
|
2615 { |
|
2616 status = CSmlDmAdapter::EInvalidObject; |
|
2617 } |
|
2618 } |
|
2619 |
|
2620 // SIP/x/RegistrarServer/Username |
|
2621 if ( KNSmlDMSIPUsername() == aUri ) |
|
2622 { |
|
2623 TSIPProfileTypeInfo type; |
|
2624 type = iProfiles->At( aProfileId )->Type(); |
|
2625 if ( type.iSIPProfileClass == TSIPProfileTypeInfo::EInternet ) |
|
2626 { |
|
2627 if ( KErrNotFound == aObject.Find( KEscaped() ) ) |
|
2628 { |
|
2629 HBufC8* encoded = EscapeUtils::EscapeEncodeL( aObject, |
|
2630 EscapeUtils::EEscapeNormal ); |
|
2631 err = iProfiles->At( aProfileId )->SetParameter( |
|
2632 KSIPRegistrar, KSIPDigestUserName, *encoded ); |
|
2633 delete encoded; |
|
2634 } |
|
2635 else |
|
2636 { |
|
2637 err = iProfiles->At( aProfileId )->SetParameter( |
|
2638 KSIPRegistrar, KSIPDigestUserName, aObject ); |
|
2639 } |
|
2640 } |
|
2641 } |
|
2642 |
|
2643 // SIP/x/RegistrarServer/PrivateIdentity |
|
2644 if ( KNSmlDMSIPPrivateIdentity() == aUri ) |
|
2645 { |
|
2646 TSIPProfileTypeInfo type; |
|
2647 type = iProfiles->At( aProfileId )->Type(); |
|
2648 |
|
2649 // Set PrivateIdentity if profiletype is Ims or preIms. |
|
2650 if ( type.iSIPProfileClass == TSIPProfileTypeInfo::EIms || |
|
2651 type.iSIPProfileClass == TSIPProfileTypeInfo::EOther ) |
|
2652 { |
|
2653 err = iProfiles->At( aProfileId )->SetParameter( |
|
2654 KSIPPrivateIdentity, aObject ); |
|
2655 } |
|
2656 else |
|
2657 { |
|
2658 status = CSmlDmAdapter::EInvalidObject; |
|
2659 } |
|
2660 } |
|
2661 |
|
2662 // SIP/x/RegistrarServer/Passwd |
|
2663 if ( KNSmlDMSIPPasswd() == aUri ) |
|
2664 { |
|
2665 err = iProfiles->At( aProfileId )->SetParameter( KSIPRegistrar, |
|
2666 KSIPDigestPassword, aObject ); |
|
2667 } |
|
2668 |
|
2669 // SIP/x/RegistrarServer/Realm |
|
2670 if ( KNSmlDMSIPRealm() == aUri ) |
|
2671 { |
|
2672 err = iProfiles->At( aProfileId )->SetParameter( KSIPRegistrar, |
|
2673 KSIPDigestRealm, aObject ); |
|
2674 } |
|
2675 |
|
2676 // Set tempUri back to original sipURI. |
|
2677 // Allow emptying realm and passwd. |
|
2678 if ( status == CSmlDmAdapter::EOk ) |
|
2679 { |
|
2680 err = iProfiles->At( aProfileId )->SetParameter( KSIPRegistrar, |
|
2681 KSIPServerAddress, tempUri->Uri().UriDes() ); |
|
2682 } |
|
2683 else |
|
2684 { |
|
2685 status = CSmlDmAdapter::EError; |
|
2686 } |
|
2687 CleanupStack::PopAndDestroy( tempUri ); |
|
2688 |
|
2689 if ( KErrNone != err ) |
|
2690 { |
|
2691 status = CSmlDmAdapter::EError; |
|
2692 } |
|
2693 |
|
2694 DBG_PRINT( "CNSmlDmSIPAdapter::UpdateRegistrarServerNodeL - end" ); |
|
2695 return status; |
|
2696 } |
|
2697 |
|
2698 // --------------------------------------------------------------------------- |
|
2699 // CNSmlDmSIPAdapter::FetchOutboundProxyNodeL |
|
2700 // Fetcher method for OutboundProxy node. |
|
2701 // --------------------------------------------------------------------------- |
|
2702 // |
|
2703 MSmlDmAdapter::TError CNSmlDmSIPAdapter::FetchOutboundProxyNodeL( |
|
2704 TUint32 aProfileId, const TDesC8& aUri, TDes8& aSegmentResult ) |
|
2705 { |
|
2706 DBG_PRINT( "CNSmlDmSIPAdapter::FetchOutboundProxyNodeL - begin" ); |
|
2707 MSmlDmAdapter::TError status = CSmlDmAdapter::EOk; |
|
2708 |
|
2709 // Get OutboundProxy SIP URI. |
|
2710 const TDesC8* uri = 0; |
|
2711 TInt err = iProfiles->At( aProfileId )->GetParameter( |
|
2712 KSIPOutboundProxy, KSIPServerAddress, uri ); |
|
2713 |
|
2714 CSIPAddress* sipURI = 0; |
|
2715 if ( 0 < uri->Length() ) |
|
2716 { |
|
2717 sipURI = CSIPAddress::DecodeL( *uri ); |
|
2718 } |
|
2719 // The whole SIP URI is empty so return ENotFound. |
|
2720 else |
|
2721 { |
|
2722 status = CSmlDmAdapter::ENotFound; |
|
2723 DBG_PRINT( "CNSmlDmSIPAdapter::FetchOutboundProxyNodeL - Host not \ |
|
2724 found end" ); |
|
2725 return status; |
|
2726 } |
|
2727 CleanupStack::PushL( sipURI ); |
|
2728 |
|
2729 // Start of outboundproxy parameters |
|
2730 // SIP//OutboundProxy/Host |
|
2731 if ( KNSmlDMSIPHost() == aUri ) |
|
2732 { |
|
2733 aSegmentResult.Copy( sipURI->Uri8().Uri().Extract( EUriHost ) ); |
|
2734 } |
|
2735 |
|
2736 // SIP//OutboundProxy/Port |
|
2737 if ( KNSmlDMSIPPort() == aUri ) |
|
2738 { |
|
2739 // Get port if exists. |
|
2740 if ( sipURI->Uri8().Uri().IsPresent( EUriPort ) ) |
|
2741 { |
|
2742 aSegmentResult.Copy( sipURI->Uri8().Uri().Extract( EUriPort ) ); |
|
2743 } |
|
2744 else |
|
2745 { |
|
2746 aSegmentResult.Num( KDefaultPortNumber ); |
|
2747 } |
|
2748 } |
|
2749 |
|
2750 // SIP//OutboundProxy/Transport |
|
2751 if ( KNSmlDMSIPTransport() == aUri ) |
|
2752 { |
|
2753 TBuf8<KUriPathMaxLength> tempPathOb; |
|
2754 tempPathOb.Copy( sipURI->Uri8().Uri().Extract( EUriPath ) ); |
|
2755 tempPathOb.LowerCase(); |
|
2756 |
|
2757 // Return default transport if none is found. |
|
2758 aSegmentResult.Copy( KNSmlDMSIPTransportAuto ); |
|
2759 |
|
2760 TInt pos = tempPathOb.Find( KSIPTransportTCP ); |
|
2761 if ( KErrNotFound != pos ) |
|
2762 { |
|
2763 aSegmentResult.Copy( KNSmlDMSIPTransportTCP ); |
|
2764 } |
|
2765 pos = tempPathOb.Find( KSIPTransportUDP ); |
|
2766 if ( KErrNotFound != pos ) |
|
2767 { |
|
2768 aSegmentResult.Copy( KNSmlDMSIPTransportUDP ); |
|
2769 } |
|
2770 } |
|
2771 |
|
2772 // SIP/x/OutboundProxy/Username |
|
2773 if ( KNSmlDMSIPUsername() == aUri ) |
|
2774 { |
|
2775 TSIPProfileTypeInfo type; |
|
2776 type = iProfiles->At( aProfileId )->Type(); |
|
2777 if ( type.iSIPProfileClass == TSIPProfileTypeInfo::EInternet ) |
|
2778 { |
|
2779 const TDesC8* paramResult = NULL; |
|
2780 err = iProfiles->At( aProfileId )->GetParameter( |
|
2781 KSIPOutboundProxy, KSIPDigestUserName, paramResult ); |
|
2782 aSegmentResult.Copy( *paramResult ); |
|
2783 } |
|
2784 else if ( type.iSIPProfileClass == TSIPProfileTypeInfo::EIms || |
|
2785 type.iSIPProfileClass == TSIPProfileTypeInfo::EOther ) |
|
2786 { |
|
2787 const TDesC8* paramResult = NULL; |
|
2788 iProfiles->At( aProfileId )-> |
|
2789 GetParameter( KSIPPrivateIdentity, paramResult ); |
|
2790 aSegmentResult.Copy( *paramResult ); |
|
2791 } |
|
2792 else |
|
2793 { |
|
2794 aSegmentResult.Copy( KNullDesC ); |
|
2795 } |
|
2796 } |
|
2797 |
|
2798 // SIP/x/OutboundProxy/Realm |
|
2799 if ( KNSmlDMSIPRealm() == aUri ) |
|
2800 { |
|
2801 const TDesC8* paramResult = NULL; |
|
2802 err = iProfiles->At( aProfileId )->GetParameter( KSIPOutboundProxy, |
|
2803 KSIPDigestRealm, paramResult ); |
|
2804 aSegmentResult.Copy( *paramResult ); |
|
2805 } |
|
2806 CleanupStack::PopAndDestroy( sipURI ); |
|
2807 |
|
2808 if ( KErrNone != err ) |
|
2809 { |
|
2810 status = CSmlDmAdapter::EError; |
|
2811 } |
|
2812 |
|
2813 DBG_PRINT( "CNSmlDmSIPAdapter::FetchOutboundProxyNodeL - end" ); |
|
2814 return status; |
|
2815 } |
|
2816 |
|
2817 // --------------------------------------------------------------------------- |
|
2818 // CNSmlDmSIPAdapter::FetchRegistrarServerNodeL |
|
2819 // Fetcher method for RegistrarServer node. |
|
2820 // --------------------------------------------------------------------------- |
|
2821 // |
|
2822 MSmlDmAdapter::TError CNSmlDmSIPAdapter::FetchRegistrarServerNodeL( |
|
2823 TUint32 aProfileId, const TDesC8& aUri, TDes8& aSegmentResult ) |
|
2824 { |
|
2825 DBG_PRINT( "CNSmlDmSIPAdapter::FetchRegistrarServerNodeL - begin" ); |
|
2826 MSmlDmAdapter::TError status = CSmlDmAdapter::EOk; |
|
2827 |
|
2828 // Start of RegistrarServer parameters. |
|
2829 // Get Registrar SIP URI. |
|
2830 const TDesC8* uri = 0; |
|
2831 TInt err = iProfiles->At( aProfileId )->GetParameter( KSIPRegistrar, |
|
2832 KSIPServerAddress, uri ); |
|
2833 |
|
2834 CSIPAddress* sipURI = 0; |
|
2835 if ( 0 < uri->Length() ) |
|
2836 { |
|
2837 sipURI = CSIPAddress::DecodeL( *uri ); |
|
2838 } |
|
2839 // The whole SIP URI is empty so return ENotFound. |
|
2840 else |
|
2841 { |
|
2842 status = CSmlDmAdapter::ENotFound; |
|
2843 DBG_PRINT( "CNSmlDmSIPAdapter::FetchRegistrarServerNodeL - Host not \ |
|
2844 found end" ); |
|
2845 return status; |
|
2846 } |
|
2847 |
|
2848 CleanupStack::PushL( sipURI ); |
|
2849 |
|
2850 // SIP/x/RegistrarServer/Host |
|
2851 if ( KNSmlDMSIPHost() == aUri ) |
|
2852 { |
|
2853 aSegmentResult.Copy( sipURI->Uri8().Uri().Extract( EUriHost ) ); |
|
2854 } |
|
2855 |
|
2856 // SIP/x/RegistrarServer/Port |
|
2857 if ( KNSmlDMSIPPort() == aUri ) |
|
2858 { |
|
2859 // Get port if exists. |
|
2860 if ( sipURI->Uri8().Uri().IsPresent( EUriPort ) ) |
|
2861 { |
|
2862 aSegmentResult.Copy( sipURI->Uri8().Uri().Extract( |
|
2863 EUriPort ) ); |
|
2864 } |
|
2865 else |
|
2866 { |
|
2867 aSegmentResult.Num ( KDefaultPortNumber ); |
|
2868 } |
|
2869 } |
|
2870 |
|
2871 // SIP/x/RegistrarServer/Transport |
|
2872 if ( KNSmlDMSIPTransport() == aUri ) |
|
2873 { |
|
2874 TBuf8<KUriPathMaxLength> tempPathReg; |
|
2875 tempPathReg.Copy( sipURI->Uri8().Uri().Extract( EUriPath ) ); |
|
2876 tempPathReg.LowerCase(); |
|
2877 |
|
2878 // Return default transport if none is found. |
|
2879 aSegmentResult.Copy( KNSmlDMSIPTransportAuto ); |
|
2880 |
|
2881 TInt pos = tempPathReg.Find( KSIPTransportTCP ); |
|
2882 if ( KErrNotFound != pos ) |
|
2883 { |
|
2884 aSegmentResult.Copy( KNSmlDMSIPTransportTCP ); |
|
2885 } |
|
2886 pos = tempPathReg.Find( KSIPTransportUDP ); |
|
2887 if ( KErrNotFound != pos ) |
|
2888 { |
|
2889 aSegmentResult.Copy( KNSmlDMSIPTransportUDP ); |
|
2890 } |
|
2891 } |
|
2892 |
|
2893 // SIP/x/RegistrarServer/Username |
|
2894 if ( KNSmlDMSIPUsername() == aUri ) |
|
2895 { |
|
2896 TSIPProfileTypeInfo type; |
|
2897 type = iProfiles->At( aProfileId )->Type(); |
|
2898 if ( type.iSIPProfileClass == TSIPProfileTypeInfo::EInternet ) |
|
2899 { |
|
2900 const TDesC8* paramResult = NULL; |
|
2901 err = iProfiles->At( aProfileId )->GetParameter( |
|
2902 KSIPRegistrar, KSIPDigestUserName, paramResult ); |
|
2903 aSegmentResult.Copy( *paramResult ); |
|
2904 } |
|
2905 else |
|
2906 { |
|
2907 aSegmentResult.Copy( KNullDesC ); |
|
2908 } |
|
2909 } |
|
2910 |
|
2911 // PrivateIdentity used in IMS or PreIms. |
|
2912 if ( KNSmlDMSIPPrivateIdentity() == aUri ) |
|
2913 { |
|
2914 TSIPProfileTypeInfo type; |
|
2915 type = iProfiles->At( aProfileId )->Type(); |
|
2916 if ( type.iSIPProfileClass == TSIPProfileTypeInfo::EIms || |
|
2917 type.iSIPProfileClass == TSIPProfileTypeInfo::EOther ) |
|
2918 { |
|
2919 const TDesC8* paramResult = NULL; |
|
2920 iProfiles->At( aProfileId )-> |
|
2921 GetParameter( KSIPPrivateIdentity, paramResult ); |
|
2922 aSegmentResult.Copy( *paramResult ); |
|
2923 } |
|
2924 else |
|
2925 { |
|
2926 aSegmentResult.Copy( KNullDesC ); |
|
2927 } |
|
2928 } |
|
2929 |
|
2930 // SIP/x/RegistrarServer/Realm |
|
2931 if ( KNSmlDMSIPRealm() == aUri ) |
|
2932 { |
|
2933 const TDesC8* paramResult = NULL; |
|
2934 err = iProfiles->At( aProfileId )->GetParameter( |
|
2935 KSIPRegistrar, KSIPDigestRealm, paramResult ); |
|
2936 aSegmentResult.Copy( *paramResult ); |
|
2937 } |
|
2938 CleanupStack::PopAndDestroy( sipURI ); |
|
2939 |
|
2940 if ( KErrNone != err ) |
|
2941 { |
|
2942 status = CSmlDmAdapter::EError; |
|
2943 } |
|
2944 |
|
2945 DBG_PRINT( "CNSmlDmSIPAdapter::FetchRegistrarServerNodeL - end" ); |
|
2946 return status; |
|
2947 } |
|
2948 |
|
2949 // End of file |