1 /* |
|
2 * Copyright (c) 2009-2010 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: VoIP handler for VoIP XML processor |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef VOIPXMLVOIPHANDLER_H |
|
20 #define VOIPXMLVOIPHANDLER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <sipprofileregistryobserver.h> |
|
24 #include <crcseprofileentry.h> |
|
25 #include <crcseaudiocodecentry.h> |
|
26 |
|
27 class CSPSettings; |
|
28 class CRCSEProfileRegistry; |
|
29 class CRCSEAudioCodecRegistry; |
|
30 class CRCSEProfileEntry; |
|
31 class CSPProperty; |
|
32 |
|
33 typedef CRCSEAudioCodecEntry::TOnOff TCodecOnOff; |
|
34 typedef CRCSEProfileEntry::TOnOff TEntryOnOff; |
|
35 |
|
36 struct TTemporaryCodec |
|
37 { |
|
38 /** |
|
39 * Codec name. |
|
40 */ |
|
41 HBufC* iName; |
|
42 /** |
|
43 * Jitter buffer size. |
|
44 */ |
|
45 TInt iJitterBuffer; |
|
46 /** |
|
47 * Octet-align. |
|
48 */ |
|
49 TCodecOnOff iOctetAlign; |
|
50 /** |
|
51 * PTime value. |
|
52 */ |
|
53 TInt iPtime; |
|
54 /** |
|
55 * MaxPtime value. |
|
56 */ |
|
57 TInt iMaxPtime; |
|
58 /** |
|
59 * Mode-set values. |
|
60 */ |
|
61 RArray<TUint32> iModeSet; |
|
62 /** |
|
63 * Mode-change-period value. |
|
64 */ |
|
65 TInt iModeChangePeriod; |
|
66 /** |
|
67 * Mode-change-neighbor value. |
|
68 */ |
|
69 TCodecOnOff iModeChangeNeighbor; |
|
70 /** |
|
71 * Max-red value. |
|
72 */ |
|
73 TInt iMaxRed; |
|
74 /** |
|
75 * VAD value. |
|
76 */ |
|
77 TCodecOnOff iVad; |
|
78 /** |
|
79 * Annexb value. |
|
80 */ |
|
81 TCodecOnOff iAnnexb; |
|
82 }; |
|
83 |
|
84 struct TSpSettings |
|
85 { |
|
86 /** |
|
87 * Tells if buddy requests are automatically accepted. |
|
88 */ |
|
89 TBool iAutoAcceptBuddies; |
|
90 /** |
|
91 * Provider bookmark URL. |
|
92 */ |
|
93 HBufC* iProviderUrl; |
|
94 /** |
|
95 * Branding URI. |
|
96 */ |
|
97 HBufC* iBrandingUri; |
|
98 /** |
|
99 * Tells if the service will be automatically enabled. |
|
100 */ |
|
101 TBool iAutoEnable; |
|
102 /** |
|
103 * Message Waiting Indicator URI for voice mailbox. |
|
104 */ |
|
105 HBufC* iMwiUri; |
|
106 /** |
|
107 * Listening URI for voice mailbox. |
|
108 */ |
|
109 HBufC* iListeningUri; |
|
110 /** |
|
111 * Re-subscribe interval for voice mailbox. |
|
112 */ |
|
113 TInt iResubrcribe; |
|
114 /** |
|
115 * Tells if SIP IM is enabled. IM will be set as enabled only if |
|
116 * a presence ID is received via LinkSettings() method. |
|
117 */ |
|
118 TBool iEnableSipIm; |
|
119 /** |
|
120 * Brand ID. |
|
121 */ |
|
122 HBufC* iBrandId; |
|
123 }; |
|
124 |
|
125 /** |
|
126 * VoIP handler class. |
|
127 * Handles VoIP related settings. |
|
128 * |
|
129 * @lib voipxmlprocessor.lib |
|
130 * @since S60 v5.0 |
|
131 */ |
|
132 class CVoipXmlVoipHandler : public CBase, public MSIPProfileRegistryObserver |
|
133 { |
|
134 #ifdef _DEBUG |
|
135 friend class UT_CVoipXmlVoipHandler; |
|
136 friend class UT_CVoipXmlParser; |
|
137 friend class UT_CVoipXmlParamHandler; |
|
138 #endif |
|
139 |
|
140 public: |
|
141 |
|
142 /** |
|
143 * Two-phased constructor. |
|
144 */ |
|
145 static CVoipXmlVoipHandler* NewL(); |
|
146 |
|
147 /** |
|
148 * Destructor. |
|
149 */ |
|
150 virtual ~CVoipXmlVoipHandler(); |
|
151 |
|
152 /** |
|
153 * Sets VoIP setting. |
|
154 * |
|
155 * @since S60 v5.0 |
|
156 * @param aType Type of setting (VoIP 'core', vmbx or codec) |
|
157 * @param aParam Parameter to be set. |
|
158 * @param aValue Value of the setting. |
|
159 */ |
|
160 void SetSetting( TInt aType, TInt aParam, const TDesC& aValue ); |
|
161 |
|
162 /** |
|
163 * Stores settings to RCSE. |
|
164 * |
|
165 * @since S60 v5.0 |
|
166 * @return KErrNone if successful, |
|
167 * KErrNotSupported if no settings to be stored, |
|
168 * KErrCompletion if settings could not be stored. |
|
169 */ |
|
170 TInt StoreSettings(); |
|
171 |
|
172 /** |
|
173 * Returns the service ID. |
|
174 * |
|
175 * @since S60 v5.0 |
|
176 * @return VoIP service ID. |
|
177 */ |
|
178 TUint32 SettingsId(); |
|
179 |
|
180 /** |
|
181 * Method to inform the handler that currently deployed settings |
|
182 * have ended. This way we will know when a codec is ready to be |
|
183 * put to RCSE. |
|
184 * |
|
185 * @since S60 v5.0 |
|
186 * @param aType Type of settings. |
|
187 */ |
|
188 void SettingsEnd( TInt aType ); |
|
189 |
|
190 /** |
|
191 * Gives linkage information. |
|
192 * |
|
193 * @since S60 v5.0 |
|
194 * @param aType Type of settings. |
|
195 * @param aSettingsId Settings ID. |
|
196 */ |
|
197 void LinkSettings( TInt aType, TUint32 aSettingsId ); |
|
198 |
|
199 /** |
|
200 * Finalizes settings, i.e. sets all the settings that are bound to |
|
201 * settings linkage (e.g. SIP User-Agent header and |
|
202 * settings stored in SPSettings). |
|
203 * |
|
204 * @since S60 v5.0 |
|
205 * @return KErrNone if successful, |
|
206 * KErrCompletion if settings could not be finalized. |
|
207 */ |
|
208 TInt FinalizeSettings(); |
|
209 |
|
210 /** |
|
211 * Returns the service tab ID. |
|
212 * |
|
213 * @since S60 v5.0 |
|
214 * @return Service tab ID. |
|
215 */ |
|
216 TUint32 ServiceTabIdL(); |
|
217 |
|
218 protected: |
|
219 |
|
220 // from base class MSIPProfileRegistryObserver |
|
221 |
|
222 /** |
|
223 * From MSIPProfileRegistryObserver |
|
224 * SIP profile information event. |
|
225 * |
|
226 * @since S60 v5.0 |
|
227 * @param aSIPProfileId SIP profile ID. |
|
228 * @param aEvent Type of SIP event |
|
229 */ |
|
230 void ProfileRegistryEventOccurred( TUint32 /*aSIPProfileId*/, |
|
231 TEvent /*aEvent*/ ); |
|
232 |
|
233 /** |
|
234 * From MSIPProfileRegistryObserver |
|
235 * An asynchronous error has occurred related to SIP profile. |
|
236 * |
|
237 * @since S60 v5.0 |
|
238 * @param aSIPProfileId SIP profile ID. |
|
239 * @param aError Error code. |
|
240 */ |
|
241 void ProfileRegistryErrorOccurred( TUint32 /*aSIPProfileId*/, |
|
242 TInt /*aError*/ ); |
|
243 |
|
244 private: |
|
245 |
|
246 /** |
|
247 * Sets VoIP core setting to temporary storage. |
|
248 * |
|
249 * @param aParam Parameter to be set. |
|
250 * @param aValue Value of the setting. |
|
251 * @since S60 v5.0 |
|
252 */ |
|
253 void SetCoreSettingL( TInt aParam, const TDesC& aValue ); |
|
254 |
|
255 /** |
|
256 * Sets codec setting to temporary storage. |
|
257 * |
|
258 * @param aParam Parameter to be set. |
|
259 * @param aValue Value of the setting. |
|
260 * @since S60 v5.0 |
|
261 */ |
|
262 void SetCodecSettingL( TInt aParam, const TDesC& aValue ); |
|
263 |
|
264 /** |
|
265 * Sets voice mailbox setting to temporary storage. |
|
266 * |
|
267 * @param aParam Parameter to be set. |
|
268 * @param aValue Value of the setting. |
|
269 * @since S60 v5.0 |
|
270 */ |
|
271 void SetVmbxSettingL( TInt aParam, const TDesC& aValue ); |
|
272 |
|
273 /** |
|
274 * Validates profile name and modifies it if necessary. |
|
275 * |
|
276 * @since S60 v5.0 |
|
277 * @param aName Name to be validated. |
|
278 */ |
|
279 void ValidateProfileNameL( TDes& aName ); |
|
280 |
|
281 /** |
|
282 * Sets temporary codec to RCSE. |
|
283 * |
|
284 * @since S60 v5.0 |
|
285 */ |
|
286 void SetCodecToRcseL(); |
|
287 |
|
288 /** |
|
289 * Reset temporary codec settings (iCurrentCodec) |
|
290 * |
|
291 * @since S60 v5.0 |
|
292 */ |
|
293 void ResetTempCodec( TBool aCloseArray = EFalse ); |
|
294 |
|
295 /** |
|
296 * Resets temporary service provider settings (iSpSettings) |
|
297 * |
|
298 * @since S60 v5.0 |
|
299 */ |
|
300 void ResetTempSpSettings(); |
|
301 |
|
302 /** |
|
303 * Sets SIP related VoIP settings (links VoIP profile to SIP and sets |
|
304 * SIP User-Agent header). |
|
305 * |
|
306 * @since S60 v5.0 |
|
307 * @param aSipId SIP settings ID. |
|
308 */ |
|
309 void SetSipInfoL( TUint32 aSipId ); |
|
310 |
|
311 /** |
|
312 * Sets SPSettings to service table. |
|
313 * |
|
314 * @since S60 v5.0 |
|
315 */ |
|
316 void SetSpSettingsL(); |
|
317 |
|
318 /** |
|
319 * Adds default codec set to iEntry. |
|
320 * |
|
321 * @since S60 v5.0 |
|
322 */ |
|
323 void AddDefaultCodecsL(); |
|
324 |
|
325 /** |
|
326 * Sets the service as default service and preferred telephony as PS. |
|
327 * |
|
328 * @since S60 v5.1 |
|
329 */ |
|
330 void SetAsDefaultL(); |
|
331 |
|
332 private: |
|
333 |
|
334 CVoipXmlVoipHandler(); |
|
335 void ConstructL(); |
|
336 |
|
337 private: |
|
338 |
|
339 /** |
|
340 * RCSE profile registry. |
|
341 * Own. |
|
342 */ |
|
343 CRCSEProfileRegistry* iRegistry; |
|
344 |
|
345 /** |
|
346 * RCSE audio codec registry |
|
347 * Own. |
|
348 */ |
|
349 CRCSEAudioCodecRegistry* iCodecRegistry; |
|
350 |
|
351 /** |
|
352 * RCSE profile entry. |
|
353 * Own. |
|
354 */ |
|
355 CRCSEProfileEntry* iEntry; |
|
356 |
|
357 /** |
|
358 * Tells if any settings have been set to temporary profile. |
|
359 */ |
|
360 TBool iSettingsSet; |
|
361 |
|
362 /** |
|
363 * VoIP service ID. |
|
364 */ |
|
365 TUint32 iServiceId; |
|
366 |
|
367 /** |
|
368 * Current codec that is being modified. |
|
369 */ |
|
370 TTemporaryCodec iCurrentCodec; |
|
371 |
|
372 /** |
|
373 * SPSettings that are temporarily stored and . |
|
374 */ |
|
375 TSpSettings iSpSettings; |
|
376 |
|
377 /** |
|
378 * Presence settings ID. This is received in LinkSettings method and |
|
379 * will be stored to SPSettings in FinalizeSettings method. |
|
380 */ |
|
381 TUint32 iPresenceId; |
|
382 |
|
383 /** |
|
384 * Destination (SNAP) ID. This is received in LinkSettings method and |
|
385 * will be stored to SPSettings in FinalizedSettings method. |
|
386 */ |
|
387 TUint32 iDestinationId; |
|
388 |
|
389 /** |
|
390 * Tells if the service is to be set as default service. |
|
391 */ |
|
392 TBool iDefault; |
|
393 }; |
|
394 |
|
395 #endif // VOIPXMLVOIPHANDLER_H |
|
396 |
|
397 // End of File |
|