author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:01:56 +0300 | |
branch | RCL_3 |
changeset 31 | 5886d40bb3de |
parent 28 | d38647835c2e |
child 33 | 2989b291cac7 |
permissions | -rw-r--r-- |
28 | 1 |
/* |
2 |
* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "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 VoIP adapter |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDE FILES |
|
20 |
#include <f32file.h> |
|
21 |
#include <sysutil.h> |
|
22 |
#include <settingsinternalcrkeys.h> |
|
23 |
#include <centralrepository.h> |
|
24 |
#include <wlaninternalpskeys.h> // For GetWlanacAddress and GetWlanTypeL. |
|
25 |
#include <badesca.h> // For CDesC8ArrayFlat used in CompleteOutstandingCmdsL. |
|
26 |
#include <coemain.h> // For GetPhoneModelL. |
|
27 |
#include <crcseprofileregistry.h> |
|
28 |
#include <crcseprofileentry.h> |
|
29 |
#include <crcseaudiocodecregistry.h> |
|
30 |
#include <crcseaudiocodecentry.h> |
|
31 |
#include <utf.h> |
|
32 |
#include <sipmanagedprofile.h> // For SIP User Agent Header. |
|
33 |
#include <sipprofileregistryobserver.h> // For SIP User Agent Header. |
|
34 |
#include <sipmanagedprofileregistry.h> // For SIP User Agent Header. |
|
35 |
#include <spdefinitions.h> // For Service Provider Settings. |
|
36 |
#include <spsettings.h> // For Service Provider Settings. |
|
37 |
#include <spentry.h> // For Service Provider Settings. |
|
38 |
#include <spproperty.h> // For Service Provider Settings. |
|
39 |
#include <featmgr.h> |
|
40 |
#include <nsmldmiapmatcher.h> // For fetching IAP. |
|
41 |
#include <nsmldmuri.h> // for parsing uris |
|
42 |
#include <pathinfo.h> // For getting phone rom root path. |
|
43 |
#include <cvimpstsettingsstore.h> // For IM tone path |
|
44 |
#include <pressettingsset.h> // for checking if presence settings is valid |
|
45 |
#include <pressettingsapi.h> // for checking if presence settings is valid |
|
46 |
||
47 |
#include "nsmldmvoipadapter.h" |
|
48 |
#include "cdmvoipspsettings.h" |
|
49 |
#include "CSIPProfileRegistryObserver.h" // For SIP User Agent Header. |
|
50 |
#include "cipappphoneutils.h" // For GetPhoneModelL, GetTerminalTypeL |
|
51 |
#include "cipapputilsaddressresolver.h" // For GetWlanMacAddress |
|
52 |
#include "smldmvoipdebug.h" |
|
53 |
||
54 |
// CONSTANTS |
|
55 |
||
56 |
const TInt KNSmlVoIPMaxUriLength = 256; |
|
57 |
const TInt KDefaultResultSize = 64; |
|
58 |
const TInt KNSmlVoIPMaxResultLength = 256; |
|
59 |
const TInt KNSmlDMFatMinimumFileSize = 512; |
|
60 |
const TUint KTempStringlength = 200; |
|
61 |
_LIT8( KSpaceMark, " " ); |
|
62 |
_LIT8( KUserAgent, "User-Agent" ); |
|
63 |
_LIT8( KColonMark, ":" ); |
|
64 |
||
65 |
_LIT8( KNSmlDMVoIPDDFVersion, "1.0" ); |
|
66 |
_LIT8( KNSmlDMVoIPNodeName, "VoIP" ); |
|
67 |
_LIT8( KNSmlDMVoIPPrefix, "VoIPId" ); |
|
68 |
_LIT8( KNSmlDMVoIPDynamicNode, "" ); |
|
69 |
_LIT8( KNSmlDMVoIPSetID, "VoIPId" ); |
|
70 |
_LIT8( KNSmlDMVoIPProvID, "ProviderName" ); |
|
71 |
_LIT8( KNSmlDMVoIPName, "SettingsName" ); |
|
72 |
_LIT8( KNSmlDMVoIPPreferredCodecsNode, "PreferredCodecs" ); |
|
73 |
||
74 |
// VoIP/x/CodecSettings |
|
75 |
_LIT8( KNSmlDMVoIPCodecSettingsNode, "CodecSettings" ); |
|
76 |
_LIT8( KNSmlDMVoIPCodecSettingsId, "CodecSettingsId" ); |
|
77 |
_LIT8( KNSmlDMVoIPCodecId, "VoIPCodecId" ); |
|
78 |
_LIT8( KNSmlDMVoIPPreferredCodecId, "PreferredCodecId" ); |
|
79 |
_LIT8( KNSmlDMVoIPMediaTypeName, "MediaTypeName" ); |
|
80 |
_LIT8( KNSmlDMVoIPMediaSubTypeName, "MediaSubTypeName" ); |
|
81 |
_LIT8( KNSmlDMVoIPJitterBufferSize, "JitterBufferSize" ); |
|
82 |
_LIT8( KNSmlDMVoIPOctetAlign, "OctetAlign" ); |
|
83 |
_LIT8( KNSmlDMVoIPModeSetNode, "ModeSet" ); |
|
84 |
_LIT8( KNSmlDMVoIPMode, "Mode" ); |
|
85 |
_LIT8( KNSmlDMVoIPModeId, "ModeId" ); |
|
86 |
_LIT8( KNSmlDMVoIPModeChangePeriod, "ModeChangePeriod" ); |
|
87 |
_LIT8( KNSmlDMVoIPModeChangeNeighbor, "ModeChangeNeighbor" ); |
|
88 |
_LIT8( KNSmlDMVoIPPtime, "Ptime" ); |
|
89 |
_LIT8( KNSmlDMVoIPMaxPtime, "MaxPtime" ); |
|
90 |
_LIT8( KNSmlDMVoIPVAD, "VAD" ); |
|
91 |
_LIT8( KNSmlDMVoIPAnnexB, "AnnexB" ); |
|
92 |
_LIT8( KNSmlDMVoIPMaxRed, "MaxRed" ); |
|
93 |
||
94 |
// VoIP/x/SettingIds node |
|
95 |
_LIT8( KNSmlDMVoIPSettingIdsNode, "SettingIds" ); |
|
96 |
_LIT8( KNSmlDMVoIPSettingId, "SettingId" ); |
|
97 |
_LIT8( KNSmlDMVoIPProfileType, "ProfileType" ); |
|
98 |
_LIT8( KNSmlDMVoIPProfileId, "ProfileId" ); |
|
99 |
_LIT8( KNSmlDMVoIPProfileSpecificId, "ProfileSpecificId" ); |
|
100 |
_LIT8( KNSmlDMVoIPProfileTypeSIP, "SIP" ); |
|
101 |
_LIT8( KNSmlDMVoIPProfileTypeSCCP, "SCCP" ); |
|
102 |
||
103 |
// VoIP/x/ |
|
104 |
_LIT8( KNSmlDMVoIPSMPort, "StartMediaPort" ); |
|
105 |
_LIT8( KNSmlDMVoIPEMPort, "EndMediaPort" ); |
|
106 |
_LIT8( KNSmlDMVoIPMediaQos, "MediaQos" ); |
|
107 |
_LIT8( KNSmlDMVoIPDTMFIB, "InbandDTMF" ); |
|
108 |
_LIT8( KNSmlDMVoIPDTMFOB, "OutbandDTMF" ); |
|
109 |
_LIT8( KNSmlDMVoIPSecureCallPref, "SecureCallPref" ); |
|
110 |
_LIT8( KNSmlDMVoIPRTCP, "RTCP" ); |
|
111 |
_LIT8( KNSmlDMVoIPUAHTerminalType, "UAHTerminalType" ); |
|
112 |
_LIT8( KNSmlDMVoIPUAHWLANMAC, "UAHWLANMAC" ); |
|
113 |
_LIT8( KNSmlDMVoIPUAHString, "UAHString" ); |
|
114 |
_LIT8( KNSmlDMVoIPProfileLockedToIAP, "ProfileLockedToIAP" ); |
|
115 |
_LIT8( KNSmlDMVoIPPluginUID, "VoIPPluginUID" ); |
|
116 |
_LIT8( KNSmlDMVoIPAllowVoIPOverWCDMA, "AllowVoIPOverWCDMA" ); |
|
117 |
_LIT8( KNSmlDMVoIPVoIPDigits, "VoIPDigits" ); |
|
118 |
_LIT8( KNSmlDMVoIPURIDomainIgnoreRule, "URIDomainIgnoreRule" ); |
|
119 |
_LIT8( KNSmlDMVoIPAutoAcceptBuddyRequest, "AutoAcceptBuddyRequest" ); |
|
120 |
_LIT8( KNSmlDMVoIPUsedVoIPRelease, "UsedVoIPRelease" ); |
|
121 |
_LIT8( KNSmlDMVoIPAddUserPhone, "AddUserPhone" ); |
|
122 |
_LIT8( KNSmlDMVoIPProviderBookmarkUri, "ProviderBookmarkURI" ); |
|
123 |
_LIT8( KNSmlDMVoIPSIPConnTestUri, "SIPConnectivityTestURI" ); |
|
124 |
_LIT8( KNSmlDMVoIPNatFwProfileId, "NATFWProfileId" ); |
|
125 |
_LIT8( KNSmlDMVoIPMinSessionInterval, "MinSessionInterval" ); |
|
126 |
_LIT8( KNSmlDMVoIPSessionExpires, "SessionExpires" ); |
|
127 |
_LIT8( KNSmlDMVoIPBrandingDataUri, "BradingDataURI" ); |
|
128 |
_LIT8( KNSmlDMVoIPPresenceSettingsId, "PresenceSettingsId" ); |
|
129 |
_LIT8( KNSmlDMVoIPUsedNatProtocol, "UsedNATProtocol" ); |
|
130 |
_LIT8( KNSmlDMVoIPAutoEnable, "AutoEnable" ); |
|
131 |
_LIT8( KNSmlDMVoIPSnapProfileId, "SNAPProfileId" ); |
|
132 |
_LIT8( KNSmlDMVoIPEnableIm, "EnableIM" ); |
|
133 |
||
134 |
// VoIP/x/VoiceMailBox |
|
135 |
_LIT8( KNSmlDMVoIPVmbxNode, "VoiceMailBox" ); |
|
136 |
_LIT8( KNSmlDMVoIPMwiUri, "MWI-URI" ); |
|
137 |
_LIT8( KNSmlDMVoIPListeningUri, "ListeningURI" ); |
|
138 |
_LIT8( KNSmlDMVoIPUsedIAPId, "UsedIAPId" ); |
|
139 |
_LIT8( KNSmlDMVoIPReSubscribeInterval, "ReSubscribeInterval" ); |
|
140 |
_LIT8( KNSmlDMVoIPUsedSIPProfileId, "UsedSIPProfileId" ); |
|
141 |
||
142 |
// Explanations of parameters |
|
143 |
_LIT8( KNSmlDMVoIPNodeNameExp, "The interior object holds all VoIP objects" ); |
|
144 |
_LIT8( KNSmlDMVoIPDynamicNodeExp, "Placeholder for settings ID's" ); |
|
145 |
_LIT8( KNSmlDMVoIPSetIDExp, "Settings ID number" ); |
|
146 |
_LIT8( KNSmlDMVoIPProvIDExp, "Provider ID" ); |
|
147 |
_LIT8( KNSmlDMVoIPNameExp, "Name of the settings" ); |
|
148 |
||
149 |
// CodecSettings |
|
150 |
_LIT8( KNSmlDMVoIPCodecOrderExp, "Codec order" ); |
|
151 |
_LIT8( KNSmlDMVoIPCodecSettingsNodeExp, "CodecSettings" ); |
|
152 |
_LIT8( KNSmlDMVoIPCodecSettingsIdExp, "CodecSettingsID" ); |
|
153 |
_LIT8( KNSmlDMVoIPMediaTypeNameExp, "MediaTypeName" ); |
|
154 |
_LIT8( KNSmlDMVoIPMediaSubTypeNameExp, "MediaSubTypeName" ); |
|
155 |
_LIT8( KNSmlDMVoIPJitterBufferSizeExp, "JitterBufferSize" ); |
|
156 |
_LIT8( KNSmlDMVoIPOctetAlignExp, "OctetAlign" ); |
|
157 |
_LIT8( KNSmlDMVoIPModeSetNodeExp, "ModeSet" ); |
|
158 |
_LIT8( KNSmlDMVoIPModeSetIdExp, "Mode Id" ); |
|
159 |
_LIT8( KNSmlDMVoIPModeChangePeriodExp, "ModeChangePeriod" ); |
|
160 |
_LIT8( KNSmlDMVoIPModeChangeNeighborExp, "ModeChangeNeighbor" ); |
|
161 |
_LIT8( KNSmlDMVoIPPtimeExp, "Ptime" ); |
|
162 |
_LIT8( KNSmlDMVoIPMaxPtimeExp, "MaxPtime" ); |
|
163 |
_LIT8( KNSmlDMVoIPVADExp, "Voice activation detection" ); |
|
164 |
_LIT8( KNSmlDMVoIPAnnexBExp, "AnnexB" ); |
|
165 |
_LIT8( KNSmlDMVoIPMaxRedExp, "Max-red" ); |
|
166 |
||
167 |
// VoIP/x/ |
|
168 |
_LIT8( KNSmlDMVoIPSMPortExp, "Start media port" ); |
|
169 |
_LIT8( KNSmlDMVoIPEMPortExp, "End media port" ); |
|
170 |
_LIT8( KNSmlDMVoIPMediaQosExp, "Media QOS" ); |
|
171 |
_LIT8( KNSmlDMVoIPDTMFIBExp, "DTMF in-band" ); |
|
172 |
_LIT8( KNSmlDMVoIPDTMFOBExp, "DTMF out-band" ); |
|
173 |
_LIT8( KNSmlDMVoIPSecureCallPrefExp, "Secure call preference"); |
|
174 |
_LIT8( KNSmlDMVoIPRTCPExp, "Real-Time Control Protocol reporting" ); |
|
175 |
_LIT8( KNSmlDMVoIPUAHTerminalTypeExp, "SIP VoIP User Agent header: terminal type display" ); |
|
176 |
_LIT8( KNSmlDMVoIPUAHWLANMACExp, "SIP VoIP User Agent header: WLAN MAC address display " ); |
|
177 |
_LIT8( KNSmlDMVoIPUAHStringExp, "SIP VoIP User Agent header: free string" ); |
|
178 |
_LIT8( KNSmlDMVoIPProfileLockedToIAPExp, "Profile locked to IAP" ); |
|
179 |
_LIT8( KNSmlDMVoIPPluginUIDExp, "VoIP plugin UID" ); |
|
180 |
_LIT8( KNSmlDMVoIPAllowVoIPOverWCDMAExp, "Allow VoIP over WCDMA" ); |
|
181 |
_LIT8( KNSmlDMVoIPVoIPDigitsExp, "Number of meaningful VoIP digits" ); |
|
182 |
_LIT8( KNSmlDMVoIPURIDomainIgnoreRuleExp, "Domain part of URI ignore rule" ); |
|
183 |
_LIT8( KNSmlDMVoIPAutoAcceptBuddyRequestExp, "Auto-accept buddy request" ); |
|
184 |
_LIT8( KNSmlDMVoIPUsedVoIPReleaseExp, "Used VoIP release" ); |
|
185 |
_LIT8( KNSmlDMVoIPAddUserPhoneExp, "Add user=phone to all numbers" ); |
|
186 |
_LIT8( KNSmlDMVoIPProviderBookmarkUriExp, "Provider bookmark URI" ); |
|
187 |
_LIT8( KNSmlDMVoIPSIPConnTestUriExp, "SIP connectivity test URI" ); |
|
188 |
_LIT8( KNSmlDMVoIPNatFwProfileIdExp, "NATFW profile ID" ); |
|
189 |
_LIT8( KNSmlDMVoIPMinSessionIntervalExp, "Minimum value for session interval" ); |
|
190 |
_LIT8( KNSmlDMVoIPSessionExpiresExp, "Session interval for SIP session" ); |
|
191 |
_LIT8( KNSmlDMVoIPBrandingDataUriExp, "Brading data URI" ); |
|
192 |
_LIT8( KNSmlDMVoIPPresenceSettingsIdExp, "Presence settings ID" ); |
|
193 |
_LIT8( KNSmlDMVoIPUsedNatProtocolExp, "Used NAT Protocol" ); |
|
194 |
_LIT8( KNSmlDMVoIPAutoEnableExp, "Auto enable the service" ); |
|
195 |
_LIT8( KNSmlDMVoIPSnapProfileIdExp, "SNAP profile ID" ); |
|
196 |
_LIT8( KNSmlDMVoIPEnableImExp, "Enable IM" ); |
|
197 |
||
198 |
// VoIP/x/VoiceMailBox |
|
199 |
_LIT8( KNSmlDMVoIPVmbxNodeExp, "VoiceMailBox node" ); |
|
200 |
_LIT8( KNSmlDMVoIPMwiUriExp, "MWI-URI" ); |
|
201 |
_LIT8( KNSmlDMVoIPListeningUriExp, "Listening-URI" ); |
|
202 |
_LIT8( KNSmlDMVoIPUsedIAPIdExp, "Used IAP ID" ); |
|
203 |
_LIT8( KNSmlDMVoIPReSubscribeIntervalExp, "Re-rubscribe interval" ); |
|
204 |
_LIT8( KNSmlDMVoIPUsedSIPProfileIdExp, "Used SIP profile ID" ); |
|
205 |
||
206 |
// VoIP/x/SettingIds node |
|
207 |
_LIT8( KNSmlDMVoIPProfileTypeExp, "ProfileType" ); |
|
208 |
_LIT8( KNSmlDMVoIPProfileIdExp, "ProfileId" ); |
|
209 |
_LIT8( KNSmlDMVoIPProfileSpecificExp, "ProfileSpecificId" ); |
|
210 |
||
211 |
// Other |
|
212 |
_LIT8( KNSmlDMVoIPValueTrue, "True" ); |
|
213 |
_LIT8( KNSmlDMVoIPValueFalse, "False" ); |
|
214 |
_LIT8( KNSmlDMVoIPValueNotSet, "NotSet" ); |
|
215 |
_LIT8( KNSmlDefDMSIP, "SIP" ); |
|
216 |
_LIT8( KNSmlDefDMSCCP, "SCCP/SCCPAcc" ); |
|
217 |
_LIT8( KNSmlDMVoIPTextPlain, "text/plain" ); |
|
218 |
_LIT8( KNSmlDMVoIPSeparator, "/" ); |
|
219 |
_LIT8( KNSmlVoIPUriDotSlash, "./"); |
|
220 |
_LIT( KOpenParenthesis, "(" ); |
|
221 |
_LIT( KClosedParenthesis, ")" ); |
|
222 |
_LIT8( KDefaultSettingsName, "DMAdapterIns" ); |
|
223 |
_LIT8( KNSmlDMSIPSipID, "SIPId" ); |
|
224 |
_LIT8( KNSmlDMSCCPSccpID, "SCCPId" ); |
|
225 |
_LIT8( KNSmlDMNATFWDomain, "NATFW/DomainSpecific" ); |
|
226 |
_LIT8( KNSmlDMPresence, "OMA_PRESENCE" ); |
|
227 |
_LIT8( KNSmlDMSnapUriPrefix, "BearerManagementSNAP" ); |
|
228 |
const TInt KSixSegs = 6; |
|
229 |
const TInt KFiveSegs = 5; |
|
230 |
const TInt KFourSegs = 4; |
|
231 |
const TInt KThreeSegs = 3; |
|
232 |
const TInt KTwoSegs = 2; |
|
233 |
||
234 |
const TUint8 KDMVoIPSeparator = '/'; |
|
235 |
||
236 |
// VoiceMailBox related constants. |
|
237 |
const TInt KDefaultReSubscribe = 600; |
|
238 |
// IM related constants. |
|
239 |
const TUint32 KIMSubServicePluginId = 0x1027545A; // KSIPConnectivityPluginImplUid |
|
240 |
const TUint32 KIMLaunchUid = 0x200255D0; |
|
241 |
const TInt KIMSettingsId = 1; |
|
242 |
// Default IM message tone |
|
243 |
_LIT( KDefaultTone, "Message 2.aac" ); |
|
244 |
||
245 |
// Bearer related constants |
|
246 |
const TUint32 KBearerNotSpecified = 0; |
|
247 |
const TUint32 KBearerWlanOnly = 1; |
|
248 |
const TUint32 KBearerCellularOnly = 2; |
|
249 |
||
250 |
// --------------------------------------------------------------------------- |
|
251 |
// CNSmlDmVoIPAdapter::ConstructL |
|
252 |
// Symbian 2nd phase constructor can leave. |
|
253 |
// --------------------------------------------------------------------------- |
|
254 |
// |
|
255 |
void CNSmlDmVoIPAdapter::ConstructL() |
|
256 |
{ |
|
257 |
DBG_PRINT( "CNSmlDmVoIPAdapter::ConstructL(): begin" ); |
|
258 |
// Check VoIP support from feature manager |
|
259 |
FeatureManager::InitializeLibL(); |
|
260 |
TBool support = FeatureManager::FeatureSupported( KFeatureIdCommonVoip ); |
|
261 |
FeatureManager::UnInitializeLib(); |
|
262 |
||
263 |
if ( !support ) |
|
264 |
{ |
|
265 |
DBG_PRINT( "CNSmlDmVoIPAdapter::ConstructL(): no support" ); |
|
266 |
User::Leave( KErrNotSupported ); |
|
267 |
} |
|
268 |
DBG_PRINT( "CNSmlDmVoIPAdapter::ConstructL(): end" ); |
|
269 |
} |
|
270 |
||
271 |
// --------------------------------------------------------------------------- |
|
272 |
// CNSmlDmVoIPAdapter* CNSmlDmVoIPAdapter::NewL |
|
273 |
// Two-phased constructor. |
|
274 |
// --------------------------------------------------------------------------- |
|
275 |
// |
|
276 |
CNSmlDmVoIPAdapter* CNSmlDmVoIPAdapter::NewL( |
|
277 |
MSmlDmCallback* aDmCallback ) |
|
278 |
{ |
|
279 |
DBG_PRINT("CNSmlDmVoIPAdapter::NewL(): begin"); |
|
280 |
CNSmlDmVoIPAdapter* self = new (ELeave) CNSmlDmVoIPAdapter( aDmCallback ); |
|
281 |
self->ConstructL(); |
|
282 |
self->iDmCallback = aDmCallback; |
|
283 |
DBG_PRINT("CNSmlDmVoIPAdapter::NewL(): end"); |
|
284 |
return self; |
|
285 |
} |
|
286 |
||
287 |
// --------------------------------------------------------------------------- |
|
288 |
// CNSmlDmVoIPAdapter::~CNSmlDmVoIPAdapter |
|
289 |
// --------------------------------------------------------------------------- |
|
290 |
// |
|
291 |
CNSmlDmVoIPAdapter::~CNSmlDmVoIPAdapter() |
|
292 |
{ |
|
293 |
DBG_PRINT("CNSmlDmVoIPAdapter::~CNSmlDmVoIPAdapter(): begin"); |
|
294 |
||
295 |
iCodecEntries.ResetAndDestroy(); |
|
296 |
iCodecEntries.Close(); |
|
297 |
||
298 |
iProfileEntries.ResetAndDestroy(); |
|
299 |
iProfileEntries.Close(); |
|
300 |
||
301 |
if ( iCRCSEAudioCodec ) |
|
302 |
{ |
|
303 |
delete iCRCSEAudioCodec; |
|
304 |
} |
|
305 |
||
306 |
if ( iCRCSEProfile ) |
|
307 |
{ |
|
308 |
delete iCRCSEProfile; |
|
309 |
} |
|
310 |
delete iTempProfileIdObject; |
|
311 |
iProfileModifs.Close(); |
|
312 |
iCodecModifs.Close(); |
|
313 |
||
314 |
iSPSettings.ResetAndDestroy(); |
|
315 |
iSPSettings.Close(); |
|
316 |
||
317 |
DBG_PRINT("CNSmlDmVoIPAdapter::~CNSmlDmVoIPAdapter(): end"); |
|
318 |
} |
|
319 |
||
320 |
// --------------------------------------------------------------------------- |
|
321 |
// CNSmlDmVoIPAdapter::LoadProfilesL |
|
322 |
// --------------------------------------------------------------------------- |
|
323 |
// |
|
324 |
void CNSmlDmVoIPAdapter::LoadProfilesL() |
|
325 |
{ |
|
326 |
DBG_PRINT("CNSmlDmVoIPAdapter::LoadProfilesL(): begin"); |
|
327 |
||
328 |
if ( !iCRCSEProfile ) |
|
329 |
{ |
|
330 |
iCRCSEProfile = CRCSEProfileRegistry::NewL(); |
|
331 |
} |
|
332 |
||
333 |
if ( !iCRCSEAudioCodec ) |
|
334 |
{ |
|
335 |
iCRCSEAudioCodec = CRCSEAudioCodecRegistry::NewL(); |
|
336 |
} |
|
337 |
||
338 |
// Load profiles to pointerarray |
|
339 |
RArray<TUint32> allIds; |
|
340 |
iCRCSEProfile->GetAllIdsL( allIds ); |
|
341 |
TInt idCount = allIds.Count(); |
|
342 |
for ( TInt counter = 0; counter < idCount; counter++ ) |
|
343 |
{ |
|
344 |
CRCSEProfileEntry* profile = CRCSEProfileEntry::NewLC(); |
|
345 |
iCRCSEProfile->FindL( allIds[counter], *profile ); |
|
346 |
// Ownership change to iProfileEntries: |
|
347 |
iProfileEntries.AppendL( profile ); |
|
348 |
CleanupStack::Pop( profile ); |
|
349 |
} |
|
350 |
||
351 |
allIds.Reset(); |
|
352 |
||
353 |
// Load audio codecs information to pointerarray |
|
354 |
iCRCSEAudioCodec->GetAllCodecIdsL( allIds ); |
|
355 |
idCount = allIds.Count(); |
|
356 |
for ( TInt counter = 0; counter < idCount; counter++ ) |
|
357 |
{ |
|
358 |
CRCSEAudioCodecEntry* codec = CRCSEAudioCodecEntry::NewLC(); |
|
359 |
iCRCSEAudioCodec->FindL( allIds[counter], *codec ); |
|
360 |
// Ownership change to iCodecEntries: |
|
361 |
iCodecEntries.AppendL( codec ); |
|
362 |
CleanupStack::Pop( codec ); |
|
363 |
} |
|
364 |
allIds.Close(); |
|
365 |
DBG_PRINT("CNSmlDmVoIPAdapter::LoadProfilesL(): end"); |
|
366 |
} |
|
367 |
||
368 |
// --------------------------------------------------------------------------- |
|
369 |
// CNSmlDmVoIPAdapter::CNSmlDmVoIPAdapter |
|
370 |
// C++ default constructor can NOT contain any code, that |
|
371 |
// might leave. |
|
372 |
// --------------------------------------------------------------------------- |
|
373 |
// |
|
374 |
CNSmlDmVoIPAdapter::CNSmlDmVoIPAdapter( TAny* aEcomArguments ): |
|
375 |
CSmlDmAdapter( aEcomArguments ) |
|
376 |
{ |
|
377 |
DBG_PRINT("CNSmlDmVoIPAdapter::CNSmlDmVoIPAdapter(aEcomArguments): begin"); |
|
378 |
DBG_PRINT("CNSmlDmVoIPAdapter::CNSmlDmVoIPAdapter(aEcomArguments): end"); |
|
379 |
} |
|
380 |
||
381 |
// --------------------------------------------------------------------------- |
|
382 |
// CNSmlDmVoIPAdapter::DDFVersionL |
|
383 |
// Inserts DDF version of the adapter to aDDFVersion |
|
384 |
// --------------------------------------------------------------------------- |
|
385 |
// |
|
386 |
void CNSmlDmVoIPAdapter::DDFVersionL( CBufBase& aDDFVersion ) |
|
387 |
{ |
|
388 |
DBG_PRINT("CNSmlDmVoIPAdapter::DDFVersionL(TDes& aDDFVersion): begin"); |
|
389 |
aDDFVersion.InsertL( 0, KNSmlDMVoIPDDFVersion ); |
|
390 |
DBG_PRINT("CNSmlDmVoIPAdapter::DDFVersionL(TDes& aDDFVersion): end"); |
|
391 |
} |
|
392 |
||
393 |
// --------------------------------------------------------------------------- |
|
394 |
// CNSmlDmVoIPAdapter::DDFStructureL |
|
395 |
// Builds the DDF structure of adapter |
|
396 |
// --------------------------------------------------------------------------- |
|
397 |
// |
|
398 |
void CNSmlDmVoIPAdapter::DDFStructureL( MSmlDmDDFObject& aDDF ) |
|
399 |
{ |
|
400 |
DBG_PRINT("CNSmlDmVoIPAdapter::DDFStructureL(): begin"); |
|
401 |
||
402 |
TSmlDmAccessTypes accessTypesGet; |
|
403 |
accessTypesGet.SetGet(); |
|
404 |
||
405 |
TSmlDmAccessTypes accessTypesGetAdd; |
|
406 |
accessTypesGetAdd.SetGet(); |
|
407 |
accessTypesGetAdd.SetAdd(); |
|
408 |
||
409 |
TSmlDmAccessTypes accessTypesGetReplaceAdd; |
|
410 |
accessTypesGetReplaceAdd.SetGet(); |
|
411 |
accessTypesGetReplaceAdd.SetReplace(); |
|
412 |
accessTypesGetReplaceAdd.SetAdd(); |
|
413 |
||
414 |
TSmlDmAccessTypes accessTypesAll; |
|
415 |
accessTypesAll.SetGet(); |
|
416 |
accessTypesAll.SetDelete(); |
|
417 |
accessTypesAll.SetAdd(); |
|
418 |
accessTypesAll.SetReplace(); |
|
419 |
||
420 |
// VoIP |
|
421 |
MSmlDmDDFObject& voip = aDDF.AddChildObjectL( KNSmlDMVoIPNodeName ); |
|
422 |
voip.SetAccessTypesL( accessTypesGetAdd ); |
|
423 |
voip.SetOccurenceL( MSmlDmDDFObject::EOne ); |
|
424 |
voip.SetScopeL( MSmlDmDDFObject::EPermanent ); |
|
425 |
voip.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
426 |
voip.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
427 |
voip.SetDescriptionL( KNSmlDMVoIPNodeNameExp ); |
|
428 |
||
429 |
// dynamic settings ID node |
|
430 |
MSmlDmDDFObject& idNode = voip.AddChildObjectGroupL(); |
|
431 |
idNode.SetAccessTypesL( accessTypesAll ); |
|
432 |
idNode.SetOccurenceL( MSmlDmDDFObject::EZeroOrMore ); |
|
433 |
idNode.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
434 |
idNode.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
435 |
idNode.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
436 |
idNode.SetDescriptionL( KNSmlDMVoIPDynamicNode ); |
|
437 |
||
438 |
// VoIPId |
|
439 |
MSmlDmDDFObject& setID = idNode.AddChildObjectL( |
|
440 |
KNSmlDMVoIPSetID ); |
|
441 |
setID.SetAccessTypesL( accessTypesGet ); |
|
442 |
setID.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
443 |
setID.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
444 |
setID.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
445 |
setID.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
446 |
setID.SetDescriptionL( KNSmlDMVoIPSetIDExp ); |
|
447 |
||
448 |
// ProviderName |
|
449 |
MSmlDmDDFObject& provID = idNode.AddChildObjectL( |
|
450 |
KNSmlDMVoIPProvID ); |
|
451 |
provID.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
452 |
provID.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
453 |
provID.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
454 |
provID.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
455 |
provID.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
456 |
provID.SetDescriptionL( KNSmlDMVoIPProvIDExp ); |
|
457 |
||
458 |
// SettingsName |
|
459 |
MSmlDmDDFObject& name = idNode.AddChildObjectL( |
|
460 |
KNSmlDMVoIPName ); |
|
461 |
name.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
462 |
name.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
463 |
name.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
464 |
name.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
465 |
name.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
466 |
name.SetDescriptionL( KNSmlDMVoIPNameExp ); |
|
467 |
||
468 |
// PreferredCodecs node |
|
469 |
MSmlDmDDFObject& codecOrder = idNode.AddChildObjectL( |
|
470 |
KNSmlDMVoIPPreferredCodecsNode ); |
|
471 |
codecOrder.SetAccessTypesL( accessTypesGet ); |
|
472 |
codecOrder.SetOccurenceL( MSmlDmDDFObject::EOne ); |
|
473 |
codecOrder.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
474 |
codecOrder.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
475 |
codecOrder.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
476 |
codecOrder.SetDescriptionL( KNSmlDMVoIPCodecOrderExp ); |
|
477 |
||
478 |
// PreferredCodecs dynamic |
|
479 |
MSmlDmDDFObject& codecDyn = codecOrder.AddChildObjectGroupL(); |
|
480 |
codecDyn.SetAccessTypesL( accessTypesGet ); |
|
481 |
codecDyn.SetOccurenceL( MSmlDmDDFObject::EZeroOrMore ); |
|
482 |
codecDyn.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
483 |
codecDyn.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
484 |
codecDyn.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
485 |
codecDyn.SetDescriptionL( KNSmlDMVoIPCodecOrderExp ); |
|
486 |
||
487 |
// PreferredCodecs/PreferredCodecId |
|
488 |
MSmlDmDDFObject& preferredCodecID = codecDyn.AddChildObjectL( |
|
489 |
KNSmlDMVoIPPreferredCodecId ); |
|
490 |
preferredCodecID.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
491 |
preferredCodecID.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
492 |
preferredCodecID.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
493 |
preferredCodecID.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
494 |
preferredCodecID.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
495 |
preferredCodecID.SetDescriptionL( KNSmlDMVoIPCodecSettingsIdExp ); |
|
496 |
||
497 |
// CodecSettings node |
|
498 |
MSmlDmDDFObject& codecNode = idNode.AddChildObjectL( |
|
499 |
KNSmlDMVoIPCodecSettingsNode ); |
|
500 |
codecNode.SetAccessTypesL( accessTypesGetAdd ); |
|
501 |
codecNode.SetOccurenceL( MSmlDmDDFObject::EOne ); |
|
502 |
codecNode.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
503 |
codecNode.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
504 |
codecNode.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
505 |
codecNode.SetDescriptionL( KNSmlDMVoIPCodecSettingsNodeExp ); |
|
506 |
||
507 |
// CodecSettings dynamic |
|
508 |
MSmlDmDDFObject& codecSetDyn = codecNode.AddChildObjectGroupL(); |
|
509 |
codecSetDyn.SetAccessTypesL( accessTypesAll ); |
|
510 |
codecSetDyn.SetOccurenceL( MSmlDmDDFObject::EZeroOrMore ); |
|
511 |
codecSetDyn.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
512 |
codecSetDyn.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
513 |
codecSetDyn.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
514 |
codecSetDyn.SetDescriptionL( KNSmlDMVoIPDynamicNodeExp ); |
|
515 |
||
516 |
// CodecSettings/VoIPCodecId |
|
517 |
MSmlDmDDFObject& codecsetID = codecSetDyn.AddChildObjectL( |
|
518 |
KNSmlDMVoIPCodecId ); |
|
519 |
codecsetID.SetAccessTypesL( accessTypesGet ); |
|
520 |
codecsetID.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
521 |
codecsetID.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
522 |
codecsetID.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
523 |
codecsetID.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
524 |
codecsetID.SetDescriptionL( KNSmlDMVoIPCodecSettingsIdExp ); |
|
525 |
||
526 |
// CodecSettings/MediaTypeName |
|
527 |
MSmlDmDDFObject& mediaTypeName = codecSetDyn.AddChildObjectL( |
|
528 |
KNSmlDMVoIPMediaTypeName ); |
|
529 |
mediaTypeName.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
530 |
mediaTypeName.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
531 |
mediaTypeName.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
532 |
mediaTypeName.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
533 |
mediaTypeName.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
534 |
mediaTypeName.SetDescriptionL( KNSmlDMVoIPMediaTypeNameExp ); |
|
535 |
||
536 |
// CodecSettings/MediaSubTypeName |
|
537 |
MSmlDmDDFObject& mediaSubTypeName = codecSetDyn.AddChildObjectL( |
|
538 |
KNSmlDMVoIPMediaSubTypeName ); |
|
539 |
mediaSubTypeName.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
540 |
mediaSubTypeName.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
541 |
mediaSubTypeName.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
542 |
mediaSubTypeName.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
543 |
mediaSubTypeName.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
544 |
mediaSubTypeName.SetDescriptionL( KNSmlDMVoIPMediaSubTypeNameExp ); |
|
545 |
||
546 |
// CodecSettings/JitterBufferSize |
|
547 |
MSmlDmDDFObject& jitterBufferSize = codecSetDyn.AddChildObjectL( |
|
548 |
KNSmlDMVoIPJitterBufferSize ); |
|
549 |
jitterBufferSize.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
550 |
jitterBufferSize.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
551 |
jitterBufferSize.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
552 |
jitterBufferSize.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
553 |
jitterBufferSize.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
554 |
jitterBufferSize.SetDescriptionL( KNSmlDMVoIPJitterBufferSizeExp ); |
|
555 |
||
556 |
// CodecSettings/OctetAlign |
|
557 |
MSmlDmDDFObject& octetAlign = codecSetDyn.AddChildObjectL( |
|
558 |
KNSmlDMVoIPOctetAlign ); |
|
559 |
octetAlign.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
560 |
octetAlign.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
561 |
octetAlign.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
562 |
octetAlign.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
563 |
octetAlign.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
564 |
octetAlign.SetDescriptionL( KNSmlDMVoIPOctetAlignExp ); |
|
565 |
||
566 |
// CodecSettings/ModeSet node |
|
567 |
MSmlDmDDFObject& modeSetNode = codecSetDyn.AddChildObjectL( |
|
568 |
KNSmlDMVoIPModeSetNode ); |
|
569 |
modeSetNode.SetAccessTypesL( accessTypesGetAdd ); |
|
570 |
modeSetNode.SetOccurenceL( MSmlDmDDFObject::EOne ); |
|
571 |
modeSetNode.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
572 |
modeSetNode.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
573 |
modeSetNode.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
574 |
modeSetNode.SetDescriptionL( KNSmlDMVoIPModeSetNodeExp ); |
|
575 |
||
576 |
// ModeSet dynamic |
|
577 |
MSmlDmDDFObject& modeSetDyn = modeSetNode.AddChildObjectGroupL(); |
|
578 |
modeSetDyn.SetAccessTypesL( accessTypesAll ); |
|
579 |
modeSetDyn.SetOccurenceL( MSmlDmDDFObject::EZeroOrMore ); |
|
580 |
modeSetDyn.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
581 |
modeSetDyn.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
582 |
modeSetDyn.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
583 |
modeSetDyn.SetDescriptionL( KNSmlDMVoIPModeSetIdExp ); |
|
584 |
||
585 |
// ModeSet/x/Mode |
|
586 |
MSmlDmDDFObject& modeSetId = modeSetDyn.AddChildObjectL( |
|
587 |
KNSmlDMVoIPMode ); |
|
588 |
modeSetId.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
589 |
modeSetId.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
590 |
modeSetId.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
591 |
modeSetId.SetDFFormatL( MSmlDmDDFObject::EInt ); // int |
|
592 |
modeSetId.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
593 |
modeSetId.SetDescriptionL( KNSmlDMVoIPModeChangePeriodExp ); |
|
594 |
||
595 |
// CodecSettings/ModeChangePeriod |
|
596 |
MSmlDmDDFObject& modeChangePer = codecSetDyn.AddChildObjectL( |
|
597 |
KNSmlDMVoIPModeChangePeriod ); |
|
598 |
modeChangePer.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
599 |
modeChangePer.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
600 |
modeChangePer.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
601 |
modeChangePer.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
602 |
modeChangePer.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
603 |
modeChangePer.SetDescriptionL( KNSmlDMVoIPModeChangePeriodExp ); |
|
604 |
||
605 |
// CodecSettings/ModeChangeNeighbor |
|
606 |
MSmlDmDDFObject& modeChange = codecSetDyn.AddChildObjectL( |
|
607 |
KNSmlDMVoIPModeChangeNeighbor ); |
|
608 |
modeChange.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
609 |
modeChange.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
610 |
modeChange.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
611 |
modeChange.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
612 |
modeChange.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
613 |
modeChange.SetDescriptionL( KNSmlDMVoIPModeChangeNeighborExp ); |
|
614 |
||
615 |
// CodecSettings/Ptime |
|
616 |
MSmlDmDDFObject& ptime = codecSetDyn.AddChildObjectL( |
|
617 |
KNSmlDMVoIPPtime ); |
|
618 |
ptime.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
619 |
ptime.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
620 |
ptime.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
621 |
ptime.SetDFFormatL( MSmlDmDDFObject::EInt ); // int |
|
622 |
ptime.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
623 |
ptime.SetDescriptionL( KNSmlDMVoIPPtimeExp ); |
|
624 |
||
625 |
// CodecSettings/MaxPtime |
|
626 |
MSmlDmDDFObject& maxptime = codecSetDyn.AddChildObjectL( |
|
627 |
KNSmlDMVoIPMaxPtime ); |
|
628 |
maxptime.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
629 |
maxptime.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
630 |
maxptime.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
631 |
maxptime.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
632 |
maxptime.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
633 |
maxptime.SetDescriptionL( KNSmlDMVoIPMaxPtimeExp ); |
|
634 |
||
635 |
// CodecSettings/VAD |
|
636 |
MSmlDmDDFObject& vad = codecSetDyn.AddChildObjectL( |
|
637 |
KNSmlDMVoIPVAD ); |
|
638 |
vad.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
639 |
vad.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
640 |
vad.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
641 |
vad.SetDFFormatL( MSmlDmDDFObject::EBool ); // bool |
|
642 |
vad.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
643 |
vad.SetDescriptionL( KNSmlDMVoIPVADExp ); |
|
644 |
||
645 |
// CodecSettings/AnnexB |
|
646 |
MSmlDmDDFObject& annexB = codecSetDyn.AddChildObjectL( |
|
647 |
KNSmlDMVoIPAnnexB ); |
|
648 |
annexB.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
649 |
annexB.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
650 |
annexB.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
651 |
annexB.SetDFFormatL( MSmlDmDDFObject::EBool ); // bool |
|
652 |
annexB.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
653 |
annexB.SetDescriptionL( KNSmlDMVoIPAnnexBExp ); |
|
654 |
||
655 |
// CodecSettings/MaxRed |
|
656 |
MSmlDmDDFObject& maxRed = codecSetDyn.AddChildObjectL( |
|
657 |
KNSmlDMVoIPMaxRed ); |
|
658 |
maxRed.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
659 |
maxRed.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
660 |
maxRed.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
661 |
maxRed.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
662 |
maxRed.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
663 |
maxRed.SetDescriptionL( KNSmlDMVoIPMaxRedExp ); |
|
664 |
||
665 |
// SettingsIds node |
|
666 |
MSmlDmDDFObject& settingIds = idNode.AddChildObjectL( |
|
667 |
KNSmlDMVoIPSettingIdsNode ); |
|
668 |
settingIds.SetAccessTypesL( accessTypesGetAdd ); |
|
669 |
settingIds.SetOccurenceL( MSmlDmDDFObject::EOne ); |
|
670 |
settingIds.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
671 |
settingIds.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
672 |
settingIds.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
673 |
settingIds.SetDescriptionL( KNSmlDMVoIPDynamicNode ); |
|
674 |
||
675 |
// settingsIds dynamic |
|
676 |
MSmlDmDDFObject& settingIdsDynID = settingIds.AddChildObjectGroupL(); |
|
677 |
settingIdsDynID.SetAccessTypesL( accessTypesAll ); |
|
678 |
settingIdsDynID.SetOccurenceL( MSmlDmDDFObject::EZeroOrMore ); |
|
679 |
settingIdsDynID.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
680 |
settingIdsDynID.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
681 |
settingIdsDynID.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
682 |
settingIdsDynID.SetDescriptionL( KNSmlDMVoIPDynamicNodeExp ); |
|
683 |
||
684 |
// SettingIds/ProfileType |
|
685 |
MSmlDmDDFObject& profileType = settingIdsDynID.AddChildObjectL( |
|
686 |
KNSmlDMVoIPProfileType ); |
|
687 |
profileType.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
688 |
profileType.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
689 |
profileType.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
690 |
profileType.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
691 |
profileType.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
692 |
profileType.SetDescriptionL( KNSmlDMVoIPProfileTypeExp ); |
|
693 |
||
694 |
// SettingIds/ProfileId |
|
695 |
MSmlDmDDFObject& profileId = settingIdsDynID.AddChildObjectL( |
|
696 |
KNSmlDMVoIPProfileId ); |
|
697 |
profileId.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
698 |
profileId.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
699 |
profileId.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
700 |
profileId.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
701 |
profileId.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
702 |
profileId.SetDescriptionL( KNSmlDMVoIPProfileIdExp ); |
|
703 |
||
704 |
// SettingIds/ProfileSpecificId |
|
705 |
MSmlDmDDFObject& profileSpecific = settingIdsDynID.AddChildObjectL( |
|
706 |
KNSmlDMVoIPProfileSpecificId ); |
|
707 |
profileSpecific.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
708 |
profileSpecific.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
709 |
profileSpecific.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
710 |
profileSpecific.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
711 |
profileSpecific.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
712 |
profileSpecific.SetDescriptionL( KNSmlDMVoIPProfileSpecificExp ); |
|
713 |
||
714 |
// VoIP/<x>/VoiceMailBox |
|
715 |
MSmlDmDDFObject& vmbx = idNode.AddChildObjectL( |
|
716 |
KNSmlDMVoIPVmbxNode ); |
|
717 |
vmbx.SetAccessTypesL( accessTypesGetAdd ); |
|
718 |
vmbx.SetOccurenceL( MSmlDmDDFObject::EOne ); |
|
719 |
vmbx.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
720 |
vmbx.SetDFFormatL( MSmlDmDDFObject::ENode ); |
|
721 |
vmbx.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
722 |
vmbx.SetDescriptionL( KNSmlDMVoIPVmbxNodeExp ); |
|
723 |
||
724 |
// VoIP/<x>/VoiceMailBox/MWI-URI |
|
725 |
MSmlDmDDFObject& mwiUri = vmbx.AddChildObjectL( |
|
726 |
KNSmlDMVoIPMwiUri ); |
|
727 |
mwiUri.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
728 |
mwiUri.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
729 |
mwiUri.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
730 |
mwiUri.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
731 |
mwiUri.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
732 |
mwiUri.SetDescriptionL( KNSmlDMVoIPMwiUriExp ); |
|
733 |
||
734 |
// VoIP/<x>/VoiceMailBox/ListeningURI |
|
735 |
MSmlDmDDFObject& listenUri = vmbx.AddChildObjectL( |
|
736 |
KNSmlDMVoIPListeningUri ); |
|
737 |
listenUri.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
738 |
listenUri.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
739 |
listenUri.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
740 |
listenUri.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
741 |
listenUri.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
742 |
listenUri.SetDescriptionL( KNSmlDMVoIPListeningUriExp ); |
|
743 |
||
744 |
// VoIP/<x>/VoiceMailBox/UsedIAPId |
|
745 |
MSmlDmDDFObject& usedIapId = vmbx.AddChildObjectL( |
|
746 |
KNSmlDMVoIPUsedIAPId ); |
|
747 |
usedIapId.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
748 |
usedIapId.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
749 |
usedIapId.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
750 |
usedIapId.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
751 |
usedIapId.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
752 |
usedIapId.SetDescriptionL( KNSmlDMVoIPUsedIAPIdExp ); |
|
753 |
||
754 |
// VoIP/<x>/VoiceMailBox/ReSubscribeInterval |
|
755 |
MSmlDmDDFObject& reSubscribe = vmbx.AddChildObjectL( |
|
756 |
KNSmlDMVoIPReSubscribeInterval ); |
|
757 |
reSubscribe.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
758 |
reSubscribe.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
759 |
reSubscribe.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
760 |
reSubscribe.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
761 |
reSubscribe.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
762 |
reSubscribe.SetDescriptionL( KNSmlDMVoIPReSubscribeIntervalExp ); |
|
763 |
||
764 |
// VoIP/<x>/VoiceMailBox/UsedSIPProfileId |
|
765 |
MSmlDmDDFObject& sipId = vmbx.AddChildObjectL( |
|
766 |
KNSmlDMVoIPUsedSIPProfileId ); |
|
767 |
sipId.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
768 |
sipId.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
769 |
sipId.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
770 |
sipId.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
771 |
sipId.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
772 |
sipId.SetDescriptionL( KNSmlDMVoIPUsedSIPProfileIdExp ); |
|
773 |
||
774 |
// StartMediaPort |
|
775 |
MSmlDmDDFObject& smport = idNode.AddChildObjectL( |
|
776 |
KNSmlDMVoIPSMPort ); |
|
777 |
smport.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
778 |
smport.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
779 |
smport.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
780 |
smport.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
781 |
smport.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
782 |
smport.SetDescriptionL( KNSmlDMVoIPSMPortExp ); |
|
783 |
||
784 |
// EndMediaPort |
|
785 |
MSmlDmDDFObject& emport = idNode.AddChildObjectL( |
|
786 |
KNSmlDMVoIPEMPort ); |
|
787 |
emport.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
788 |
emport.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
789 |
emport.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
790 |
emport.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
791 |
emport.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
792 |
emport.SetDescriptionL( KNSmlDMVoIPEMPortExp ); |
|
793 |
||
794 |
// MediaQos |
|
795 |
MSmlDmDDFObject& mediaQos = idNode.AddChildObjectL( |
|
796 |
KNSmlDMVoIPMediaQos ); |
|
797 |
mediaQos.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
798 |
mediaQos.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
799 |
mediaQos.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
800 |
mediaQos.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
801 |
mediaQos.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
802 |
mediaQos.SetDescriptionL( KNSmlDMVoIPMediaQosExp ); |
|
803 |
||
804 |
// DTMFIB |
|
805 |
MSmlDmDDFObject& dtmfbib = idNode.AddChildObjectL( |
|
806 |
KNSmlDMVoIPDTMFIB ); |
|
807 |
dtmfbib.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
808 |
dtmfbib.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
809 |
dtmfbib.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
810 |
dtmfbib.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
811 |
dtmfbib.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
812 |
dtmfbib.SetDescriptionL( KNSmlDMVoIPDTMFIBExp ); |
|
813 |
||
814 |
// DTMFOB |
|
815 |
MSmlDmDDFObject& dtmfob = idNode.AddChildObjectL( |
|
816 |
KNSmlDMVoIPDTMFOB ); |
|
817 |
dtmfob.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
818 |
dtmfob.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
819 |
dtmfob.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
820 |
dtmfob.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
821 |
dtmfob.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
822 |
dtmfob.SetDescriptionL( KNSmlDMVoIPDTMFOBExp ); |
|
823 |
||
824 |
// SecureCallPref |
|
825 |
MSmlDmDDFObject& secureCallPref = idNode.AddChildObjectL( |
|
826 |
KNSmlDMVoIPSecureCallPref ); |
|
827 |
secureCallPref.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
828 |
secureCallPref.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
829 |
secureCallPref.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
830 |
secureCallPref.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
831 |
secureCallPref.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
832 |
secureCallPref.SetDescriptionL( KNSmlDMVoIPSecureCallPrefExp ); |
|
833 |
||
834 |
// RTCP |
|
835 |
MSmlDmDDFObject& rtcp = idNode.AddChildObjectL( |
|
836 |
KNSmlDMVoIPRTCP ); |
|
837 |
rtcp.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
838 |
rtcp.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
839 |
rtcp.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
840 |
rtcp.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
841 |
rtcp.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
842 |
rtcp.SetDescriptionL( KNSmlDMVoIPRTCPExp ); |
|
843 |
||
844 |
// UAHTerminalType |
|
845 |
MSmlDmDDFObject& uahTerminalType = idNode.AddChildObjectL( |
|
846 |
KNSmlDMVoIPUAHTerminalType ); |
|
847 |
uahTerminalType.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
848 |
uahTerminalType.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
849 |
uahTerminalType.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
850 |
uahTerminalType.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
851 |
uahTerminalType.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
852 |
uahTerminalType.SetDescriptionL( KNSmlDMVoIPUAHTerminalTypeExp ); |
|
853 |
||
854 |
// UAHWLANMAC |
|
855 |
MSmlDmDDFObject& uahWLANMAC = idNode.AddChildObjectL( |
|
856 |
KNSmlDMVoIPUAHWLANMAC ); |
|
857 |
uahWLANMAC.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
858 |
uahWLANMAC.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
859 |
uahWLANMAC.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
860 |
uahWLANMAC.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
861 |
uahWLANMAC.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
862 |
uahWLANMAC.SetDescriptionL( KNSmlDMVoIPUAHWLANMACExp ); |
|
863 |
||
864 |
// UAHString |
|
865 |
MSmlDmDDFObject& uahString = idNode.AddChildObjectL( |
|
866 |
KNSmlDMVoIPUAHString ); |
|
867 |
uahString.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
868 |
uahString.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
869 |
uahString.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
870 |
uahString.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
871 |
uahString.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
872 |
uahString.SetDescriptionL( KNSmlDMVoIPUAHStringExp ); |
|
873 |
||
874 |
// ProfileLockedToIAP |
|
875 |
MSmlDmDDFObject& profileLockedToIAP = idNode.AddChildObjectL( |
|
876 |
KNSmlDMVoIPProfileLockedToIAP ); |
|
877 |
profileLockedToIAP.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
878 |
profileLockedToIAP.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
879 |
profileLockedToIAP.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
880 |
profileLockedToIAP.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
881 |
profileLockedToIAP.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
882 |
profileLockedToIAP.SetDescriptionL( KNSmlDMVoIPProfileLockedToIAPExp ); |
|
883 |
||
884 |
// VoIPPluginUID |
|
885 |
MSmlDmDDFObject& voipPluginUID = idNode.AddChildObjectL( |
|
886 |
KNSmlDMVoIPPluginUID ); |
|
887 |
voipPluginUID.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
888 |
voipPluginUID.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
889 |
voipPluginUID.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
890 |
voipPluginUID.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
891 |
voipPluginUID.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
892 |
voipPluginUID.SetDescriptionL( KNSmlDMVoIPPluginUIDExp ); |
|
893 |
||
894 |
// AllowVoIPOverWCDMA |
|
895 |
MSmlDmDDFObject& voipOverWCDMA = idNode.AddChildObjectL( |
|
896 |
KNSmlDMVoIPAllowVoIPOverWCDMA ); |
|
897 |
voipOverWCDMA.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
898 |
voipOverWCDMA.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
899 |
voipOverWCDMA.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
900 |
voipOverWCDMA.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
901 |
voipOverWCDMA.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
902 |
voipOverWCDMA.SetDescriptionL( KNSmlDMVoIPAllowVoIPOverWCDMAExp ); |
|
903 |
||
904 |
// VoIPDigits |
|
905 |
MSmlDmDDFObject& voipDigits = idNode.AddChildObjectL( |
|
906 |
KNSmlDMVoIPVoIPDigits ); |
|
907 |
voipDigits.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
908 |
voipDigits.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
909 |
voipDigits.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
910 |
voipDigits.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
911 |
voipDigits.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
912 |
voipDigits.SetDescriptionL( KNSmlDMVoIPVoIPDigitsExp ); |
|
913 |
||
914 |
// URIDomainIgnoreRule |
|
915 |
MSmlDmDDFObject& uriDomainIgn = idNode.AddChildObjectL( |
|
916 |
KNSmlDMVoIPURIDomainIgnoreRule ); |
|
917 |
uriDomainIgn.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
918 |
uriDomainIgn.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
919 |
uriDomainIgn.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
920 |
uriDomainIgn.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
921 |
uriDomainIgn.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
922 |
uriDomainIgn.SetDescriptionL( KNSmlDMVoIPURIDomainIgnoreRuleExp ); |
|
923 |
||
924 |
// AutoAcceptBuddyRequest |
|
925 |
MSmlDmDDFObject& aaBuddyReq = idNode.AddChildObjectL( |
|
926 |
KNSmlDMVoIPAutoAcceptBuddyRequest ); |
|
927 |
aaBuddyReq.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
928 |
aaBuddyReq.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
929 |
aaBuddyReq.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
930 |
aaBuddyReq.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
931 |
aaBuddyReq.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
932 |
aaBuddyReq.SetDescriptionL( KNSmlDMVoIPAutoAcceptBuddyRequestExp ); |
|
933 |
||
934 |
// UsedVoIPRelease |
|
935 |
MSmlDmDDFObject& voipRel = idNode.AddChildObjectL( |
|
936 |
KNSmlDMVoIPUsedVoIPRelease ); |
|
937 |
voipRel.SetAccessTypesL( accessTypesGet ); |
|
938 |
voipRel.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
939 |
voipRel.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
940 |
voipRel.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
941 |
voipRel.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
942 |
voipRel.SetDescriptionL( KNSmlDMVoIPUsedVoIPReleaseExp ); |
|
943 |
||
944 |
// AddUserPhone |
|
945 |
MSmlDmDDFObject& addUserPhone = idNode.AddChildObjectL( |
|
946 |
KNSmlDMVoIPAddUserPhone ); |
|
947 |
addUserPhone.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
948 |
addUserPhone.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
949 |
addUserPhone.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
950 |
addUserPhone.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
951 |
addUserPhone.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
952 |
addUserPhone.SetDescriptionL( KNSmlDMVoIPAddUserPhoneExp ); |
|
953 |
||
954 |
// ProviderBookmarkURI |
|
955 |
MSmlDmDDFObject& providerBkmarkUri = idNode.AddChildObjectL( |
|
956 |
KNSmlDMVoIPProviderBookmarkUri ); |
|
957 |
providerBkmarkUri.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
958 |
providerBkmarkUri.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
959 |
providerBkmarkUri.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
960 |
providerBkmarkUri.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
961 |
providerBkmarkUri.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
962 |
providerBkmarkUri.SetDescriptionL( KNSmlDMVoIPProviderBookmarkUriExp ); |
|
963 |
||
964 |
// SIPConnectivityTestURI |
|
965 |
MSmlDmDDFObject& sipConnTestUri = idNode.AddChildObjectL( |
|
966 |
KNSmlDMVoIPSIPConnTestUri ); |
|
967 |
sipConnTestUri.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
968 |
sipConnTestUri.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
969 |
sipConnTestUri.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
970 |
sipConnTestUri.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
971 |
sipConnTestUri.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
972 |
sipConnTestUri.SetDescriptionL( KNSmlDMVoIPSIPConnTestUriExp ); |
|
973 |
||
974 |
// NATFWProfileId |
|
975 |
MSmlDmDDFObject& natfwId = idNode.AddChildObjectL( |
|
976 |
KNSmlDMVoIPNatFwProfileId ); |
|
977 |
natfwId.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
978 |
natfwId.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
979 |
natfwId.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
980 |
natfwId.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
981 |
natfwId.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
982 |
natfwId.SetDescriptionL( KNSmlDMVoIPNatFwProfileIdExp ); |
|
983 |
||
984 |
// MinSessionInterval |
|
985 |
MSmlDmDDFObject& minSe = idNode.AddChildObjectL( |
|
986 |
KNSmlDMVoIPMinSessionInterval ); |
|
987 |
minSe.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
988 |
minSe.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
989 |
minSe.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
990 |
minSe.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
991 |
minSe.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
992 |
minSe.SetDescriptionL( KNSmlDMVoIPMinSessionIntervalExp ); |
|
993 |
||
994 |
// SessionExpires |
|
995 |
MSmlDmDDFObject& sessionExpires = idNode.AddChildObjectL( |
|
996 |
KNSmlDMVoIPSessionExpires ); |
|
997 |
sessionExpires.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
998 |
sessionExpires.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
999 |
sessionExpires.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
1000 |
sessionExpires.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
1001 |
sessionExpires.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
1002 |
sessionExpires.SetDescriptionL( KNSmlDMVoIPSessionExpiresExp ); |
|
1003 |
||
1004 |
// BradingDataURI |
|
1005 |
MSmlDmDDFObject& brandingUri = idNode.AddChildObjectL( |
|
1006 |
KNSmlDMVoIPBrandingDataUri ); |
|
1007 |
brandingUri.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
1008 |
brandingUri.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
1009 |
brandingUri.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
1010 |
brandingUri.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
1011 |
brandingUri.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
1012 |
brandingUri.SetDescriptionL( KNSmlDMVoIPBrandingDataUriExp ); |
|
1013 |
||
1014 |
// PresenceSettingsID |
|
1015 |
MSmlDmDDFObject& presenceId = idNode.AddChildObjectL( |
|
1016 |
KNSmlDMVoIPPresenceSettingsId ); |
|
1017 |
presenceId.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
1018 |
presenceId.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
1019 |
presenceId.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
1020 |
presenceId.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
1021 |
presenceId.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
1022 |
presenceId.SetDescriptionL( KNSmlDMVoIPPresenceSettingsIdExp ); |
|
1023 |
||
1024 |
// UsedNatProtocol |
|
1025 |
MSmlDmDDFObject& natProtocol = idNode.AddChildObjectL( |
|
1026 |
KNSmlDMVoIPUsedNatProtocol ); |
|
1027 |
natProtocol.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
1028 |
natProtocol.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
1029 |
natProtocol.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
1030 |
natProtocol.SetDFFormatL( MSmlDmDDFObject::EInt ); |
|
1031 |
natProtocol.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
1032 |
natProtocol.SetDescriptionL( KNSmlDMVoIPUsedNatProtocolExp ); |
|
1033 |
||
1034 |
// AutoEnableService |
|
1035 |
MSmlDmDDFObject& autoEnable = idNode.AddChildObjectL( |
|
1036 |
KNSmlDMVoIPAutoEnable ); |
|
1037 |
autoEnable.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
1038 |
autoEnable.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
1039 |
autoEnable.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
1040 |
autoEnable.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
1041 |
autoEnable.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
1042 |
autoEnable.SetDescriptionL( KNSmlDMVoIPAutoEnableExp ); |
|
1043 |
||
1044 |
// SNAPProfileId |
|
1045 |
MSmlDmDDFObject& snapId = idNode.AddChildObjectL( |
|
1046 |
KNSmlDMVoIPSnapProfileId ); |
|
1047 |
snapId.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
1048 |
snapId.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
1049 |
snapId.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
1050 |
snapId.SetDFFormatL( MSmlDmDDFObject::EChr ); |
|
1051 |
snapId.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
1052 |
snapId.SetDescriptionL( KNSmlDMVoIPSnapProfileIdExp ); |
|
1053 |
||
1054 |
// EnableIM |
|
1055 |
MSmlDmDDFObject& enableIm = idNode.AddChildObjectL( |
|
1056 |
KNSmlDMVoIPEnableIm ); |
|
1057 |
enableIm.SetAccessTypesL( accessTypesGetReplaceAdd ); |
|
1058 |
enableIm.SetOccurenceL( MSmlDmDDFObject::EZeroOrOne ); |
|
1059 |
enableIm.SetScopeL( MSmlDmDDFObject::EDynamic ); |
|
1060 |
enableIm.SetDFFormatL( MSmlDmDDFObject::EBool ); |
|
1061 |
enableIm.AddDFTypeMimeTypeL( KNSmlDMVoIPTextPlain ); |
|
1062 |
enableIm.SetDescriptionL( KNSmlDMVoIPEnableImExp ); |
|
1063 |
||
1064 |
DBG_PRINT("CNSmlDmVoIPAdapter::DDFStructureL(): end"); |
|
1065 |
} |
|
1066 |
||
1067 |
// --------------------------------------------------------------------------- |
|
1068 |
// CNSmlDmVoIPAdapter::UpdateLeafObjectL |
|
1069 |
// Updates value of leaf object |
|
1070 |
// --------------------------------------------------------------------------- |
|
1071 |
// |
|
1072 |
void CNSmlDmVoIPAdapter::UpdateLeafObjectL( |
|
1073 |
const TDesC8& aURI, |
|
1074 |
const TDesC8& aLUID, |
|
1075 |
const TDesC8& aObject, |
|
1076 |
const TDesC8& /*aType*/, |
|
1077 |
const TInt aStatusRef ) |
|
1078 |
{ |
|
1079 |
DBG_PRINT("CNSmlDmVoIPAdapter::UpdateLeafObjectL(): begin"); |
|
1080 |
||
1081 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
1082 |
||
1083 |
// Load VoIP profile information if not loaded yet |
|
1084 |
if ( !iProfileEntries.Count() ) |
|
1085 |
{ |
|
1086 |
LoadProfilesL(); |
|
1087 |
} |
|
1088 |
||
1089 |
CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk; |
|
1090 |
TPtrC8 uriSeg = LastURISeg( aURI ); |
|
1091 |
TPtrC8 uriTmp = RemoveLastURISeg( aURI ); |
|
1092 |
TPtrC8 secondLastUriSeg = LastURISeg( uriTmp ); |
|
1093 |
||
1094 |
// Check that luid mapping exist |
|
1095 |
if ( !aLUID.Length() ) |
|
1096 |
{ |
|
1097 |
iDmCallback->SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
1098 |
DBG_PRINT("CNSmlDmVoIPAdapter::UpdateLeafObjectL(): no LUID end"); |
|
1099 |
return; |
|
1100 |
} |
|
1101 |
||
1102 |
// Find profile and get settings |
|
1103 |
iProfileID = FindProfileLocation( aLUID ); |
|
1104 |
||
1105 |
// If profile is not found return error. |
|
1106 |
if ( KErrNotFound == iProfileID ) |
|
1107 |
{ |
|
1108 |
retValue = CSmlDmAdapter::ENotFound; |
|
1109 |
iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
1110 |
DBG_PRINT("CNSmlDmVoIPAdapter::UpdateLeafObjectL(): not found end"); |
|
1111 |
return; |
|
1112 |
} |
|
1113 |
||
1114 |
CDMVoIPSPSettings* spSettings = CDMVoIPSPSettings::NewLC(); // CS:1 |
|
1115 |
spSettings->iRcseProfileId = iProfileEntries[iProfileID]->iId; |
|
1116 |
TInt spSettingsId( KErrNotFound ); |
|
1117 |
// Check if service provider settings for this VoIP profile are already |
|
1118 |
// updated to be stored. |
|
1119 |
for ( TInt counter = 0; counter < iSPSettings.Count(); counter++ ) |
|
1120 |
{ |
|
1121 |
if ( iProfileEntries[iProfileID]->iId == |
|
1122 |
iSPSettings[counter]->iRcseProfileId ) |
|
1123 |
{ |
|
1124 |
spSettingsId = counter; |
|
1125 |
} |
|
1126 |
} |
|
1127 |
TBool addSpSettings( EFalse ); |
|
1128 |
||
1129 |
// Check that profile is not already to be saved. |
|
1130 |
if ( KErrNotFound == iProfileModifs.Find( iProfileID ) ) |
|
1131 |
{ |
|
1132 |
iProfileModifs.Insert( iProfileID, iProfileModifs.Count() ); |
|
1133 |
} |
|
1134 |
||
1135 |
// VoIP/x/ProviderName |
|
1136 |
if ( KNSmlDMVoIPProvID() == uriSeg ) |
|
1137 |
{ |
|
1138 |
CRCSEProfileEntry* tmpEntryForProvider = CRCSEProfileEntry::NewLC(); |
|
1139 |
tmpEntryForProvider->iProviderName.Copy( aObject ); |
|
1140 |
CheckDuplicateProviderL( *tmpEntryForProvider ); |
|
1141 |
iProfileEntries[iProfileID]->iProviderName.Copy( |
|
1142 |
tmpEntryForProvider->iProviderName ); |
|
1143 |
CleanupStack::PopAndDestroy( tmpEntryForProvider ); |
|
1144 |
} |
|
1145 |
// VoIP/x/SettingsName |
|
1146 |
else if ( KNSmlDMVoIPName() == uriSeg ) |
|
1147 |
{ |
|
1148 |
CRCSEProfileEntry* tmpEntryForName = CRCSEProfileEntry::NewLC(); |
|
1149 |
tmpEntryForName->iSettingsName.Copy( aObject ); |
|
1150 |
CheckDuplicateNameL( *tmpEntryForName ); |
|
1151 |
iProfileEntries[iProfileID]->iSettingsName.Copy( |
|
1152 |
tmpEntryForName->iSettingsName ); |
|
1153 |
CleanupStack::PopAndDestroy( tmpEntryForName ); |
|
1154 |
} |
|
1155 |
// VoIP/x/SMPort |
|
1156 |
else if ( KNSmlDMVoIPSMPort() == uriSeg ) |
|
1157 |
{ |
|
1158 |
iProfileEntries[iProfileID]->iStartMediaPort = |
|
1159 |
DesToInt( aObject ); |
|
1160 |
} |
|
1161 |
// VoIP/x/EMPort |
|
1162 |
else if ( KNSmlDMVoIPEMPort() == uriSeg ) |
|
1163 |
{ |
|
1164 |
iProfileEntries[iProfileID]->iEndMediaPort = DesToInt( aObject ); |
|
1165 |
} |
|
1166 |
// VoIP/x/MediaQos |
|
1167 |
else if ( KNSmlDMVoIPMediaQos() == uriSeg ) |
|
1168 |
{ |
|
1169 |
iProfileEntries[iProfileID]->iMediaQOS = DesToInt( aObject ); |
|
1170 |
} |
|
1171 |
// VoIP/x/DTMFIB |
|
1172 |
else if ( KNSmlDMVoIPDTMFIB() == uriSeg ) |
|
1173 |
{ |
|
1174 |
if ( KNSmlDMVoIPValueTrue() == aObject ) |
|
1175 |
{ |
|
1176 |
iProfileEntries[iProfileID]->iInbandDTMF = CRCSEProfileEntry::EOn; |
|
1177 |
} |
|
1178 |
else if ( KNSmlDMVoIPValueFalse() == aObject ) |
|
1179 |
{ |
|
1180 |
iProfileEntries[iProfileID]->iInbandDTMF = |
|
1181 |
CRCSEProfileEntry::EOff; |
|
1182 |
} |
|
1183 |
else |
|
1184 |
{ |
|
1185 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1186 |
} |
|
1187 |
} |
|
1188 |
// VoIP/x/DTMFOB |
|
1189 |
else if ( KNSmlDMVoIPDTMFOB() == uriSeg ) |
|
1190 |
{ |
|
1191 |
if ( KNSmlDMVoIPValueTrue() == aObject ) |
|
1192 |
{ |
|
1193 |
iProfileEntries[iProfileID]->iOutbandDTMF = |
|
1194 |
CRCSEProfileEntry::EOn; |
|
1195 |
} |
|
1196 |
else if ( KNSmlDMVoIPValueFalse() == aObject ) |
|
1197 |
{ |
|
1198 |
iProfileEntries[iProfileID]->iOutbandDTMF = |
|
1199 |
CRCSEProfileEntry::EOff; |
|
1200 |
} |
|
1201 |
else |
|
1202 |
{ |
|
1203 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1204 |
} |
|
1205 |
} |
|
1206 |
// VoIP/x/SecureCallPref |
|
1207 |
else if ( KNSmlDMVoIPSecureCallPref() == uriSeg ) |
|
1208 |
{ |
|
1209 |
iProfileEntries[iProfileID]-> |
|
1210 |
iSecureCallPreference = DesToInt( aObject ); |
|
1211 |
} |
|
1212 |
// VoIP/x/RTCP |
|
1213 |
else if ( KNSmlDMVoIPRTCP() == uriSeg ) |
|
1214 |
{ |
|
1215 |
iProfileEntries[iProfileID]->iRTCP = DesToInt( aObject ); |
|
1216 |
} |
|
1217 |
// VoIP/x/UAHTerminalType |
|
1218 |
else if ( KNSmlDMVoIPUAHTerminalType() == uriSeg ) |
|
1219 |
{ |
|
1220 |
iProfileEntries[iProfileID]-> |
|
1221 |
iSIPVoIPUAHTerminalType = DesToInt( aObject ); |
|
1222 |
} |
|
1223 |
// VoIP/x/UAHWLANMAC |
|
1224 |
else if ( KNSmlDMVoIPUAHWLANMAC() == uriSeg ) |
|
1225 |
{ |
|
1226 |
iProfileEntries[iProfileID]-> |
|
1227 |
iSIPVoIPUAHeaderWLANMAC = DesToInt( aObject ); |
|
1228 |
} |
|
1229 |
// VoIP/x/UAHString |
|
1230 |
else if ( KNSmlDMVoIPUAHString() == uriSeg ) |
|
1231 |
{ |
|
1232 |
iProfileEntries[iProfileID]-> |
|
1233 |
iSIPVoIPUAHeaderString.Copy( aObject ); |
|
1234 |
} |
|
1235 |
// VoIP/x/ProfileLockedToIAP |
|
1236 |
else if ( KNSmlDMVoIPProfileLockedToIAP() == uriSeg ) |
|
1237 |
{ |
|
1238 |
if ( KNSmlDMVoIPValueTrue() == aObject ) |
|
1239 |
{ |
|
1240 |
iProfileEntries[iProfileID]-> |
|
1241 |
iProfileLockedToIAP = CRCSEProfileEntry::EOn; |
|
1242 |
} |
|
1243 |
else if ( KNSmlDMVoIPValueFalse() == aObject ) |
|
1244 |
{ |
|
1245 |
iProfileEntries[iProfileID]-> |
|
1246 |
iProfileLockedToIAP = CRCSEProfileEntry::EOff; |
|
1247 |
} |
|
1248 |
else |
|
1249 |
{ |
|
1250 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1251 |
} |
|
1252 |
} |
|
1253 |
// VoIP/x/VoIPPluginUID |
|
1254 |
else if ( KNSmlDMVoIPPluginUID() == uriSeg ) |
|
1255 |
{ |
|
1256 |
iProfileEntries[iProfileID]->iVoIPPluginUID = |
|
1257 |
DesToTUint( aObject ); |
|
1258 |
} |
|
1259 |
// VoIP/x/AllowVoIPOverWCDMA |
|
1260 |
else if ( KNSmlDMVoIPAllowVoIPOverWCDMA() == uriSeg ) |
|
1261 |
{ |
|
1262 |
if ( KNSmlDMVoIPValueTrue() == aObject ) |
|
1263 |
{ |
|
1264 |
iProfileEntries[iProfileID]-> |
|
1265 |
iAllowVoIPoverWCDMA = CRCSEProfileEntry::EOn; |
|
1266 |
} |
|
1267 |
else if ( KNSmlDMVoIPValueFalse() == aObject ) |
|
1268 |
{ |
|
1269 |
iProfileEntries[iProfileID]-> |
|
1270 |
iAllowVoIPoverWCDMA = CRCSEProfileEntry::EOff; |
|
1271 |
} |
|
1272 |
else |
|
1273 |
{ |
|
1274 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1275 |
} |
|
1276 |
iAllowVoIPOverWCDMAModified = ETrue; |
|
1277 |
} |
|
1278 |
// VoIP/x/VoIPDigits |
|
1279 |
else if ( KNSmlDMVoIPVoIPDigits() == uriSeg ) |
|
1280 |
{ |
|
1281 |
iProfileEntries[iProfileID]->iMeanCountOfVoIPDigits = |
|
1282 |
DesToInt( aObject ); |
|
1283 |
} |
|
1284 |
// VoIP/x/URIDomainIgnoreRule |
|
1285 |
else if ( KNSmlDMVoIPURIDomainIgnoreRule() == uriSeg ) |
|
1286 |
{ |
|
1287 |
iProfileEntries[iProfileID]->iIgnoreAddrDomainPart = |
|
1288 |
DesToInt( aObject ); |
|
1289 |
} |
|
1290 |
// VoIP/x/AddUserPhone |
|
1291 |
else if ( KNSmlDMVoIPAddUserPhone() == uriSeg ) |
|
1292 |
{ |
|
1293 |
if ( KNSmlDMVoIPValueFalse() == aObject ) |
|
1294 |
{ |
|
1295 |
iProfileEntries[iProfileID]->iUserPhoneUriParameter = |
|
1296 |
CRCSEProfileEntry::EOff; |
|
1297 |
} |
|
1298 |
else if ( KNSmlDMVoIPValueTrue() == aObject ) |
|
1299 |
{ |
|
1300 |
iProfileEntries[iProfileID]->iUserPhoneUriParameter = |
|
1301 |
CRCSEProfileEntry::EOn; |
|
1302 |
} |
|
1303 |
else |
|
1304 |
{ |
|
1305 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1306 |
} |
|
1307 |
} |
|
1308 |
// VoIP/x/ProviderBookmarkURI |
|
1309 |
else if ( KNSmlDMVoIPProviderBookmarkUri() == uriSeg ) |
|
1310 |
{ |
|
1311 |
if ( KErrNotFound == spSettingsId ) |
|
1312 |
{ |
|
1313 |
delete spSettings->iServiceProviderBookmark; |
|
1314 |
spSettings->iServiceProviderBookmark = NULL; |
|
1315 |
spSettings->iServiceProviderBookmark = HBufC::NewL( |
|
1316 |
aObject.Length() ); |
|
1317 |
spSettings->iServiceProviderBookmark->Des().Copy( aObject ); |
|
1318 |
addSpSettings = ETrue; |
|
1319 |
} |
|
1320 |
else |
|
1321 |
{ |
|
1322 |
delete iSPSettings[spSettingsId]->iServiceProviderBookmark; |
|
1323 |
iSPSettings[spSettingsId]->iServiceProviderBookmark = NULL; |
|
1324 |
iSPSettings[spSettingsId]->iServiceProviderBookmark = HBufC::NewL( |
|
1325 |
aObject.Length() ); |
|
1326 |
iSPSettings[spSettingsId]->iServiceProviderBookmark->Des().Copy( |
|
1327 |
aObject ); |
|
1328 |
} |
|
1329 |
} |
|
1330 |
// VoIP/x/SIPConnectivityTestURI |
|
1331 |
else if ( KNSmlDMVoIPSIPConnTestUri() == uriSeg ) |
|
1332 |
{ |
|
1333 |
iProfileEntries[iProfileID]->iSIPConnTestAddress.Copy( |
|
1334 |
aObject ); |
|
1335 |
} |
|
1336 |
// VoIP/x/NATFWProfileId |
|
1337 |
else if ( KNSmlDMVoIPNatFwProfileId() == uriSeg ) |
|
1338 |
{ |
|
1339 |
TUint32 natId = NatFwIdL( aObject ); |
|
1340 |
if ( KErrNone == natId ) |
|
1341 |
{ |
|
1342 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1343 |
} |
|
1344 |
else |
|
1345 |
{ |
|
1346 |
iProfileEntries[iProfileID]->iNATSettingsStorageId = natId; |
|
1347 |
} |
|
1348 |
} |
|
1349 |
// VoIP/x/MinSessionInterval |
|
1350 |
else if ( KNSmlDMVoIPMinSessionInterval() == uriSeg ) |
|
1351 |
{ |
|
1352 |
iProfileEntries[iProfileID]->iSIPMinSE = DesToInt( aObject ); |
|
1353 |
} |
|
1354 |
// VoIP/x/SessionExpires |
|
1355 |
else if ( KNSmlDMVoIPSessionExpires() == uriSeg ) |
|
1356 |
{ |
|
1357 |
iProfileEntries[iProfileID]->iSIPSessionExpires = |
|
1358 |
DesToInt( aObject ); |
|
1359 |
} |
|
1360 |
// VoIP/x/BradingDataURI |
|
1361 |
else if ( KNSmlDMVoIPBrandingDataUri() == uriSeg ) |
|
1362 |
{ |
|
1363 |
if ( KErrNotFound == spSettingsId ) |
|
1364 |
{ |
|
1365 |
delete spSettings->iBrandingDataUri; |
|
1366 |
spSettings->iBrandingDataUri = NULL; |
|
1367 |
spSettings->iBrandingDataUri = HBufC::NewL( aObject.Length() ); |
|
1368 |
spSettings->iBrandingDataUri->Des().Copy( aObject ); |
|
1369 |
addSpSettings = ETrue; |
|
1370 |
} |
|
1371 |
else |
|
1372 |
{ |
|
1373 |
delete iSPSettings[spSettingsId]->iBrandingDataUri; |
|
1374 |
iSPSettings[spSettingsId]->iBrandingDataUri = NULL; |
|
1375 |
iSPSettings[spSettingsId]->iBrandingDataUri = |
|
1376 |
HBufC::NewL( aObject.Length() ); |
|
1377 |
iSPSettings[spSettingsId]->iBrandingDataUri->Des().Copy( |
|
1378 |
aObject ); |
|
1379 |
} |
|
1380 |
} |
|
1381 |
// VoIP/x/PresenceSettingsID |
|
1382 |
else if ( KNSmlDMVoIPPresenceSettingsId() == uriSeg ) |
|
1383 |
{ |
|
1384 |
if ( KErrNotFound == spSettingsId ) |
|
1385 |
{ |
|
1386 |
spSettings->iPresenceId = PresenceIdL( aObject ); |
|
1387 |
addSpSettings = ETrue; |
|
1388 |
} |
|
1389 |
else |
|
1390 |
{ |
|
1391 |
iSPSettings[spSettingsId]->iPresenceId = PresenceIdL( aObject ); |
|
1392 |
} |
|
1393 |
} |
|
1394 |
// VoIP/x/UsedNATProtocol |
|
1395 |
else if ( KNSmlDMVoIPUsedNatProtocol() == uriSeg ) |
|
1396 |
{ |
|
1397 |
iProfileEntries[iProfileID]->iNATProtocol = DesToInt( aObject ); |
|
1398 |
} |
|
1399 |
// VoIP/x/AutoEnable |
|
1400 |
else if ( KNSmlDMVoIPAutoEnable() == uriSeg ) |
|
1401 |
{ |
|
1402 |
if ( KErrNotFound == spSettingsId ) |
|
1403 |
{ |
|
1404 |
spSettings->iAutoEnableService = DesToInt( aObject ); |
|
1405 |
addSpSettings = ETrue; |
|
1406 |
} |
|
1407 |
else |
|
1408 |
{ |
|
1409 |
iSPSettings[spSettingsId]->iAutoEnableService = |
|
1410 |
DesToInt( aObject ); |
|
1411 |
} |
|
1412 |
} |
|
1413 |
// VoIP/x/SNAPProfileId |
|
1414 |
else if ( KNSmlDMVoIPSnapProfileId() == uriSeg ) |
|
1415 |
{ |
|
1416 |
if ( KErrNotFound == spSettingsId ) |
|
1417 |
{ |
|
1418 |
spSettings->iSnapId = SnapIdL( aObject ); |
|
1419 |
addSpSettings = ETrue; |
|
1420 |
} |
|
1421 |
else |
|
1422 |
{ |
|
1423 |
iSPSettings[spSettingsId]->iSnapId = SnapIdL( aObject ); |
|
1424 |
} |
|
1425 |
} |
|
1426 |
// VoIP/x/EnableIM |
|
1427 |
else if ( KNSmlDMVoIPEnableIm() == uriSeg ) |
|
1428 |
{ |
|
1429 |
if ( KErrNotFound == spSettingsId ) |
|
1430 |
{ |
|
1431 |
if ( KNSmlDMVoIPValueFalse() == aObject ) |
|
1432 |
{ |
|
1433 |
spSettings->iImEnabled = EFalse; |
|
1434 |
addSpSettings = ETrue; |
|
1435 |
} |
|
1436 |
else if ( KNSmlDMVoIPValueTrue() == aObject ) |
|
1437 |
{ |
|
1438 |
spSettings->iImEnabled = ETrue; |
|
1439 |
addSpSettings = ETrue; |
|
1440 |
} |
|
1441 |
else |
|
1442 |
{ |
|
1443 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1444 |
} |
|
1445 |
} |
|
1446 |
else |
|
1447 |
{ |
|
1448 |
if ( KNSmlDMVoIPValueFalse() == aObject ) |
|
1449 |
{ |
|
1450 |
iSPSettings[spSettingsId]->iImEnabled = EFalse; |
|
1451 |
} |
|
1452 |
else if ( KNSmlDMVoIPValueTrue() == aObject ) |
|
1453 |
{ |
|
1454 |
iSPSettings[spSettingsId]->iImEnabled = ETrue; |
|
1455 |
} |
|
1456 |
else |
|
1457 |
{ |
|
1458 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1459 |
} |
|
1460 |
} |
|
1461 |
} |
|
1462 |
||
1463 |
// ============================== |
|
1464 |
// SettingIds node (update) |
|
1465 |
// ============================== |
|
1466 |
// |
|
1467 |
||
1468 |
// VoIP/x/SettingIds |
|
1469 |
if ( KNSmlDMVoIPSettingId() == LastURISeg( aLUID ).Left( |
|
1470 |
KNSmlDMVoIPSettingId().Length() ) |
|
1471 |
&& KFiveSegs == NumOfURISegs( aURI ) ) |
|
1472 |
{ |
|
1473 |
retValue = UpdateSettingIdsSpecificObjectL( aLUID, uriSeg, aObject ); |
|
1474 |
} |
|
1475 |
||
1476 |
// ============================== |
|
1477 |
// PreferredCodecs node (update) |
|
1478 |
// ============================== |
|
1479 |
// |
|
1480 |
||
1481 |
// VoIP/x/PreferredCodecs node |
|
1482 |
if ( KNSmlDMVoIPPreferredCodecId() == uriSeg |
|
1483 |
&& KFiveSegs == NumOfURISegs( aURI ) ) |
|
1484 |
{ |
|
1485 |
// Check that codec ID is found from codec entries before setting it. |
|
1486 |
// Preferred codec ID setting is only for knowing and changing an |
|
1487 |
// already existing codec priority. |
|
1488 |
if ( FindCodecLocation( DesToInt( aObject ) ) != KErrNotFound && |
|
1489 |
DesToInt( aLUID.Right( 10 ) ) <= iProfileEntries[iProfileID]-> |
|
1490 |
iPreferredCodecs.Count() ) |
|
1491 |
{ |
|
1492 |
iProfileEntries[iProfileID]->iPreferredCodecs[ |
|
1493 |
DesToInt( aLUID.Right( 10 ))] = DesToInt( aObject ); |
|
1494 |
} |
|
1495 |
else |
|
1496 |
{ |
|
1497 |
// Codec is not found from codecsettings or |
|
1498 |
// invalid LUID is passed to the adapter. |
|
1499 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1500 |
} |
|
1501 |
||
1502 |
} |
|
1503 |
||
1504 |
// ============================== |
|
1505 |
// CodecSettings node (update) |
|
1506 |
// ============================== |
|
1507 |
// |
|
1508 |
if ( KNSmlDMVoIPCodecSettingsId() == LastURISeg( aLUID ). |
|
1509 |
Left( KNSmlDMVoIPCodecSettingsId().Length() ) |
|
1510 |
&& KFiveSegs == NumOfURISegs( aURI ) ) |
|
1511 |
{ |
|
1512 |
retValue = UpdateCodecSpecificObject( aLUID, uriSeg, aObject ); |
|
1513 |
} |
|
1514 |
||
1515 |
// ============================== |
|
1516 |
// VoiceMailBox node (update) |
|
1517 |
// ============================== |
|
1518 |
// |
|
1519 |
if ( KNSmlDMVoIPVmbxNode() == secondLastUriSeg && |
|
1520 |
KFourSegs == NumOfURISegs( aURI ) ) |
|
1521 |
{ |
|
1522 |
if ( KNSmlDMVoIPMwiUri() == uriSeg ) |
|
1523 |
{ |
|
1524 |
if ( KErrNotFound == spSettingsId ) |
|
1525 |
{ |
|
1526 |
delete spSettings->iVmbxMwiUri; |
|
1527 |
spSettings->iVmbxMwiUri = NULL; |
|
1528 |
spSettings->iVmbxMwiUri = HBufC::NewL( aObject.Length() ); |
|
1529 |
spSettings->iVmbxMwiUri->Des().Copy( aObject ); |
|
1530 |
addSpSettings = ETrue; |
|
1531 |
} |
|
1532 |
else |
|
1533 |
{ |
|
1534 |
delete iSPSettings[spSettingsId]->iVmbxMwiUri; |
|
1535 |
iSPSettings[spSettingsId]->iVmbxMwiUri = NULL; |
|
1536 |
iSPSettings[spSettingsId]->iVmbxMwiUri = HBufC::NewL( |
|
1537 |
aObject.Length() ); |
|
1538 |
iSPSettings[spSettingsId]->iVmbxMwiUri->Des().Copy( aObject ); |
|
1539 |
} |
|
1540 |
} |
|
1541 |
else if ( KNSmlDMVoIPListeningUri() == uriSeg ) |
|
1542 |
{ |
|
1543 |
if ( KErrNotFound == spSettingsId ) |
|
1544 |
{ |
|
1545 |
delete spSettings->iVmbxListenUri; |
|
1546 |
spSettings->iVmbxListenUri = NULL; |
|
1547 |
spSettings->iVmbxListenUri = HBufC::NewL( aObject.Length() ); |
|
1548 |
spSettings->iVmbxListenUri->Des().Copy( aObject ); |
|
1549 |
addSpSettings = ETrue; |
|
1550 |
} |
|
1551 |
else |
|
1552 |
{ |
|
1553 |
delete iSPSettings[spSettingsId]->iVmbxListenUri; |
|
1554 |
iSPSettings[spSettingsId]->iVmbxListenUri = NULL; |
|
1555 |
iSPSettings[spSettingsId]->iVmbxListenUri = HBufC::NewL( |
|
1556 |
aObject.Length() ); |
|
1557 |
iSPSettings[spSettingsId]->iVmbxListenUri->Des().Copy( |
|
1558 |
aObject ); |
|
1559 |
} |
|
1560 |
} |
|
1561 |
else if ( KNSmlDMVoIPUsedIAPId() == uriSeg ) |
|
1562 |
{ |
|
1563 |
TInt iapId = ConRefL( aObject ); |
|
1564 |
if ( KErrNotFound == iapId ) |
|
1565 |
{ |
|
1566 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1567 |
} |
|
1568 |
else |
|
1569 |
{ |
|
1570 |
if ( KErrNotFound == spSettingsId ) |
|
1571 |
{ |
|
1572 |
spSettings->iVmbxIapId = iapId; |
|
1573 |
addSpSettings = ETrue; |
|
1574 |
} |
|
1575 |
else |
|
1576 |
{ |
|
1577 |
iSPSettings[spSettingsId]->iVmbxIapId = iapId; |
|
1578 |
} |
|
1579 |
} |
|
1580 |
} |
|
1581 |
else if ( KNSmlDMVoIPReSubscribeInterval() == uriSeg ) |
|
1582 |
{ |
|
1583 |
if ( KErrNotFound == spSettingsId ) |
|
1584 |
{ |
|
1585 |
spSettings->iReSubscribeInterval = DesToInt( aObject ); |
|
1586 |
addSpSettings = ETrue; |
|
1587 |
} |
|
1588 |
else |
|
1589 |
{ |
|
1590 |
iSPSettings[spSettingsId]->iReSubscribeInterval = |
|
1591 |
DesToInt( aObject ); |
|
1592 |
} |
|
1593 |
} |
|
1594 |
else if ( KNSmlDMVoIPUsedSIPProfileId() == uriSeg ) |
|
1595 |
{ |
|
1596 |
TUint32 profileId = SetSipRefL( aObject ); |
|
1597 |
if ( profileId > 0 ) |
|
1598 |
{ |
|
1599 |
if ( KErrNotFound == spSettingsId ) |
|
1600 |
{ |
|
1601 |
spSettings->iVmbxSipId = profileId; |
|
1602 |
addSpSettings = ETrue; |
|
1603 |
} |
|
1604 |
else |
|
1605 |
{ |
|
1606 |
iSPSettings[spSettingsId]->iVmbxSipId = profileId; |
|
1607 |
} |
|
1608 |
} |
|
1609 |
else |
|
1610 |
{ |
|
1611 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1612 |
} |
|
1613 |
} |
|
1614 |
else if ( KNSmlDMVoIPAutoAcceptBuddyRequest() == uriSeg ) |
|
1615 |
{ |
|
1616 |
if ( KErrNotFound == spSettingsId ) |
|
1617 |
{ |
|
1618 |
spSettings->iAutoAcceptBuddy = DesToInt( aObject ); |
|
1619 |
addSpSettings = ETrue; |
|
1620 |
} |
|
1621 |
else |
|
1622 |
{ |
|
1623 |
iSPSettings[spSettingsId]->iAutoAcceptBuddy = |
|
1624 |
DesToInt( aObject ); |
|
1625 |
} |
|
1626 |
} |
|
1627 |
else |
|
1628 |
{ |
|
1629 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1630 |
} |
|
1631 |
} |
|
1632 |
||
1633 |
if ( addSpSettings ) |
|
1634 |
{ |
|
1635 |
// Append Service Provider Settings to array for saving them later. |
|
1636 |
// iSPSettings array will own the object now. |
|
1637 |
iSPSettings.AppendL( spSettings ); |
|
1638 |
CleanupStack::Pop( spSettings ); // CS:0 |
|
1639 |
} |
|
1640 |
else |
|
1641 |
{ |
|
1642 |
// Local Service Provider Settings not needed. |
|
1643 |
CleanupStack::PopAndDestroy( spSettings ); // CS:0 |
|
1644 |
} |
|
1645 |
||
1646 |
iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
1647 |
||
1648 |
DBG_PRINT("CNSmlDmVoIPAdapter::UpdateLeafObjectL(): end"); |
|
1649 |
} |
|
1650 |
||
1651 |
// --------------------------------------------------------------------------- |
|
1652 |
// CNSmlDmVoIPAdapter::UpdateCodecSpecificObject |
|
1653 |
// Updates Codec specific object. |
|
1654 |
// --------------------------------------------------------------------------- |
|
1655 |
// |
|
1656 |
CSmlDmAdapter::TError CNSmlDmVoIPAdapter::UpdateCodecSpecificObject( |
|
1657 |
const TDesC8& aLUID, const TDesC8& aUriSeg, const TDesC8& aObject ) |
|
1658 |
{ |
|
1659 |
DBG_PRINT("CNSmlDmVoIPAdapter::UpdateCodecSpecificObject(): begin"); |
|
1660 |
||
1661 |
CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk; |
|
1662 |
||
1663 |
// Get codec ID used by these settings. |
|
1664 |
TUint32 codecId = DesToInt( aLUID.Right( 10 ) ); |
|
1665 |
TInt codecPos = FindCodecLocation( codecId ); |
|
1666 |
if ( KErrNotFound != codecPos ) |
|
1667 |
{ |
|
1668 |
// Add profile to be saved if not done already. |
|
1669 |
if ( KErrNotFound == iCodecModifs.Find( codecPos ) ) |
|
1670 |
{ |
|
1671 |
iCodecModifs.Insert( codecPos, iCodecModifs.Count() ); |
|
1672 |
} |
|
1673 |
//CodecId |
|
1674 |
if ( KNSmlDMVoIPCodecId() == aUriSeg ) |
|
1675 |
{ |
|
1676 |
iCodecEntries[codecPos]->iCodecId = DesToInt( aObject ); |
|
1677 |
} |
|
1678 |
//MediaTypeName |
|
1679 |
if ( KNSmlDMVoIPMediaTypeName() == aUriSeg ) |
|
1680 |
{ |
|
1681 |
iCodecEntries[codecPos]->iMediaTypeName.Copy( aObject ); |
|
1682 |
} |
|
1683 |
//MediaSubTypeName |
|
1684 |
if ( KNSmlDMVoIPMediaSubTypeName() == aUriSeg ) |
|
1685 |
{ |
|
1686 |
iCodecEntries[codecPos]-> |
|
1687 |
iMediaSubTypeName.Copy( aObject ); |
|
1688 |
} |
|
1689 |
//JitterBufferSize |
|
1690 |
if ( KNSmlDMVoIPJitterBufferSize() == aUriSeg ) |
|
1691 |
{ |
|
1692 |
iCodecEntries[codecPos]->iJitterBufferSize = |
|
1693 |
DesToInt( aObject ); |
|
1694 |
} |
|
1695 |
//OctetAlign |
|
1696 |
if ( KNSmlDMVoIPOctetAlign() == aUriSeg ) |
|
1697 |
{ |
|
1698 |
if ( KNSmlDMVoIPValueTrue() == aObject ) |
|
1699 |
{ |
|
1700 |
iCodecEntries[codecPos]->iOctetAlign = |
|
1701 |
CRCSEAudioCodecEntry::EOn; |
|
1702 |
} |
|
1703 |
else if ( KNSmlDMVoIPValueFalse() == aObject ) |
|
1704 |
{ |
|
1705 |
iCodecEntries[codecPos]->iOctetAlign = |
|
1706 |
CRCSEAudioCodecEntry::EOff; |
|
1707 |
} |
|
1708 |
else |
|
1709 |
{ |
|
1710 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1711 |
} |
|
1712 |
} |
|
1713 |
//ModeChangePeriod |
|
1714 |
if ( KNSmlDMVoIPModeChangePeriod() == aUriSeg ) |
|
1715 |
{ |
|
1716 |
iCodecEntries[codecPos]->iModeChangePeriod = |
|
1717 |
DesToInt( aObject ); |
|
1718 |
} |
|
1719 |
//ModeChangeNeighbor |
|
1720 |
if ( KNSmlDMVoIPModeChangeNeighbor() == aUriSeg ) |
|
1721 |
{ |
|
1722 |
if ( KNSmlDMVoIPValueTrue() == aObject ) |
|
1723 |
{ |
|
1724 |
iCodecEntries[codecPos]->iModeChangeNeighbor = |
|
1725 |
CRCSEAudioCodecEntry::EOn; |
|
1726 |
} |
|
1727 |
else if ( KNSmlDMVoIPValueFalse() == aObject ) |
|
1728 |
{ |
|
1729 |
iCodecEntries[codecPos]->iModeChangeNeighbor = |
|
1730 |
CRCSEAudioCodecEntry::EOff; |
|
1731 |
} |
|
1732 |
else |
|
1733 |
{ |
|
1734 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1735 |
} |
|
1736 |
} |
|
1737 |
//Ptime |
|
1738 |
if ( KNSmlDMVoIPPtime() == aUriSeg ) |
|
1739 |
{ |
|
1740 |
iCodecEntries[codecPos]->iPtime = DesToInt( aObject ); |
|
1741 |
} |
|
1742 |
//Maxptime |
|
1743 |
if ( KNSmlDMVoIPMaxPtime() == aUriSeg ) |
|
1744 |
{ |
|
1745 |
iCodecEntries[codecPos]->iMaxptime = DesToInt( aObject ); |
|
1746 |
} |
|
1747 |
//VAD |
|
1748 |
if ( KNSmlDMVoIPVAD() == aUriSeg ) |
|
1749 |
{ |
|
1750 |
if ( KNSmlDMVoIPValueTrue() == aObject ) |
|
1751 |
{ |
|
1752 |
iCodecEntries[codecPos]->iVAD = |
|
1753 |
CRCSEAudioCodecEntry::EOn; |
|
1754 |
} |
|
1755 |
else if ( KNSmlDMVoIPValueFalse() == aObject ) |
|
1756 |
{ |
|
1757 |
iCodecEntries[codecPos]->iVAD = |
|
1758 |
CRCSEAudioCodecEntry::EOff; |
|
1759 |
} |
|
1760 |
else |
|
1761 |
{ |
|
1762 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1763 |
} |
|
1764 |
} |
|
1765 |
//AnnexB |
|
1766 |
if ( KNSmlDMVoIPAnnexB() == aUriSeg ) |
|
1767 |
{ |
|
1768 |
if ( KNSmlDMVoIPValueTrue() == aObject ) |
|
1769 |
{ |
|
1770 |
iCodecEntries[codecPos]->iAnnexb = |
|
1771 |
CRCSEAudioCodecEntry::EOn; |
|
1772 |
} |
|
1773 |
else if ( KNSmlDMVoIPValueFalse() == aObject ) |
|
1774 |
{ |
|
1775 |
iCodecEntries[codecPos]->iAnnexb = |
|
1776 |
CRCSEAudioCodecEntry::EOff; |
|
1777 |
} |
|
1778 |
else |
|
1779 |
{ |
|
1780 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1781 |
} |
|
1782 |
} |
|
1783 |
// MaxRed |
|
1784 |
if ( KNSmlDMVoIPMaxRed() == aUriSeg ) |
|
1785 |
{ |
|
1786 |
iCodecEntries[codecPos]->iMaxRed = DesToInt( aObject ); |
|
1787 |
} |
|
1788 |
||
1789 |
// ============================== |
|
1790 |
// ModeSet node ( update ) |
|
1791 |
// ============================== |
|
1792 |
// |
|
1793 |
if ( KNSmlDMVoIPMode() == aUriSeg ) |
|
1794 |
{ |
|
1795 |
// Add profile to be saved if not done already. |
|
1796 |
if ( KErrNotFound == iCodecModifs.Find( codecPos ) ) |
|
1797 |
{ |
|
1798 |
iCodecModifs.Insert( codecPos, iCodecModifs.Count() ); |
|
1799 |
} |
|
1800 |
iCodecEntries[codecPos]->iModeSet[ |
|
1801 |
DesToInt( aLUID.Right( 10 ))] = DesToInt( aObject ); |
|
1802 |
} |
|
1803 |
} |
|
1804 |
else |
|
1805 |
{ |
|
1806 |
// codecsetting not found even in luid exists |
|
1807 |
retValue = CSmlDmAdapter::EError; |
|
1808 |
} |
|
1809 |
DBG_PRINT("CNSmlDmVoIPAdapter::UpdateCodecSpecificObject(): end"); |
|
1810 |
||
1811 |
return retValue; |
|
1812 |
} |
|
1813 |
||
1814 |
// --------------------------------------------------------------------------- |
|
1815 |
// CNSmlDmVoIPAdapter::UpdateSettingIdsSpecificObjectL |
|
1816 |
// Updates SettingIds specific object. |
|
1817 |
// --------------------------------------------------------------------------- |
|
1818 |
// |
|
1819 |
CSmlDmAdapter::TError CNSmlDmVoIPAdapter::UpdateSettingIdsSpecificObjectL( |
|
1820 |
const TDesC8& aLUID, const TDesC8& aUriSeg, const TDesC8& aObject ) |
|
1821 |
{ |
|
1822 |
DBG_PRINT("CNSmlDmVoIPAdapter::UpdateSettingIdsSpecificObjectL(): start"); |
|
1823 |
||
1824 |
CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk; |
|
1825 |
||
1826 |
// Get SIP Specific ID used by these settings. |
|
1827 |
||
1828 |
// Add profile to be saved if not done already. |
|
1829 |
if ( KErrNotFound == iProfileModifs.Find( iProfileID ) ) |
|
1830 |
{ |
|
1831 |
iProfileModifs.Insert( iProfileID, iProfileModifs.Count() ); |
|
1832 |
} |
|
1833 |
//ProfileType |
|
1834 |
if ( KNSmlDMVoIPProfileType() == aUriSeg ) |
|
1835 |
{ |
|
1836 |
if ( KNSmlDMVoIPProfileTypeSIP() == aObject ) |
|
1837 |
{ |
|
1838 |
iProfileEntries[iProfileID]->iIds[DesToInt( |
|
1839 |
LastURISeg( aLUID ).Right( 10 ))].iProfileType = 0; |
|
1840 |
// If the profile id is not saved and the string to fetch it is only temporaly stored, |
|
1841 |
// the profile id will be fetched from previously-stored member value and set as well |
|
1842 |
// when saveing the profiletype. |
|
1843 |
if( iTempProfileIdObject ) |
|
1844 |
{ |
|
1845 |
TUint32 profileId = SetSipRefL( *iTempProfileIdObject ); |
|
1846 |
if ( profileId > 0 ) |
|
1847 |
{ |
|
1848 |
// Set profileId to settingsids. |
|
1849 |
iProfileEntries[iProfileID]-> |
|
1850 |
iIds[DesToInt( LastURISeg( aLUID ).Right( 10 ))]. |
|
1851 |
iProfileId = profileId; |
|
1852 |
retValue = CSmlDmAdapter::EOk; |
|
1853 |
} |
|
1854 |
else |
|
1855 |
{ |
|
1856 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1857 |
} |
|
1858 |
} |
|
1859 |
iIsProfileTypeSet = ETrue; |
|
1860 |
delete iTempProfileIdObject; |
|
1861 |
iTempProfileIdObject = NULL; |
|
1862 |
} |
|
1863 |
else if ( KNSmlDMVoIPProfileTypeSCCP() == aObject ) |
|
1864 |
{ |
|
1865 |
iProfileEntries[iProfileID]->iIds[DesToInt( |
|
1866 |
LastURISeg( aLUID ).Right( 10 ))].iProfileType = 1; |
|
1867 |
// If the profile id is not saved and the string to fetch it is only temporaly stored, |
|
1868 |
// the profile id will be fetched from previously-stored member value and set as well |
|
1869 |
// when saveing the profiletype. |
|
1870 |
if( iTempProfileIdObject ) |
|
1871 |
{ |
|
1872 |
TUint32 profileId = SetSccpRefL( *iTempProfileIdObject ); |
|
1873 |
// profileId can be zero |
|
1874 |
if ( profileId > 0 || 0 == profileId ) |
|
1875 |
{ |
|
1876 |
// set profileId to settingsids |
|
1877 |
iProfileEntries[iProfileID]->iIds[DesToInt( |
|
1878 |
LastURISeg( aLUID ).Right( 10 ))]. |
|
1879 |
iProfileId = profileId; |
|
1880 |
retValue = CSmlDmAdapter::EOk; |
|
1881 |
} |
|
1882 |
else |
|
1883 |
{ |
|
1884 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1885 |
} |
|
1886 |
} |
|
1887 |
iIsProfileTypeSet = ETrue; |
|
1888 |
delete iTempProfileIdObject; |
|
1889 |
iTempProfileIdObject = NULL; |
|
1890 |
} |
|
1891 |
else |
|
1892 |
{ |
|
1893 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1894 |
} |
|
1895 |
} |
|
1896 |
// ProfileId |
|
1897 |
if ( KNSmlDMVoIPProfileId() == aUriSeg ) |
|
1898 |
{ |
|
1899 |
// Handle SIP type. |
|
1900 |
if ( 0 == iProfileEntries[iProfileID]->iIds[DesToInt( |
|
1901 |
LastURISeg( aLUID ).Right( 10 ))].iProfileType ) |
|
1902 |
{ |
|
1903 |
TUint32 profileId = SetSipRefL( aObject ); |
|
1904 |
if ( profileId > 0 ) |
|
1905 |
{ |
|
1906 |
// Set profileId to settingsids. |
|
1907 |
iProfileEntries[iProfileID]-> |
|
1908 |
iIds[DesToInt( LastURISeg( aLUID ).Right( 10 ))]. |
|
1909 |
iProfileId = profileId; |
|
1910 |
retValue = CSmlDmAdapter::EOk; |
|
1911 |
} |
|
1912 |
else |
|
1913 |
{ |
|
1914 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1915 |
} |
|
1916 |
} |
|
1917 |
// Handle SCCP type |
|
1918 |
else if ( 1 == iProfileEntries[iProfileID]->iIds[DesToInt( |
|
1919 |
LastURISeg( aLUID ).Right( 10 ))].iProfileType ) |
|
1920 |
{ |
|
1921 |
TUint32 profileId = SetSccpRefL( aObject ); |
|
1922 |
||
1923 |
// profileId can be zero |
|
1924 |
if ( profileId > 0 || 0 == profileId ) |
|
1925 |
{ |
|
1926 |
// set profileId to settingsids |
|
1927 |
iProfileEntries[iProfileID]->iIds[DesToInt( |
|
1928 |
LastURISeg( aLUID ).Right( 10 ))]. |
|
1929 |
iProfileId = profileId; |
|
1930 |
retValue = CSmlDmAdapter::EOk; |
|
1931 |
} |
|
1932 |
else |
|
1933 |
{ |
|
1934 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
1935 |
} |
|
1936 |
} |
|
1937 |
// If the ProfileType has not been set yet, |
|
1938 |
// the string used to fetch ProfileId temporarily is stored to a member value. |
|
1939 |
else if ( !iIsProfileTypeSet ) |
|
1940 |
{ |
|
1941 |
if( iTempProfileIdObject ) |
|
1942 |
{ |
|
1943 |
delete iTempProfileIdObject; |
|
1944 |
iTempProfileIdObject = NULL; |
|
1945 |
} |
|
1946 |
iTempProfileIdObject = aObject.AllocL(); |
|
1947 |
} |
|
1948 |
else |
|
1949 |
{ |
|
1950 |
// no SCCP or SIP type found |
|
1951 |
retValue = CSmlDmAdapter::EError; |
|
1952 |
} |
|
1953 |
} |
|
1954 |
// ProfileSpecificId |
|
1955 |
if ( KNSmlDMVoIPProfileSpecificId() == aUriSeg ) |
|
1956 |
{ |
|
1957 |
// SIPSpecific settings have been removed so set |
|
1958 |
// SIPSpecific ID as not found. |
|
1959 |
iProfileEntries[iProfileID]->iIds[DesToInt( |
|
1960 |
LastURISeg( aLUID ).Right( 10 ))]. |
|
1961 |
iProfileSpecificSettingId = KErrNotFound; |
|
1962 |
||
1963 |
// Set status to OK so we won't break backwards compatibility. |
|
1964 |
// Some DM servers may react to receiving other status than OK |
|
1965 |
// when sending settings they think are supported. |
|
1966 |
retValue = CSmlDmAdapter::EOk; |
|
1967 |
} |
|
1968 |
||
1969 |
DBG_PRINT("CNSmlDmVoIPAdapter::UpdateSettingIdsSpecificObjectL(): end"); |
|
1970 |
||
1971 |
return retValue; |
|
1972 |
} |
|
1973 |
// --------------------------------------------------------------------------- |
|
1974 |
// CNSmlDmVoIPAdapter::DeleteObjectL |
|
1975 |
// This deletes VoIP profiles |
|
1976 |
// --------------------------------------------------------------------------- |
|
1977 |
// |
|
1978 |
void CNSmlDmVoIPAdapter::DeleteObjectL( |
|
1979 |
const TDesC8& aURI, |
|
1980 |
const TDesC8& aLUID, |
|
1981 |
const TInt aStatusRef ) |
|
1982 |
{ |
|
1983 |
DBG_PRINT("CNSmlDmVoIPAdapter::DeleteObjectL( ): begin"); |
|
1984 |
||
1985 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
1986 |
||
1987 |
// Load VoIP profile information if not loaded yet |
|
1988 |
if ( !iProfileEntries.Count() ) |
|
1989 |
{ |
|
1990 |
LoadProfilesL(); |
|
1991 |
} |
|
1992 |
||
1993 |
CSmlDmAdapter::TError retValue = CSmlDmAdapter::EError; |
|
1994 |
||
1995 |
// Get URI parameters. |
|
1996 |
TBuf8<KNSmlVoIPMaxUriLength> uri = aURI; |
|
1997 |
TPtrC8 uriSeg = LastURISeg( aURI ); |
|
1998 |
TPtrC8 uriTmp = RemoveLastURISeg( aURI ); |
|
1999 |
TPtrC8 secondLastUriSeg = LastURISeg( uriTmp ); |
|
2000 |
||
2001 |
// Copy LUID as last segment if exists. |
|
2002 |
if ( 0 < aLUID.Length() ) |
|
2003 |
{ |
|
2004 |
uri.Copy ( aLUID ); |
|
2005 |
} |
|
2006 |
iProfileID = FindProfileLocation( uri ); |
|
2007 |
if ( KErrNotFound == iProfileID ) |
|
2008 |
{ |
|
2009 |
iProfileID = FindProfileLocation( aURI ); |
|
2010 |
if ( KErrNotFound == iProfileID ) |
|
2011 |
{ |
|
2012 |
retValue = CSmlDmAdapter::ENotFound; |
|
2013 |
iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
2014 |
DBG_PRINT("CNSmlDmVoIPAdapter::DeleteObjectL( ): ENotFound end"); |
|
2015 |
return; |
|
2016 |
} |
|
2017 |
} |
|
2018 |
||
2019 |
// ============================== |
|
2020 |
// VoIP/x (delete) |
|
2021 |
// ============================== |
|
2022 |
// |
|
2023 |
if ( secondLastUriSeg == KNSmlDMVoIPNodeName |
|
2024 |
&& aLUID.Find( KNSmlDMVoIPPrefix ) != KErrNotFound ) |
|
2025 |
{ |
|
2026 |
// Delete profile from RCSE. |
|
2027 |
iCRCSEProfile->DeleteL( iProfileEntries[iProfileID]->iId ); |
|
2028 |
||
2029 |
// Delete profile also from memory and compress array. |
|
2030 |
delete iProfileEntries[iProfileID]; |
|
2031 |
iProfileEntries[iProfileID] = NULL; |
|
2032 |
iProfileEntries.Remove( iProfileID ); |
|
2033 |
iProfileEntries.Compress(); |
|
2034 |
iDmCallback->SetMappingL( aURI, KNullDesC8 ); |
|
2035 |
retValue = CSmlDmAdapter::EOk; |
|
2036 |
||
2037 |
// Fall back to CS preferred when no more VoIP profiles |
|
2038 |
TInt profileCount = iProfileEntries.Count(); |
|
2039 |
if ( KErrNone == profileCount ) |
|
2040 |
{ |
|
2041 |
SetTelephonyPreferenceL( ECSPreferred ); |
|
2042 |
} |
|
2043 |
} |
|
2044 |
||
2045 |
// ============================== |
|
2046 |
// CodecSettings node ( delete ) |
|
2047 |
// ============================== |
|
2048 |
// |
|
2049 |
else if ( KNSmlDMVoIPCodecSettingsNode() == secondLastUriSeg |
|
2050 |
&& KFourSegs == NumOfURISegs( aURI ) |
|
2051 |
&& aLUID.Find( KNSmlDMVoIPCodecSettingsId ) != KErrNotFound ) |
|
2052 |
{ |
|
2053 |
// Get codec ID used by this setting. |
|
2054 |
TUint32 codecId = DesToInt( aLUID.Right(10) ); |
|
2055 |
TInt codecPos = FindCodecLocation( codecId ); |
|
2056 |
if ( KErrNotFound != codecPos ) |
|
2057 |
{ |
|
2058 |
// Delete codec settings from RCSE. |
|
2059 |
iCRCSEAudioCodec->DeleteL( codecId ); |
|
2060 |
TInt preferredPos = iProfileEntries[iProfileID]-> |
|
2061 |
iPreferredCodecs.Find( codecId ); |
|
2062 |
||
2063 |
// Remove codec settings ID from profiles iPreferredCodecs. |
|
2064 |
iProfileEntries[iProfileID]->iPreferredCodecs.Remove( |
|
2065 |
preferredPos ); |
|
2066 |
iProfileEntries[iProfileID]->iPreferredCodecs.Compress(); |
|
2067 |
||
2068 |
// Remove codec settings from iCodecEntries and update |
|
2069 |
// Profile back to RCSE. |
|
2070 |
delete iCodecEntries[codecPos]; |
|
2071 |
iCodecEntries[codecPos] = NULL; |
|
2072 |
iCodecEntries.Remove( codecPos ); |
|
2073 |
iCodecEntries.Compress(); |
|
2074 |
iCRCSEProfile->UpdateL( iProfileEntries[iProfileID]-> |
|
2075 |
iId, *iProfileEntries[iProfileID] ); |
|
2076 |
retValue = CSmlDmAdapter::EOk; |
|
2077 |
} |
|
2078 |
else |
|
2079 |
{ |
|
2080 |
retValue = CSmlDmAdapter::EError; |
|
2081 |
} |
|
2082 |
} |
|
2083 |
||
2084 |
// ============================== |
|
2085 |
// VoIP/x/SettingIds ( delete ) |
|
2086 |
// ==============================, |
|
2087 |
// |
|
2088 |
else if ( KNSmlDMVoIPSettingIdsNode() == secondLastUriSeg |
|
2089 |
&& KFourSegs == NumOfURISegs( aURI ) |
|
2090 |
&& aLUID.Find( KNSmlDMVoIPSettingId ) != KErrNotFound ) |
|
2091 |
{ |
|
2092 |
iProfileEntries[iProfileID]->iIds.Remove( |
|
2093 |
DesToInt( aLUID.Right( 10 ) ) ); |
|
2094 |
iProfileEntries[iProfileID]->iIds.Compress(); |
|
2095 |
iCRCSEProfile->UpdateL( iProfileEntries[iProfileID]-> |
|
2096 |
iId, *iProfileEntries[iProfileID] ); |
|
2097 |
retValue = CSmlDmAdapter::EOk; |
|
2098 |
} |
|
2099 |
||
2100 |
// ============================== |
|
2101 |
// VoIP/x/CodecSettings/x/ModeSet Node ( delete ) |
|
2102 |
// ============================== |
|
2103 |
// |
|
2104 |
else if ( KNSmlDMVoIPModeSetNode() == secondLastUriSeg |
|
2105 |
&& KSixSegs == NumOfURISegs( aURI ) |
|
2106 |
&& aLUID.Find( KNSmlDMVoIPModeId ) != KErrNotFound ) |
|
2107 |
{ |
|
2108 |
// get codecid used by this setting |
|
2109 |
TUint32 codecId = DesToInt( RemoveLastURISeg( aLUID ).Right( 10 ) ); |
|
2110 |
TInt codecPos = FindCodecLocation( codecId ); |
|
2111 |
if ( KErrNotFound != codecPos ) |
|
2112 |
{ |
|
2113 |
// remove modeset from iCodecEntries |
|
2114 |
iCodecEntries[codecPos]-> |
|
2115 |
iModeSet.Remove( DesToInt( aLUID.Right( 10 ) ) ); |
|
2116 |
iCodecEntries[codecPos]-> |
|
2117 |
iModeSet.Compress(); |
|
2118 |
||
2119 |
// update changes also to rcse |
|
2120 |
iCRCSEAudioCodec->UpdateL( codecId, *iCodecEntries[codecPos] ); |
|
2121 |
iDmCallback->SetMappingL( aURI, KNullDesC8 ); |
|
2122 |
retValue = CSmlDmAdapter::EOk; |
|
2123 |
} |
|
2124 |
else |
|
2125 |
{ |
|
2126 |
retValue = CSmlDmAdapter::EError; |
|
2127 |
} |
|
2128 |
} |
|
2129 |
else |
|
2130 |
{ |
|
2131 |
retValue = CSmlDmAdapter::EInvalidObject; |
|
2132 |
} |
|
2133 |
iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
2134 |
DBG_PRINT("CNSmlDmVoIPAdapter::DeleteObjectL( ): end"); |
|
2135 |
} |
|
2136 |
||
2137 |
// --------------------------------------------------------------------------- |
|
2138 |
// CNSmlDmVoIPAdapter::FetchLeafObjectL |
|
2139 |
// Fetches the values of leaf objects. |
|
2140 |
// --------------------------------------------------------------------------- |
|
2141 |
// |
|
2142 |
void CNSmlDmVoIPAdapter::FetchLeafObjectL( |
|
2143 |
const TDesC8& aURI, |
|
2144 |
const TDesC8& aLUID, |
|
2145 |
const TDesC8& aType, |
|
2146 |
const TInt aResultsRef, |
|
2147 |
const TInt aStatusRef ) |
|
2148 |
{ |
|
2149 |
DBG_PRINT("CNSmlDmVoIPAdapter::FetchLeafObjectL(): begin"); |
|
2150 |
||
2151 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
2152 |
||
2153 |
// Load VoIP profile information if not loaded yet |
|
2154 |
if ( !iProfileEntries.Count() ) |
|
2155 |
{ |
|
2156 |
LoadProfilesL(); |
|
2157 |
} |
|
2158 |
||
2159 |
CBufBase *result = CBufFlat::NewL( KDefaultResultSize ); |
|
2160 |
CleanupStack::PushL( result ); |
|
2161 |
CSmlDmAdapter::TError status = FetchObjectL( aURI, aLUID, *result ); |
|
2162 |
||
2163 |
if ( CSmlDmAdapter::EOk == status ) |
|
2164 |
{ |
|
2165 |
iDmCallback->SetResultsL( aResultsRef, *result, aType ); |
|
2166 |
} |
|
2167 |
iDmCallback->SetStatusL( aStatusRef, status ); |
|
2168 |
||
2169 |
CleanupStack::PopAndDestroy( result ); //result |
|
2170 |
result = NULL; |
|
2171 |
DBG_PRINT("CNSmlDmVoIPAdapter::FetchLeafObjectL(): end"); |
|
2172 |
} |
|
2173 |
||
2174 |
// --------------------------------------------------------------------------- |
|
2175 |
// CNSmlDmVoIPAdapter::FetchObjectL() |
|
2176 |
// Fetches the values of leaf objects. |
|
2177 |
// --------------------------------------------------------------------------- |
|
2178 |
// |
|
2179 |
CSmlDmAdapter::TError CNSmlDmVoIPAdapter::FetchObjectL( |
|
2180 |
const TDesC8& aURI, const TDesC8& aLUID, |
|
2181 |
CBufBase& result ) |
|
2182 |
{ |
|
2183 |
DBG_PRINT("CNSmlDmVoIPAdapter::FetchObjectL(): start"); |
|
2184 |
CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk; |
|
2185 |
typedef CRCSEProfileEntry Entry; |
|
2186 |
||
2187 |
// Check that LUID mapping exists. |
|
2188 |
if ( !aLUID.Length() > 0 ) |
|
2189 |
{ |
|
2190 |
DBG_PRINT("CNSmlDmVoIPAdapter::FetchLeafObjectL(internal)()():ENotFound end"); |
|
2191 |
return CSmlDmAdapter::ENotFound; |
|
2192 |
} |
|
2193 |
||
2194 |
TBuf8<KNSmlVoIPMaxResultLength> segmentResult; |
|
2195 |
TPtrC8 uriSeg = LastURISeg( aURI ); |
|
2196 |
||
2197 |
TPtrC8 uriTmp = RemoveLastURISeg( aURI ); |
|
2198 |
TPtrC8 secondLastUriSeg = LastURISeg( uriTmp ); |
|
2199 |
||
2200 |
// Find profile and get its settings. |
|
2201 |
iProfileID = FindProfileLocation( aLUID ); |
|
2202 |
||
2203 |
// If profile is not found return error. |
|
2204 |
if ( KErrNotFound == iProfileID ) |
|
2205 |
{ |
|
2206 |
DBG_PRINT( "CNSmlDmVoIPAdapter::FetchObjectL(): ENotFound end" ); |
|
2207 |
return CSmlDmAdapter::ENotFound; |
|
2208 |
} |
|
2209 |
||
2210 |
// Set SPS ready for getting values. |
|
2211 |
CSPSettings* spSettings = CSPSettings::NewLC(); // CS:1 |
|
2212 |
TUint32 serviceId = iProfileEntries[iProfileID]->iServiceProviderId; |
|
2213 |
||
2214 |
//VoIP/x/VoIPId |
|
2215 |
if ( KNSmlDMVoIPSetID() == uriSeg ) |
|
2216 |
{ |
|
2217 |
segmentResult.AppendNumFixedWidthUC( |
|
2218 |
iProfileEntries[iProfileID]->iId, EDecimal, 10 ); |
|
2219 |
} |
|
2220 |
//VoIP/x/ProviderName |
|
2221 |
else if ( KNSmlDMVoIPProvID() == uriSeg ) |
|
2222 |
{ |
|
2223 |
segmentResult.Copy( iProfileEntries[iProfileID]-> |
|
2224 |
iProviderName ); |
|
2225 |
} |
|
2226 |
//VoIP/x/SettingsName |
|
2227 |
else if ( KNSmlDMVoIPName() == uriSeg ) |
|
2228 |
{ |
|
2229 |
segmentResult.Copy( iProfileEntries[iProfileID]-> |
|
2230 |
iSettingsName ); |
|
2231 |
} |
|
2232 |
//VoIP/x/SMPort |
|
2233 |
else if ( KNSmlDMVoIPSMPort() == uriSeg ) |
|
2234 |
{ |
|
2235 |
segmentResult.Num( iProfileEntries[iProfileID]-> |
|
2236 |
iStartMediaPort ); |
|
2237 |
} |
|
2238 |
//VoIP/x/EMPort |
|
2239 |
else if ( KNSmlDMVoIPEMPort() == uriSeg ) |
|
2240 |
{ |
|
2241 |
segmentResult.Num( iProfileEntries[iProfileID]-> |
|
2242 |
iEndMediaPort ); |
|
2243 |
} |
|
2244 |
//VoIP/x/MediaQos |
|
2245 |
else if ( KNSmlDMVoIPMediaQos() == uriSeg ) |
|
2246 |
{ |
|
2247 |
segmentResult.Num( iProfileEntries[iProfileID]-> |
|
2248 |
iMediaQOS ); |
|
2249 |
} |
|
2250 |
//VoIP/x/DTMFIB |
|
2251 |
else if ( KNSmlDMVoIPDTMFIB() == uriSeg ) |
|
2252 |
{ |
|
2253 |
if ( Entry::EOONotSet == iProfileEntries[iProfileID]-> |
|
2254 |
iInbandDTMF ) |
|
2255 |
{ |
|
2256 |
segmentResult.Copy( KNSmlDMVoIPValueNotSet ); |
|
2257 |
} |
|
2258 |
if ( Entry::EOn == iProfileEntries[iProfileID]->iInbandDTMF ) |
|
2259 |
{ |
|
2260 |
segmentResult.Copy( KNSmlDMVoIPValueTrue ); |
|
2261 |
} |
|
2262 |
if ( Entry::EOff == iProfileEntries[iProfileID]->iInbandDTMF ) |
|
2263 |
{ |
|
2264 |
segmentResult.Copy( KNSmlDMVoIPValueFalse ); |
|
2265 |
} |
|
2266 |
} |
|
2267 |
//VoIP/x/DTMFOB |
|
2268 |
else if ( KNSmlDMVoIPDTMFOB() == uriSeg ) |
|
2269 |
{ |
|
2270 |
if ( Entry::EOONotSet == iProfileEntries[iProfileID]-> |
|
2271 |
iOutbandDTMF ) |
|
2272 |
{ |
|
2273 |
segmentResult.Copy( KNSmlDMVoIPValueNotSet ); |
|
2274 |
} |
|
2275 |
if ( Entry::EOff == iProfileEntries[iProfileID]->iOutbandDTMF ) |
|
2276 |
{ |
|
2277 |
segmentResult.Copy( KNSmlDMVoIPValueFalse ); |
|
2278 |
} |
|
2279 |
if ( Entry::EOn == iProfileEntries[iProfileID]->iOutbandDTMF ) |
|
2280 |
{ |
|
2281 |
segmentResult.Copy( KNSmlDMVoIPValueTrue ); |
|
2282 |
} |
|
2283 |
} |
|
2284 |
// VoIP/x/SecureCallPref |
|
2285 |
else if ( KNSmlDMVoIPSecureCallPref() == uriSeg ) |
|
2286 |
{ |
|
2287 |
segmentResult.Num( iProfileEntries[iProfileID]-> |
|
2288 |
iSecureCallPreference ); |
|
2289 |
} |
|
2290 |
// VoIP/x/RTCP |
|
2291 |
else if ( KNSmlDMVoIPRTCP() == uriSeg ) |
|
2292 |
{ |
|
2293 |
segmentResult.Num( iProfileEntries[iProfileID]->iRTCP ); |
|
2294 |
} |
|
2295 |
// VoIP/x/UAHTerminalType |
|
2296 |
else if ( KNSmlDMVoIPUAHTerminalType() == uriSeg ) |
|
2297 |
{ |
|
2298 |
segmentResult.Num( iProfileEntries[iProfileID]-> |
|
2299 |
iSIPVoIPUAHTerminalType ); |
|
2300 |
} |
|
2301 |
// VoIP/x/UAHWLANMAC |
|
2302 |
else if ( KNSmlDMVoIPUAHWLANMAC() == uriSeg ) |
|
2303 |
{ |
|
2304 |
segmentResult.Num( iProfileEntries[iProfileID]-> |
|
2305 |
iSIPVoIPUAHeaderWLANMAC ); |
|
2306 |
} |
|
2307 |
// VoIP/x/UAHString |
|
2308 |
else if ( KNSmlDMVoIPUAHString() == uriSeg ) |
|
2309 |
{ |
|
2310 |
segmentResult.Copy( iProfileEntries[iProfileID]-> |
|
2311 |
iSIPVoIPUAHeaderString ); |
|
2312 |
} |
|
2313 |
// VoIP/x/ProfileLockedToIAP |
|
2314 |
else if ( KNSmlDMVoIPProfileLockedToIAP() == uriSeg ) |
|
2315 |
{ |
|
2316 |
if ( Entry::EOONotSet == iProfileEntries[iProfileID]-> |
|
2317 |
iProfileLockedToIAP ) |
|
2318 |
{ |
|
2319 |
segmentResult.Copy( KNSmlDMVoIPValueNotSet ); |
|
2320 |
} |
|
2321 |
if ( Entry::EOn == iProfileEntries[iProfileID]-> |
|
2322 |
iProfileLockedToIAP ) |
|
2323 |
{ |
|
2324 |
segmentResult.Copy( KNSmlDMVoIPValueTrue ); |
|
2325 |
} |
|
2326 |
if ( Entry::EOff == iProfileEntries[iProfileID]-> |
|
2327 |
iProfileLockedToIAP ) |
|
2328 |
{ |
|
2329 |
segmentResult.Copy( KNSmlDMVoIPValueFalse ); |
|
2330 |
} |
|
2331 |
} |
|
2332 |
// VoIP/x/VoIPPluginUID |
|
2333 |
else if ( KNSmlDMVoIPPluginUID() == uriSeg ) |
|
2334 |
{ |
|
2335 |
segmentResult.Num( iProfileEntries[iProfileID]->iVoIPPluginUID ); |
|
2336 |
} |
|
2337 |
// VoIP/x/AllowVoIPOverWCDMA |
|
2338 |
else if ( KNSmlDMVoIPAllowVoIPOverWCDMA() == uriSeg ) |
|
2339 |
{ |
|
2340 |
TInt sipProfileId(0); |
|
2341 |
TUint32 bearerFilttering(0); |
|
2342 |
||
2343 |
for ( TInt index = 0; index < iProfileEntries[iProfileID]-> |
|
2344 |
iIds.Count(); index++ ) |
|
2345 |
{ |
|
2346 |
if ( iProfileEntries[iProfileID]->iIds[index].iProfileType == 0 ) |
|
2347 |
{ |
|
2348 |
sipProfileId = iProfileEntries[iProfileID]-> |
|
2349 |
iIds[index].iProfileId; |
|
2350 |
break; |
|
2351 |
} |
|
2352 |
} |
|
2353 |
||
2354 |
CSIPProfile* sipProf = NULL; |
|
2355 |
CSIPProfileRegistryObserver* sipRegObs = |
|
2356 |
CSIPProfileRegistryObserver::NewLC(); // CS:1 |
|
2357 |
CSIPManagedProfileRegistry* sipProfReg = |
|
2358 |
CSIPManagedProfileRegistry::NewLC( *sipRegObs ); // CS:2 |
|
2359 |
TRAPD( err, ( sipProf = sipProfReg->ProfileL( sipProfileId ) ) ); |
|
2360 |
||
2361 |
if ( KErrNone == err ) |
|
2362 |
{ |
|
2363 |
User::LeaveIfError( sipProf->GetParameter( |
|
2364 |
KBearerType, bearerFilttering ) ); |
|
2365 |
} |
|
2366 |
||
2367 |
CleanupStack::PopAndDestroy( sipProfReg ); // CS:1 |
|
2368 |
CleanupStack::PopAndDestroy( sipRegObs ); // CS:0 |
|
2369 |
||
2370 |
if ( bearerFilttering == KBearerWlanOnly ) |
|
2371 |
{ |
|
2372 |
segmentResult.Copy( KNSmlDMVoIPValueFalse ); |
|
2373 |
} |
|
2374 |
||
2375 |
else if ( bearerFilttering == KBearerNotSpecified ) |
|
2376 |
{ |
|
2377 |
segmentResult.Copy( KNSmlDMVoIPValueTrue ); |
|
2378 |
} |
|
2379 |
} |
|
2380 |
// VoIP/x/VoIPDigits |
|
2381 |
else if ( KNSmlDMVoIPVoIPDigits() == uriSeg ) |
|
2382 |
{ |
|
2383 |
segmentResult.Num( iProfileEntries[iProfileID]-> |
|
2384 |
iMeanCountOfVoIPDigits ); |
|
2385 |
} |
|
2386 |
// VoIP/x/URIDomainIgnoreRule |
|
2387 |
else if ( KNSmlDMVoIPURIDomainIgnoreRule() == uriSeg ) |
|
2388 |
{ |
|
2389 |
segmentResult.Num( iProfileEntries[iProfileID]-> |
|
2390 |
iIgnoreAddrDomainPart ); |
|
2391 |
} |
|
2392 |
// VoIP/x/AutoAcceptBuddyRequest |
|
2393 |
else if ( KNSmlDMVoIPAutoAcceptBuddyRequest() == uriSeg ) |
|
2394 |
{ |
|
2395 |
CSPProperty* autoAcceptBuddy = CSPProperty::NewLC(); |
|
2396 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2397 |
ESubPropertyPresenceRequestPreference, *autoAcceptBuddy ); |
|
2398 |
if ( KErrNone != err ) |
|
2399 |
{ |
|
2400 |
retValue = CSmlDmAdapter::EError; |
|
2401 |
} |
|
2402 |
else |
|
2403 |
{ |
|
2404 |
TInt autoAccept; |
|
2405 |
err = autoAcceptBuddy->GetValue( autoAccept ); |
|
2406 |
if ( KErrNone == err ) |
|
2407 |
{ |
|
2408 |
segmentResult.Num( autoAccept ); |
|
2409 |
} |
|
2410 |
else |
|
2411 |
{ |
|
2412 |
retValue = CSmlDmAdapter::EError; |
|
2413 |
} |
|
2414 |
} |
|
2415 |
CleanupStack::PopAndDestroy( autoAcceptBuddy ); |
|
2416 |
} |
|
2417 |
// VoIP/x/UsedVoIPRelease |
|
2418 |
else if ( KNSmlDMVoIPUsedVoIPRelease() == uriSeg ) |
|
2419 |
{ |
|
2420 |
TBuf16<KMaxUriLength> voipRelease( KNullDesC16 ); |
|
2421 |
voipRelease.Copy( spSettings->GetSIPVoIPSWVersion() ); |
|
2422 |
if ( !voipRelease.Length() ) |
|
2423 |
{ |
|
2424 |
retValue = CSmlDmAdapter::EError; |
|
2425 |
} |
|
2426 |
else |
|
2427 |
{ |
|
2428 |
segmentResult.Copy( voipRelease ); |
|
2429 |
} |
|
2430 |
} |
|
2431 |
// VoIP/x/AddUserPhone |
|
2432 |
else if ( KNSmlDMVoIPAddUserPhone() == uriSeg ) |
|
2433 |
{ |
|
2434 |
if ( Entry::EOONotSet == iProfileEntries[iProfileID]-> |
|
2435 |
iUserPhoneUriParameter ) |
|
2436 |
{ |
|
2437 |
segmentResult.Copy( KNSmlDMVoIPValueNotSet ); |
|
2438 |
} |
|
2439 |
else if ( Entry::EOn == iProfileEntries[iProfileID]-> |
|
2440 |
iUserPhoneUriParameter ) |
|
2441 |
{ |
|
2442 |
segmentResult.Copy( KNSmlDMVoIPValueTrue ); |
|
2443 |
} |
|
2444 |
else if ( Entry::EOff == iProfileEntries[iProfileID]-> |
|
2445 |
iUserPhoneUriParameter ) |
|
2446 |
{ |
|
2447 |
segmentResult.Copy( KNSmlDMVoIPValueFalse ); |
|
2448 |
} |
|
2449 |
} |
|
2450 |
// VoIP/x/ProviderBookmarkURI |
|
2451 |
else if ( KNSmlDMVoIPProviderBookmarkUri() == uriSeg ) |
|
2452 |
{ |
|
2453 |
CSPProperty* providerBkmark = CSPProperty::NewLC(); |
|
2454 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2455 |
EPropertyServiceBookmarkUri, *providerBkmark ); |
|
2456 |
if ( KErrNone != err ) |
|
2457 |
{ |
|
2458 |
retValue = CSmlDmAdapter::EError; |
|
2459 |
} |
|
2460 |
else |
|
2461 |
{ |
|
2462 |
TBuf16<KNSmlVoIPMaxUriLength> bkmark; |
|
2463 |
err = providerBkmark->GetValue( bkmark ); |
|
2464 |
if ( KErrNone == err ) |
|
2465 |
{ |
|
2466 |
segmentResult.Copy( bkmark ); |
|
2467 |
} |
|
2468 |
else |
|
2469 |
{ |
|
2470 |
retValue = CSmlDmAdapter::EError; |
|
2471 |
} |
|
2472 |
} |
|
2473 |
CleanupStack::PopAndDestroy( providerBkmark ); |
|
2474 |
} |
|
2475 |
// VoIP/x/SIPConnectivityTestURI |
|
2476 |
else if ( KNSmlDMVoIPSIPConnTestUri() == uriSeg ) |
|
2477 |
{ |
|
2478 |
segmentResult.Copy( iProfileEntries[iProfileID]-> |
|
2479 |
iSIPConnTestAddress ); |
|
2480 |
} |
|
2481 |
// VoIP/x/NATFWProfileId |
|
2482 |
else if ( KNSmlDMVoIPNatFwProfileId() == uriSeg ) |
|
2483 |
{ |
|
2484 |
TBuf16<KMaxUriLength> natfwProfile; |
|
2485 |
retValue = GetNatFwUriL( natfwProfile, |
|
2486 |
iProfileEntries[iProfileID]->iNATSettingsStorageId ); |
|
2487 |
if ( CSmlDmAdapter::EOk == retValue ) |
|
2488 |
{ |
|
2489 |
segmentResult.Copy( natfwProfile ); |
|
2490 |
} |
|
2491 |
} |
|
2492 |
// VoIP/x/MinSessionInterval |
|
2493 |
else if ( KNSmlDMVoIPMinSessionInterval() == uriSeg ) |
|
2494 |
{ |
|
2495 |
segmentResult.Num( iProfileEntries[iProfileID]->iSIPMinSE ); |
|
2496 |
} |
|
2497 |
// VoIP/x/SessionExpires |
|
2498 |
else if ( KNSmlDMVoIPSessionExpires() == uriSeg ) |
|
2499 |
{ |
|
2500 |
segmentResult.Num( iProfileEntries[iProfileID]-> |
|
2501 |
iSIPSessionExpires ); |
|
2502 |
} |
|
2503 |
// VoIP/x/BradingDataURI |
|
2504 |
else if ( KNSmlDMVoIPBrandingDataUri() == uriSeg ) |
|
2505 |
{ |
|
2506 |
CSPProperty* brandingUri = CSPProperty::NewLC(); |
|
2507 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2508 |
ESubPropertyVoIPBrandDataUri, *brandingUri ); |
|
2509 |
if ( KErrNone != err ) |
|
2510 |
{ |
|
2511 |
retValue = CSmlDmAdapter::EError; |
|
2512 |
} |
|
2513 |
else |
|
2514 |
{ |
|
2515 |
TBuf16<KNSmlVoIPMaxUriLength> brandUri; |
|
2516 |
err = brandingUri->GetValue( brandUri ); |
|
2517 |
if ( KErrNone == err ) |
|
2518 |
{ |
|
2519 |
segmentResult.Copy( brandUri ); |
|
2520 |
} |
|
2521 |
else |
|
2522 |
{ |
|
2523 |
retValue = CSmlDmAdapter::EError; |
|
2524 |
} |
|
2525 |
} |
|
2526 |
CleanupStack::PopAndDestroy( brandingUri ); |
|
2527 |
} |
|
2528 |
// VoIP/x/PresenceSettingsId |
|
2529 |
else if ( KNSmlDMVoIPPresenceSettingsId() == uriSeg ) |
|
2530 |
{ |
|
2531 |
CSPProperty* presenceId = CSPProperty::NewLC(); |
|
2532 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2533 |
ESubPropertyPresenceSettingsId, *presenceId ); |
|
2534 |
if ( KErrNone != err ) |
|
2535 |
{ |
|
2536 |
retValue = CSmlDmAdapter::EError; |
|
2537 |
} |
|
2538 |
else |
|
2539 |
{ |
|
2540 |
TInt presId; |
|
2541 |
err = presenceId->GetValue( presId ); |
|
2542 |
if ( KErrNone == err ) |
|
2543 |
{ |
|
2544 |
TBuf16<KMaxUriLength> presenceUri; |
|
2545 |
retValue = GetPresenceUriL( presenceUri, (TUint32)presId ); |
|
2546 |
if ( EOk == retValue ) |
|
2547 |
{ |
|
2548 |
segmentResult.Copy( presenceUri ); |
|
2549 |
} |
|
2550 |
} |
|
2551 |
else |
|
2552 |
{ |
|
2553 |
retValue = CSmlDmAdapter::EError; |
|
2554 |
} |
|
2555 |
} |
|
2556 |
CleanupStack::PopAndDestroy( presenceId ); |
|
2557 |
} |
|
2558 |
// VoIP/x/UsedNATProtocol |
|
2559 |
else if ( KNSmlDMVoIPUsedNatProtocol() == uriSeg ) |
|
2560 |
{ |
|
2561 |
segmentResult.Num( iProfileEntries[iProfileID]->iNATProtocol ); |
|
2562 |
} |
|
2563 |
// VoIP/x/AutoEnable |
|
2564 |
else if ( KNSmlDMVoIPAutoEnable() == uriSeg ) |
|
2565 |
{ |
|
2566 |
CSPProperty* autoEnableService = CSPProperty::NewLC(); |
|
2567 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2568 |
ESubPropertyVoIPEnabled, *autoEnableService ); |
|
2569 |
if ( KErrNone != err ) |
|
2570 |
{ |
|
2571 |
retValue = CSmlDmAdapter::EError; |
|
2572 |
} |
|
2573 |
else |
|
2574 |
{ |
|
2575 |
TInt autoEnable; |
|
2576 |
err = autoEnableService->GetValue( autoEnable ); |
|
2577 |
if ( KErrNone == err ) |
|
2578 |
{ |
|
2579 |
segmentResult.Num( autoEnable ); |
|
2580 |
} |
|
2581 |
else |
|
2582 |
{ |
|
2583 |
retValue = CSmlDmAdapter::EError; |
|
2584 |
} |
|
2585 |
} |
|
2586 |
CleanupStack::PopAndDestroy( autoEnableService ); |
|
2587 |
} |
|
2588 |
// VoIP/x/SnapProfileId |
|
2589 |
else if ( KNSmlDMVoIPSnapProfileId() == uriSeg ) |
|
2590 |
{ |
|
2591 |
CSPProperty* snapProfileId = CSPProperty::NewLC(); |
|
2592 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2593 |
ESubPropertyVoIPPreferredSNAPId, *snapProfileId ); |
|
2594 |
if ( KErrNone != err ) |
|
2595 |
{ |
|
2596 |
retValue = CSmlDmAdapter::EError; |
|
2597 |
} |
|
2598 |
else |
|
2599 |
{ |
|
2600 |
TInt snapId; |
|
2601 |
err = snapProfileId->GetValue( snapId ); |
|
2602 |
if ( KErrNone == err ) |
|
2603 |
{ |
|
2604 |
TBuf8<KMaxUriLength> snapUri; |
|
2605 |
retValue = GetSnapUriL( snapUri, (TUint32)snapId ); |
|
2606 |
if ( EOk == retValue ) |
|
2607 |
{ |
|
2608 |
segmentResult.Copy( snapUri ); |
|
2609 |
} |
|
2610 |
} |
|
2611 |
else |
|
2612 |
{ |
|
2613 |
retValue = CSmlDmAdapter::EError; |
|
2614 |
} |
|
2615 |
} |
|
2616 |
CleanupStack::PopAndDestroy( snapProfileId ); |
|
2617 |
} |
|
2618 |
// VoIP/x/EnableIM |
|
2619 |
else if ( KNSmlDMVoIPEnableIm() == uriSeg ) |
|
2620 |
{ |
|
2621 |
CSPProperty* enableIm = CSPProperty::NewLC(); |
|
2622 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2623 |
ESubPropertyIMEnabled, *enableIm ); |
|
2624 |
if ( KErrNotFound == err ) |
|
2625 |
{ |
|
2626 |
segmentResult.Copy( KNSmlDMVoIPValueFalse ); |
|
2627 |
} |
|
2628 |
else if ( KErrNone != err ) |
|
2629 |
{ |
|
2630 |
retValue = CSmlDmAdapter::EError; |
|
2631 |
} |
|
2632 |
else |
|
2633 |
{ |
|
2634 |
TInt enableValue; |
|
2635 |
err = enableIm->GetValue( enableValue ); |
|
2636 |
if ( KErrNone == err && 0 < enableValue ) |
|
2637 |
{ |
|
2638 |
segmentResult.Copy( KNSmlDMVoIPValueTrue ); |
|
2639 |
} |
|
2640 |
else if ( KErrNone == err && !enableValue ) |
|
2641 |
{ |
|
2642 |
segmentResult.Copy( KNSmlDMVoIPValueFalse ); |
|
2643 |
} |
|
2644 |
else |
|
2645 |
{ |
|
2646 |
retValue = CSmlDmAdapter::EError; |
|
2647 |
} |
|
2648 |
} |
|
2649 |
CleanupStack::PopAndDestroy( enableIm ); |
|
2650 |
} |
|
2651 |
||
2652 |
// ============================== |
|
2653 |
// CodecSettings node ( fetch ) |
|
2654 |
// ============================== |
|
2655 |
// |
|
2656 |
// VoIP/x/PreferredCodecs node |
|
2657 |
if ( KNSmlDMVoIPPreferredCodecId() == uriSeg.Left( |
|
2658 |
KNSmlDMVoIPPreferredCodecId().Length() ) ) |
|
2659 |
{ |
|
2660 |
TInt preferredPos = DesToInt( LastURISeg( aLUID ).Right( 10 ) ); |
|
2661 |
segmentResult.Num( iProfileEntries[iProfileID]-> |
|
2662 |
iPreferredCodecs[preferredPos]); |
|
2663 |
} |
|
2664 |
||
2665 |
// VoIP/x/CodecSettings node |
|
2666 |
if ( KNSmlDMVoIPCodecSettingsId() == LastURISeg( aLUID ). |
|
2667 |
Left( KNSmlDMVoIPCodecSettingsId().Length() ) |
|
2668 |
&& KFiveSegs == NumOfURISegs( aURI ) ) |
|
2669 |
{ |
|
2670 |
retValue = FetchCodecObject( aLUID, uriSeg, segmentResult ); |
|
2671 |
} |
|
2672 |
||
2673 |
// ============================== |
|
2674 |
// SettingIds node ( fetch ) |
|
2675 |
// ============================== |
|
2676 |
// |
|
2677 |
if ( KNSmlDMVoIPSettingId() == LastURISeg( aLUID ). |
|
2678 |
Left( KNSmlDMVoIPSettingId().Length() ) |
|
2679 |
&& KFiveSegs == NumOfURISegs( aURI ) ) |
|
2680 |
{ |
|
2681 |
||
2682 |
//ProfileType |
|
2683 |
if ( KNSmlDMVoIPProfileType() == uriSeg ) |
|
2684 |
{ |
|
2685 |
if ( 0 == iProfileEntries[iProfileID]->iIds[DesToInt( |
|
2686 |
LastURISeg( aLUID ).Right( 10 ))].iProfileType ) |
|
2687 |
{ |
|
2688 |
segmentResult.Copy( KNSmlDMVoIPProfileTypeSIP ); |
|
2689 |
} |
|
2690 |
if ( 1 == iProfileEntries[iProfileID]->iIds[DesToInt( |
|
2691 |
LastURISeg( aLUID ).Right( 10 ))].iProfileType ) |
|
2692 |
{ |
|
2693 |
segmentResult.Copy( KNSmlDMVoIPProfileTypeSCCP ); |
|
2694 |
} |
|
2695 |
} |
|
2696 |
||
2697 |
// ProfileId |
|
2698 |
if ( KNSmlDMVoIPProfileId() == uriSeg ) |
|
2699 |
{ |
|
2700 |
if ( 0 == iProfileEntries[iProfileID]->iIds[DesToInt( |
|
2701 |
LastURISeg( aLUID ).Right( 10 ))].iProfileType ) |
|
2702 |
{ |
|
2703 |
retValue = GetSipIdL( result, iProfileEntries[iProfileID]-> |
|
2704 |
iIds[DesToInt( LastURISeg( aLUID ).Right( 10 ))]. |
|
2705 |
iProfileId ); |
|
2706 |
} |
|
2707 |
if ( 1 == iProfileEntries[iProfileID]->iIds[DesToInt( |
|
2708 |
LastURISeg( aLUID ).Right( 10 ))].iProfileType ) |
|
2709 |
{ |
|
2710 |
// Get SCCP ID from sccp adapter if exists |
|
2711 |
retValue = GetSccpIdL( result, iProfileEntries[iProfileID]-> |
|
2712 |
iIds[DesToInt( LastURISeg( aLUID ).Right( 10 ))]. |
|
2713 |
iProfileId ); |
|
2714 |
} |
|
2715 |
} |
|
2716 |
||
2717 |
// ProfileSpecificId |
|
2718 |
if ( KNSmlDMVoIPProfileSpecificId() == uriSeg ) |
|
2719 |
{ |
|
2720 |
segmentResult.Num( iProfileEntries[iProfileID]->iIds[ |
|
2721 |
DesToInt( LastURISeg( aLUID ).Right( 10 ) ) ]. |
|
2722 |
iProfileSpecificSettingId ); |
|
2723 |
} |
|
2724 |
} |
|
2725 |
||
2726 |
// ============================== |
|
2727 |
// VoiceMailBox node (fetch) |
|
2728 |
// ============================== |
|
2729 |
// |
|
2730 |
if ( KNSmlDMVoIPVmbxNode() == secondLastUriSeg && |
|
2731 |
KFourSegs == NumOfURISegs( aURI ) ) |
|
2732 |
{ |
|
2733 |
// VoIP/x/VoiceMailBox/MWI-URI |
|
2734 |
if ( KNSmlDMVoIPMwiUri() == uriSeg ) |
|
2735 |
{ |
|
2736 |
CSPProperty* mwiUri = CSPProperty::NewLC(); |
|
2737 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2738 |
ESubPropertyVMBXMWIAddress, *mwiUri ); |
|
2739 |
if ( KErrNone != err ) |
|
2740 |
{ |
|
2741 |
retValue = CSmlDmAdapter::EError; |
|
2742 |
} |
|
2743 |
else |
|
2744 |
{ |
|
2745 |
TBuf16<KNSmlVoIPMaxUriLength> mwiAddr; |
|
2746 |
err = mwiUri->GetValue( mwiAddr ); |
|
2747 |
if ( KErrNone == err ) |
|
2748 |
{ |
|
2749 |
segmentResult.Copy( mwiAddr ); |
|
2750 |
} |
|
2751 |
else |
|
2752 |
{ |
|
2753 |
retValue = CSmlDmAdapter::EError; |
|
2754 |
} |
|
2755 |
} |
|
2756 |
CleanupStack::PopAndDestroy( mwiUri ); |
|
2757 |
} |
|
2758 |
||
2759 |
// VoIP/x/VoiceMailBox/ListeningURI |
|
2760 |
if ( KNSmlDMVoIPListeningUri() == uriSeg ) |
|
2761 |
{ |
|
2762 |
CSPProperty* listeningUri = CSPProperty::NewLC(); |
|
2763 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2764 |
ESubPropertyVMBXListenAddress, *listeningUri ); |
|
2765 |
if ( KErrNone != err ) |
|
2766 |
{ |
|
2767 |
retValue = CSmlDmAdapter::EError; |
|
2768 |
} |
|
2769 |
else |
|
2770 |
{ |
|
2771 |
TBuf16<KNSmlVoIPMaxUriLength> listenUri; |
|
2772 |
err = listeningUri->GetValue( listenUri ); |
|
2773 |
if ( KErrNone == err ) |
|
2774 |
{ |
|
2775 |
segmentResult.Copy( listenUri ); |
|
2776 |
} |
|
2777 |
else |
|
2778 |
{ |
|
2779 |
retValue = CSmlDmAdapter::EError; |
|
2780 |
} |
|
2781 |
} |
|
2782 |
CleanupStack::PopAndDestroy( listeningUri ); |
|
2783 |
} |
|
2784 |
||
2785 |
// VoIP/x/VoiceMailBox/UsedIAPId |
|
2786 |
if ( KNSmlDMVoIPUsedIAPId() == uriSeg ) |
|
2787 |
{ |
|
2788 |
CSPProperty* iapId = CSPProperty::NewLC(); |
|
2789 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2790 |
ESubPropertyVMBXPreferredIAPId, *iapId ); |
|
2791 |
if ( KErrNone != err ) |
|
2792 |
{ |
|
2793 |
retValue = CSmlDmAdapter::EError; |
|
2794 |
} |
|
2795 |
else |
|
2796 |
{ |
|
2797 |
TInt iap; |
|
2798 |
err = iapId->GetValue( iap ); |
|
2799 |
if ( KErrNone == err ) |
|
2800 |
{ |
|
2801 |
retValue = GetConRefL( result, iap ); |
|
2802 |
if ( CSmlDmAdapter::EOk != retValue ) |
|
2803 |
{ |
|
2804 |
result.Reset(); |
|
2805 |
} |
|
2806 |
} |
|
2807 |
else |
|
2808 |
{ |
|
2809 |
retValue = CSmlDmAdapter::EError; |
|
2810 |
} |
|
2811 |
||
2812 |
} |
|
2813 |
CleanupStack::PopAndDestroy( iapId ); |
|
2814 |
} |
|
2815 |
||
2816 |
// VoIP/x/VoiceMailBox/ReSubscribeInterval |
|
2817 |
if ( KNSmlDMVoIPReSubscribeInterval() == uriSeg ) |
|
2818 |
{ |
|
2819 |
CSPProperty* reSubscrInterval = CSPProperty::NewLC(); |
|
2820 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2821 |
ESubPropertyVMBXMWISubscribeInterval, *reSubscrInterval ); |
|
2822 |
if ( KErrNone != err ) |
|
2823 |
{ |
|
2824 |
retValue = CSmlDmAdapter::EError; |
|
2825 |
} |
|
2826 |
else |
|
2827 |
{ |
|
2828 |
TInt reSubscribe; |
|
2829 |
err = reSubscrInterval->GetValue( reSubscribe ); |
|
2830 |
if ( KErrNone == err ) |
|
2831 |
{ |
|
2832 |
segmentResult.Num( reSubscribe ); |
|
2833 |
} |
|
2834 |
else |
|
2835 |
{ |
|
2836 |
retValue = CSmlDmAdapter::EError; |
|
2837 |
} |
|
2838 |
} |
|
2839 |
CleanupStack::PopAndDestroy( reSubscrInterval ); |
|
2840 |
} |
|
2841 |
||
2842 |
// VoIP/x/VoiceMailBox/UsedSIPProfileId |
|
2843 |
if ( KNSmlDMVoIPUsedSIPProfileId() == uriSeg ) |
|
2844 |
{ |
|
2845 |
CSPProperty* sipProfileId = CSPProperty::NewLC(); |
|
2846 |
TInt err = spSettings->FindPropertyL( serviceId, |
|
2847 |
ESubPropertyVMBXSettingsId, *sipProfileId ); |
|
2848 |
if ( KErrNone != err ) |
|
2849 |
{ |
|
2850 |
retValue = CSmlDmAdapter::EError; |
|
2851 |
} |
|
2852 |
else |
|
2853 |
{ |
|
2854 |
TInt sipId; |
|
2855 |
err = sipProfileId->GetValue( sipId ); |
|
2856 |
if ( KErrNone == err ) |
|
2857 |
{ |
|
2858 |
retValue = GetSipIdL( result, sipId ); |
|
2859 |
if ( CSmlDmAdapter::EOk != retValue ) |
|
2860 |
{ |
|
2861 |
result.Reset(); |
|
2862 |
} |
|
2863 |
} |
|
2864 |
else |
|
2865 |
{ |
|
2866 |
retValue = CSmlDmAdapter::EError; |
|
2867 |
} |
|
2868 |
} |
|
2869 |
CleanupStack::PopAndDestroy( sipProfileId ); |
|
2870 |
} |
|
2871 |
} |
|
2872 |
||
2873 |
result.InsertL( result.Size(), segmentResult ); |
|
2874 |
CleanupStack::PopAndDestroy( spSettings ); |
|
2875 |
||
2876 |
DBG_PRINT("CNSmlDmVoIPAdapter::FetchObjectL(): end"); |
|
2877 |
return retValue; |
|
2878 |
} |
|
2879 |
||
2880 |
// --------------------------------------------------------------------------- |
|
2881 |
// CNSmlDmVoIPAdapter::FetchCodecObject |
|
2882 |
// Fetches the values of Codec specific leaf objects. |
|
2883 |
// --------------------------------------------------------------------------- |
|
2884 |
// |
|
2885 |
CSmlDmAdapter::TError CNSmlDmVoIPAdapter::FetchCodecObject( |
|
2886 |
const TDesC8& aLUID, const TDesC8& aUriSeg, TDes8& aSegmentResult ) |
|
2887 |
{ |
|
2888 |
DBG_PRINT("CNSmlDmVoIPAdapter::FetchCodecObject(): begin"); |
|
2889 |
||
2890 |
CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk; |
|
2891 |
||
2892 |
TUint32 codecId = DesToInt( aLUID.Right( 10 ) ); |
|
2893 |
TInt codecPos = FindCodecLocation( codecId ); |
|
2894 |
if ( KErrNotFound != codecPos ) |
|
2895 |
{ |
|
2896 |
//CodecId |
|
2897 |
if ( KNSmlDMVoIPCodecId() == aUriSeg ) |
|
2898 |
{ |
|
2899 |
aSegmentResult.Num ( iCodecEntries[codecPos]->iCodecId ); |
|
2900 |
} |
|
2901 |
//MediaTypeName |
|
2902 |
if ( KNSmlDMVoIPMediaTypeName() == aUriSeg ) |
|
2903 |
{ |
|
2904 |
aSegmentResult.Copy ( iCodecEntries[codecPos]-> |
|
2905 |
iMediaTypeName ); |
|
2906 |
} |
|
2907 |
//MediaSubTypeName |
|
2908 |
if ( KNSmlDMVoIPMediaSubTypeName() == aUriSeg ) |
|
2909 |
{ |
|
2910 |
aSegmentResult.Copy ( iCodecEntries[codecPos]-> |
|
2911 |
iMediaSubTypeName ); |
|
2912 |
} |
|
2913 |
//JitterBufferSize |
|
2914 |
if ( KNSmlDMVoIPJitterBufferSize() == aUriSeg ) |
|
2915 |
{ |
|
2916 |
if ( KNotSet < iCodecEntries[codecPos]->iJitterBufferSize ) |
|
2917 |
{ |
|
2918 |
aSegmentResult.Num ( iCodecEntries[codecPos]-> |
|
2919 |
iJitterBufferSize ); |
|
2920 |
} |
|
2921 |
} |
|
2922 |
//OctetAlign |
|
2923 |
if ( KNSmlDMVoIPOctetAlign() == aUriSeg ) |
|
2924 |
{ |
|
2925 |
if ( CRCSEAudioCodecEntry::EOn == |
|
2926 |
iCodecEntries[codecPos]->iOctetAlign ) |
|
2927 |
{ |
|
2928 |
aSegmentResult.Copy( KNSmlDMVoIPValueTrue ); |
|
2929 |
} |
|
2930 |
if ( CRCSEAudioCodecEntry::EOff == |
|
2931 |
iCodecEntries[codecPos]->iOctetAlign ) |
|
2932 |
{ |
|
2933 |
aSegmentResult.Copy( KNSmlDMVoIPValueFalse ); |
|
2934 |
} |
|
2935 |
} |
|
2936 |
//ModeChangePeriod |
|
2937 |
if ( KNSmlDMVoIPModeChangePeriod() == aUriSeg ) |
|
2938 |
{ |
|
2939 |
if ( KNotSet < iCodecEntries[codecPos]-> |
|
2940 |
iModeChangePeriod ) |
|
2941 |
{ |
|
2942 |
aSegmentResult.Num( iCodecEntries[codecPos]-> |
|
2943 |
iModeChangePeriod ); |
|
2944 |
} |
|
2945 |
} |
|
2946 |
//ModeChangeNeighbor |
|
2947 |
if ( KNSmlDMVoIPModeChangeNeighbor() == aUriSeg ) |
|
2948 |
{ |
|
2949 |
if ( CRCSEAudioCodecEntry::EOn == |
|
2950 |
iCodecEntries[codecPos]->iModeChangeNeighbor ) |
|
2951 |
{ |
|
2952 |
aSegmentResult.Copy( KNSmlDMVoIPValueTrue ); |
|
2953 |
} |
|
2954 |
if ( CRCSEAudioCodecEntry::EOff == |
|
2955 |
iCodecEntries[codecPos]->iModeChangeNeighbor ) |
|
2956 |
{ |
|
2957 |
aSegmentResult.Copy( KNSmlDMVoIPValueFalse ); |
|
2958 |
} |
|
2959 |
} |
|
2960 |
//Ptime |
|
2961 |
if ( KNSmlDMVoIPPtime() == aUriSeg ) |
|
2962 |
{ |
|
2963 |
if ( KNotSet < iCodecEntries[codecPos]->iPtime ) |
|
2964 |
{ |
|
2965 |
aSegmentResult.Num( iCodecEntries[codecPos]->iPtime ); |
|
2966 |
} |
|
2967 |
} |
|
2968 |
//Maxptime |
|
2969 |
if ( KNSmlDMVoIPMaxPtime() == aUriSeg ) |
|
2970 |
{ |
|
2971 |
if ( KNotSet < iCodecEntries[codecPos]->iMaxptime ) |
|
2972 |
{ |
|
2973 |
aSegmentResult.Num( |
|
2974 |
iCodecEntries[codecPos]->iMaxptime ); |
|
2975 |
} |
|
2976 |
} |
|
2977 |
//VAD |
|
2978 |
if ( KNSmlDMVoIPVAD() == aUriSeg ) |
|
2979 |
{ |
|
2980 |
if ( CRCSEAudioCodecEntry::EOn == |
|
2981 |
iCodecEntries[codecPos]->iVAD ) |
|
2982 |
{ |
|
2983 |
aSegmentResult.Copy( KNSmlDMVoIPValueTrue ); |
|
2984 |
} |
|
2985 |
if ( CRCSEAudioCodecEntry::EOff == |
|
2986 |
iCodecEntries[codecPos]->iVAD ) |
|
2987 |
{ |
|
2988 |
aSegmentResult.Copy( KNSmlDMVoIPValueFalse ); |
|
2989 |
} |
|
2990 |
} |
|
2991 |
//AnnexB |
|
2992 |
if ( KNSmlDMVoIPAnnexB() == aUriSeg ) |
|
2993 |
{ |
|
2994 |
if ( CRCSEAudioCodecEntry::EOn == |
|
2995 |
iCodecEntries[codecPos]->iAnnexb ) |
|
2996 |
{ |
|
2997 |
aSegmentResult.Copy( KNSmlDMVoIPValueTrue ); |
|
2998 |
} |
|
2999 |
if ( CRCSEAudioCodecEntry::EOff == |
|
3000 |
iCodecEntries[codecPos]->iAnnexb ) |
|
3001 |
{ |
|
3002 |
aSegmentResult.Copy( KNSmlDMVoIPValueFalse ); |
|
3003 |
} |
|
3004 |
} |
|
3005 |
// MaxRed |
|
3006 |
if ( KNSmlDMVoIPMaxRed() == aUriSeg ) |
|
3007 |
{ |
|
3008 |
if ( CRCSEAudioCodecEntry::EOONotSet < |
|
3009 |
iCodecEntries[codecPos]->iMaxRed ) |
|
3010 |
{ |
|
3011 |
aSegmentResult.Num( iCodecEntries[codecPos]->iMaxRed ); |
|
3012 |
} |
|
3013 |
} |
|
3014 |
||
3015 |
// ============================== |
|
3016 |
// ModeSet node ( fetch ) |
|
3017 |
// ============================== |
|
3018 |
// |
|
3019 |
if ( KNSmlDMVoIPMode() == aUriSeg ) |
|
3020 |
{ |
|
3021 |
aSegmentResult.Num ( iCodecEntries[codecPos]-> |
|
3022 |
iModeSet[DesToInt( aLUID.Right( 10 ))] ); |
|
3023 |
} |
|
3024 |
} |
|
3025 |
else |
|
3026 |
{ |
|
3027 |
// Codec not found even if LUID exists. |
|
3028 |
retValue = CSmlDmAdapter::EError; |
|
3029 |
} |
|
3030 |
||
3031 |
DBG_PRINT("CNSmlDmVoIPAdapter::FetchCodecObject(): begin"); |
|
3032 |
||
3033 |
return retValue; |
|
3034 |
} |
|
3035 |
||
3036 |
// --------------------------------------------------------------------------- |
|
3037 |
// CNSmlDmVoIPAdapter::ChildURIListL |
|
3038 |
// Inserts the list of children objects of the node to dm-module |
|
3039 |
// --------------------------------------------------------------------------- |
|
3040 |
// |
|
3041 |
void CNSmlDmVoIPAdapter::ChildURIListL( |
|
3042 |
const TDesC8& aURI, |
|
3043 |
const TDesC8& aLUID, |
|
3044 |
const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, |
|
3045 |
const TInt aResultsRef, |
|
3046 |
const TInt aStatusRef ) |
|
3047 |
{ |
|
3048 |
DBG_PRINT( "CNSmlDmVoIPAdapter::ChildURIListL(): start" ); |
|
3049 |
||
3050 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
3051 |
||
3052 |
// Load VoIP profile information if not loaded yet |
|
3053 |
if ( !iProfileEntries.Count() ) |
|
3054 |
{ |
|
3055 |
LoadProfilesL(); |
|
3056 |
} |
|
3057 |
||
3058 |
CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk; |
|
3059 |
||
3060 |
CBufBase *currentURISegmentList = CBufFlat::NewL( 1 ); |
|
3061 |
CleanupStack::PushL( currentURISegmentList ); |
|
3062 |
||
3063 |
// get URI parameters |
|
3064 |
TBuf8<KNSmlVoIPMaxUriLength> uri( KNullDesC8 ); |
|
3065 |
TBuf8<KNSmlVoIPMaxUriLength> mappingInfo( KNullDesC8 ); |
|
3066 |
TPtrC8 uriTmp = RemoveLastURISeg( aURI ); |
|
3067 |
TPtrC8 secondLastUriSeg = LastURISeg( uriTmp ); |
|
3068 |
TBuf8<KSmlMaxURISegLen> segmentName; |
|
3069 |
TInt howManyObjects = iProfileEntries.Count(); |
|
3070 |
||
3071 |
iProfileID = FindProfileLocation( aLUID ); |
|
3072 |
||
3073 |
// VoIP |
|
3074 |
if ( KNSmlDMVoIPNodeName() == LastURISeg( aURI ) ) |
|
3075 |
{ |
|
3076 |
for ( TInt counter = 0; counter < howManyObjects ; counter++ ) |
|
3077 |
{ |
|
3078 |
TBool notInList = ETrue; |
|
3079 |
TInt currentline = 0; |
|
3080 |
TUint ddId ( iProfileEntries[counter]->iId ); |
|
3081 |
while ( notInList && currentline < aPreviousURISegmentList.Count() ) |
|
3082 |
{ |
|
3083 |
TInt profileLocation = FindProfileLocation( |
|
3084 |
aPreviousURISegmentList.At( currentline ).iURISegLUID ); |
|
3085 |
if ( profileLocation != KErrNotFound ) |
|
3086 |
{ |
|
3087 |
TUint32 profileID( |
|
3088 |
iProfileEntries[profileLocation]->iId ); |
|
3089 |
if ( profileID == ddId ) |
|
3090 |
{ |
|
3091 |
notInList = EFalse; |
|
3092 |
break; |
|
3093 |
} |
|
3094 |
} |
|
3095 |
currentline++; |
|
3096 |
} |
|
3097 |
if ( notInList ) |
|
3098 |
{ |
|
3099 |
// VoIP/x |
|
3100 |
segmentName.Copy( KNSmlDMVoIPPrefix ); |
|
3101 |
||
3102 |
// Add profileID number to identify profile |
|
3103 |
segmentName.AppendNumFixedWidthUC( |
|
3104 |
iProfileEntries[counter]->iId, EDecimal, 10 ); |
|
3105 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3106 |
Size(), segmentName ); |
|
3107 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3108 |
Size(), KNSmlDMVoIPSeparator ); |
|
3109 |
||
3110 |
// set luid mapping to dm-module |
|
3111 |
mappingInfo.Copy ( KNSmlDMVoIPPrefix ); |
|
3112 |
TUint val ( iProfileEntries[counter]->iId ); |
|
3113 |
mappingInfo.AppendNumFixedWidthUC( val, EDecimal, 10 ); |
|
3114 |
uri.Copy( KNSmlDMVoIPNodeName ); |
|
3115 |
uri.Append ( KNSmlDMVoIPSeparator ); |
|
3116 |
uri.Append ( KNSmlDMVoIPPrefix ); |
|
3117 |
uri.AppendNumFixedWidthUC( val, EDecimal, 10 ); |
|
3118 |
iDmCallback->SetMappingL( uri, mappingInfo ); |
|
3119 |
} |
|
3120 |
else |
|
3121 |
{ // Add those in PreviousList which are on database |
|
3122 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3123 |
aPreviousURISegmentList.At(currentline).iURISeg ); |
|
3124 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3125 |
KNSmlDMVoIPSeparator ); |
|
3126 |
} |
|
3127 |
} |
|
3128 |
retValue = CSmlDmAdapter::EOk; |
|
3129 |
iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
3130 |
iDmCallback->SetResultsL( aResultsRef, *currentURISegmentList, |
|
3131 |
KNullDesC8 ); |
|
3132 |
CleanupStack::PopAndDestroy( currentURISegmentList ); |
|
3133 |
currentURISegmentList = NULL; |
|
3134 |
return; |
|
3135 |
} |
|
3136 |
||
3137 |
if ( KErrNotFound == iProfileID ) |
|
3138 |
{ |
|
3139 |
retValue = CSmlDmAdapter::ENotFound; |
|
3140 |
iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
3141 |
CleanupStack::PopAndDestroy( currentURISegmentList ); |
|
3142 |
currentURISegmentList = NULL; |
|
3143 |
return; |
|
3144 |
} |
|
3145 |
||
3146 |
// VoIP/x/PreferredCodecs |
|
3147 |
if ( KNSmlDMVoIPPreferredCodecsNode() == LastURISeg( aURI ) ) |
|
3148 |
{ |
|
3149 |
TInt preferredCount = iProfileEntries[iProfileID]-> |
|
3150 |
iPreferredCodecs.Count(); |
|
3151 |
for ( TInt counter = 0; counter < preferredCount ; counter++ ) |
|
3152 |
{ |
|
3153 |
TBool inList = EFalse; |
|
3154 |
||
3155 |
// We need to rebuild LUID mapping if someone other has added or |
|
3156 |
// deleted codecs, because there is no usable link to each codec. |
|
3157 |
if ( aPreviousURISegmentList.Count() == preferredCount ) |
|
3158 |
{ |
|
3159 |
inList = ETrue; |
|
3160 |
} |
|
3161 |
if ( !inList ) |
|
3162 |
{ |
|
3163 |
segmentName.Copy( KNSmlDMVoIPPreferredCodecId ); |
|
3164 |
segmentName.AppendNumFixedWidthUC( counter + 1, EDecimal, 3 ); |
|
3165 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3166 |
Size(), segmentName ); |
|
3167 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3168 |
Size(), KNSmlDMVoIPSeparator ); |
|
3169 |
||
3170 |
// Set LUID mapping to dm-module. |
|
3171 |
mappingInfo.Copy ( aLUID ); |
|
3172 |
mappingInfo.Append ( KNSmlDMVoIPSeparator ); |
|
3173 |
mappingInfo.Append ( KNSmlDMVoIPPreferredCodecId ); |
|
3174 |
mappingInfo.AppendNumFixedWidthUC( counter, EDecimal, 10 ); |
|
3175 |
uri.Copy( aURI ); |
|
3176 |
uri.Append ( KNSmlDMVoIPSeparator ); |
|
3177 |
uri.Append ( KNSmlDMVoIPPreferredCodecId ); |
|
3178 |
uri.AppendNumFixedWidthUC( counter + 1, EDecimal, 3 ); |
|
3179 |
iDmCallback->SetMappingL( uri, mappingInfo ); |
|
3180 |
} |
|
3181 |
else |
|
3182 |
{ // Add those in PreviousList which are on database |
|
3183 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3184 |
aPreviousURISegmentList.At( counter ).iURISeg ); |
|
3185 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3186 |
KNSmlDMVoIPSeparator ); |
|
3187 |
} |
|
3188 |
} |
|
3189 |
} |
|
3190 |
||
3191 |
// VoIP/x/PreferredCodecs/x/ |
|
3192 |
else if ( KNSmlDMVoIPPreferredCodecsNode() == secondLastUriSeg |
|
3193 |
&& KFourSegs == NumOfURISegs( aURI ) ) |
|
3194 |
{ |
|
3195 |
segmentName.Copy( KNSmlDMVoIPPreferredCodecId ); |
|
3196 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3197 |
Size(), segmentName ); |
|
3198 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3199 |
Size(), KNSmlDMVoIPSeparator ); |
|
3200 |
} |
|
3201 |
||
3202 |
// VoIP/x/ |
|
3203 |
else if ( KNSmlDMVoIPCodecSettingsNode() == LastURISeg( aURI ) ) |
|
3204 |
{ |
|
3205 |
for ( TInt counter = 0; |
|
3206 |
counter < iProfileEntries[iProfileID]->iPreferredCodecs.Count(); |
|
3207 |
counter++ ) |
|
3208 |
{ |
|
3209 |
TBool notInList = ETrue; |
|
3210 |
TInt currentline = 0; |
|
3211 |
TUint32 ddId = iProfileEntries[iProfileID]-> |
|
3212 |
iPreferredCodecs[counter]; |
|
3213 |
while ( notInList && currentline < |
|
3214 |
aPreviousURISegmentList.Count() ) |
|
3215 |
{ |
|
3216 |
if ( DesToInt( aPreviousURISegmentList.At( currentline ). |
|
3217 |
iURISegLUID.Right( 10 ) ) == ddId ) |
|
3218 |
{ |
|
3219 |
notInList = EFalse; |
|
3220 |
break; |
|
3221 |
} |
|
3222 |
currentline++; |
|
3223 |
} |
|
3224 |
if ( notInList ) |
|
3225 |
{ |
|
3226 |
segmentName.Copy( KNSmlDMVoIPCodecSettingsId ); |
|
3227 |
segmentName.AppendNumFixedWidthUC( counter + 1, EDecimal, 3 ); |
|
3228 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3229 |
Size(), segmentName ); |
|
3230 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3231 |
Size(), KNSmlDMVoIPSeparator ); |
|
3232 |
||
3233 |
// Set LUID mapping to dm-module. |
|
3234 |
mappingInfo.Copy ( aLUID ); |
|
3235 |
mappingInfo.Append ( KNSmlDMVoIPSeparator ); |
|
3236 |
mappingInfo.Append ( KNSmlDMVoIPCodecSettingsId ); |
|
3237 |
mappingInfo.AppendNumFixedWidthUC( ddId, EDecimal, 10 ); |
|
3238 |
uri.Copy( aURI ); |
|
3239 |
uri.Append ( KNSmlDMVoIPSeparator ); |
|
3240 |
uri.Append ( KNSmlDMVoIPCodecSettingsId ); |
|
3241 |
uri.AppendNumFixedWidthUC( counter + 1, EDecimal, 3 ); |
|
3242 |
iDmCallback->SetMappingL( uri, mappingInfo ); |
|
3243 |
} |
|
3244 |
else |
|
3245 |
{ // Add those from PreviousList which are on database |
|
3246 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3247 |
aPreviousURISegmentList.At(currentline).iURISeg ); |
|
3248 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3249 |
KNSmlDMVoIPSeparator ); |
|
3250 |
} |
|
3251 |
} |
|
3252 |
} |
|
3253 |
||
3254 |
// ============================== |
|
3255 |
// CodecSettings node |
|
3256 |
// ============================== |
|
3257 |
// |
|
3258 |
else if ( KNSmlDMVoIPCodecSettingsNode() == secondLastUriSeg |
|
3259 |
&& KFourSegs == NumOfURISegs( aURI ) ) |
|
3260 |
{ |
|
3261 |
CodecChildListL( currentURISegmentList ); |
|
3262 |
} |
|
3263 |
||
3264 |
// ============================== |
|
3265 |
// ModeSet node |
|
3266 |
// ============================== |
|
3267 |
// |
|
3268 |
else if ( KNSmlDMVoIPModeSetNode() == LastURISeg( aURI ) ) |
|
3269 |
{ |
|
3270 |
TUint32 codecId; |
|
3271 |
codecId = DesToInt( aLUID.Right( 10 ) ); |
|
3272 |
TInt codecPos = FindCodecLocation( codecId ); |
|
3273 |
if ( KErrNotFound != codecPos ) |
|
3274 |
{ |
|
3275 |
TInt modesetCount = iCodecEntries[codecPos]->iModeSet.Count(); |
|
3276 |
for ( TInt counter = 0; counter < modesetCount; counter++ ) |
|
3277 |
{ |
|
3278 |
TBool inList = EFalse; |
|
3279 |
||
3280 |
// We need to rebuild LUID mapping if someone other has added |
|
3281 |
// or deleted, because there is no usable link to each ModeSet. |
|
3282 |
if ( aPreviousURISegmentList.Count() == modesetCount ) |
|
3283 |
{ |
|
3284 |
inList = ETrue; |
|
3285 |
} |
|
3286 |
if ( !inList ) |
|
3287 |
{ |
|
3288 |
segmentName.Copy( KNSmlDMVoIPModeId ); |
|
3289 |
segmentName.AppendNumFixedWidthUC( counter + 1, EDecimal, |
|
3290 |
3 ); |
|
3291 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3292 |
Size(), segmentName ); |
|
3293 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3294 |
Size(), KNSmlDMVoIPSeparator ); |
|
3295 |
||
3296 |
// Set LUID mapping to DM module. |
|
3297 |
mappingInfo.Copy ( aLUID ); |
|
3298 |
mappingInfo.Append ( KNSmlDMVoIPSeparator ); |
|
3299 |
mappingInfo.Append ( KNSmlDMVoIPModeId ); |
|
3300 |
mappingInfo.AppendNumFixedWidthUC( counter, EDecimal, 10 ); |
|
3301 |
uri.Copy( aURI ); |
|
3302 |
uri.Append ( KNSmlDMVoIPSeparator ); |
|
3303 |
uri.Append ( KNSmlDMVoIPModeId ); |
|
3304 |
uri.AppendNumFixedWidthUC( counter + 1, EDecimal, 3 ); |
|
3305 |
iDmCallback->SetMappingL( uri, mappingInfo ); |
|
3306 |
} |
|
3307 |
else |
|
3308 |
{ // Add those in PreviousList which are on database. |
|
3309 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3310 |
Size(), aPreviousURISegmentList.At( counter ).iURISeg ); |
|
3311 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3312 |
Size(), KNSmlDMVoIPSeparator ); |
|
3313 |
} |
|
3314 |
} |
|
3315 |
} |
|
3316 |
else |
|
3317 |
{ |
|
3318 |
retValue = CSmlDmAdapter::EError; |
|
3319 |
} |
|
3320 |
||
3321 |
} |
|
3322 |
||
3323 |
else if ( KNSmlDMVoIPModeSetNode() == secondLastUriSeg |
|
3324 |
&& KSixSegs == NumOfURISegs( aURI ) ) |
|
3325 |
{ |
|
3326 |
segmentName.Copy( KNSmlDMVoIPMode ); |
|
3327 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3328 |
segmentName ); |
|
3329 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3330 |
KNSmlDMVoIPSeparator ); |
|
3331 |
} |
|
3332 |
||
3333 |
// ============================== |
|
3334 |
// SettingIds node |
|
3335 |
// ============================== |
|
3336 |
// |
|
3337 |
// VoIP/x/SettingIds |
|
3338 |
else if ( KNSmlDMVoIPSettingIdsNode() == LastURISeg( aURI ) ) |
|
3339 |
{ |
|
3340 |
for ( TInt counter = 0; counter < |
|
3341 |
iProfileEntries[iProfileID]->iIds.Count(); counter++ ) |
|
3342 |
{ |
|
3343 |
TBool inList = EFalse; |
|
3344 |
||
3345 |
// We need to rebuild luid mapping if someone other has made |
|
3346 |
// some changes because there is no usable link to settingids. |
|
3347 |
if ( aPreviousURISegmentList.Count() == |
|
3348 |
iProfileEntries[iProfileID]->iIds.Count() ) |
|
3349 |
{ |
|
3350 |
inList = ETrue; |
|
3351 |
} |
|
3352 |
if ( !inList ) |
|
3353 |
{ |
|
3354 |
segmentName.Copy( KNSmlDMVoIPSettingId ); |
|
3355 |
segmentName.AppendNumFixedWidthUC( counter + 1, EDecimal, 3 ); |
|
3356 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3357 |
Size(), segmentName ); |
|
3358 |
currentURISegmentList->InsertL( currentURISegmentList-> |
|
3359 |
Size(), KNSmlDMVoIPSeparator ); |
|
3360 |
||
3361 |
// set luid mapping to dm-module |
|
3362 |
mappingInfo.Copy ( aLUID ); |
|
3363 |
mappingInfo.Append ( KNSmlDMVoIPSeparator ); |
|
3364 |
mappingInfo.Append ( KNSmlDMVoIPSettingId ); |
|
3365 |
mappingInfo.AppendNumFixedWidthUC( counter, EDecimal, 10 ); |
|
3366 |
uri.Copy( aURI ); |
|
3367 |
uri.Append ( KNSmlDMVoIPSeparator ); |
|
3368 |
uri.Append ( KNSmlDMVoIPSettingId ); |
|
3369 |
uri.AppendNumFixedWidthUC( counter + 1, EDecimal, 3 ); |
|
3370 |
iDmCallback->SetMappingL( uri, mappingInfo ); |
|
3371 |
} |
|
3372 |
else |
|
3373 |
{ // Add those in PreviousList which are on database |
|
3374 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3375 |
aPreviousURISegmentList.At( counter ).iURISeg ); |
|
3376 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3377 |
KNSmlDMVoIPSeparator ); |
|
3378 |
} |
|
3379 |
} |
|
3380 |
} |
|
3381 |
||
3382 |
// ============================== |
|
3383 |
// SettingId leaf |
|
3384 |
// ============================== |
|
3385 |
// |
|
3386 |
else if ( KNSmlDMVoIPSettingIdsNode() == secondLastUriSeg |
|
3387 |
&& KFourSegs == NumOfURISegs( aURI ) ) |
|
3388 |
{ |
|
3389 |
// ProfileType |
|
3390 |
segmentName.Copy( KNSmlDMVoIPProfileType ); |
|
3391 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3392 |
segmentName ); |
|
3393 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3394 |
KNSmlDMVoIPSeparator ); |
|
3395 |
||
3396 |
// ProfileId |
|
3397 |
segmentName.Copy( KNSmlDMVoIPProfileId ); |
|
3398 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3399 |
segmentName ); |
|
3400 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3401 |
KNSmlDMVoIPSeparator ); |
|
3402 |
||
3403 |
// ProfileSpecific |
|
3404 |
segmentName.Copy( KNSmlDMVoIPProfileSpecificId ); |
|
3405 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3406 |
segmentName ); |
|
3407 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3408 |
KNSmlDMVoIPSeparator ); |
|
3409 |
} |
|
3410 |
||
3411 |
// ============================== |
|
3412 |
// VoIP/x/VoiceMailBox node |
|
3413 |
// ============================== |
|
3414 |
// |
|
3415 |
else if ( KNSmlDMVoIPVmbxNode() == LastURISeg( aURI ) && |
|
3416 |
KThreeSegs == NumOfURISegs( aURI ) ) |
|
3417 |
{ |
|
3418 |
// VoIP/x/VoiceMailBox/MWI-URI |
|
3419 |
segmentName.Copy( KNSmlDMVoIPMwiUri ); |
|
3420 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3421 |
segmentName ); |
|
3422 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3423 |
KNSmlDMVoIPSeparator ); |
|
3424 |
// VoIP/x/VoiceMailBox/ListeningURI |
|
3425 |
segmentName.Copy( KNSmlDMVoIPListeningUri ); |
|
3426 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3427 |
segmentName ); |
|
3428 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3429 |
KNSmlDMVoIPSeparator ); |
|
3430 |
// VoIP/x/VoiceMailBox/UsedIAPId |
|
3431 |
segmentName.Copy( KNSmlDMVoIPUsedIAPId ); |
|
3432 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3433 |
segmentName ); |
|
3434 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3435 |
KNSmlDMVoIPSeparator ); |
|
3436 |
// VoIP/x/VoiceMailBox/ReSubscribeInterval |
|
3437 |
segmentName.Copy( KNSmlDMVoIPReSubscribeInterval ); |
|
3438 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3439 |
segmentName ); |
|
3440 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3441 |
KNSmlDMVoIPSeparator ); |
|
3442 |
// VoIP/x/VoiceMailBox/UsedSIPProfileId |
|
3443 |
segmentName.Copy( KNSmlDMVoIPUsedSIPProfileId ); |
|
3444 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3445 |
segmentName ); |
|
3446 |
currentURISegmentList->InsertL( currentURISegmentList->Size(), |
|
3447 |
KNSmlDMVoIPSeparator ); |
|
3448 |
} |
|
3449 |
||
3450 |
// ============================== |
|
3451 |
// VoIP/x/ node |
|
3452 |
// ============================== |
|
3453 |
// |
|
3454 |
else if ( KNSmlDMVoIPNodeName() == secondLastUriSeg |
|
3455 |
&& KTwoSegs == NumOfURISegs( aURI ) ) |
|
3456 |
{ |
|
3457 |
VoipChildListL( currentURISegmentList ); |
|
3458 |
} |
|
3459 |
else |
|
3460 |
{ |
|
3461 |
// if none of asked nodes found return error. |
|
3462 |
retValue = CSmlDmAdapter::ENotFound; |
|
3463 |
} |
|
3464 |
iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
3465 |
if ( CSmlDmAdapter::EOk == retValue ) |
|
3466 |
{ |
|
3467 |
iDmCallback->SetResultsL( aResultsRef, *currentURISegmentList, |
|
3468 |
KNullDesC8 ); |
|
3469 |
} |
|
3470 |
CleanupStack::PopAndDestroy( currentURISegmentList ); |
|
3471 |
currentURISegmentList = NULL; |
|
3472 |
DBG_PRINT("CNSmlDmVoIPAdapter::ChildURIListL(): end"); |
|
3473 |
} |
|
3474 |
||
3475 |
// --------------------------------------------------------------------------- |
|
3476 |
// CNSmlDmVoIPAdapter::CodecChildListL |
|
3477 |
// Inserts Codec specific leaf objects. |
|
3478 |
// --------------------------------------------------------------------------- |
|
3479 |
// |
|
3480 |
void CNSmlDmVoIPAdapter::CodecChildListL( |
|
3481 |
CBufBase* const aCurrentURISegmentList ) |
|
3482 |
{ |
|
3483 |
DBG_PRINT("CNSmlDmVoIPAdapter::CodecChildListL(): start"); |
|
3484 |
||
3485 |
TBuf8<KSmlMaxURISegLen> segmentName; |
|
3486 |
||
3487 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/VoIPCodecId |
|
3488 |
segmentName.Copy( KNSmlDMVoIPCodecId ); |
|
3489 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3490 |
segmentName ); |
|
3491 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3492 |
KNSmlDMVoIPSeparator ); |
|
3493 |
||
3494 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/MediaTypeName |
|
3495 |
segmentName.Copy( KNSmlDMVoIPMediaTypeName ); |
|
3496 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3497 |
segmentName ); |
|
3498 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3499 |
KNSmlDMVoIPSeparator ); |
|
3500 |
||
3501 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/MediaSubTypeName |
|
3502 |
segmentName.Copy( KNSmlDMVoIPMediaSubTypeName ); |
|
3503 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3504 |
segmentName ); |
|
3505 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3506 |
KNSmlDMVoIPSeparator ); |
|
3507 |
||
3508 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/JitterBufferSize |
|
3509 |
segmentName.Copy( KNSmlDMVoIPJitterBufferSize ); |
|
3510 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3511 |
segmentName ); |
|
3512 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3513 |
KNSmlDMVoIPSeparator ); |
|
3514 |
||
3515 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/OctetAlign |
|
3516 |
segmentName.Copy( KNSmlDMVoIPOctetAlign ); |
|
3517 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3518 |
segmentName ); |
|
3519 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3520 |
KNSmlDMVoIPSeparator ); |
|
3521 |
||
3522 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/ModeSet |
|
3523 |
segmentName.Copy( KNSmlDMVoIPModeSetNode ); |
|
3524 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3525 |
segmentName ); |
|
3526 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3527 |
KNSmlDMVoIPSeparator ); |
|
3528 |
||
3529 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/ModeChangePeriod |
|
3530 |
segmentName.Copy( KNSmlDMVoIPModeChangePeriod ); |
|
3531 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3532 |
segmentName ); |
|
3533 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3534 |
KNSmlDMVoIPSeparator ); |
|
3535 |
||
3536 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/ModeChangeNeighbor |
|
3537 |
segmentName.Copy( KNSmlDMVoIPModeChangeNeighbor ); |
|
3538 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3539 |
segmentName ); |
|
3540 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3541 |
KNSmlDMVoIPSeparator ); |
|
3542 |
||
3543 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/Ptime |
|
3544 |
segmentName.Copy( KNSmlDMVoIPPtime ); |
|
3545 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3546 |
segmentName ); |
|
3547 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3548 |
KNSmlDMVoIPSeparator ); |
|
3549 |
||
3550 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/MaxPtime |
|
3551 |
segmentName.Copy( KNSmlDMVoIPMaxPtime ); |
|
3552 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3553 |
segmentName ); |
|
3554 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3555 |
KNSmlDMVoIPSeparator ); |
|
3556 |
||
3557 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/VAD |
|
3558 |
segmentName.Copy( KNSmlDMVoIPVAD ); |
|
3559 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3560 |
segmentName ); |
|
3561 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3562 |
KNSmlDMVoIPSeparator ); |
|
3563 |
||
3564 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/AnnexB |
|
3565 |
segmentName.Copy( KNSmlDMVoIPAnnexB ); |
|
3566 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3567 |
segmentName ); |
|
3568 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3569 |
KNSmlDMVoIPSeparator ); |
|
3570 |
||
3571 |
// VoIP/x/CodecSettings/CodecSettingsIdXXX/MaxRed |
|
3572 |
segmentName.Copy( KNSmlDMVoIPMaxRed ); |
|
3573 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3574 |
segmentName ); |
|
3575 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3576 |
KNSmlDMVoIPSeparator ); |
|
3577 |
||
3578 |
DBG_PRINT("CNSmlDmVoIPAdapter::CodecChildListL(): end"); |
|
3579 |
} |
|
3580 |
||
3581 |
// --------------------------------------------------------------------------- |
|
3582 |
// CNSmlDmVoIPAdapter::VoipChildListL |
|
3583 |
// Inserts VoIP leaf objects. |
|
3584 |
// --------------------------------------------------------------------------- |
|
3585 |
// |
|
3586 |
void CNSmlDmVoIPAdapter::VoipChildListL( |
|
3587 |
CBufBase* const aCurrentURISegmentList ) |
|
3588 |
{ |
|
3589 |
DBG_PRINT("CNSmlDmVoIPAdapter::VoipChildListL(): start"); |
|
3590 |
||
3591 |
TBuf8<KSmlMaxURISegLen> segmentName; |
|
3592 |
||
3593 |
// VoIP/x/VoIPID |
|
3594 |
segmentName.Copy( KNSmlDMVoIPSetID ); |
|
3595 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3596 |
segmentName ); |
|
3597 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3598 |
KNSmlDMVoIPSeparator ); |
|
3599 |
||
3600 |
// VoIP/x/ProviderName |
|
3601 |
segmentName.Copy( KNSmlDMVoIPProvID ); |
|
3602 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3603 |
segmentName ); |
|
3604 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3605 |
KNSmlDMVoIPSeparator ); |
|
3606 |
||
3607 |
// VoIP/x/SettingsName |
|
3608 |
segmentName.Copy( KNSmlDMVoIPName ); |
|
3609 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3610 |
segmentName ); |
|
3611 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3612 |
KNSmlDMVoIPSeparator ); |
|
3613 |
||
3614 |
// VoIP/x/PreferredCodecs |
|
3615 |
segmentName.Copy( KNSmlDMVoIPPreferredCodecsNode ); |
|
3616 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3617 |
segmentName ); |
|
3618 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3619 |
KNSmlDMVoIPSeparator ); |
|
3620 |
||
3621 |
// VoIP/x/CodecSettings |
|
3622 |
segmentName.Copy( KNSmlDMVoIPCodecSettingsNode ); |
|
3623 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3624 |
segmentName ); |
|
3625 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3626 |
KNSmlDMVoIPSeparator ); |
|
3627 |
||
3628 |
// VoIP/x/SettingIds |
|
3629 |
segmentName.Copy( KNSmlDMVoIPSettingIdsNode ); |
|
3630 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3631 |
segmentName ); |
|
3632 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3633 |
KNSmlDMVoIPSeparator ); |
|
3634 |
||
3635 |
// VoIP/x/StartMediaPort |
|
3636 |
segmentName.Copy( KNSmlDMVoIPSMPort ); |
|
3637 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3638 |
segmentName ); |
|
3639 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3640 |
KNSmlDMVoIPSeparator ); |
|
3641 |
||
3642 |
// VoIP/x/EndMediaPort |
|
3643 |
segmentName.Copy( KNSmlDMVoIPEMPort ); |
|
3644 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3645 |
segmentName ); |
|
3646 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3647 |
KNSmlDMVoIPSeparator ); |
|
3648 |
||
3649 |
// VoIP/x/VoiceMailBox |
|
3650 |
segmentName.Copy( KNSmlDMVoIPVmbxNode ); |
|
3651 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3652 |
segmentName ); |
|
3653 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3654 |
KNSmlDMVoIPSeparator ); |
|
3655 |
||
3656 |
// VoIP/x/MegiaQos |
|
3657 |
segmentName.Copy( KNSmlDMVoIPMediaQos ); |
|
3658 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3659 |
segmentName ); |
|
3660 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3661 |
KNSmlDMVoIPSeparator ); |
|
3662 |
||
3663 |
// VoIP/x/InbandDTMF |
|
3664 |
segmentName.Copy( KNSmlDMVoIPDTMFIB ); |
|
3665 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3666 |
segmentName ); |
|
3667 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3668 |
KNSmlDMVoIPSeparator ); |
|
3669 |
||
3670 |
// VoIP/x/OutbandDTMF |
|
3671 |
segmentName.Copy( KNSmlDMVoIPDTMFOB ); |
|
3672 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3673 |
segmentName ); |
|
3674 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3675 |
KNSmlDMVoIPSeparator ); |
|
3676 |
||
3677 |
// VoIP/x/SecureCallPref |
|
3678 |
segmentName.Copy( KNSmlDMVoIPSecureCallPref ); |
|
3679 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3680 |
segmentName ); |
|
3681 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3682 |
KNSmlDMVoIPSeparator ); |
|
3683 |
||
3684 |
// VoIP/x/RTCP |
|
3685 |
segmentName.Copy( KNSmlDMVoIPRTCP ); |
|
3686 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3687 |
segmentName ); |
|
3688 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3689 |
KNSmlDMVoIPSeparator ); |
|
3690 |
||
3691 |
// VoIP/x/UAHTerminalType |
|
3692 |
segmentName.Copy( KNSmlDMVoIPUAHTerminalType ); |
|
3693 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3694 |
segmentName ); |
|
3695 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3696 |
KNSmlDMVoIPSeparator ); |
|
3697 |
||
3698 |
// VoIP/x/UAHWLANMAC |
|
3699 |
segmentName.Copy( KNSmlDMVoIPUAHWLANMAC ); |
|
3700 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3701 |
segmentName ); |
|
3702 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3703 |
KNSmlDMVoIPSeparator ); |
|
3704 |
||
3705 |
// VoIP/x/UAHString |
|
3706 |
segmentName.Copy( KNSmlDMVoIPUAHString ); |
|
3707 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3708 |
segmentName ); |
|
3709 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3710 |
KNSmlDMVoIPSeparator ); |
|
3711 |
||
3712 |
// VoIP/x/ProfileLockedToIAP |
|
3713 |
segmentName.Copy( KNSmlDMVoIPProfileLockedToIAP ); |
|
3714 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3715 |
segmentName ); |
|
3716 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3717 |
KNSmlDMVoIPSeparator ); |
|
3718 |
||
3719 |
// VoIP/x/VoIPPluginUID |
|
3720 |
segmentName.Copy( KNSmlDMVoIPPluginUID ); |
|
3721 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3722 |
segmentName ); |
|
3723 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3724 |
KNSmlDMVoIPSeparator ); |
|
3725 |
||
3726 |
// VoIP/x/AllowVoIPoverWCDMA |
|
3727 |
segmentName.Copy( KNSmlDMVoIPAllowVoIPOverWCDMA ); |
|
3728 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3729 |
segmentName ); |
|
3730 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3731 |
KNSmlDMVoIPSeparator ); |
|
3732 |
||
3733 |
// VoIP/x/VoIPDigits |
|
3734 |
segmentName.Copy( KNSmlDMVoIPVoIPDigits ); |
|
3735 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3736 |
segmentName ); |
|
3737 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3738 |
KNSmlDMVoIPSeparator ); |
|
3739 |
||
3740 |
// VoIP/x/URIDomainIgnoreRule |
|
3741 |
segmentName.Copy( KNSmlDMVoIPURIDomainIgnoreRule ); |
|
3742 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3743 |
segmentName ); |
|
3744 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3745 |
KNSmlDMVoIPSeparator ); |
|
3746 |
||
3747 |
// VoIP/x/AutoAcceptBuddyRequest |
|
3748 |
segmentName.Copy( KNSmlDMVoIPAutoAcceptBuddyRequest ); |
|
3749 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3750 |
segmentName ); |
|
3751 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3752 |
KNSmlDMVoIPSeparator ); |
|
3753 |
||
3754 |
// VoIP/x/UsedVoIPRelease |
|
3755 |
segmentName.Copy( KNSmlDMVoIPUsedVoIPRelease ); |
|
3756 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3757 |
segmentName ); |
|
3758 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3759 |
KNSmlDMVoIPSeparator ); |
|
3760 |
||
3761 |
// VoIP/x/AddUserPhone |
|
3762 |
segmentName.Copy( KNSmlDMVoIPAddUserPhone ); |
|
3763 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3764 |
segmentName ); |
|
3765 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3766 |
KNSmlDMVoIPSeparator ); |
|
3767 |
||
3768 |
// VoIP/x/ProviderBookmarkURI |
|
3769 |
segmentName.Copy( KNSmlDMVoIPProviderBookmarkUri ); |
|
3770 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3771 |
segmentName ); |
|
3772 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3773 |
KNSmlDMVoIPSeparator ); |
|
3774 |
||
3775 |
// VoIP/x/SIPConnectivityTestURI |
|
3776 |
segmentName.Copy( KNSmlDMVoIPSIPConnTestUri ); |
|
3777 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3778 |
segmentName ); |
|
3779 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3780 |
KNSmlDMVoIPSeparator ); |
|
3781 |
||
3782 |
// VoIP/x/NATFWProfileId |
|
3783 |
segmentName.Copy( KNSmlDMVoIPNatFwProfileId ); |
|
3784 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3785 |
segmentName ); |
|
3786 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3787 |
KNSmlDMVoIPSeparator ); |
|
3788 |
||
3789 |
// VoIP/x/MinSessionInterval |
|
3790 |
segmentName.Copy( KNSmlDMVoIPMinSessionInterval ); |
|
3791 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3792 |
segmentName ); |
|
3793 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3794 |
KNSmlDMVoIPSeparator ); |
|
3795 |
||
3796 |
// VoIP/x/SessionExpires |
|
3797 |
segmentName.Copy( KNSmlDMVoIPSessionExpires ); |
|
3798 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3799 |
segmentName ); |
|
3800 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3801 |
KNSmlDMVoIPSeparator ); |
|
3802 |
||
3803 |
// VoIP/x/BradingDataURI |
|
3804 |
segmentName.Copy( KNSmlDMVoIPBrandingDataUri ); |
|
3805 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3806 |
segmentName ); |
|
3807 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3808 |
KNSmlDMVoIPSeparator ); |
|
3809 |
||
3810 |
// VoIP/x/PresenceSettingsId |
|
3811 |
segmentName.Copy( KNSmlDMVoIPPresenceSettingsId ); |
|
3812 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3813 |
segmentName ); |
|
3814 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3815 |
KNSmlDMVoIPSeparator ); |
|
3816 |
||
3817 |
// VoIP/x/UsedNATProtocol |
|
3818 |
segmentName.Copy( KNSmlDMVoIPUsedNatProtocol ); |
|
3819 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3820 |
segmentName ); |
|
3821 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3822 |
KNSmlDMVoIPSeparator ); |
|
3823 |
||
3824 |
// VoIP/x/AutoEnable |
|
3825 |
segmentName.Copy( KNSmlDMVoIPAutoEnable ); |
|
3826 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3827 |
segmentName ); |
|
3828 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3829 |
KNSmlDMVoIPSeparator ); |
|
3830 |
||
3831 |
// VoIP/x/SnapProfileId |
|
3832 |
segmentName.Copy( KNSmlDMVoIPSnapProfileId ); |
|
3833 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3834 |
segmentName ); |
|
3835 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3836 |
KNSmlDMVoIPSeparator ); |
|
3837 |
||
3838 |
// VoIP/x/EnableIM |
|
3839 |
segmentName.Copy( KNSmlDMVoIPEnableIm ); |
|
3840 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3841 |
segmentName ); |
|
3842 |
aCurrentURISegmentList->InsertL( aCurrentURISegmentList->Size(), |
|
3843 |
KNSmlDMVoIPSeparator ); |
|
3844 |
||
3845 |
DBG_PRINT("CNSmlDmVoIPAdapter::VoipChildListL(): end"); |
|
3846 |
} |
|
3847 |
||
3848 |
// --------------------------------------------------------------------------- |
|
3849 |
// CNSmlDmVoIPAdapter::AddNodeObjectL |
|
3850 |
// Adds a new node. |
|
3851 |
// --------------------------------------------------------------------------- |
|
3852 |
// |
|
3853 |
void CNSmlDmVoIPAdapter::AddNodeObjectL( |
|
3854 |
const TDesC8& aURI, |
|
3855 |
const TDesC8& aParentLUID, |
|
3856 |
const TInt aStatusRef ) |
|
3857 |
{ |
|
3858 |
DBG_PRINT("CNSmlDmVoIPAdapter::AddNodeObjectL(): begin"); |
|
3859 |
||
3860 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
3861 |
||
3862 |
CSmlDmAdapter::TError retValue = EOk; |
|
3863 |
||
3864 |
// Load VoIP profile information if not loaded yet |
|
3865 |
if ( !iProfileEntries.Count() ) |
|
3866 |
{ |
|
3867 |
LoadProfilesL(); |
|
3868 |
} |
|
3869 |
// Find profile from array, profile deleted from elsewhere if not found |
|
3870 |
if ( aParentLUID.Length() > 0 ) |
|
3871 |
{ |
|
3872 |
TInt profileID = FindProfileLocation ( aParentLUID ); |
|
3873 |
if ( KErrNotFound == profileID ) |
|
3874 |
{ |
|
3875 |
retValue = CSmlDmAdapter::ENotFound; |
|
3876 |
} |
|
3877 |
else |
|
3878 |
{ |
|
3879 |
retValue = CSmlDmAdapter::EAlreadyExists; |
|
3880 |
} |
|
3881 |
} |
|
3882 |
||
3883 |
// Get last URI segment. |
|
3884 |
TBuf8<KNSmlVoIPMaxUriLength> uri = aURI; |
|
3885 |
TBuf8<KNSmlVoIPMaxUriLength> mappingInfo ( KNullDesC8 ); |
|
3886 |
TPtrC8 uriSeg = LastURISeg( aURI ); |
|
3887 |
TPtrC8 uriTmp = RemoveLastURISeg( aURI ); |
|
3888 |
TPtrC8 secondLastUriSeg = LastURISeg( uriTmp ); |
|
3889 |
||
3890 |
// Find profile |
|
3891 |
iProfileID = FindProfileLocation( aParentLUID ); |
|
3892 |
||
3893 |
// ============================== |
|
3894 |
// VoIP node ( add ) |
|
3895 |
// ============================== |
|
3896 |
// |
|
3897 |
// VoIP/x/VoIP |
|
3898 |
if ( KNSmlDMVoIPNodeName() == secondLastUriSeg |
|
3899 |
&& ( EOk == retValue || ENotFound == retValue ) ) |
|
3900 |
{ |
|
3901 |
// Check OOD before saving new profile. |
|
3902 |
RFs fs; |
|
3903 |
User::LeaveIfError( fs.Connect() ); |
|
3904 |
CleanupClosePushL( fs ); // CS:1 |
|
3905 |
||
3906 |
// VoIP settings are stored in three files. |
|
3907 |
if ( SysUtil::FFSSpaceBelowCriticalLevelL( |
|
3908 |
&fs, KNSmlDMFatMinimumFileSize * 3 ) ) |
|
3909 |
{ |
|
3910 |
// Prevent writing in OOD. |
|
3911 |
CleanupStack::PopAndDestroy( &fs ); // CS:0 |
|
3912 |
iDmCallback->SetStatusL( aStatusRef, CSmlDmAdapter::EDiskFull ); |
|
3913 |
DBG_PRINT("CNSmlDmVoIPAdapter::AddNodeObjectL(): DISK FULL end"); |
|
3914 |
return; |
|
3915 |
} |
|
3916 |
CleanupStack::PopAndDestroy( &fs ); // CS:0 |
|
3917 |
CRCSEProfileEntry* newProfileEntry = CRCSEProfileEntry::NewLC(); |
|
3918 |
iCRCSEProfile->GetDefaultProfile( *newProfileEntry ); |
|
3919 |
if ( uriSeg.Length() < KMaxSettingsNameLength ) |
|
3920 |
{ |
|
3921 |
newProfileEntry->iSettingsName.Copy( uriSeg ); |
|
3922 |
} |
|
3923 |
newProfileEntry->iProviderName.Copy( KDefaultSettingsName ); |
|
3924 |
CheckDuplicateNameL( *newProfileEntry ); |
|
3925 |
CheckDuplicateProviderL( *newProfileEntry ); |
|
3926 |
||
3927 |
CRCSEAudioCodecEntry* newAudioCodecEntry1 = |
|
3928 |
CRCSEAudioCodecEntry::NewLC(); |
|
3929 |
newAudioCodecEntry1->SetDefaultCodecValueSet( KAudioCodecAMRWB() ); |
|
3930 |
newAudioCodecEntry1->iMediaSubTypeName = KAudioCodecAMRWB; |
|
3931 |
TUint32 codecId = iCRCSEAudioCodec->AddL( *newAudioCodecEntry1 ); |
|
3932 |
newProfileEntry->iPreferredCodecs.Append( codecId ); |
|
3933 |
newAudioCodecEntry1->iCodecId = codecId; |
|
3934 |
iCodecEntries.AppendL( newAudioCodecEntry1 ); |
|
3935 |
CleanupStack::Pop( newAudioCodecEntry1 ); |
|
3936 |
||
3937 |
CRCSEAudioCodecEntry* newAudioCodecEntry2 = |
|
3938 |
CRCSEAudioCodecEntry::NewLC(); |
|
3939 |
newAudioCodecEntry2->SetDefaultCodecValueSet( KAudioCodecAMR() ); |
|
3940 |
newAudioCodecEntry2->iMediaSubTypeName = KAudioCodecAMR; |
|
3941 |
codecId = iCRCSEAudioCodec->AddL( *newAudioCodecEntry2 ); |
|
3942 |
newProfileEntry->iPreferredCodecs.Append( codecId ); |
|
3943 |
newAudioCodecEntry2->iCodecId = codecId; |
|
3944 |
iCodecEntries.AppendL( newAudioCodecEntry2 ); |
|
3945 |
CleanupStack::Pop( newAudioCodecEntry2 ); |
|
3946 |
||
3947 |
CRCSEAudioCodecEntry* newAudioCodecEntry3 = |
|
3948 |
CRCSEAudioCodecEntry::NewLC(); |
|
3949 |
newAudioCodecEntry3->SetDefaultCodecValueSet( KAudioCodecPCMU() ); |
|
3950 |
newAudioCodecEntry3->iMediaSubTypeName = KAudioCodecPCMU; |
|
3951 |
codecId = iCRCSEAudioCodec->AddL( *newAudioCodecEntry3 ); |
|
3952 |
newProfileEntry->iPreferredCodecs.Append( codecId ); |
|
3953 |
newAudioCodecEntry3->iCodecId = codecId; |
|
3954 |
iCodecEntries.AppendL( newAudioCodecEntry3 ); |
|
3955 |
CleanupStack::Pop( newAudioCodecEntry3 ); |
|
3956 |
||
3957 |
CRCSEAudioCodecEntry* newAudioCodecEntry4 = |
|
3958 |
CRCSEAudioCodecEntry::NewLC(); |
|
3959 |
newAudioCodecEntry4->SetDefaultCodecValueSet( KAudioCodecPCMA() ); |
|
3960 |
newAudioCodecEntry4->iMediaSubTypeName = KAudioCodecPCMA; |
|
3961 |
codecId = iCRCSEAudioCodec->AddL( *newAudioCodecEntry4 ); |
|
3962 |
newProfileEntry->iPreferredCodecs.Append( codecId ); |
|
3963 |
newAudioCodecEntry4->iCodecId = codecId; |
|
3964 |
iCodecEntries.AppendL( newAudioCodecEntry4 ); |
|
3965 |
CleanupStack::Pop( newAudioCodecEntry4 ); |
|
3966 |
||
3967 |
CRCSEAudioCodecEntry* newAudioCodecEntry5 = |
|
3968 |
CRCSEAudioCodecEntry::NewLC(); |
|
3969 |
newAudioCodecEntry5->SetDefaultCodecValueSet( KAudioCodeciLBC() ); |
|
3970 |
newAudioCodecEntry5->iMediaSubTypeName = KAudioCodeciLBC; |
|
3971 |
codecId = iCRCSEAudioCodec->AddL( *newAudioCodecEntry5 ); |
|
3972 |
newProfileEntry->iPreferredCodecs.Append( codecId ); |
|
3973 |
newAudioCodecEntry5->iCodecId = codecId; |
|
3974 |
iCodecEntries.AppendL( newAudioCodecEntry5 ); |
|
3975 |
CleanupStack::Pop( newAudioCodecEntry5 ); |
|
3976 |
||
3977 |
CRCSEAudioCodecEntry* newAudioCodecEntry6 = |
|
3978 |
CRCSEAudioCodecEntry::NewLC(); |
|
3979 |
newAudioCodecEntry6->SetDefaultCodecValueSet( KAudioCodecG729() ); |
|
3980 |
newAudioCodecEntry6->iMediaSubTypeName = KAudioCodecG729; |
|
3981 |
codecId = iCRCSEAudioCodec->AddL( *newAudioCodecEntry6 ); |
|
3982 |
newProfileEntry->iPreferredCodecs.Append( codecId ); |
|
3983 |
newAudioCodecEntry6->iCodecId = codecId; |
|
3984 |
iCodecEntries.AppendL( newAudioCodecEntry6 ); |
|
3985 |
CleanupStack::Pop( newAudioCodecEntry6 ); |
|
3986 |
||
3987 |
CRCSEAudioCodecEntry* newAudioCodecEntry7 = |
|
3988 |
CRCSEAudioCodecEntry::NewLC(); |
|
3989 |
newAudioCodecEntry7->SetDefaultCodecValueSet( KAudioCodecCN() ); |
|
3990 |
newAudioCodecEntry7->iMediaSubTypeName = KAudioCodecCN; |
|
3991 |
codecId = iCRCSEAudioCodec->AddL( *newAudioCodecEntry7 ); |
|
3992 |
newProfileEntry->iPreferredCodecs.Append( codecId ); |
|
3993 |
newAudioCodecEntry7->iCodecId = codecId; |
|
3994 |
iCodecEntries.AppendL( newAudioCodecEntry7 ); |
|
3995 |
CleanupStack::Pop( newAudioCodecEntry7 ); |
|
3996 |
||
3997 |
// Add SettingIds entry. |
|
3998 |
TSettingIds idEntry; |
|
3999 |
idEntry.iProfileType = -1; |
|
4000 |
// SIPSpecific not supported => ID not found. |
|
4001 |
idEntry.iProfileSpecificSettingId = KErrNotFound; |
|
4002 |
idEntry.iProfileId = -1; |
|
4003 |
newProfileEntry->iIds.Append( idEntry ); |
|
4004 |
||
4005 |
// Add new VoIP profile. |
|
4006 |
TUint32 profileID = iCRCSEProfile->AddL( *newProfileEntry ); |
|
4007 |
newProfileEntry->iId = profileID; |
|
31
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
4008 |
UpdateServiceIdL( newProfileEntry ); |
28 | 4009 |
iProfileEntries.AppendL( newProfileEntry ); |
4010 |
||
4011 |
// Add LUID mapping to first SettingIds of profile. |
|
4012 |
uri.Copy( aURI ); |
|
4013 |
uri.Append( KNSmlDMVoIPSeparator ); |
|
4014 |
uri.Append( KNSmlDMVoIPSettingIdsNode ); |
|
4015 |
uri.Append( KNSmlDMVoIPSeparator ); |
|
4016 |
uri.Append( KNSmlDMVoIPSettingId ); |
|
4017 |
uri.AppendNumFixedWidthUC( 1, EDecimal, 3 ); |
|
4018 |
mappingInfo.Copy( KNSmlDMVoIPPrefix ); |
|
4019 |
mappingInfo.AppendNumFixedWidthUC( profileID, EDecimal, 10 ); |
|
4020 |
mappingInfo.Append( KNSmlDMVoIPSeparator ); |
|
4021 |
mappingInfo.Append( KNSmlDMVoIPSettingId ); |
|
4022 |
mappingInfo.AppendNumFixedWidthUC( 0, EDecimal, 10 ); |
|
4023 |
iDmCallback->SetMappingL( uri, mappingInfo ); |
|
4024 |
||
4025 |
// Add LUID mapping for CodecSettings and preferredCodecs. |
|
4026 |
for ( TInt counter = 0; counter < newProfileEntry-> |
|
4027 |
iPreferredCodecs.Count(); counter++ ) |
|
4028 |
{ |
|
4029 |
uri.Copy( aURI ); |
|
4030 |
uri.Append( KNSmlDMVoIPSeparator ); |
|
4031 |
uri.Append( KNSmlDMVoIPCodecSettingsNode ); |
|
4032 |
uri.Append( KNSmlDMVoIPSeparator ); |
|
4033 |
uri.Append( KNSmlDMVoIPCodecSettingsId ); |
|
4034 |
uri.AppendNumFixedWidthUC( counter + 1, EDecimal, 3 ); |
|
4035 |
mappingInfo.Copy( KNSmlDMVoIPPrefix ); |
|
4036 |
mappingInfo.AppendNumFixedWidthUC( profileID, EDecimal, 10 ); |
|
4037 |
mappingInfo.Append( KNSmlDMVoIPSeparator ); |
|
4038 |
mappingInfo.Append( KNSmlDMVoIPCodecSettingsId ); |
|
4039 |
mappingInfo.AppendNumFixedWidthUC( newProfileEntry-> |
|
4040 |
iPreferredCodecs[counter], EDecimal, 10 ); |
|
4041 |
iDmCallback->SetMappingL( uri, mappingInfo ); |
|
4042 |
||
4043 |
uri.Copy( aURI ); |
|
4044 |
uri.Append( KNSmlDMVoIPSeparator ); |
|
4045 |
uri.Append( KNSmlDMVoIPPreferredCodecsNode ); |
|
4046 |
uri.Append( KNSmlDMVoIPSeparator ); |
|
4047 |
uri.Append( KNSmlDMVoIPPreferredCodecId ); |
|
4048 |
uri.AppendNumFixedWidthUC( counter + 1, EDecimal, 3 ); |
|
4049 |
mappingInfo.Copy( KNSmlDMVoIPPrefix ); |
|
4050 |
mappingInfo.AppendNumFixedWidthUC( profileID, EDecimal, 10 ); |
|
4051 |
mappingInfo.Append( KNSmlDMVoIPSeparator ); |
|
4052 |
mappingInfo.Append( KNSmlDMVoIPPreferredCodecId ); |
|
4053 |
mappingInfo.AppendNumFixedWidthUC( counter, EDecimal, 10 ); |
|
4054 |
iDmCallback->SetMappingL( uri, mappingInfo ); |
|
4055 |
} |
|
4056 |
||
4057 |
// Set LUID mapping to DM module. |
|
4058 |
mappingInfo.Copy ( KNSmlDMVoIPPrefix ); |
|
4059 |
mappingInfo.AppendNumFixedWidthUC( profileID, EDecimal, 10 ); |
|
4060 |
iDmCallback->SetMappingL( aURI, mappingInfo ); |
|
4061 |
||
4062 |
CleanupStack::Pop( newProfileEntry ); |
|
4063 |
||
4064 |
retValue = CSmlDmAdapter::EOk; |
|
4065 |
} |
|
4066 |
||
4067 |
if ( KErrNotFound != iProfileID ) |
|
4068 |
{ |
|
4069 |
// ============================== |
|
4070 |
// CodecSettings node (add) |
|
4071 |
// ============================== |
|
4072 |
// |
|
4073 |
if ( KNSmlDMVoIPCodecSettingsNode() == secondLastUriSeg && |
|
4074 |
KErrNotFound == aParentLUID.Find( KNSmlDMVoIPCodecSettingsId ) ) |
|
4075 |
{ |
|
4076 |
CRCSEAudioCodecEntry *newAudioCodecEntry = |
|
4077 |
CRCSEAudioCodecEntry::NewLC(); |
|
4078 |
iCRCSEAudioCodec->GetDefaultCodec( *newAudioCodecEntry ); |
|
4079 |
TUint32 codecId = iCRCSEAudioCodec->AddL( *newAudioCodecEntry ); |
|
4080 |
newAudioCodecEntry->iCodecId = codecId; |
|
4081 |
iCodecEntries.AppendL( newAudioCodecEntry ); |
|
4082 |
||
4083 |
// Add new codec ID to iPreferredCodecs of current VoIP profile. |
|
4084 |
iProfileEntries[iProfileID]-> |
|
4085 |
iPreferredCodecs.Append( codecId ); |
|
4086 |
||
4087 |
// Update VoIP profile back to permanent store. |
|
4088 |
iCRCSEProfile->UpdateL( iProfileEntries[iProfileID]-> |
|
4089 |
iId, *iProfileEntries[iProfileID] ); |
|
4090 |
CleanupStack::Pop( newAudioCodecEntry ); |
|
31
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
4091 |
UpdateServiceIdL( iProfileEntries[iProfileID] ); |
28 | 4092 |
// Add LUID mapping to new codecsettings entry. |
4093 |
mappingInfo.Copy( KNSmlDMVoIPPrefix ); |
|
4094 |
TUint val( iProfileEntries[iProfileID]->iId ); |
|
4095 |
mappingInfo.AppendNumFixedWidthUC( val, EDecimal, 10 ); |
|
4096 |
mappingInfo.Append( KNSmlDMVoIPSeparator ); |
|
4097 |
mappingInfo.Append( KNSmlDMVoIPCodecSettingsId ); |
|
4098 |
mappingInfo.AppendNumFixedWidthUC( codecId, EDecimal, 10 ); |
|
4099 |
iDmCallback->SetMappingL( aURI, mappingInfo ); |
|
4100 |
||
4101 |
// Add LUID mapping to new preferredcodecs entry. |
|
4102 |
uri.Copy( RemoveLastURISeg( RemoveLastURISeg( aURI ) ) ); |
|
4103 |
uri.Append( KNSmlDMVoIPSeparator ); |
|
4104 |
uri.Append( KNSmlDMVoIPPreferredCodecsNode ); |
|
4105 |
uri.Append( KNSmlDMVoIPSeparator ); |
|
4106 |
uri.Append( KNSmlDMVoIPPreferredCodecId ); |
|
4107 |
uri.AppendNumFixedWidthUC( |
|
4108 |
iProfileEntries[iProfileID]->iPreferredCodecs.Count(), |
|
4109 |
EDecimal, 3 ); |
|
4110 |
mappingInfo.Copy( KNSmlDMVoIPPrefix ); |
|
4111 |
mappingInfo.AppendNumFixedWidthUC( iProfileID, EDecimal, 10 ); |
|
4112 |
mappingInfo.Append( KNSmlDMVoIPSeparator ); |
|
4113 |
mappingInfo.Append( KNSmlDMVoIPPreferredCodecId ); |
|
4114 |
mappingInfo.AppendNumFixedWidthUC( |
|
4115 |
iProfileEntries[iProfileID]->iPreferredCodecs.Count() - 1, |
|
4116 |
EDecimal, 10 ); |
|
4117 |
iDmCallback->SetMappingL( uri, mappingInfo ); |
|
4118 |
retValue = CSmlDmAdapter::EOk; |
|
4119 |
} |
|
4120 |
||
4121 |
// ============================== |
|
4122 |
// ModeSet node (add) |
|
4123 |
// ============================== |
|
4124 |
// |
|
4125 |
if ( KNSmlDMVoIPModeSetNode() == secondLastUriSeg |
|
4126 |
&& KErrNotFound == aParentLUID.Find( KNSmlDMVoIPModeId ) ) |
|
4127 |
{ |
|
4128 |
// Get codec ID used by these settings. |
|
4129 |
TUint32 codecId = DesToInt( aParentLUID.Right( 10 ) ); |
|
4130 |
TInt codecPos = FindCodecLocation( codecId ); |
|
4131 |
if ( KErrNotFound != codecPos ) |
|
4132 |
{ |
|
4133 |
iCodecEntries[codecPos]->iModeSet.Append( 1 ); |
|
4134 |
iCRCSEAudioCodec->UpdateL( codecId, |
|
4135 |
*iCodecEntries[codecPos] ); |
|
4136 |
||
4137 |
// All LUID mapping to new mode-set item. |
|
4138 |
mappingInfo.Copy( aParentLUID ); |
|
4139 |
mappingInfo.Append( KNSmlDMVoIPSeparator ); |
|
4140 |
mappingInfo.Append( KNSmlDMVoIPModeId ); |
|
4141 |
mappingInfo.AppendNumFixedWidthUC( |
|
4142 |
iCodecEntries[codecPos]->iModeSet.Count() - 1, |
|
4143 |
EDecimal, 10 ); |
|
4144 |
iDmCallback->SetMappingL( aURI, mappingInfo ); |
|
4145 |
retValue = CSmlDmAdapter::EOk; |
|
4146 |
} |
|
4147 |
else |
|
4148 |
{ |
|
4149 |
retValue = CSmlDmAdapter::EError; |
|
4150 |
} |
|
4151 |
} |
|
4152 |
||
4153 |
// ============================== |
|
4154 |
// SettingIds node (add) |
|
4155 |
// ============================== |
|
4156 |
// |
|
4157 |
if ( KNSmlDMVoIPSettingIdsNode() == secondLastUriSeg && |
|
4158 |
KErrNotFound == aParentLUID.Find( KNSmlDMVoIPSettingId ) ) |
|
4159 |
{ |
|
4160 |
TSettingIds idEntry; |
|
4161 |
idEntry.iProfileType = 0; |
|
4162 |
idEntry.iProfileSpecificSettingId = -1; |
|
4163 |
idEntry.iProfileId = 0; |
|
4164 |
iProfileEntries[iProfileID]->iIds.Append( idEntry ); |
|
4165 |
iCRCSEProfile->UpdateL( iProfileEntries[iProfileID]->iId, |
|
4166 |
*iProfileEntries[iProfileID] ); |
|
4167 |
mappingInfo.Copy( KNSmlDMVoIPPrefix ); |
|
31
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
4168 |
UpdateServiceIdL( iProfileEntries[iProfileID] ); |
28 | 4169 |
TUint val( iProfileEntries[iProfileID]->iId ); |
4170 |
mappingInfo.AppendNumFixedWidthUC( val, EDecimal, 10 ); |
|
4171 |
mappingInfo.Append( KNSmlDMVoIPSeparator ); |
|
4172 |
mappingInfo.Append( KNSmlDMVoIPSettingId ); |
|
4173 |
mappingInfo.AppendNumFixedWidthUC( |
|
4174 |
iProfileEntries[iProfileID]->iIds.Count() - 1, EDecimal, 10 ); |
|
4175 |
iDmCallback->SetMappingL( aURI, mappingInfo ); |
|
4176 |
retValue = CSmlDmAdapter::EOk; |
|
4177 |
} |
|
4178 |
} |
|
4179 |
||
4180 |
// Return status ok for existing leaf nodes that do not need |
|
4181 |
// to be added separately. |
|
4182 |
if ( aParentLUID.Length() > 0 && |
|
4183 |
retValue != CSmlDmAdapter::ENotFound && |
|
4184 |
( KNSmlDMVoIPCodecSettingsNode() == uriSeg |
|
4185 |
|| KNSmlDMVoIPModeSetNode() == uriSeg |
|
4186 |
|| KNSmlDMVoIPSettingIdsNode() == uriSeg |
|
4187 |
|| KNSmlDMVoIPSettingIdsNode() == uriSeg |
|
4188 |
|| KNSmlDMVoIPVmbxNode() == uriSeg |
|
4189 |
) ) |
|
4190 |
{ |
|
4191 |
retValue = CSmlDmAdapter::EOk; |
|
4192 |
} |
|
4193 |
iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
4194 |
||
4195 |
DBG_PRINT("CNSmlDmVoIPAdapter::AddNodeObjectL(): end"); |
|
4196 |
} |
|
4197 |
||
4198 |
// --------------------------------------------------------------------------- |
|
4199 |
// CNSmlDmVoIPAdapter::UpdateLeafObjectL |
|
4200 |
// For streaming large object data. |
|
4201 |
// --------------------------------------------------------------------------- |
|
4202 |
// |
|
4203 |
void CNSmlDmVoIPAdapter::UpdateLeafObjectL( |
|
4204 |
const TDesC8& /*aURI*/, |
|
4205 |
const TDesC8& /*aLUID*/, |
|
4206 |
RWriteStream*& /*aStream*/, |
|
4207 |
const TDesC8& /*aType*/, |
|
4208 |
const TInt aStatusRef ) |
|
4209 |
{ |
|
4210 |
DBG_PRINT("CNSmlDmVoIPAdapter::UpdateLeafObjectL(): stream: begin"); |
|
4211 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
4212 |
iDmCallback->SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
4213 |
DBG_PRINT("CNSmlDmVoIPAdapter::UpdateLeafObjectL(): stream: end"); |
|
4214 |
} |
|
4215 |
||
4216 |
// --------------------------------------------------------------------------- |
|
4217 |
// CNSmlDmVoIPAdapter::FetchLeafObjectSizeL |
|
4218 |
// Fetches leaf object size of aURI. |
|
4219 |
// --------------------------------------------------------------------------- |
|
4220 |
// |
|
4221 |
void CNSmlDmVoIPAdapter::FetchLeafObjectSizeL( |
|
4222 |
const TDesC8& aURI, |
|
4223 |
const TDesC8& aLUID, |
|
4224 |
const TDesC8& aType, |
|
4225 |
const TInt aResultsRef, |
|
4226 |
const TInt aStatusRef ) |
|
4227 |
{ |
|
4228 |
DBG_PRINT("CNSmlDmVoIPAdapter::FetchLeafObjectSizeL(): begin"); |
|
4229 |
||
4230 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
4231 |
||
4232 |
CBufBase *object = CBufFlat::NewL( 1 ); |
|
4233 |
CleanupStack::PushL( object ); |
|
4234 |
CSmlDmAdapter::TError retValue = FetchObjectL( aURI, aLUID, *object ); |
|
4235 |
||
4236 |
TInt objSizeInBytes = object->Size(); |
|
4237 |
TBuf8<16> stringObjSizeInBytes; |
|
4238 |
stringObjSizeInBytes.Num( objSizeInBytes ); |
|
4239 |
object->Reset(); |
|
4240 |
object->InsertL( 0, stringObjSizeInBytes ); |
|
4241 |
||
4242 |
iDmCallback->SetStatusL( aStatusRef, retValue ); |
|
4243 |
iDmCallback->SetResultsL( aResultsRef, *object, aType ); |
|
4244 |
CleanupStack::PopAndDestroy( object ); |
|
4245 |
object = NULL; |
|
4246 |
DBG_PRINT("CNSmlDmVoIPAdapter::FetchLeafObjectSizeL(): end"); |
|
4247 |
} |
|
4248 |
||
4249 |
// --------------------------------------------------------------------------- |
|
4250 |
// CNSmlDmVoIPAdapter::ExecuteCommandL |
|
4251 |
// --------------------------------------------------------------------------- |
|
4252 |
// |
|
4253 |
void CNSmlDmVoIPAdapter::ExecuteCommandL( |
|
4254 |
const TDesC8& /*aURI*/, |
|
4255 |
const TDesC8& /*aLUID*/, |
|
4256 |
const TDesC8& /*aArgument*/, |
|
4257 |
const TDesC8& /*aType*/, |
|
4258 |
const TInt aStatusRef ) |
|
4259 |
{ |
|
4260 |
DBG_PRINT("CNSmlDmVoIPAdapter::ExecuteCommandL(): begin"); |
|
4261 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
4262 |
iDmCallback->SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
4263 |
DBG_PRINT("CNSmlDmVoIPAdapter::ExecuteCommandL(): end"); |
|
4264 |
} |
|
4265 |
||
4266 |
// --------------------------------------------------------------------------- |
|
4267 |
// CNSmlDmVoIPAdapter::ExecuteCommandL |
|
4268 |
// --------------------------------------------------------------------------- |
|
4269 |
// |
|
4270 |
void CNSmlDmVoIPAdapter::ExecuteCommandL( |
|
4271 |
const TDesC8& /*aURI*/, |
|
4272 |
const TDesC8& /*aParentLUID*/, |
|
4273 |
RWriteStream*& /*aStream*/, |
|
4274 |
const TDesC8& /*aType*/, |
|
4275 |
const TInt aStatusRef ) |
|
4276 |
{ |
|
4277 |
DBG_PRINT("CNSmlDmVoIPAdapter::ExecuteCommandL(): stream: begin"); |
|
4278 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
4279 |
iDmCallback->SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
4280 |
DBG_PRINT("CNSmlDmVoIPAdapter::ExecuteCommandL(): stream: end"); |
|
4281 |
} |
|
4282 |
||
4283 |
// --------------------------------------------------------------------------- |
|
4284 |
// CNSmlDmVoIPAdapter::CopyCommandL |
|
4285 |
// --------------------------------------------------------------------------- |
|
4286 |
// |
|
4287 |
void CNSmlDmVoIPAdapter::CopyCommandL( |
|
4288 |
const TDesC8& /*aTargetURI*/, |
|
4289 |
const TDesC8& /*aTargetLUID*/, |
|
4290 |
const TDesC8& /*aSourceURI*/, |
|
4291 |
const TDesC8& /*aSourceLUID*/, |
|
4292 |
const TDesC8& /*aType*/, |
|
4293 |
TInt aStatusRef ) |
|
4294 |
{ |
|
4295 |
DBG_PRINT("CNSmlDmVoIPAdapter::CopyCommandL(): begin"); |
|
4296 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
4297 |
iDmCallback->SetStatusL( aStatusRef, CSmlDmAdapter::EError ); |
|
4298 |
DBG_PRINT("CNSmlDmVoIPAdapter::CopyCommandL(): end"); |
|
4299 |
} |
|
4300 |
||
4301 |
// --------------------------------------------------------------------------- |
|
4302 |
// CNSmlDmVoIPAdapter::StartAtomicL |
|
4303 |
// For signaling adapter of beginning of the atomic section |
|
4304 |
// --------------------------------------------------------------------------- |
|
4305 |
// |
|
4306 |
void CNSmlDmVoIPAdapter::StartAtomicL() |
|
4307 |
{ |
|
4308 |
DBG_PRINT("CNSmlDmVoIPAdapter::StartAtomicL(): begin"); |
|
4309 |
DBG_PRINT("CNSmlDmVoIPAdapter::StartAtomicL(): end"); |
|
4310 |
} |
|
4311 |
||
4312 |
// --------------------------------------------------------------------------- |
|
4313 |
// CNSmlDmVoIPAdapter::CommitAtomicL |
|
4314 |
// The CommitAtomicL call is issued only if all the commands in the Atomic were successful |
|
4315 |
// --------------------------------------------------------------------------- |
|
4316 |
// |
|
4317 |
void CNSmlDmVoIPAdapter::CommitAtomicL() |
|
4318 |
{ |
|
4319 |
DBG_PRINT("CNSmlDmVoIPAdapter::CommitAtomicL(): begin"); |
|
4320 |
DBG_PRINT("CNSmlDmVoIPAdapter::CommitAtomicL(): end"); |
|
4321 |
} |
|
4322 |
||
4323 |
// --------------------------------------------------------------------------- |
|
4324 |
// CNSmlDmVoIPAdapter::RollbackAtomicL |
|
4325 |
// For signaling adapter to roll back all atomic commands |
|
4326 |
// --------------------------------------------------------------------------- |
|
4327 |
// |
|
4328 |
void CNSmlDmVoIPAdapter::RollbackAtomicL() |
|
4329 |
{ |
|
4330 |
DBG_PRINT("CNSmlDmVoIPAdapter::RollbackAtomicL(): begin"); |
|
4331 |
DBG_PRINT("CNSmlDmVoIPAdapter::RollbackAtomicL(): end"); |
|
4332 |
} |
|
4333 |
||
4334 |
// --------------------------------------------------------------------------- |
|
4335 |
// CNSmlDmVoIPAdapter::StreamingSupport |
|
4336 |
// For telling framework whether streaming large object data is supported |
|
4337 |
// --------------------------------------------------------------------------- |
|
4338 |
// |
|
4339 |
TBool CNSmlDmVoIPAdapter::StreamingSupport( TInt& /*aItemSize*/ ) |
|
4340 |
{ |
|
4341 |
DBG_PRINT("CNSmlDmVoIPAdapter::StreamingSupport(): begin"); |
|
4342 |
DBG_PRINT("CNSmlDmVoIPAdapter::StreamingSupport(): end"); |
|
4343 |
return EFalse; |
|
4344 |
} |
|
4345 |
||
4346 |
// --------------------------------------------------------------------------- |
|
4347 |
// CNSmlDmVoIPAdapter::StreamCommittedL() |
|
4348 |
// For telling adapter when streaming large object is finished. |
|
4349 |
// --------------------------------------------------------------------------- |
|
4350 |
// |
|
4351 |
void CNSmlDmVoIPAdapter::StreamCommittedL() |
|
4352 |
{ |
|
4353 |
DBG_PRINT("CNSmlDmVoIPAdapter::StreamCommittedL(): begin"); |
|
4354 |
DBG_PRINT("CNSmlDmVoIPAdapter::StreamCommittedL(): end"); |
|
4355 |
} |
|
4356 |
||
4357 |
// --------------------------------------------------------------------------- |
|
4358 |
// CNSmlDmVoIPAdapter::CompleteOutstandingCmdsL() |
|
4359 |
// When all buffered dm commands are sent to adapter, set SIP User Agent |
|
4360 |
// Header into SIPManagedProfile, and save all changes. |
|
4361 |
// --------------------------------------------------------------------------- |
|
4362 |
// |
|
4363 |
void CNSmlDmVoIPAdapter::CompleteOutstandingCmdsL() |
|
4364 |
{ |
|
4365 |
DBG_PRINT("CNSmlDmVoIPAdapter::CompleteOutstandingCmdsL(): begin"); |
|
4366 |
||
4367 |
// Save only profiles that have changed. If there are such profiles, |
|
4368 |
// save changed profiles back to permanent store |
|
4369 |
if ( iProfileEntries.Count() ) |
|
4370 |
{ |
|
4371 |
for ( TInt counter = 0; counter < iProfileModifs.Count(); counter++ ) |
|
4372 |
{ |
|
4373 |
for ( TInt index = 0; index < iProfileEntries[counter]-> |
|
4374 |
iIds.Count(); index++ ) |
|
4375 |
{ |
|
4376 |
if ( ( 0 == iProfileEntries[counter]-> |
|
4377 |
iIds[index].iProfileType ) |
|
4378 |
&& iProfileEntries[counter]-> |
|
4379 |
iIds[index].iProfileId > 0 |
|
4380 |
&& ( iProfileEntries[counter]-> |
|
4381 |
iSIPVoIPUAHTerminalType || |
|
4382 |
iProfileEntries[counter]-> |
|
4383 |
iSIPVoIPUAHeaderWLANMAC || |
|
4384 |
iProfileEntries[counter]-> |
|
4385 |
iSIPVoIPUAHeaderString.Length() > 0 || |
|
4386 |
iAllowVoIPOverWCDMAModified ) ) |
|
4387 |
{ |
|
4388 |
// Create objects that allow the creation of |
|
4389 |
// CSIPManagedProfile object. |
|
4390 |
CSIPProfile* sipProf = NULL; |
|
4391 |
CSIPProfileRegistryObserver* sipRegObs = |
|
4392 |
CSIPProfileRegistryObserver::NewLC(); // CS:1 |
|
4393 |
CSIPManagedProfileRegistry* sipProfReg = |
|
4394 |
CSIPManagedProfileRegistry::NewLC( |
|
4395 |
*sipRegObs ); // CS:2 |
|
4396 |
TRAPD( err, ( sipProf = sipProfReg->ProfileL( |
|
4397 |
iProfileEntries[counter]-> |
|
4398 |
iIds[index].iProfileId ) ) ); |
|
4399 |
if ( KErrNone == err ) |
|
4400 |
{ |
|
4401 |
CSIPManagedProfile* sipManProf = |
|
4402 |
static_cast<CSIPManagedProfile*>( sipProf ); |
|
4403 |
CleanupStack::PushL( sipManProf ); // CS:3 |
|
4404 |
// Compile the User Agent Header into a TBuf string. |
|
4405 |
TBuf8<KTempStringlength> userAgentHeader; |
|
4406 |
TBuf<KMaxTerminalTypeLength> tempTerminalType; |
|
4407 |
TBuf<KWlanMacAddressLength> tempWlanMac; |
|
4408 |
TBuf<KMaxSettingsLength32> tempFreeString; |
|
4409 |
tempFreeString = iProfileEntries[counter]-> |
|
4410 |
iSIPVoIPUAHeaderString; |
|
4411 |
||
4412 |
userAgentHeader.Append( KUserAgent ); |
|
4413 |
userAgentHeader.Append( KColonMark ); |
|
4414 |
userAgentHeader.Append( KSpaceMark ); |
|
4415 |
||
4416 |
if ( iProfileEntries[counter]-> |
|
4417 |
iSIPVoIPUAHTerminalType ) |
|
4418 |
{ |
|
4419 |
GetTerminalTypeL( tempTerminalType ); |
|
4420 |
userAgentHeader.Append( tempTerminalType ); |
|
4421 |
userAgentHeader.Append( KSpaceMark ); |
|
4422 |
} |
|
4423 |
if ( iProfileEntries[counter]-> |
|
4424 |
iSIPVoIPUAHeaderWLANMAC ) |
|
4425 |
{ |
|
4426 |
GetWlanMacAddressL( tempWlanMac ); |
|
4427 |
userAgentHeader.Append( tempWlanMac ); |
|
4428 |
userAgentHeader.Append( KSpaceMark ); |
|
4429 |
} |
|
4430 |
if ( tempFreeString.Length() > 0 ) |
|
4431 |
{ |
|
4432 |
userAgentHeader.Append( tempFreeString ); |
|
4433 |
} |
|
4434 |
||
4435 |
// Create an array for setting the user agent header. |
|
4436 |
// Granularity is 1 since only one item is appended |
|
4437 |
// into the array. |
|
4438 |
CDesC8ArrayFlat* uahArray = new ( ELeave ) |
|
4439 |
CDesC8ArrayFlat( 1 ); |
|
4440 |
CleanupStack::PushL( uahArray ); // CS:4 |
|
4441 |
uahArray->AppendL( userAgentHeader ); |
|
4442 |
if ( userAgentHeader.Length() > 0 ) |
|
4443 |
{ |
|
4444 |
User::LeaveIfError( |
|
4445 |
sipManProf->SetParameter( |
|
4446 |
KSIPHeaders, *uahArray ) ); |
|
4447 |
} |
|
4448 |
||
4449 |
if ( iAllowVoIPOverWCDMAModified ) |
|
4450 |
{ |
|
4451 |
if ( iProfileEntries[iProfileID]-> |
|
4452 |
iAllowVoIPoverWCDMA == |
|
4453 |
CRCSEProfileEntry::EOn ) |
|
4454 |
{ |
|
4455 |
User::LeaveIfError( |
|
4456 |
sipManProf->SetParameter( |
|
4457 |
KBearerType, KBearerNotSpecified ) ); |
|
4458 |
} |
|
4459 |
else if ( iProfileEntries[iProfileID]-> |
|
4460 |
iAllowVoIPoverWCDMA == |
|
4461 |
CRCSEProfileEntry::EOff ) |
|
4462 |
{ |
|
4463 |
User::LeaveIfError( |
|
4464 |
sipManProf->SetParameter( |
|
4465 |
KBearerType, KBearerWlanOnly ) ); |
|
4466 |
} |
|
4467 |
iAllowVoIPOverWCDMAModified = EFalse; |
|
4468 |
} |
|
4469 |
||
4470 |
sipProfReg->SaveL( *sipManProf ); |
|
4471 |
uahArray->Reset(); |
|
4472 |
// uahArray, sipManProf |
|
4473 |
CleanupStack::PopAndDestroy( uahArray ); // CS:3 |
|
4474 |
CleanupStack::PopAndDestroy( sipManProf ); // CS:2 |
|
4475 |
}// if |
|
4476 |
// sipProfReg, sipRegObs |
|
4477 |
CleanupStack::PopAndDestroy( sipProfReg ); // CS:1 |
|
4478 |
CleanupStack::PopAndDestroy( sipRegObs ); // CS:0 |
|
4479 |
sipProf = NULL; |
|
4480 |
}// if |
|
4481 |
}// for |
|
4482 |
iCRCSEProfile->UpdateL( |
|
4483 |
iProfileEntries[iProfileModifs[counter]]->iId, |
|
4484 |
*iProfileEntries[iProfileModifs[counter]] ); |
|
4485 |
} |
|
4486 |
iProfileModifs.Reset(); |
|
4487 |
} |
|
4488 |
||
4489 |
if ( iCodecEntries.Count() ) |
|
4490 |
{ |
|
4491 |
for ( TInt counter = 0; counter < iCodecModifs.Count(); counter++ ) |
|
4492 |
{ |
|
4493 |
iCRCSEAudioCodec->UpdateL( iCodecEntries[iCodecModifs[counter]]-> |
|
4494 |
iCodecId, *iCodecEntries[iCodecModifs[counter]] ); |
|
4495 |
} |
|
4496 |
iCodecModifs.Reset(); |
|
4497 |
} |
|
4498 |
||
4499 |
// Since CRCSEProfileRegistry::UpdateL takes CRCSEProfileEntry as const, |
|
4500 |
// the service ID'S in iProfileEntries array items have not changed. |
|
4501 |
// Hence load all profiles again from CRCSEProfileRegistry. |
|
4502 |
iCodecEntries.ResetAndDestroy(); |
|
4503 |
iProfileEntries.ResetAndDestroy(); |
|
4504 |
LoadProfilesL(); |
|
4505 |
||
4506 |
||
4507 |
const TInt spSettingsCount = iSPSettings.Count(); |
|
4508 |
if ( spSettingsCount ) |
|
4509 |
{ |
|
4510 |
// Set SPS ready for setting values. |
|
4511 |
CSPSettings* spSettings = CSPSettings::NewLC(); // CS:1 |
|
4512 |
||
4513 |
for ( TInt counter = 0; counter < spSettingsCount; counter++ ) |
|
4514 |
{ |
|
4515 |
TUint32 serviceId = |
|
4516 |
iProfileEntries[iProfileID]->iServiceProviderId; |
|
4517 |
||
4518 |
TInt err( KErrNone ); |
|
4519 |
CSPEntry* spEntry = CSPEntry::NewLC(); // CS:2 |
|
4520 |
err = spSettings->FindEntryL( serviceId, *spEntry ); |
|
4521 |
User::LeaveIfError( err ); |
|
4522 |
||
4523 |
CSPProperty* property = CSPProperty::NewLC(); // CS:3 |
|
4524 |
||
4525 |
// VMBX MWI-URI. |
|
4526 |
if ( iSPSettings[counter]->iVmbxMwiUri->Des().Length() ) |
|
4527 |
{ |
|
4528 |
err = property->SetName( ESubPropertyVMBXMWIAddress ); |
|
4529 |
property->SetValue( |
|
4530 |
iSPSettings[counter]->iVmbxMwiUri->Des() ); |
|
4531 |
if ( KErrNone == err ) |
|
4532 |
{ |
|
4533 |
err = spEntry->AddPropertyL( *property ); |
|
4534 |
if ( KErrAlreadyExists == err ) |
|
4535 |
{ |
|
4536 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4537 |
ESubPropertyVMBXMWIAddress, |
|
4538 |
iSPSettings[counter]->iVmbxMwiUri->Des() ) ); |
|
4539 |
} |
|
4540 |
else |
|
4541 |
{ |
|
4542 |
User::LeaveIfError( err ); |
|
4543 |
} |
|
4544 |
} |
|
4545 |
||
4546 |
// Let's check if listening URI has been or is about |
|
4547 |
// to be set. If not, set same as in MWI address. |
|
4548 |
CSPProperty* listeningUri = CSPProperty::NewLC(); |
|
4549 |
err = spSettings->FindPropertyL( serviceId, |
|
4550 |
ESubPropertyVMBXListenAddress, *listeningUri ); |
|
4551 |
if ( KErrNone != err && |
|
4552 |
!iSPSettings[counter]->iVmbxListenUri->Des().Length() ) |
|
4553 |
{ |
|
4554 |
delete iSPSettings[counter]->iVmbxListenUri; |
|
4555 |
iSPSettings[counter]->iVmbxListenUri = NULL; |
|
4556 |
iSPSettings[counter]->iVmbxListenUri = |
|
4557 |
iSPSettings[counter]->iVmbxMwiUri->Des().AllocL(); |
|
4558 |
} |
|
4559 |
CleanupStack::PopAndDestroy( listeningUri ); |
|
4560 |
||
4561 |
// Let's check if re-subscribe interval has been or is |
|
4562 |
// about to be set. If not, set default value. |
|
4563 |
CSPProperty* reSubscrInterval = CSPProperty::NewLC(); |
|
4564 |
err = spSettings->FindPropertyL( serviceId, |
|
4565 |
ESubPropertyVMBXMWISubscribeInterval, *reSubscrInterval ); |
|
4566 |
if ( KErrNone != err && |
|
4567 |
iSPSettings[counter]->iReSubscribeInterval == KErrNotFound ) |
|
4568 |
{ |
|
4569 |
iSPSettings[counter]->iReSubscribeInterval = |
|
4570 |
KDefaultReSubscribe; |
|
4571 |
} |
|
4572 |
CleanupStack::PopAndDestroy( reSubscrInterval ); |
|
4573 |
} |
|
4574 |
||
4575 |
// VMBX ListeningURI. |
|
4576 |
if ( iSPSettings[counter]->iVmbxListenUri->Des().Length() ) |
|
4577 |
{ |
|
4578 |
err = property->SetName( ESubPropertyVMBXListenAddress ); |
|
4579 |
property->SetValue( |
|
4580 |
iSPSettings[counter]->iVmbxListenUri->Des() ); |
|
4581 |
if ( KErrNone == err ) |
|
4582 |
{ |
|
4583 |
err = spEntry->AddPropertyL( *property ); |
|
4584 |
if ( KErrAlreadyExists == err ) |
|
4585 |
{ |
|
4586 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4587 |
ESubPropertyVMBXListenAddress, |
|
4588 |
iSPSettings[counter]->iVmbxListenUri->Des() ) ); |
|
4589 |
} |
|
4590 |
else |
|
4591 |
{ |
|
4592 |
User::LeaveIfError( err ); |
|
4593 |
} |
|
4594 |
} |
|
4595 |
} |
|
4596 |
||
4597 |
// VMBX IAP ID. |
|
4598 |
if ( KErrNone != iSPSettings[counter]->iVmbxIapId ) |
|
4599 |
{ |
|
4600 |
err = property->SetName( ESubPropertyVMBXPreferredIAPId ); |
|
4601 |
property->SetValue( iSPSettings[counter]->iVmbxIapId ); |
|
4602 |
if ( KErrNone == err ) |
|
4603 |
{ |
|
4604 |
err = spEntry->AddPropertyL( *property ); |
|
4605 |
if ( KErrAlreadyExists == err ) |
|
4606 |
{ |
|
4607 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4608 |
ESubPropertyVMBXPreferredIAPId, |
|
4609 |
iSPSettings[counter]->iVmbxIapId ) ); |
|
4610 |
} |
|
4611 |
else |
|
4612 |
{ |
|
4613 |
User::LeaveIfError( err ); |
|
4614 |
} |
|
4615 |
} |
|
4616 |
} |
|
4617 |
||
4618 |
// VMBX re-SUBSCRIBE interval. |
|
4619 |
if ( KErrNotFound != iSPSettings[counter]->iReSubscribeInterval ) |
|
4620 |
{ |
|
4621 |
err = property->SetName( |
|
4622 |
ESubPropertyVMBXMWISubscribeInterval ); |
|
4623 |
property->SetValue( |
|
4624 |
iSPSettings[counter]->iReSubscribeInterval ); |
|
4625 |
if ( KErrNone == err ) |
|
4626 |
{ |
|
4627 |
err = spEntry->AddPropertyL( *property ); |
|
4628 |
if ( KErrAlreadyExists == err ) |
|
4629 |
{ |
|
4630 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4631 |
ESubPropertyVMBXMWISubscribeInterval, |
|
4632 |
iSPSettings[counter]->iReSubscribeInterval ) ); |
|
4633 |
} |
|
4634 |
else |
|
4635 |
{ |
|
4636 |
User::LeaveIfError( err ); |
|
4637 |
} |
|
4638 |
} |
|
4639 |
} |
|
4640 |
||
4641 |
// VMBX SIP ID. |
|
4642 |
if ( KErrNone != iSPSettings[counter]->iVmbxSipId ) |
|
4643 |
{ |
|
4644 |
err = property->SetName( ESubPropertyVMBXSettingsId ); |
|
4645 |
property->SetValue( iSPSettings[counter]->iVmbxSipId ); |
|
4646 |
if ( KErrNone == err ) |
|
4647 |
{ |
|
4648 |
err = spEntry->AddPropertyL( *property ); |
|
4649 |
if ( KErrAlreadyExists == err ) |
|
4650 |
{ |
|
4651 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4652 |
ESubPropertyVMBXSettingsId, |
|
4653 |
iSPSettings[counter]->iVmbxSipId ) ); |
|
4654 |
} |
|
4655 |
else |
|
4656 |
{ |
|
4657 |
User::LeaveIfError( err ); |
|
4658 |
} |
|
4659 |
} |
|
4660 |
} |
|
4661 |
||
4662 |
// Service provider bookmark URI. |
|
4663 |
if ( iSPSettings[counter]->iServiceProviderBookmark-> |
|
4664 |
Des().Length() ) |
|
4665 |
{ |
|
4666 |
err = property->SetName( EPropertyServiceBookmarkUri ); |
|
4667 |
property->SetValue( |
|
4668 |
iSPSettings[counter]->iServiceProviderBookmark->Des() ); |
|
4669 |
if ( KErrNone == err ) |
|
4670 |
{ |
|
4671 |
err = spEntry->AddPropertyL( *property ); |
|
4672 |
if ( KErrAlreadyExists == err ) |
|
4673 |
{ |
|
4674 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4675 |
EPropertyServiceBookmarkUri, |
|
4676 |
iSPSettings[counter]-> |
|
4677 |
iServiceProviderBookmark->Des() ) ); |
|
4678 |
} |
|
4679 |
else |
|
4680 |
{ |
|
4681 |
User::LeaveIfError( err ); |
|
4682 |
} |
|
4683 |
} |
|
4684 |
} |
|
4685 |
||
4686 |
// Branding data URI. |
|
4687 |
if ( iSPSettings[counter]->iBrandingDataUri->Des().Length() ) |
|
4688 |
{ |
|
4689 |
err = property->SetName( ESubPropertyVoIPBrandDataUri ); |
|
4690 |
property->SetValue( |
|
4691 |
iSPSettings[counter]->iBrandingDataUri->Des() ); |
|
4692 |
if ( KErrNone == err ) |
|
4693 |
{ |
|
4694 |
err = spEntry->AddPropertyL( *property ); |
|
4695 |
if ( KErrAlreadyExists == err ) |
|
4696 |
{ |
|
4697 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4698 |
ESubPropertyVoIPBrandDataUri, |
|
4699 |
iSPSettings[counter]->iBrandingDataUri->Des() ) ); |
|
4700 |
} |
|
4701 |
else |
|
4702 |
{ |
|
4703 |
User::LeaveIfError( err ); |
|
4704 |
} |
|
4705 |
} |
|
4706 |
} |
|
4707 |
||
4708 |
// Presence settings ID. |
|
4709 |
if ( KErrNone != iSPSettings[counter]->iPresenceId ) |
|
4710 |
{ |
|
4711 |
err = property->SetName( ESubPropertyPresenceSettingsId ); |
|
4712 |
property->SetValue( |
|
4713 |
iSPSettings[counter]->iPresenceId ); |
|
4714 |
if ( KErrNone == err ) |
|
4715 |
{ |
|
4716 |
err = spEntry->AddPropertyL( *property ); |
|
4717 |
if ( KErrAlreadyExists == err ) |
|
4718 |
{ |
|
4719 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4720 |
ESubPropertyPresenceSettingsId, |
|
4721 |
iSPSettings[counter]->iPresenceId ) ); |
|
4722 |
} |
|
4723 |
else |
|
4724 |
{ |
|
4725 |
User::LeaveIfError( err ); |
|
4726 |
} |
|
4727 |
} |
|
4728 |
} |
|
4729 |
||
4730 |
// Presence auto accept buddy request. |
|
4731 |
if ( KErrNotFound != iSPSettings[counter]->iAutoAcceptBuddy ) |
|
4732 |
{ |
|
4733 |
TOnOff value( static_cast<TOnOff>( |
|
4734 |
iSPSettings[counter]->iAutoAcceptBuddy ) ); |
|
4735 |
err = property->SetName( |
|
4736 |
ESubPropertyPresenceRequestPreference ); |
|
4737 |
property->SetValue( value ); |
|
4738 |
if ( KErrNone == err ) |
|
4739 |
{ |
|
4740 |
err = spEntry->AddPropertyL( *property ); |
|
4741 |
if ( KErrAlreadyExists == err ) |
|
4742 |
{ |
|
4743 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4744 |
ESubPropertyPresenceRequestPreference, value ) ); |
|
4745 |
} |
|
4746 |
else |
|
4747 |
{ |
|
4748 |
User::LeaveIfError( err ); |
|
4749 |
} |
|
4750 |
} |
|
4751 |
} |
|
4752 |
||
4753 |
// Auto enable service. |
|
4754 |
if ( KErrNotFound != iSPSettings[counter]->iAutoEnableService ) |
|
4755 |
{ |
|
4756 |
TOnOff value( static_cast<TOnOff>( |
|
4757 |
iSPSettings[counter]->iAutoEnableService ) ); |
|
4758 |
err = property->SetName( ESubPropertyVoIPEnabled ); |
|
4759 |
err = property->SetValue( value ); |
|
4760 |
if ( KErrNone == err ) |
|
4761 |
{ |
|
4762 |
err = spEntry->AddPropertyL( *property ); |
|
4763 |
if ( KErrAlreadyExists == err ) |
|
4764 |
{ |
|
4765 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4766 |
ESubPropertyVoIPEnabled, value ) ) ; |
|
4767 |
} |
|
4768 |
else |
|
4769 |
{ |
|
4770 |
User::LeaveIfError( err ); |
|
4771 |
} |
|
4772 |
} |
|
4773 |
// enable presence |
|
4774 |
if ( KErrNone != iSPSettings[counter]->iPresenceId ) |
|
4775 |
{ |
|
4776 |
err = property->SetName( ESubPropertyPresenceEnabled ); |
|
4777 |
property->SetValue( value ); |
|
4778 |
if ( KErrNone == err ) |
|
4779 |
{ |
|
4780 |
err = spEntry->AddPropertyL( *property ); |
|
4781 |
if ( KErrAlreadyExists == err ) |
|
4782 |
{ |
|
4783 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4784 |
ESubPropertyPresenceEnabled, value ) ); |
|
4785 |
} |
|
4786 |
else |
|
4787 |
{ |
|
4788 |
User::LeaveIfError( err ); |
|
4789 |
} |
|
4790 |
} |
|
4791 |
} |
|
4792 |
// enable voicemailbox |
|
4793 |
if ( KErrNone != iSPSettings[counter]->iVmbxIapId ) |
|
4794 |
{ |
|
4795 |
err = property->SetName( ESubPropertyVMBXEnabled ); |
|
4796 |
property->SetValue( value ); |
|
4797 |
if ( KErrNone == err ) |
|
4798 |
{ |
|
4799 |
err = spEntry->AddPropertyL( *property ); |
|
4800 |
if ( KErrAlreadyExists == err ) |
|
4801 |
{ |
|
4802 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4803 |
ESubPropertyVMBXEnabled, value ) ); |
|
4804 |
} |
|
4805 |
else |
|
4806 |
{ |
|
4807 |
User::LeaveIfError( err ); |
|
4808 |
} |
|
4809 |
} |
|
4810 |
} |
|
4811 |
} |
|
4812 |
||
4813 |
// SNAP Profile ID. |
|
4814 |
if ( KErrNone != iSPSettings[counter]->iSnapId ) |
|
4815 |
{ |
|
4816 |
err = property->SetName( ESubPropertyVoIPPreferredSNAPId ); |
|
4817 |
property->SetValue( iSPSettings[counter]->iSnapId ); |
|
4818 |
if ( KErrNone == err ) |
|
4819 |
{ |
|
4820 |
err = spEntry->AddPropertyL( *property ); |
|
4821 |
if ( KErrAlreadyExists == err ) |
|
4822 |
{ |
|
4823 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4824 |
ESubPropertyVoIPPreferredSNAPId, |
|
4825 |
iSPSettings[counter]->iSnapId ) ); |
|
4826 |
} |
|
4827 |
else |
|
4828 |
{ |
|
4829 |
User::LeaveIfError( err ); |
|
4830 |
} |
|
4831 |
} |
|
4832 |
} |
|
4833 |
||
4834 |
// Enable IM |
|
4835 |
if ( KErrNotFound != iSPSettings[counter]->iImEnabled ) |
|
4836 |
{ |
|
4837 |
// IM is enabled => add or set IM properties. |
|
4838 |
if ( iSPSettings[counter]->iImEnabled ) |
|
4839 |
{ |
|
4840 |
// IM enabled. |
|
4841 |
property->SetName( ESubPropertyIMEnabled ); |
|
4842 |
property->SetValue( EOn ); |
|
4843 |
err = spEntry->AddPropertyL( *property ); |
|
4844 |
if ( KErrAlreadyExists == err ) |
|
4845 |
{ |
|
4846 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4847 |
ESubPropertyIMEnabled, EOn ) ); |
|
4848 |
} |
|
4849 |
||
4850 |
// IM launch UID. |
|
4851 |
property->SetName( ESubPropertyIMLaunchUid ); |
|
4852 |
property->SetValue( KIMLaunchUid ); |
|
4853 |
err = spEntry->AddPropertyL( *property ); |
|
4854 |
if ( KErrAlreadyExists == err ) |
|
4855 |
{ |
|
4856 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4857 |
ESubPropertyIMLaunchUid, KIMLaunchUid ) ); |
|
4858 |
} |
|
4859 |
||
4860 |
// IM settings ID. |
|
4861 |
property->SetName( ESubPropertyIMSettingsId ); |
|
4862 |
// The value only needs to be different from 0, |
|
4863 |
// no-one actually uses it. |
|
4864 |
property->SetValue( KIMSettingsId ); |
|
4865 |
err = spEntry->AddPropertyL( *property ); |
|
4866 |
if ( KErrAlreadyExists == err ) |
|
4867 |
{ |
|
4868 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4869 |
ESubPropertyIMSettingsId, KIMSettingsId ) ); |
|
4870 |
} |
|
4871 |
||
4872 |
// IM sub-service plugin UID. |
|
4873 |
property->SetName( EPropertyIMSubServicePluginId ); |
|
4874 |
property->SetValue( KIMSubServicePluginId ); |
|
4875 |
err = spEntry->AddPropertyL( *property ); |
|
4876 |
if ( KErrAlreadyExists == err ) |
|
4877 |
{ |
|
4878 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4879 |
EPropertyIMSubServicePluginId, |
|
4880 |
KIMSubServicePluginId ) ); |
|
4881 |
} |
|
4882 |
||
4883 |
// IM preferred SNAP ID. |
|
4884 |
const CSPProperty* snap; |
|
4885 |
spEntry->GetProperty( snap, |
|
4886 |
ESubPropertyVoIPPreferredSNAPId ); |
|
4887 |
TInt snapId( KErrNone ); |
|
4888 |
err = snap->GetValue( snapId ); |
|
4889 |
if ( KErrNone == err ) |
|
4890 |
{ |
|
4891 |
property->SetName( ESubPropertyIMPreferredSNAPId ); |
|
4892 |
err = property->SetValue( snapId ); |
|
4893 |
if ( KErrNone == err ) |
|
4894 |
{ |
|
4895 |
err = spEntry->AddPropertyL( *property ); |
|
4896 |
if ( KErrAlreadyExists == err ) |
|
4897 |
{ |
|
4898 |
User::LeaveIfError( spEntry->UpdateProperty( |
|
4899 |
ESubPropertyIMPreferredSNAPId, |
|
4900 |
snapId ) ); |
|
4901 |
} |
|
4902 |
} |
|
4903 |
} |
|
4904 |
||
4905 |
// IM default tone. |
|
4906 |
TFileName toneFile; |
|
4907 |
toneFile.Copy( PathInfo::RomRootPath() ); |
|
4908 |
toneFile.Append( PathInfo::DigitalSoundsPath() ); |
|
4909 |
toneFile.Append( KDefaultTone ); |
|
4910 |
MVIMPSTSettingsStore* vimpStSettings = |
|
4911 |
CVIMPSTSettingsStore::NewLC(); // CS:4 |
|
4912 |
User::LeaveIfError( vimpStSettings->SetL( serviceId, |
|
4913 |
EServiceToneFileName, toneFile ) ); |
|
4914 |
// Pop vimpStSettings (can't use M object as argument). |
|
4915 |
CleanupStack::PopAndDestroy(); // CS:3 |
|
4916 |
} |
|
4917 |
// IM enabled is set to false => delete IM properties. |
|
4918 |
else |
|
4919 |
{ |
|
4920 |
spEntry->DeleteProperty( ESubPropertyIMEnabled ); |
|
4921 |
spEntry->DeleteProperty( ESubPropertyIMLaunchUid ); |
|
4922 |
spEntry->DeleteProperty( ESubPropertyIMSettingsId ); |
|
4923 |
spEntry->DeleteProperty( EPropertyIMSubServicePluginId ); |
|
4924 |
spEntry->DeleteProperty( ESubPropertyIMPreferredSNAPId ); |
|
4925 |
} |
|
4926 |
} |
|
4927 |
||
4928 |
err = spSettings->UpdateEntryL( *spEntry ); |
|
4929 |
// property, spEntry |
|
4930 |
CleanupStack::PopAndDestroy( property ); // CS:2 |
|
4931 |
CleanupStack::PopAndDestroy( spEntry ); // CS:1 |
|
4932 |
} // for |
|
4933 |
CleanupStack::PopAndDestroy( spSettings ); // CS:0 |
|
4934 |
iSPSettings.ResetAndDestroy(); |
|
4935 |
} |
|
4936 |
||
4937 |
DBG_PRINT("CNSmlDmVoIPAdapter::CompleteOutstandingCmdsL(): end"); |
|
4938 |
} |
|
4939 |
||
4940 |
// --------------------------------------------------------------------------- |
|
4941 |
// CNSmlDmVoIPAdapter::FindProfileLocation |
|
4942 |
// Finds profileID from aURI and returns profile location in array. |
|
4943 |
// --------------------------------------------------------------------------- |
|
4944 |
// |
|
4945 |
TInt CNSmlDmVoIPAdapter::FindProfileLocation( const TDesC8& aURI ) const |
|
4946 |
{ |
|
4947 |
TInt id( 0 ); |
|
4948 |
id = aURI.Find( KNSmlDMVoIPPrefix ); |
|
4949 |
if ( id != KErrNotFound ) |
|
4950 |
{ |
|
4951 |
id = DesToInt( aURI.Mid( id + KNSmlDMVoIPPrefix().Length(), 10 ) ); |
|
4952 |
for ( TInt counter = 0; counter < iProfileEntries.Count(); counter++ ) |
|
4953 |
{ |
|
4954 |
if ( iProfileEntries[counter]->iId == id ) |
|
4955 |
{ |
|
4956 |
return counter; |
|
4957 |
} |
|
4958 |
} |
|
4959 |
} |
|
4960 |
return KErrNotFound; |
|
4961 |
} |
|
4962 |
||
4963 |
// --------------------------------------------------------------------------- |
|
4964 |
// CNSmlDmVoIPAdapter::DesToInt |
|
4965 |
// Converts a 8 bit descriptor to int. |
|
4966 |
// --------------------------------------------------------------------------- |
|
4967 |
// |
|
4968 |
TInt CNSmlDmVoIPAdapter::DesToInt( const TDesC8& aDes ) const |
|
4969 |
{ |
|
4970 |
TLex8 lex( aDes ); |
|
4971 |
TInt value = 0; |
|
4972 |
lex.Val( value ); |
|
4973 |
return value; |
|
4974 |
} |
|
4975 |
||
4976 |
// --------------------------------------------------------------------------- |
|
4977 |
// CNSmlDmVoIPAdapter::DesToTUint |
|
4978 |
// Converts a 8bit descriptor to TUint. |
|
4979 |
// --------------------------------------------------------------------------- |
|
4980 |
// |
|
4981 |
TUint CNSmlDmVoIPAdapter::DesToTUint( const TDesC8& aDes ) const |
|
4982 |
{ |
|
4983 |
TLex8 lex( aDes ); |
|
4984 |
TUint value = 0; |
|
4985 |
lex.Val( value ); |
|
4986 |
return value; |
|
4987 |
} |
|
4988 |
||
4989 |
// --------------------------------------------------------------------------- |
|
4990 |
// TPtrC8 CNSmlDmVoIPAdapter::RemoveLastURISeg |
|
4991 |
// returns parent uri, i.e. removes last uri segment |
|
4992 |
// --------------------------------------------------------------------------- |
|
4993 |
// |
|
4994 |
const TPtrC8 CNSmlDmVoIPAdapter::RemoveLastURISeg( const TDesC8& aURI ) const |
|
4995 |
{ |
|
4996 |
TInt i ( 0 ); |
|
4997 |
if ( KErrNotFound != aURI.Find( KNSmlDMVoIPSeparator ) ) |
|
4998 |
{ |
|
4999 |
for ( i = aURI.Length() - 1; i >= 0; i-- ) |
|
5000 |
{ |
|
5001 |
if ( KDMVoIPSeparator == aURI[i] ) |
|
5002 |
{ |
|
5003 |
break; |
|
5004 |
} |
|
5005 |
} |
|
5006 |
} |
|
5007 |
return aURI.Left( i ); |
|
5008 |
} |
|
5009 |
||
5010 |
// --------------------------------------------------------------------------- |
|
5011 |
// TInt CNSmlDmVoIPAdapter::NumOfURISegs |
|
5012 |
// For getting the number of uri segs |
|
5013 |
// --------------------------------------------------------------------------- |
|
5014 |
// |
|
5015 |
TInt CNSmlDmVoIPAdapter::NumOfURISegs( const TDesC8& aURI ) const |
|
5016 |
{ |
|
5017 |
TInt numOfURISegs = 1; |
|
5018 |
for ( TInt i = 0; i < aURI.Length(); i++ ) |
|
5019 |
{ |
|
5020 |
if ( KDMVoIPSeparator == aURI[i] ) |
|
5021 |
{ |
|
5022 |
numOfURISegs++; |
|
5023 |
} |
|
5024 |
} |
|
5025 |
return numOfURISegs; |
|
5026 |
} |
|
5027 |
||
5028 |
// --------------------------------------------------------------------------- |
|
5029 |
// TPtrC8 CNSmlDmVoIPAdapter::LastURISeg |
|
5030 |
// Returns only the last uri segment |
|
5031 |
// --------------------------------------------------------------------------- |
|
5032 |
// |
|
5033 |
const TPtrC8 CNSmlDmVoIPAdapter::LastURISeg( const TDesC8& aURI ) const |
|
5034 |
{ |
|
5035 |
TInt i( 0 ); |
|
5036 |
if ( KErrNotFound != aURI.Find( KNSmlDMVoIPSeparator ) ) |
|
5037 |
{ |
|
5038 |
for ( i = aURI.Length() - 1; i >= 0; i-- ) |
|
5039 |
{ |
|
5040 |
if ( KDMVoIPSeparator == aURI[i] ) |
|
5041 |
{ |
|
5042 |
break; |
|
5043 |
} |
|
5044 |
} |
|
5045 |
} |
|
5046 |
if ( 0 == i ) |
|
5047 |
{ |
|
5048 |
return aURI; |
|
5049 |
} |
|
5050 |
else |
|
5051 |
{ |
|
5052 |
return aURI.Mid( i + 1 ); |
|
5053 |
} |
|
5054 |
} |
|
5055 |
||
5056 |
// --------------------------------------------------------------------------- |
|
5057 |
// TPtrC8 CNSmlDmVoIPAdapter::RemoveDotSlash |
|
5058 |
// return uri without dot and slash in start |
|
5059 |
// --------------------------------------------------------------------------- |
|
5060 |
// |
|
5061 |
const TPtrC8 CNSmlDmVoIPAdapter::RemoveDotSlash( const TDesC8& aURI ) const |
|
5062 |
{ |
|
5063 |
if ( 0 == aURI.Find( KNSmlVoIPUriDotSlash ) ) |
|
5064 |
{ |
|
5065 |
return aURI.Right( aURI.Length() - KNSmlVoIPUriDotSlash().Length() ); |
|
5066 |
} |
|
5067 |
else |
|
5068 |
{ |
|
5069 |
return aURI; |
|
5070 |
} |
|
5071 |
} |
|
5072 |
||
5073 |
// --------------------------------------------------------------------------- |
|
5074 |
// CNSmlDmVoIPAdapter::SetSipRefL |
|
5075 |
// Set sip reference value. |
|
5076 |
// --------------------------------------------------------------------------- |
|
5077 |
// |
|
5078 |
TUint32 CNSmlDmVoIPAdapter::SetSipRefL( const TDesC8& aObject ) const |
|
5079 |
{ |
|
5080 |
DBG_PRINT("CNSmlDmVoIPAdapter::SetSipRef() : begin"); |
|
5081 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
5082 |
||
5083 |
CBufBase* fetchResult = CBufFlat::NewL( 1 ); |
|
5084 |
CleanupStack::PushL( fetchResult ); |
|
5085 |
||
5086 |
// Make all SIP profiles known |
|
5087 |
CSmlDmAdapter::TError errorStatus; |
|
5088 |
iDmCallback->FetchLinkL( KNSmlDefDMSIP, *fetchResult, errorStatus ); |
|
5089 |
||
5090 |
// Fetch SIP profile ID. |
|
5091 |
TBuf8<KNSmlVoIPMaxResultLength> object; |
|
5092 |
object.Copy( aObject ); |
|
5093 |
object.Append( KNSmlDMVoIPSeparator ); |
|
5094 |
object.Append( KNSmlDMSIPSipID ); |
|
5095 |
iDmCallback->FetchLinkL( object, *fetchResult, errorStatus ); |
|
5096 |
TUint32 profileId = DesToInt( fetchResult->Ptr( 0 ) ); |
|
5097 |
CleanupStack::PopAndDestroy( fetchResult ); |
|
5098 |
fetchResult = NULL; |
|
5099 |
DBG_PRINT("CNSmlDmVoIPAdapter::SetSipRef() : end"); |
|
5100 |
return profileId; |
|
5101 |
} |
|
5102 |
||
5103 |
// --------------------------------------------------------------------------- |
|
5104 |
// CNSmlDmVoIPAdapter::GetSipIdL |
|
5105 |
// Get URI for given sip profile ID. |
|
5106 |
// --------------------------------------------------------------------------- |
|
5107 |
// |
|
5108 |
MSmlDmAdapter::TError CNSmlDmVoIPAdapter::GetSipIdL( CBufBase& aObject, |
|
5109 |
TUint32 aID ) const |
|
5110 |
{ |
|
5111 |
DBG_PRINT("CNSmlDmVoIPAdapter::GetSipIdL() : begin"); |
|
5112 |
||
5113 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
5114 |
||
5115 |
CBufBase* result = CBufFlat::NewL( 1 ); |
|
5116 |
CleanupStack::PushL( result ); |
|
5117 |
CSmlDmAdapter::TError errorStatus; |
|
5118 |
TBuf8<KNSmlVoIPMaxResultLength> object; |
|
5119 |
iDmCallback->FetchLinkL( KNSmlDefDMSIP, *result, errorStatus ); |
|
5120 |
result->Compress(); |
|
5121 |
HBufC8* childList = HBufC8::NewLC( result->Size() ); |
|
5122 |
TInt uriSegCount( 0 ); |
|
5123 |
if ( result->Size() > 0 ) |
|
5124 |
{ |
|
5125 |
childList->Des().Copy( result->Ptr(0) ); |
|
5126 |
||
5127 |
// Delete last / mark |
|
5128 |
childList->Des().Delete( childList->Length() - 1, 1 ); |
|
5129 |
uriSegCount = NumOfURISegs( childList->Des() ); |
|
5130 |
} |
|
5131 |
||
5132 |
for ( TInt counter = 0; counter < uriSegCount; counter++ ) |
|
5133 |
{ |
|
5134 |
result->Reset(); |
|
5135 |
object.Copy( KNSmlDefDMSIP ); |
|
5136 |
object.Append( KNSmlDMVoIPSeparator ); |
|
5137 |
object.Append( LastURISeg( childList->Des() ) ); |
|
5138 |
||
5139 |
// Make SIP profile settings known |
|
5140 |
iDmCallback->FetchLinkL( object, *result, errorStatus ); |
|
5141 |
result->Compress(); |
|
5142 |
result->Reset(); |
|
5143 |
||
5144 |
// Get SIP id |
|
5145 |
object.Append( KNSmlDMVoIPSeparator ); |
|
5146 |
object.Append( KNSmlDMSIPSipID ); |
|
5147 |
iDmCallback->FetchLinkL( object, *result, errorStatus ); |
|
5148 |
if ( aID == DesToInt( result->Ptr( 0 ) ) ) |
|
5149 |
{ |
|
5150 |
aObject.InsertL( aObject.Size(), RemoveLastURISeg( object ) ); |
|
5151 |
break; |
|
5152 |
} |
|
5153 |
childList->Des().Copy( RemoveLastURISeg ( childList->Des() ) ); |
|
5154 |
} |
|
5155 |
// childList, result |
|
5156 |
CleanupStack::PopAndDestroy( childList ); // CS:1 |
|
5157 |
CleanupStack::PopAndDestroy( result ); // CS:0 |
|
5158 |
result = NULL; |
|
5159 |
childList = NULL; |
|
5160 |
DBG_PRINT("CNSmlDmVoIPAdapter::GetSipIdL() : end"); |
|
5161 |
return errorStatus; |
|
5162 |
} |
|
5163 |
||
5164 |
// --------------------------------------------------------------------------- |
|
5165 |
// CNSmlDmVoIPAdapter::SetSccpRefL |
|
5166 |
// Set SCCP reference value. |
|
5167 |
// --------------------------------------------------------------------------- |
|
5168 |
// |
|
5169 |
TUint CNSmlDmVoIPAdapter::SetSccpRefL( const TDesC8& aObject ) const |
|
5170 |
{ |
|
5171 |
DBG_PRINT("CNSmlDmVoIPAdapter::SetSccpRef() : begin"); |
|
5172 |
||
5173 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
5174 |
||
5175 |
CBufBase* fetchResult = CBufFlat::NewL( 1 ); |
|
5176 |
CleanupStack::PushL( fetchResult ); |
|
5177 |
||
5178 |
// Make all SCCP profiles known |
|
5179 |
CSmlDmAdapter::TError errorStatus; |
|
5180 |
iDmCallback->FetchLinkL( KNSmlDefDMSCCP, *fetchResult, errorStatus ); |
|
5181 |
||
5182 |
// Find profile asked |
|
5183 |
iDmCallback->FetchLinkL( aObject, *fetchResult, errorStatus ); |
|
5184 |
||
5185 |
// Fetch SCCP profile ID. |
|
5186 |
TBuf8<KNSmlVoIPMaxResultLength> object; |
|
5187 |
object.Copy( aObject ); |
|
5188 |
object.Append( KNSmlDMVoIPSeparator ); |
|
5189 |
object.Append( KNSmlDMSCCPSccpID ); |
|
5190 |
iDmCallback->FetchLinkL( object, *fetchResult, errorStatus ); |
|
5191 |
TUint32 profileId = DesToInt( fetchResult->Ptr( 0 ) ); |
|
5192 |
CleanupStack::PopAndDestroy( fetchResult ); |
|
5193 |
fetchResult = NULL; |
|
5194 |
DBG_PRINT("CNSmlDmVoIPAdapter::SetSccpRef() : end"); |
|
5195 |
return profileId; |
|
5196 |
} |
|
5197 |
||
5198 |
// --------------------------------------------------------------------------- |
|
5199 |
// CNSmlDmVoIPAdapter::GetSccpIdL |
|
5200 |
// Get URI for given sccp profile ID. |
|
5201 |
// --------------------------------------------------------------------------- |
|
5202 |
// |
|
5203 |
MSmlDmAdapter::TError CNSmlDmVoIPAdapter::GetSccpIdL( CBufBase& aObject, |
|
5204 |
TUint32 aID ) const |
|
5205 |
{ |
|
5206 |
DBG_PRINT("CNSmlDmVoIPAdapter::GetSccpIdL() : begin"); |
|
5207 |
||
5208 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
5209 |
||
5210 |
CBufBase* result = CBufFlat::NewL( 1 ); |
|
5211 |
CleanupStack::PushL( result ); |
|
5212 |
CSmlDmAdapter::TError errorStatus; |
|
5213 |
TBuf8<KNSmlVoIPMaxResultLength> object; |
|
5214 |
iDmCallback->FetchLinkL( KNSmlDefDMSCCP, *result, errorStatus ); |
|
5215 |
result->Compress(); |
|
5216 |
HBufC8* childList = HBufC8::NewLC( result->Size() ); |
|
5217 |
TInt uriSegCount ( 0 ); |
|
5218 |
if ( result->Size() > 0 ) |
|
5219 |
{ |
|
5220 |
childList->Des().Copy( result->Ptr(0) ); |
|
5221 |
||
5222 |
// Delete last / mark |
|
5223 |
childList->Des().Delete( childList->Length() - 1, 1 ); |
|
5224 |
uriSegCount = NumOfURISegs( childList->Des() ); |
|
5225 |
} |
|
5226 |
||
5227 |
for ( TInt counter = 0; counter < uriSegCount; counter++ ) |
|
5228 |
{ |
|
5229 |
result->Reset(); |
|
5230 |
||
5231 |
// Make SCCP profile settings known |
|
5232 |
object.Copy( KNSmlDefDMSCCP ); |
|
5233 |
object.Append( KNSmlDMVoIPSeparator ); |
|
5234 |
object.Append( LastURISeg( childList->Des() ) ); |
|
5235 |
iDmCallback->FetchLinkL( object, *result, errorStatus ); |
|
5236 |
result->Compress(); |
|
5237 |
result->Reset(); |
|
5238 |
||
5239 |
// Get SCCPId |
|
5240 |
object.Append( KNSmlDMVoIPSeparator ); |
|
5241 |
object.Append( KNSmlDMSCCPSccpID ); |
|
5242 |
iDmCallback->FetchLinkL( object, *result, errorStatus ); |
|
5243 |
if ( aID == DesToInt ( result->Ptr( 0 ) ) ) |
|
5244 |
{ |
|
5245 |
aObject.InsertL( aObject.Size(), RemoveLastURISeg( object ) ); |
|
5246 |
break; |
|
5247 |
} |
|
5248 |
childList->Des().Copy( RemoveLastURISeg ( childList->Des() ) ); |
|
5249 |
} |
|
5250 |
// childList, result |
|
5251 |
CleanupStack::PopAndDestroy( childList ); // CS:1 |
|
5252 |
CleanupStack::PopAndDestroy( result ); // CS:0 |
|
5253 |
result = NULL; |
|
5254 |
childList = NULL; |
|
5255 |
DBG_PRINT("CNSmlDmVoIPAdapter::GetSccpIdL() : end"); |
|
5256 |
return errorStatus; |
|
5257 |
} |
|
5258 |
||
5259 |
// --------------------------------------------------------------------------- |
|
5260 |
// CNSmlDmVoIPAdapter::CheckDuplicateNameL |
|
5261 |
// Checks if duplicate named sip profiles. Renames if same. |
|
5262 |
// --------------------------------------------------------------------------- |
|
5263 |
// |
|
5264 |
TBool CNSmlDmVoIPAdapter::CheckDuplicateNameL( CRCSEProfileEntry& aEntry ) |
|
5265 |
{ |
|
5266 |
TBool isValid( EFalse ); |
|
5267 |
HBufC* newName = HBufC::NewLC( KMaxSettingsNameLength * 2 ); |
|
5268 |
newName->Des().Copy( aEntry.iSettingsName ); |
|
5269 |
||
5270 |
TInt count( iProfileEntries.Count() ); |
|
5271 |
||
5272 |
for ( TInt n = 0; n < count; n++ ) |
|
5273 |
{ |
|
5274 |
const TDesC& existingName = iProfileEntries[n]->iSettingsName; |
|
5275 |
if ( 0 == existingName.Compare( aEntry.iSettingsName ) |
|
5276 |
&& iProfileID != n ) // Skip the current profile. |
|
5277 |
{ |
|
5278 |
TBool isUnique( EFalse ); |
|
5279 |
||
5280 |
for ( TInt i = 1; !isUnique; i++ ) |
|
5281 |
{ |
|
5282 |
TBool found( EFalse ); |
|
5283 |
||
5284 |
newName->Des().Copy( aEntry.iSettingsName ); |
|
5285 |
newName->Des().Append( KOpenParenthesis() ); |
|
5286 |
newName->Des().AppendNum( i ); |
|
5287 |
newName->Des().Append( KClosedParenthesis() ); |
|
5288 |
for ( TInt m = 0; m < count; m++ ) |
|
5289 |
{ |
|
5290 |
if ( 0 == iProfileEntries[m]->iSettingsName.Compare( |
|
5291 |
newName->Des() ) ) |
|
5292 |
{ |
|
5293 |
found = ETrue; |
|
5294 |
} |
|
5295 |
} // for |
|
5296 |
if ( !found ) |
|
5297 |
{ |
|
5298 |
isUnique = ETrue; |
|
5299 |
} |
|
5300 |
} // for |
|
5301 |
} // if |
|
5302 |
} // for |
|
5303 |
||
5304 |
// Change setting only if length is smaller than max length. |
|
5305 |
if ( newName->Length() < KMaxSettingsNameLength ) |
|
5306 |
{ |
|
5307 |
aEntry.iSettingsName.Copy( newName->Des() ); |
|
5308 |
isValid = ETrue; |
|
5309 |
} |
|
5310 |
CleanupStack::PopAndDestroy( newName ); |
|
5311 |
return isValid; |
|
5312 |
} |
|
5313 |
||
5314 |
// --------------------------------------------------------------------------- |
|
5315 |
// CNSmlDmVoIPAdapter::CheckDuplicateProviderL |
|
5316 |
// Checks if duplicate provider name. Renames if same. |
|
5317 |
// --------------------------------------------------------------------------- |
|
5318 |
// |
|
5319 |
TBool CNSmlDmVoIPAdapter::CheckDuplicateProviderL( CRCSEProfileEntry& aEntry ) |
|
5320 |
{ |
|
5321 |
TBool isValid( EFalse ); |
|
5322 |
HBufC* newName = HBufC::NewLC( KMaxProviderNameLength * 2 ); |
|
5323 |
newName->Des().Copy( aEntry.iProviderName ); |
|
5324 |
||
5325 |
TInt count( iProfileEntries.Count() ); |
|
5326 |
||
5327 |
for ( TInt n = 0; n < count; n++ ) |
|
5328 |
{ |
|
5329 |
const TDesC& existingName = iProfileEntries[n]->iProviderName; |
|
5330 |
if ( 0 == existingName.Compare( aEntry.iProviderName ) |
|
5331 |
&& iProfileID != n ) // Skip the current profile. |
|
5332 |
{ |
|
5333 |
TBool isUnique( EFalse ); |
|
5334 |
||
5335 |
for ( TInt i = 1; !isUnique; i++ ) |
|
5336 |
{ |
|
5337 |
TBool found( EFalse ); |
|
5338 |
||
5339 |
newName->Des().Copy( aEntry.iProviderName ); |
|
5340 |
newName->Des().Append( KOpenParenthesis() ); |
|
5341 |
newName->Des().AppendNum( i ); |
|
5342 |
newName->Des().Append( KClosedParenthesis() ); |
|
5343 |
for ( TInt m = 0; m < count; m++ ) |
|
5344 |
{ |
|
5345 |
if ( 0 == iProfileEntries[m]->iProviderName.Compare( |
|
5346 |
newName->Des() ) ) |
|
5347 |
{ |
|
5348 |
found = ETrue; |
|
5349 |
} |
|
5350 |
} |
|
5351 |
if ( !found ) |
|
5352 |
{ |
|
5353 |
isUnique = ETrue; |
|
5354 |
} |
|
5355 |
} |
|
5356 |
} |
|
5357 |
} |
|
5358 |
||
5359 |
// Change setting only if length is smaller than max length. |
|
5360 |
if ( newName->Length() < KMaxProviderNameLength ) |
|
5361 |
{ |
|
5362 |
aEntry.iProviderName.Copy( newName->Des() ); |
|
5363 |
isValid = ETrue; |
|
5364 |
} |
|
5365 |
||
5366 |
CleanupStack::PopAndDestroy( newName ); |
|
5367 |
return isValid; |
|
5368 |
} |
|
5369 |
||
5370 |
// --------------------------------------------------------------------------- |
|
5371 |
// TInt CNSmlDmVoIPAdapter::FindCodecLocation |
|
5372 |
// For getting codec position. |
|
5373 |
// --------------------------------------------------------------------------- |
|
5374 |
// |
|
5375 |
TInt CNSmlDmVoIPAdapter::FindCodecLocation( TUint32 aID ) const |
|
5376 |
{ |
|
5377 |
for ( TInt i = 0; i < iCodecEntries.Count(); i++ ) |
|
5378 |
{ |
|
5379 |
if ( iCodecEntries[i]->iCodecId == aID ) |
|
5380 |
{ |
|
5381 |
return i; |
|
5382 |
} |
|
5383 |
} |
|
5384 |
return KErrNotFound; |
|
5385 |
} |
|
5386 |
||
5387 |
// --------------------------------------------------------------------------- |
|
5388 |
// void CNSmlDmVoIPAdapter::SetTelephonyPreferenceL |
|
5389 |
// For setting telephony preference. |
|
5390 |
// --------------------------------------------------------------------------- |
|
5391 |
// |
|
5392 |
void CNSmlDmVoIPAdapter::SetTelephonyPreferenceL ( const TTelephonyPreference& |
|
5393 |
aTelephonyPreference ) |
|
5394 |
{ |
|
5395 |
// Central Repository for richcall settings |
|
5396 |
CRepository* rep = CRepository::NewLC( KCRUidRichCallSettings ); |
|
5397 |
if ( EPSPreferred == aTelephonyPreference ) |
|
5398 |
{ |
|
5399 |
rep->Set( KRCSEPreferredTelephony, EPSPreferred ); |
|
5400 |
} |
|
5401 |
else if ( ECSPreferred == aTelephonyPreference ) |
|
5402 |
{ |
|
5403 |
rep->Set( KRCSEPreferredTelephony, ECSPreferred ); |
|
5404 |
} |
|
5405 |
CleanupStack::PopAndDestroy( rep ); |
|
5406 |
} |
|
5407 |
||
5408 |
// --------------------------------------------------------------------------- |
|
5409 |
// CNSmlDmVoIPAdapter::GetTerminalTypeL |
|
5410 |
// Collect terminal type used in SIP User Agent Header. |
|
5411 |
// --------------------------------------------------------------------------- |
|
5412 |
// |
|
5413 |
void CNSmlDmVoIPAdapter::GetTerminalTypeL( |
|
5414 |
TBuf<KMaxTerminalTypeLength>& aTerminalType ) const |
|
5415 |
{ |
|
5416 |
aTerminalType.Zero(); // Reset before use |
|
5417 |
||
5418 |
CIpAppPhoneUtils* phoneUtils = CIpAppPhoneUtils::NewLC(); |
|
5419 |
phoneUtils->GetTerminalTypeL( aTerminalType ); // Gets phone model + type |
|
5420 |
CleanupStack::PopAndDestroy( phoneUtils ); |
|
5421 |
} |
|
5422 |
||
5423 |
// --------------------------------------------------------------------------- |
|
5424 |
// CNSmlDmVoIPAdapter::GetWlanMacAddressL |
|
5425 |
// Gets WLAN MAC address used in SIP User Agent Header (same as *#62209526#). |
|
5426 |
// --------------------------------------------------------------------------- |
|
5427 |
// |
|
5428 |
void CNSmlDmVoIPAdapter::GetWlanMacAddressL( TBuf<KWlanMacAddressLength>& |
|
5429 |
aMac ) const |
|
5430 |
{ |
|
5431 |
aMac.Zero(); // Reset before use |
|
5432 |
||
5433 |
CIPAppUtilsAddressResolver* resolver = CIPAppUtilsAddressResolver::NewLC(); |
|
5434 |
||
5435 |
TBuf8<KWlanMacAddressLength> wlanmac; |
|
5436 |
_LIT8( KFormat, "-"); |
|
5437 |
resolver->GetWlanMACAddress( wlanmac, KFormat ); |
|
5438 |
//wlanmac buffer contains now the wlan mac address like 00-15-a0-99-10-ec |
|
5439 |
CleanupStack::PopAndDestroy( resolver ); |
|
5440 |
aMac.Copy( wlanmac ); |
|
5441 |
||
5442 |
} |
|
5443 |
||
5444 |
// --------------------------------------------------------------------------- |
|
5445 |
// CNSmlDmVoIPAdapter::GetNatFwUriL |
|
5446 |
// Get NAT/FW profile URI. |
|
5447 |
// --------------------------------------------------------------------------- |
|
5448 |
// |
|
5449 |
MSmlDmAdapter::TError CNSmlDmVoIPAdapter::GetNatFwUriL( |
|
5450 |
TBuf16<KMaxUriLength>& aObject, TInt aProfileId ) const |
|
5451 |
{ |
|
5452 |
DBG_PRINT("CNSmlDmVoIPAdapter::GetNatFwUriL : begin"); |
|
5453 |
||
5454 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
5455 |
||
5456 |
CBufBase* result = CBufFlat::NewL( 1 ); // CS:1 |
|
5457 |
CleanupStack::PushL( result ); |
|
5458 |
CSmlDmAdapter::TError errorStatus; |
|
5459 |
||
5460 |
// Get URIs to all DomainSpecific NAT/FW settings. |
|
5461 |
iDmCallback->FetchLinkL( KNSmlDMNATFWDomain(), *result, errorStatus ); |
|
5462 |
||
5463 |
if ( CSmlDmAdapter::EOk != errorStatus ) |
|
5464 |
{ |
|
5465 |
CleanupStack::PopAndDestroy( result ); |
|
5466 |
return errorStatus; |
|
5467 |
} |
|
5468 |
||
5469 |
result->Compress(); |
|
5470 |
HBufC8* childList = HBufC8::NewLC( result->Size() ); // CS:2 |
|
5471 |
TInt uriSegCount( 0 ); |
|
5472 |
||
5473 |
if ( result->Size() ) |
|
5474 |
{ |
|
5475 |
childList->Des().Copy( result->Ptr(0) ); |
|
5476 |
uriSegCount = NumOfURISegs( childList->Des() ); |
|
5477 |
} |
|
5478 |
||
5479 |
for ( TInt index = 0; index < uriSegCount; index++ ) |
|
5480 |
{ |
|
5481 |
HBufC8* uri = HBufC8::NewLC( ( KMaxUriLength * KTwoSegs ) );// CS:3 |
|
5482 |
uri->Des().Copy( KNSmlDMNATFWDomain ); |
|
5483 |
uri->Des().Append( KNSmlDMVoIPSeparator() ); |
|
5484 |
uri->Des().Append( LastURISeg( childList->Des() ) ); |
|
5485 |
HBufC8* luid = HBufC8::NewLC( KMaxUriLength ); // CS:4 |
|
5486 |
luid->Des().Copy( iDmCallback->GetLuidAllocL( uri->Des() )->Des() ); |
|
5487 |
if ( luid->Des().Length() && |
|
5488 |
aProfileId == DesToTUint( LastURISeg( luid->Des() ) ) ) |
|
5489 |
{ |
|
5490 |
aObject.Copy( uri->Des() ); |
|
5491 |
// luid, uri |
|
5492 |
CleanupStack::PopAndDestroy( luid ); // CS:3 |
|
5493 |
CleanupStack::PopAndDestroy( uri ); // CS:2 |
|
5494 |
break; |
|
5495 |
} |
|
5496 |
// luid, uri |
|
5497 |
CleanupStack::PopAndDestroy( luid ); // CS:3 |
|
5498 |
CleanupStack::PopAndDestroy( uri ); // CS:2 |
|
5499 |
childList->Des().Copy( RemoveLastURISeg( childList->Des() ) ); |
|
5500 |
} |
|
5501 |
||
5502 |
// childList, result |
|
5503 |
CleanupStack::PopAndDestroy( childList ); // CS:1 |
|
5504 |
CleanupStack::PopAndDestroy( result ); // CS:0 |
|
5505 |
DBG_PRINT("CNSmlDmVoIPAdapter::GetNatFwUriL : end"); |
|
5506 |
return errorStatus; |
|
5507 |
} |
|
5508 |
||
5509 |
// --------------------------------------------------------------------------- |
|
5510 |
// CNSmlDmVoIPAdapter::NatFwIdL |
|
5511 |
// Get NAT/FW profile ID. |
|
5512 |
// --------------------------------------------------------------------------- |
|
5513 |
// |
|
5514 |
TUint32 CNSmlDmVoIPAdapter::NatFwIdL( const TDesC8& aObject ) const |
|
5515 |
{ |
|
5516 |
DBG_PRINT("CNSmlDmVoIPAdapter::NatFwIdL : begin"); |
|
5517 |
||
5518 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
5519 |
||
5520 |
TUint32 profileId( KErrNone ); |
|
5521 |
HBufC8* luid = HBufC8::NewLC( KMaxUriLength ); // CS:1 |
|
5522 |
luid->Des().Copy( iDmCallback->GetLuidAllocL( aObject )->Des() ); |
|
5523 |
if ( luid->Des().Length() ) |
|
5524 |
{ |
|
5525 |
profileId = DesToTUint( LastURISeg( luid->Des() ) ); |
|
5526 |
} |
|
5527 |
CleanupStack::PopAndDestroy( luid ); // CS:0 |
|
5528 |
DBG_PRINT("CNSmlDmVoIPAdapter::NatFwIdL : end"); |
|
5529 |
return profileId; |
|
5530 |
} |
|
5531 |
||
5532 |
// --------------------------------------------------------------------------- |
|
5533 |
// CNSmlDmVoIPAdapter::GetConRefL |
|
5534 |
// Get DM URI for IAP. |
|
5535 |
// --------------------------------------------------------------------------- |
|
5536 |
// |
|
5537 |
MSmlDmAdapter::TError CNSmlDmVoIPAdapter::GetConRefL( CBufBase& aObject, |
|
5538 |
TInt aIapId ) const |
|
5539 |
{ |
|
5540 |
DBG_PRINT("CNSmlDmVoIPAdapter::GetConRefL() : begin"); |
|
5541 |
||
5542 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
5543 |
||
5544 |
TBool found = EFalse; |
|
5545 |
CNSmlDMIAPMatcher* iapMatch = CNSmlDMIAPMatcher::NewL( iDmCallback ); |
|
5546 |
CleanupStack::PushL( iapMatch ); // CS:1 |
|
5547 |
HBufC8* uri8 = iapMatch->URIFromIAPIdL( aIapId ); |
|
5548 |
CleanupStack::PushL( uri8 ); // CS:2 |
|
5549 |
if ( uri8 ) |
|
5550 |
{ |
|
5551 |
aObject.InsertL( aObject.Size(), uri8->Des() ); |
|
5552 |
found = ETrue; |
|
5553 |
} |
|
5554 |
// uri8, iapMatch |
|
5555 |
CleanupStack::PopAndDestroy( uri8 ); // CS:1 |
|
5556 |
CleanupStack::PopAndDestroy( iapMatch ); // CS:0 |
|
5557 |
DBG_PRINT("CNSmlDmVoIPAdapter::GetConRefL() : end"); |
|
5558 |
if ( !found ) |
|
5559 |
{ |
|
5560 |
return CSmlDmAdapter::ENotFound; |
|
5561 |
} |
|
5562 |
return CSmlDmAdapter::EOk; |
|
5563 |
} |
|
5564 |
||
5565 |
// --------------------------------------------------------------------------- |
|
5566 |
// CNSmlDmVoIPAdapter::ConRefL |
|
5567 |
// Get IAP ID (connection reference value) from given URI. |
|
5568 |
// --------------------------------------------------------------------------- |
|
5569 |
// |
|
5570 |
TInt CNSmlDmVoIPAdapter::ConRefL( const TDesC8& aObject ) const |
|
5571 |
{ |
|
5572 |
DBG_PRINT("CNSmlDmVoIPAdapter::ConRefL() : begin"); |
|
5573 |
||
5574 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
5575 |
||
5576 |
CNSmlDMIAPMatcher* iapMatch = CNSmlDMIAPMatcher::NewL( iDmCallback ); |
|
5577 |
CleanupStack::PushL( iapMatch ); |
|
5578 |
TInt iapId = iapMatch->IAPIdFromURIL( aObject ); |
|
5579 |
CleanupStack::PopAndDestroy( iapMatch ); |
|
5580 |
DBG_PRINT("CNSmlDmVoIPAdapter::ConRefL() : end"); |
|
5581 |
return iapId; |
|
5582 |
} |
|
5583 |
||
5584 |
// --------------------------------------------------------------------------- |
|
5585 |
// CNSmlDmVoIPAdapter::GetPresenceUriL |
|
5586 |
// Get Presence profile DM URI. |
|
5587 |
// --------------------------------------------------------------------------- |
|
5588 |
// |
|
5589 |
MSmlDmAdapter::TError CNSmlDmVoIPAdapter::GetPresenceUriL( |
|
5590 |
TBuf16<KMaxUriLength>& aObject, TUint32 aProfileId ) const |
|
5591 |
{ |
|
5592 |
DBG_PRINT("CNSmlDmVoIPAdapter::GetPresenceUriL : begin"); |
|
5593 |
||
5594 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
5595 |
||
5596 |
CBufBase* result = CBufFlat::NewL( 1 ); |
|
5597 |
CleanupStack::PushL( result ); // CS:1 |
|
5598 |
CSmlDmAdapter::TError errorStatus; |
|
5599 |
||
5600 |
// Get URIs to all Presence settings. |
|
5601 |
iDmCallback->FetchLinkL( KNSmlDMPresence(), *result, errorStatus ); |
|
5602 |
||
5603 |
if ( CSmlDmAdapter::EOk != errorStatus ) |
|
5604 |
{ |
|
5605 |
CleanupStack::PopAndDestroy( result ); |
|
5606 |
return errorStatus; |
|
5607 |
} |
|
5608 |
||
5609 |
result->Compress(); |
|
5610 |
HBufC8* childList = HBufC8::NewLC( result->Size() ); // CS:2 |
|
5611 |
TInt uriSegCount( 0 ); |
|
5612 |
||
5613 |
if ( result->Size() ) |
|
5614 |
{ |
|
5615 |
childList->Des().Copy( result->Ptr( 0 ) ); |
|
5616 |
uriSegCount = NumOfURISegs( childList->Des() ); |
|
5617 |
} |
|
5618 |
||
5619 |
// Get LUIDs for URIs. |
|
5620 |
for ( TInt index = 0; index < uriSegCount; index++ ) |
|
5621 |
{ |
|
5622 |
HBufC8* uri = HBufC8::NewLC( KMaxUriLength ); // CS:3 |
|
5623 |
HBufC8* luid = HBufC8::NewLC( KMaxUriLength ); // CS:4 |
|
5624 |
||
5625 |
uri->Des().Copy( KNSmlDMPresence() ); |
|
5626 |
uri->Des().Append( KNSmlDMVoIPSeparator() ); |
|
5627 |
uri->Des().Append( LastURISeg( childList->Des() ) ); |
|
5628 |
luid->Des().Copy( iDmCallback->GetLuidAllocL( uri->Des() )->Des() ); |
|
5629 |
if ( luid->Des().Length() && |
|
5630 |
aProfileId == DesToTUint( LastURISeg( luid->Des() ) ) ) |
|
5631 |
{ |
|
5632 |
aObject.Copy( uri->Des() ); |
|
5633 |
// luid, uri |
|
5634 |
CleanupStack::PopAndDestroy( luid ); // CS:3 |
|
5635 |
CleanupStack::PopAndDestroy( uri ); // CS:2 |
|
5636 |
break; |
|
5637 |
} |
|
5638 |
childList->Des().Copy( RemoveLastURISeg( childList->Des() ) ); |
|
5639 |
// luid, uri |
|
5640 |
CleanupStack::PopAndDestroy( luid ); // CS:3 |
|
5641 |
CleanupStack::PopAndDestroy( uri ); // CS:2 |
|
5642 |
} |
|
5643 |
// childList, result |
|
5644 |
CleanupStack::PopAndDestroy( childList ); // CS:1 |
|
5645 |
CleanupStack::PopAndDestroy( result ); // CS:0 |
|
5646 |
DBG_PRINT("CNSmlDmVoIPAdapter::GetPresenceUriL : end"); |
|
5647 |
return errorStatus; |
|
5648 |
} |
|
5649 |
||
5650 |
// --------------------------------------------------------------------------- |
|
5651 |
// CNSmlDmVoIPAdapter::PresenceIdL |
|
5652 |
// Get Presence profile ID. |
|
5653 |
// --------------------------------------------------------------------------- |
|
5654 |
// |
|
5655 |
TUint32 CNSmlDmVoIPAdapter::PresenceIdL( const TDesC8& aObject ) const |
|
5656 |
{ |
|
5657 |
#ifdef _DEBUG |
|
5658 |
TBuf<KMaxDebugPrintLength> object; |
|
5659 |
object.Copy( aObject ); |
|
5660 |
DBG_PRINT2("CNSmlDmVoIPAdapter::PresenceIdL : begin uri: %S", &object ); |
|
5661 |
#endif |
|
5662 |
||
5663 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
5664 |
TPtrC8 uri = RemoveDotSlash( aObject ); |
|
5665 |
||
5666 |
HBufC8* luid = iDmCallback->GetLuidAllocL( uri ); |
|
5667 |
CleanupStack::PushL( luid ); //CS:1 |
|
5668 |
||
5669 |
// check whether above found id is valid or not |
|
5670 |
TUint32 profileId; |
|
5671 |
if ( luid->Length() == KErrNone ) |
|
5672 |
{ |
|
5673 |
//try to find it another way |
|
5674 |
if( NSmlDmURI::NumOfURISegs( uri ) > 1 ) |
|
5675 |
{ |
|
5676 |
TPtrC8 idSegment = NSmlDmURI::URISeg( uri, 2 ); |
|
5677 |
TBuf<KMaxDebugPrintLength> tempSegment; |
|
5678 |
tempSegment.Copy( idSegment ); |
|
5679 |
DBG_PRINT2("CNSmlDmVoIPAdapter::PresenceIdL - idSegment:%S", &tempSegment ); |
|
5680 |
profileId = DesToTUint(idSegment); |
|
5681 |
if(!IsPresIDValidL(profileId)) |
|
5682 |
{ |
|
5683 |
CleanupStack::PopAndDestroy( luid ); // CS:0 |
|
5684 |
DBG_PRINT("CNSmlDmVoIPAdapter::PresenceIdL : ID not valid - return KErrNone"); |
|
5685 |
return KErrNone; |
|
5686 |
} |
|
5687 |
CleanupStack::PopAndDestroy( luid ); // CS:0 |
|
5688 |
DBG_PRINT2("CNSmlDmVoIPAdapter::PresenceIdL - settingsId found local way:%d", profileId); |
|
5689 |
return profileId; |
|
5690 |
} |
|
5691 |
CleanupStack::PopAndDestroy( luid ); // CS:0 |
|
5692 |
DBG_PRINT("CNSmlDmVoIPAdapter::PresenceIdL : ID not valid, too short uri"); |
|
5693 |
return KErrNone; |
|
5694 |
} |
|
5695 |
profileId = DesToTUint( *luid ); |
|
5696 |
CleanupStack::PopAndDestroy( luid ); // CS:0 |
|
5697 |
DBG_PRINT2("CNSmlDmVoIPAdapter::PresenceIdL : return profleId: %d", profileId ); |
|
5698 |
return profileId; |
|
5699 |
} |
|
5700 |
||
5701 |
// ----------------------------------------------------------------------------- |
|
5702 |
// CPresenceDMAdapter::IsPresIDValidL |
|
5703 |
// ----------------------------------------------------------------------------- |
|
5704 |
// |
|
5705 |
TBool CNSmlDmVoIPAdapter::IsPresIDValidL( TUint32 aSetId ) const |
|
5706 |
{ |
|
5707 |
TPresSettingsSet tempSet; |
|
5708 |
if ((PresSettingsApi::SettingsSetL( (TInt)aSetId,tempSet)) == KErrNone) |
|
5709 |
return ETrue; |
|
5710 |
DBG_PRINT2(" CNSmlDmVoIPAdapter::IsPresIDValidL - Invalid settings : %d", aSetId ); |
|
5711 |
return EFalse; |
|
5712 |
} |
|
5713 |
||
5714 |
// --------------------------------------------------------------------------- |
|
5715 |
// CNSmlDmVoIPAdapter::SnapIdL |
|
5716 |
// Gets SNAP ID based on URI. |
|
5717 |
// --------------------------------------------------------------------------- |
|
5718 |
// |
|
5719 |
TInt CNSmlDmVoIPAdapter::SnapIdL( const TDesC8& aUri ) |
|
5720 |
{ |
|
5721 |
DBG_PRINT( "CNSmlDmVoIPAdapter::SnapIdL - begin" ); |
|
5722 |
TInt snapId( KErrNotFound ); |
|
5723 |
||
5724 |
HBufC8* luid = HBufC8::NewLC( KNSmlVoIPMaxUriLength ); // CS:1 |
|
5725 |
luid->Des().Copy( iDmCallback->GetLuidAllocL( aUri )->Des() ); |
|
5726 |
||
5727 |
if ( luid->Des().Length() ) |
|
5728 |
{ |
|
5729 |
snapId = DesToInt( LastURISeg( luid->Des() ) ); |
|
5730 |
} |
|
5731 |
CleanupStack::PopAndDestroy( luid ); // CS:0 |
|
5732 |
DBG_PRINT( "CNSmlDmVoIPAdapter::SnapIdL - end" ); |
|
5733 |
return snapId; |
|
5734 |
} |
|
5735 |
||
5736 |
// --------------------------------------------------------------------------- |
|
5737 |
// CNSmlDmVoIPAdapter::GetSnapUriL |
|
5738 |
// Set SNAP URI based on SNAP ID. |
|
5739 |
// --------------------------------------------------------------------------- |
|
5740 |
// |
|
5741 |
MSmlDmAdapter::TError CNSmlDmVoIPAdapter::GetSnapUriL( TDes8& aObject, |
|
5742 |
TInt aSnapId ) |
|
5743 |
{ |
|
5744 |
__ASSERT_ALWAYS( iDmCallback != NULL, User::Leave( KErrArgument ) ); |
|
5745 |
||
5746 |
DBG_PRINT( "CNSmlDmSIPAdapter::GetSnapUriL - begin" ); |
|
5747 |
||
5748 |
CBufBase* result = CBufFlat::NewL( 1 ); |
|
5749 |
CleanupStack::PushL( result ); // CS:1 |
|
5750 |
CSmlDmAdapter::TError status; |
|
5751 |
||
5752 |
// Get URIs to all SNAP settings. |
|
5753 |
iDmCallback->FetchLinkL( KNSmlDMSnapUriPrefix(), *result, status ); |
|
5754 |
||
5755 |
if ( CSmlDmAdapter::EOk != status ) |
|
5756 |
{ |
|
5757 |
CleanupStack::PopAndDestroy( result ); |
|
5758 |
DBG_PRINT( "CNSmlDmVoIPAdapter::GetSnapUriL - Fetch SNAP error end" ); |
|
5759 |
return status; |
|
5760 |
} |
|
5761 |
||
5762 |
result->Compress(); |
|
5763 |
HBufC8* childList = HBufC8::NewLC( result->Size() ); // CS:2 |
|
5764 |
TInt uriSegCount( 0 ); |
|
5765 |
||
5766 |
if ( result->Size() ) |
|
5767 |
{ |
|
5768 |
childList->Des().Copy( result->Ptr( 0 ) ); |
|
5769 |
uriSegCount = NumOfURISegs( childList->Des() ); |
|
5770 |
} |
|
5771 |
||
5772 |
// Get LUIDs for URIs. |
|
5773 |
for ( TInt index = 0; index < uriSegCount; index++ ) |
|
5774 |
{ |
|
5775 |
HBufC8* uri = HBufC8::NewLC( KNSmlVoIPMaxUriLength ); // CS:3 |
|
5776 |
HBufC8* luid = HBufC8::NewLC( KNSmlVoIPMaxUriLength ); // CS:4 |
|
5777 |
||
5778 |
uri->Des().Copy( KNSmlDMSnapUriPrefix() ); |
|
5779 |
uri->Des().Append( KNSmlDMVoIPSeparator() ); |
|
5780 |
uri->Des().Append( LastURISeg( childList->Des() ) ); |
|
5781 |
luid->Des().Copy( iDmCallback->GetLuidAllocL( uri->Des() )->Des() ); |
|
5782 |
if ( luid->Des().Length() && |
|
5783 |
aSnapId == DesToInt( LastURISeg( luid->Des() ) ) ) |
|
5784 |
{ |
|
5785 |
aObject.Copy( uri->Des() ); |
|
5786 |
// luid, uri |
|
5787 |
CleanupStack::PopAndDestroy( luid ); // CS:3 |
|
5788 |
CleanupStack::PopAndDestroy( uri ); // CS:2 |
|
5789 |
break; |
|
5790 |
} |
|
5791 |
childList->Des().Copy( RemoveLastURISeg( childList->Des() ) ); |
|
5792 |
// luid, uri |
|
5793 |
CleanupStack::PopAndDestroy( luid ); // CS:3 |
|
5794 |
CleanupStack::PopAndDestroy( uri ); // CS:2 |
|
5795 |
} |
|
5796 |
// childList, result |
|
5797 |
CleanupStack::PopAndDestroy( childList ); // CS:1 |
|
5798 |
CleanupStack::PopAndDestroy( result ); // CS:0 |
|
5799 |
DBG_PRINT( "CNSmlDmVoIPAdapter::GetSnapUriL - end" ); |
|
5800 |
return status; |
|
5801 |
} |
|
31
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5802 |
// --------------------------------------------------------------------------- |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5803 |
// CNSmlDmVoIPAdapter::UpdateServiceIdL |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5804 |
// Updates service id to our temp array. |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5805 |
// --------------------------------------------------------------------------- |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5806 |
// |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5807 |
void CNSmlDmVoIPAdapter::UpdateServiceIdL( CRCSEProfileEntry* aProfile ) |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5808 |
{ |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5809 |
DBG_PRINT2("CNSmlDmVoIPAdapter::UpdateServiceIdL(): original service id : %d", |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5810 |
aProfile->iServiceProviderId); |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5811 |
|
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5812 |
CRCSEProfileEntry* profile = CRCSEProfileEntry::NewLC(); |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5813 |
TRAPD( error, iCRCSEProfile->FindL( aProfile->iId, *profile ) ); |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5814 |
DBG_PRINT2("CNSmlDmVoIPAdapter::UpdateServiceIdL(): error : %d", error); |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5815 |
if ( !error ) |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5816 |
{ |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5817 |
DBG_PRINT2("CNSmlDmVoIPAdapter::UpdateServiceIdL(): service id : %d", |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5818 |
profile->iServiceProviderId); |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5819 |
aProfile->iServiceProviderId = profile->iServiceProviderId; |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5820 |
} |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5821 |
CleanupStack::PopAndDestroy( profile ); |
5886d40bb3de
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
5822 |
} |
28 | 5823 |
// End of file. |