1 /* |
|
2 * Copyright (c) 2006-2007 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: Provides static utility functions for SVP |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // #include <WlanInternalPSKeys.h> |
|
20 #include <sysutil.h> |
|
21 #include <sipprofile.h> |
|
22 |
|
23 #include <CommonEngineDomainCRKeys.h> // for accept-language -header |
|
24 #include <centralrepository.h> // for language code |
|
25 #include <settingsinternalcrkeys.h> // Settings UIs CR keys |
|
26 #include <unsafprotocolscrkeys.h> // Keys for keep-alive value,ipappsrv_dom\nat_settings_api |
|
27 |
|
28 #include <mceaudiocodec.h> |
|
29 #include <mceamrcodec.h> |
|
30 #include <mceg711codec.h> |
|
31 #include <mceilbccodec.h> |
|
32 #include <mcecodec.h> |
|
33 #include <mcedtmfcodec.h> |
|
34 #include <mceamrwbcodec.h> |
|
35 #include <mcertpsource.h> |
|
36 #include <mcemicsource.h> |
|
37 #include <mcertpsink.h> |
|
38 #include <pathinfo.h> |
|
39 #include <crcseprofileentry.h> |
|
40 #include <crcseprofileregistry.h> |
|
41 #include <crcseaudiocodecregistry.h> |
|
42 #include <crcseaudiocodecentry.h> |
|
43 |
|
44 #include "voipeventlog.h" // CVoipEventLog |
|
45 #include "voiperrorentry.h" // CVoipErrorEntry |
|
46 #include "cipapputilsaddressresolver.h" // CIPAppUtilsAddressResolver |
|
47 |
|
48 #include "svputility.h" |
|
49 #include "svplogger.h" |
|
50 #include "svpsipconsts.h" |
|
51 #include "svplanguagetagconsts.h" |
|
52 #include "svpaudioutility.h" |
|
53 |
|
54 // LOCAL CONSTANTS |
|
55 // Default audio frame size in milliseconds for calculating jitterbuffer size |
|
56 const TInt32 KJitterBufferFrameSize = 20; |
|
57 |
|
58 // Constants for iLBC 20 and 30ms modes |
|
59 const TUint32 KSvpilbcMode20ms = 20; |
|
60 const TUint32 KSvpilbcMode30ms = 30; |
|
61 |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // CSVPUtility::NewL |
|
65 // --------------------------------------------------------------------------- |
|
66 // |
|
67 CSVPUtility* CSVPUtility::NewL() |
|
68 { |
|
69 CSVPUtility* self = new( ELeave ) CSVPUtility(); |
|
70 CleanupStack::PushL( self ); |
|
71 self->ConstructL(); |
|
72 CleanupStack::Pop( self ); |
|
73 return self; |
|
74 } |
|
75 |
|
76 |
|
77 // --------------------------------------------------------------------------- |
|
78 // CSVPUtility::ConstructL |
|
79 // --------------------------------------------------------------------------- |
|
80 // |
|
81 void CSVPUtility::ConstructL() |
|
82 { |
|
83 SVPDEBUG1("CSVPUtility::ConstructL()"); |
|
84 iPreferredCodec = 0; |
|
85 iRoundIndex = 0; |
|
86 |
|
87 // create CVoipEventLog |
|
88 TRAP_IGNORE( iVoipEventLogger = CVoipEventLog::NewL() ); |
|
89 } |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // CSVPUtility::CSVPUtility |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 CSVPUtility::CSVPUtility() |
|
96 { |
|
97 SVPDEBUG1("CSVPUtility::CSVPUtility()"); |
|
98 } |
|
99 |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // CSVPUtility::~CSVPUtility |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 CSVPUtility::~CSVPUtility() |
|
106 { |
|
107 SVPDEBUG1("CSVPUtility::~CSVPUtility()"); |
|
108 delete iVoipEventLogger; |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // CSVPUtility::SetAudioCodecsMOL |
|
113 // --------------------------------------------------------------------------- |
|
114 // |
|
115 void CSVPUtility::SetAudioCodecsMOL( TUint32 aVoIPProfileId, |
|
116 CMceAudioStream& aAudioInStream, |
|
117 TInt aKeepAliveValue ) |
|
118 { |
|
119 SVPDEBUG1("CSVPUtility::SetAudioCodecsMOL: IN"); |
|
120 |
|
121 RArray< TUint32 > codecIds; |
|
122 CleanupClosePushL( codecIds ); |
|
123 |
|
124 // clear codec priority preferrence variable |
|
125 iPreferredCodec = 0; |
|
126 |
|
127 CRCSEProfileEntry* profile = CRCSEProfileEntry::NewLC(); |
|
128 CRCSEAudioCodecEntry* codecprofile = CRCSEAudioCodecEntry::NewLC(); |
|
129 CRCSEProfileRegistry* rCSEProfile = CRCSEProfileRegistry::NewLC(); |
|
130 CRCSEAudioCodecRegistry* rCSEAudioCodec = |
|
131 CRCSEAudioCodecRegistry::NewLC(); |
|
132 |
|
133 // Get VoIP profile from RCSE |
|
134 rCSEProfile->FindL( aVoIPProfileId, *profile ); |
|
135 |
|
136 // fetch codec id's |
|
137 GetCodecIdsByVoIPProfileIdL( *profile, codecIds ); |
|
138 TBool capabilitiesSet = EFalse; |
|
139 |
|
140 // Set capabilities |
|
141 for( TInt j = 0; j < codecIds.Count(); j++ ) |
|
142 { |
|
143 rCSEAudioCodec->FindL( codecIds[ j ], *codecprofile ); |
|
144 if ( !codecprofile->iMediaSubTypeName.CompareF( KAudioCodecCN ) ) |
|
145 { |
|
146 iCN = ETrue; |
|
147 } |
|
148 else |
|
149 { |
|
150 SVPDEBUG2("CSVPUtility::SetAudioCodecsMOL: j: %d", j); |
|
151 MoCallCapabilitiesL( aAudioInStream, |
|
152 *profile, |
|
153 *codecprofile ); |
|
154 capabilitiesSet = ETrue; |
|
155 } |
|
156 } |
|
157 |
|
158 // in Mo case, redundancy is never offered |
|
159 iRed = EFalse; |
|
160 |
|
161 if ( capabilitiesSet ) |
|
162 { |
|
163 SetDtmfL( *profile, aAudioInStream ); |
|
164 } |
|
165 |
|
166 SetMediaQoSL( profile->iMediaQOS, aAudioInStream.Session() ); |
|
167 |
|
168 // set comfort noise for PCMA/PCMU & ILBC if CN provisioned |
|
169 // also handles keep alive logics |
|
170 if ( iCN ) |
|
171 { |
|
172 SetComfortNoiseL( aAudioInStream ); |
|
173 RemoveUnnecessaryCodecsL( aAudioInStream ); |
|
174 SetCNKeepAliveL( aAudioInStream, aKeepAliveValue ); |
|
175 } |
|
176 else |
|
177 { |
|
178 RemoveUnnecessaryCodecsL( aAudioInStream ); |
|
179 SetKeepAliveL( aAudioInStream, aKeepAliveValue ); |
|
180 } |
|
181 |
|
182 // Check RTCP for actual and bound stream as we do not have knowledge where |
|
183 // the actual RTP sink is residing |
|
184 CheckRtcpSettingL( profile->iRTCP, aAudioInStream ); |
|
185 if ( aAudioInStream.BoundStream() ) |
|
186 { |
|
187 CheckRtcpSettingL( profile->iRTCP, aAudioInStream.BoundStreamL() ); |
|
188 } |
|
189 |
|
190 // RCSE objects can be deleted |
|
191 CleanupStack::PopAndDestroy( 5, &codecIds ); |
|
192 |
|
193 // Leave if codec information was not found. |
|
194 if ( !aAudioInStream.Codecs().Count() ) |
|
195 { |
|
196 SVPDEBUG1("CSVPUtility::SetAudioCodecsMOL KErrNotFound"); |
|
197 User::Leave( KErrNotFound ); |
|
198 } |
|
199 |
|
200 SVPDEBUG1("CSVPUtility::SetAudioCodecsMOL: OUT"); |
|
201 } |
|
202 |
|
203 // --------------------------------------------------------------------------- |
|
204 // CSVPUtility::SetKeepAliveL |
|
205 // --------------------------------------------------------------------------- |
|
206 // |
|
207 void CSVPUtility::SetKeepAliveL( CMceAudioStream& aAudioStream, |
|
208 TInt aKeepAliveValue ) |
|
209 { |
|
210 SVPDEBUG1( "CSVPUtility::SetKeepAliveL In ") |
|
211 |
|
212 TInt count = aAudioStream.Codecs().Count(); |
|
213 SVPDEBUG2( "CSVPUtility::SetKeepAliveL Codec count: %d ", count ) |
|
214 |
|
215 // values should be set to bound stream also |
|
216 CMceAudioStream& boundStream = |
|
217 static_cast< CMceAudioStream& > ( aAudioStream.BoundStreamL() ); |
|
218 |
|
219 __ASSERT_ALWAYS( &boundStream, User::Leave( KSVPErrCodecMismatch ) ); |
|
220 // Amount of codecs should be the same in audio- and boundstreams |
|
221 __ASSERT_ALWAYS( count == boundStream.Codecs().Count(), |
|
222 User::Leave( KSVPErrCodecMismatch ) ); |
|
223 |
|
224 TInt maxPl( 0 ); |
|
225 TInt minPl( 0 ); |
|
226 // first check the max payload in the codec set |
|
227 while ( count-- ) |
|
228 { |
|
229 minPl = aAudioStream.Codecs()[ count ]->PayloadType(); |
|
230 if ( minPl > maxPl ) |
|
231 { |
|
232 maxPl = minPl; |
|
233 } |
|
234 } |
|
235 |
|
236 count = aAudioStream.Codecs().Count(); |
|
237 // if max pl less than def 120, set 120 as pl |
|
238 if ( KSVPDefKeepAlivePl > maxPl ) |
|
239 { |
|
240 while( count-- ) |
|
241 { |
|
242 SVPDEBUG1( "CSVPUtility::SetKeepAliveL A ") |
|
243 aAudioStream.Codecs()[ count ]->SetKeepAlivePayloadTypeL( KSVPDefKeepAlivePl ); |
|
244 aAudioStream.Codecs()[ count ]->SetKeepAliveDataL( KNullDesC8 ); |
|
245 aAudioStream.Codecs()[ count ]->SetKeepAliveTimerL( aKeepAliveValue ); |
|
246 boundStream.Codecs()[ count ]->SetKeepAlivePayloadTypeL( KSVPDefKeepAlivePl ); |
|
247 boundStream.Codecs()[ count ]->SetKeepAliveDataL( KNullDesC8 ); |
|
248 boundStream.Codecs()[ count ]->SetKeepAliveTimerL( aKeepAliveValue ); |
|
249 } |
|
250 } |
|
251 else if ( KSVPDefKeepAlivePlMax > maxPl ) |
|
252 { |
|
253 while( count-- ) |
|
254 { |
|
255 SVPDEBUG1( "CSVPUtility::SetKeepAliveL B ") |
|
256 aAudioStream.Codecs()[ count ]->SetKeepAlivePayloadTypeL( maxPl + 1 ); |
|
257 aAudioStream.Codecs()[ count ]->SetKeepAliveDataL( KNullDesC8 ); |
|
258 aAudioStream.Codecs()[ count ]->SetKeepAliveTimerL( aKeepAliveValue ); |
|
259 boundStream.Codecs()[ count ]->SetKeepAlivePayloadTypeL( maxPl + 1 ); |
|
260 boundStream.Codecs()[ count ]->SetKeepAliveDataL( KNullDesC8 ); |
|
261 boundStream.Codecs()[ count ]->SetKeepAliveTimerL( aKeepAliveValue ); |
|
262 } |
|
263 } |
|
264 |
|
265 SVPDEBUG1( "CSVPUtility::SetKeepAliveL Out ") |
|
266 } |
|
267 |
|
268 // --------------------------------------------------------------------------- |
|
269 // CSVPUtility::SetCNKeepAliveL |
|
270 // --------------------------------------------------------------------------- |
|
271 // |
|
272 void CSVPUtility::SetCNKeepAliveL( CMceAudioStream& aAudioStream, |
|
273 TInt aKeepAliveValue ) |
|
274 { |
|
275 SVPDEBUG1( "CSVPUtility::SetCNKeepAliveL In ") |
|
276 |
|
277 TInt count = aAudioStream.Codecs().Count(); |
|
278 SVPDEBUG2( "CSVPUtility::SetCNKeepAliveL Codec count: %d ", count ) |
|
279 |
|
280 TInt mostPreferred = 0; |
|
281 // bound stream should be present always |
|
282 CMceAudioStream& boundStream = |
|
283 static_cast< CMceAudioStream& > ( aAudioStream.BoundStreamL() ); |
|
284 |
|
285 __ASSERT_ALWAYS( &boundStream, User::Leave( KSVPErrCodecMismatch ) ); |
|
286 // Amount of codecs should be the same in audio- and boundstreams |
|
287 __ASSERT_ALWAYS( count == boundStream.Codecs().Count(), |
|
288 User::Leave( KSVPErrCodecMismatch ) ); |
|
289 |
|
290 // find most preferred codec and set keepalive timer |
|
291 // value and payload for most preferred codec |
|
292 while( count-- ) |
|
293 { |
|
294 const TDesC8& codec = aAudioStream.Codecs()[ count ]->SdpName(); |
|
295 |
|
296 // handle only real audio codecs |
|
297 if ( KErrNotFound == codec.Find( KCN ) && KErrNotFound == codec.Find( KTELEVENT ) ) |
|
298 { |
|
299 if ( 0 == aAudioStream.Codecs()[ count ]->Preference() ) |
|
300 { |
|
301 SVPDEBUG2( "Most preferred codec: %d ", count ) |
|
302 SVPDEBUG2( "Payload: %d ", aAudioStream.Codecs()[ count ]->PayloadType() ) |
|
303 aAudioStream.Codecs()[ count ]->SetKeepAliveTimerL( aKeepAliveValue ); |
|
304 aAudioStream.Codecs()[ count ]->SetKeepAlivePayloadTypeL( KSVPCNPayloadType ); |
|
305 aAudioStream.Codecs()[ count ]->SetKeepAliveDataL( KNullDesC8 ); |
|
306 boundStream.Codecs()[ count ]->SetKeepAliveTimerL( aKeepAliveValue ); |
|
307 boundStream.Codecs()[ count ]->SetKeepAlivePayloadTypeL( KSVPCNPayloadType ); |
|
308 boundStream.Codecs()[ count ]->SetKeepAliveDataL( KNullDesC8 ); |
|
309 mostPreferred = count; |
|
310 } |
|
311 } |
|
312 } |
|
313 |
|
314 count = aAudioStream.Codecs().Count(); |
|
315 while ( count-- ) |
|
316 { |
|
317 if ( mostPreferred != count ) |
|
318 { |
|
319 SVPDEBUG2( "Timer value 0 for codec: %d ", count ) |
|
320 aAudioStream.Codecs()[ count ]->SetKeepAliveTimerL( 0 ); |
|
321 aAudioStream.Codecs()[ count ]->SetKeepAlivePayloadTypeL( KSVPCNPayloadType ); |
|
322 aAudioStream.Codecs()[ count ]->SetKeepAliveDataL( KNullDesC8 ); |
|
323 boundStream.Codecs()[ count ]->SetKeepAliveTimerL( 0 ); |
|
324 boundStream.Codecs()[ count ]->SetKeepAlivePayloadTypeL( KSVPCNPayloadType ); |
|
325 boundStream.Codecs()[ count ]->SetKeepAliveDataL( KNullDesC8 ); |
|
326 } |
|
327 } |
|
328 |
|
329 SVPDEBUG1( "CSVPUtility::SetCNKeepAliveL Out ") |
|
330 } |
|
331 |
|
332 // --------------------------------------------------------------------------- |
|
333 // CSVPUtility::IsComfortNoise |
|
334 // --------------------------------------------------------------------------- |
|
335 // |
|
336 TBool CSVPUtility::IsComfortNoise( CMceAudioStream& aStream ) |
|
337 { |
|
338 SVPDEBUG1( "CSVPUtility::IsComfortNoise In ") |
|
339 TInt count = aStream.Codecs().Count(); |
|
340 while ( count-- ) |
|
341 { |
|
342 if ( !aStream.Codecs()[ count ]->SdpName().CompareF( KCN ) ) |
|
343 { |
|
344 return ETrue; |
|
345 } |
|
346 } |
|
347 return EFalse; |
|
348 } |
|
349 |
|
350 // --------------------------------------------------------------------------- |
|
351 // CSVPUtility::SetAudioCodecsForEmergencyL |
|
352 // --------------------------------------------------------------------------- |
|
353 // |
|
354 void CSVPUtility::SetAudioCodecsForEmergencyL( |
|
355 CMceAudioStream& aAudioInStream, |
|
356 TInt aKeepAliveValue, |
|
357 TInt32 aVoipProfileId ) |
|
358 { |
|
359 SVPDEBUG1("CSVPUtility::SetAudioCodecsForEmergencyL() In") |
|
360 |
|
361 // clear codec priority preferrence variable |
|
362 iPreferredCodec = 0; |
|
363 |
|
364 // Default profile |
|
365 CRCSEProfileEntry* profile = CRCSEProfileEntry::NewLC(); // CS:1 |
|
366 |
|
367 // Set codecs |
|
368 if ( KErrNotFound == aVoipProfileId ) |
|
369 { |
|
370 // No VoIP profile, use default profile values |
|
371 SVPDEBUG1("CSVPUtility::SetAudioCodecsForEmergencyL, no VoIP profile") |
|
372 |
|
373 // Create default codecs (PCMA, PCMU, AMR, iLBC, G729) and set |
|
374 // capabilities |
|
375 CRCSEAudioCodecEntry* codec = CRCSEAudioCodecEntry::NewLC(); // CS:2 |
|
376 codec->SetDefaultCodecValueSet( KAudioCodecPCMA() ); |
|
377 MoCallCapabilitiesL( aAudioInStream, *profile, *codec ); |
|
378 CleanupStack::PopAndDestroy( codec ); // CS:1 |
|
379 |
|
380 codec = CRCSEAudioCodecEntry::NewLC(); // CS:2 |
|
381 codec->SetDefaultCodecValueSet( KAudioCodecPCMU() ); |
|
382 MoCallCapabilitiesL( aAudioInStream, *profile, *codec ); |
|
383 CleanupStack::PopAndDestroy( codec ); // CS:1 |
|
384 |
|
385 codec = CRCSEAudioCodecEntry::NewLC(); // CS:2 |
|
386 codec->SetDefaultCodecValueSet( KAudioCodecAMR() ); |
|
387 MoCallCapabilitiesL( aAudioInStream, *profile, *codec ); |
|
388 CleanupStack::PopAndDestroy( codec ); // CS:1 |
|
389 |
|
390 codec = CRCSEAudioCodecEntry::NewLC(); // CS:2 |
|
391 codec->SetDefaultCodecValueSet( KAudioCodeciLBC() ); |
|
392 MoCallCapabilitiesL( aAudioInStream, *profile, *codec ); |
|
393 CleanupStack::PopAndDestroy( codec ); // CS:1 |
|
394 |
|
395 codec = CRCSEAudioCodecEntry::NewLC(); // CS:2 |
|
396 codec->SetDefaultCodecValueSet( KAudioCodecG729() ); |
|
397 MoCallCapabilitiesL( aAudioInStream, *profile, *codec ); |
|
398 CleanupStack::PopAndDestroy( codec ); // CS:1 |
|
399 } |
|
400 else |
|
401 { |
|
402 // VoIP profile exists |
|
403 SVPDEBUG1("CSVPUtility::SetAudioCodecsForEmergencyL, VoIP profile") |
|
404 User::LeaveIfError( aVoipProfileId ); |
|
405 |
|
406 // Get codec IDs from profile |
|
407 CRCSEProfileRegistry* profileRegistry = |
|
408 CRCSEProfileRegistry::NewLC(); // CS:2 |
|
409 profileRegistry->FindL( aVoipProfileId, *profile ); |
|
410 CleanupStack::PopAndDestroy( profileRegistry ); // CS:1 |
|
411 RArray< TUint32 > codecIds; |
|
412 CleanupClosePushL( codecIds ); // CS:2 |
|
413 GetCodecIdsByVoIPProfileIdL( *profile, codecIds ); |
|
414 |
|
415 // Set flags |
|
416 TBool isSetPCMA( EFalse ); |
|
417 TBool isSetPCMU( EFalse ); |
|
418 |
|
419 // Set capabilities |
|
420 CRCSEAudioCodecRegistry* codecRegistry = |
|
421 CRCSEAudioCodecRegistry::NewLC(); // CS:3 |
|
422 CRCSEAudioCodecEntry* codec = NULL; |
|
423 for( TInt j = 0; j < codecIds.Count(); j++ ) |
|
424 { |
|
425 codec = CRCSEAudioCodecEntry::NewLC(); // CS:4 |
|
426 codecRegistry->FindL( codecIds[j], *codec ); |
|
427 MoCallCapabilitiesL( aAudioInStream, *profile, *codec ); |
|
428 |
|
429 // Check G711 |
|
430 if ( !codec->iMediaSubTypeName.CompareF( KAudioCodecPCMA ) ) |
|
431 { |
|
432 isSetPCMA = ETrue; |
|
433 } |
|
434 if ( !codec->iMediaSubTypeName.CompareF( KAudioCodecPCMU ) ) |
|
435 { |
|
436 isSetPCMU = ETrue; |
|
437 } |
|
438 CleanupStack::PopAndDestroy( codec ); // CS:3 |
|
439 } |
|
440 CleanupStack::PopAndDestroy( codecRegistry ); // CS:2 |
|
441 CleanupStack::PopAndDestroy( &codecIds ); // CS:1 |
|
442 |
|
443 |
|
444 // Set G711 default capabilities if not set from profile |
|
445 if ( !isSetPCMA ) |
|
446 { |
|
447 codec = CRCSEAudioCodecEntry::NewLC(); // CS:2 |
|
448 codec->SetDefaultCodecValueSet( KAudioCodecPCMA() ); |
|
449 MoCallCapabilitiesL( aAudioInStream, *profile, *codec ); |
|
450 CleanupStack::PopAndDestroy( codec ); // CS:1 |
|
451 } |
|
452 if ( !isSetPCMU ) |
|
453 { |
|
454 codec = CRCSEAudioCodecEntry::NewLC(); // CS:2 |
|
455 codec->SetDefaultCodecValueSet( KAudioCodecPCMU() ); |
|
456 MoCallCapabilitiesL( aAudioInStream, *profile, *codec ); |
|
457 CleanupStack::PopAndDestroy( codec ); // CS:1 |
|
458 } |
|
459 } |
|
460 |
|
461 SetDtmfL( *profile, aAudioInStream ); |
|
462 |
|
463 SetMediaQoSL( profile->iMediaQOS, aAudioInStream.Session() ); |
|
464 |
|
465 // in Mo case, redundancy is never offered |
|
466 iRed = EFalse; |
|
467 |
|
468 // Set comfort noise for PCMA/PCMU & ILBC if CN provisioned and keep-alive |
|
469 if ( iCN ) |
|
470 { |
|
471 SetComfortNoiseL( aAudioInStream ); |
|
472 RemoveUnnecessaryCodecsL( aAudioInStream ); |
|
473 SetCNKeepAliveL( aAudioInStream, aKeepAliveValue ); |
|
474 } |
|
475 else |
|
476 { |
|
477 RemoveUnnecessaryCodecsL( aAudioInStream ); |
|
478 SetKeepAliveL( aAudioInStream, aKeepAliveValue ); |
|
479 } |
|
480 |
|
481 // Check RTCP for actual and bound stream as we do not have knowledge where |
|
482 // the actual RTP sink is residing |
|
483 CheckRtcpSettingL( profile->iRTCP, aAudioInStream ); |
|
484 if ( aAudioInStream.BoundStream() ) |
|
485 { |
|
486 CheckRtcpSettingL( profile->iRTCP, aAudioInStream.BoundStreamL() ); |
|
487 } |
|
488 |
|
489 CleanupStack::PopAndDestroy( profile ); // CS:0 |
|
490 |
|
491 // Leave if codec information was not found. |
|
492 if ( !aAudioInStream.Codecs().Count() ) |
|
493 { |
|
494 SVPDEBUG1("CSVPUtility::SetAudioCodecsForEmergencyL KErrNotFound") |
|
495 User::Leave( KErrNotFound ); |
|
496 } |
|
497 |
|
498 SVPDEBUG1("CSVPUtility::SetAudioCodecsForEmergencyL() Out") |
|
499 } |
|
500 |
|
501 // --------------------------------------------------------------------------- |
|
502 // CSVPUtility::SetComfortNoiseL |
|
503 // --------------------------------------------------------------------------- |
|
504 // |
|
505 void CSVPUtility::SetComfortNoiseL( CMceAudioStream& aAudioStream ) |
|
506 { |
|
507 SVPDEBUG1("CSVPUtility::SetComfortNoiseL In"); |
|
508 |
|
509 // fetch available codecs |
|
510 const RPointerArray<CMceAudioCodec>& codecs = aAudioStream.Codecs(); |
|
511 |
|
512 // Comfort Noise must be enabled for bound stream codecs also |
|
513 CMceAudioStream& boundStream = |
|
514 static_cast< CMceAudioStream& > ( aAudioStream.BoundStreamL() ); |
|
515 |
|
516 // fetch bound stream codecs |
|
517 const RPointerArray< CMceAudioCodec >& |
|
518 boundCodecs = boundStream.Codecs(); |
|
519 |
|
520 iCN = EFalse; |
|
521 |
|
522 for ( TInt z = 0; z < codecs.Count(); z++ ) |
|
523 { |
|
524 if ( !codecs[ z ]->SdpName().CompareF( KCN ) && !iCN ) |
|
525 { |
|
526 SVPDEBUG1("CSVPUtility::SetComfortNoiseL CN found"); |
|
527 // enable CN from main and bound stream |
|
528 aAudioStream.Codecs()[ z ]->SetStateL( CMceCodec::EEnabled ); |
|
529 boundStream.Codecs()[ z ]->SetStateL( CMceCodec::EEnabled ); |
|
530 // set flag to true, so CN is not removed from media attributes |
|
531 iCN = ETrue; |
|
532 |
|
533 // set also correct priority order for CN => lowest priority |
|
534 aAudioStream.Codecs()[ z ]->SetPreferenceL( codecs.Count() ); |
|
535 } |
|
536 } |
|
537 if ( iCN ) |
|
538 { |
|
539 for ( TInt i = 0; i < codecs.Count(); i++ ) |
|
540 { |
|
541 if( !codecs[ i ]->SdpName().CompareF( KPCMA ) || |
|
542 !codecs[ i ]->SdpName().CompareF( KPCMU ) || |
|
543 !codecs[ i ]->SdpName().CompareF( KILBC ) ) |
|
544 { |
|
545 SVPDEBUG1("CSVPUtility::SetComfortNoiseL Setting VAD"); |
|
546 codecs[ i ]->EnableVAD( ETrue ); |
|
547 boundCodecs[ i ]->EnableVAD( ETrue ); |
|
548 } |
|
549 } |
|
550 } |
|
551 SVPDEBUG1("CSVPUtility::SetComfortNoiseL Out"); |
|
552 } |
|
553 |
|
554 // --------------------------------------------------------------------------- |
|
555 // CSVPUtility::SetDtmfL |
|
556 // --------------------------------------------------------------------------- |
|
557 // |
|
558 void CSVPUtility::SetDtmfL( const CRCSEProfileEntry& aVoIPProfile, |
|
559 CMceAudioStream& aAudioStream ) |
|
560 { |
|
561 SVPDEBUG3( "CSVPUtility::SetDtmfL IB STATUS: %d OB STATUS: %d", |
|
562 aVoIPProfile.iInbandDTMF, aVoIPProfile.iOutbandDTMF ) |
|
563 |
|
564 // If both on, not set or both off, prefer outband. |
|
565 if ( ( CRCSEAudioCodecEntry::EOn == aVoIPProfile.iInbandDTMF && |
|
566 CRCSEAudioCodecEntry::EOn == aVoIPProfile.iOutbandDTMF ) || |
|
567 ( CRCSEAudioCodecEntry::EOONotSet == aVoIPProfile.iInbandDTMF && |
|
568 CRCSEAudioCodecEntry::EOONotSet == aVoIPProfile.iOutbandDTMF ) || |
|
569 ( CRCSEAudioCodecEntry::EOff == aVoIPProfile.iInbandDTMF && |
|
570 CRCSEAudioCodecEntry::EOff == aVoIPProfile.iOutbandDTMF ) ) |
|
571 { |
|
572 SVPDEBUG1( "CSVPUtility::SetDtmfL IB/OB both enabled, not set or off" ) |
|
573 |
|
574 iTelEv = ETrue; |
|
575 SetDtmfCodecOrderL( aAudioStream ); |
|
576 } |
|
577 // Check inband enabled situation |
|
578 else if ( CRCSEAudioCodecEntry::EOn == aVoIPProfile.iInbandDTMF && |
|
579 CRCSEAudioCodecEntry::EOff == aVoIPProfile.iOutbandDTMF ) |
|
580 { |
|
581 SVPDEBUG1( "CSVPUtility::SetDtmfL OB DTMF OFF, IB DTMF ON" ) |
|
582 |
|
583 iTelEv = EFalse; |
|
584 } |
|
585 // Check outband enabled situation |
|
586 else if ( CRCSEAudioCodecEntry::EOff == aVoIPProfile.iInbandDTMF && |
|
587 CRCSEAudioCodecEntry::EOn == aVoIPProfile.iOutbandDTMF ) |
|
588 { |
|
589 SVPDEBUG1( "CSVPUtility::SetDtmfL OB DTMF ON, IB DTMF OFF" ) |
|
590 |
|
591 iTelEv = ETrue; |
|
592 SetDtmfCodecOrderL( aAudioStream ); |
|
593 } |
|
594 // else all cases handled above. |
|
595 } |
|
596 |
|
597 //---------------------------------------------------------------------------- |
|
598 // CSVPUtility::GetDTMFMode |
|
599 //---------------------------------------------------------------------------- |
|
600 // |
|
601 TBool CSVPUtility::GetDTMFMode() |
|
602 { |
|
603 SVPDEBUG2( "SVPUtility::GetDTMFMode iTelEv: %d", iTelEv ) |
|
604 |
|
605 return iTelEv; // EFalse: DTMF Inband, ETrue: DTMF Outband |
|
606 } |
|
607 |
|
608 //---------------------------------------------------------------------------- |
|
609 // CSVPUtility::SetDtmfMode |
|
610 //---------------------------------------------------------------------------- |
|
611 // |
|
612 void CSVPUtility::SetDtmfMode( TBool aOutbandEnabled ) |
|
613 { |
|
614 SVPDEBUG2( "SVPUtility::SetDtmfMode aOutbandEnabled: %d", |
|
615 aOutbandEnabled ) |
|
616 |
|
617 iTelEv = aOutbandEnabled; |
|
618 } |
|
619 |
|
620 // --------------------------------------------------------------------------- |
|
621 // CSVPUtility::SetAudioCodecsMTL |
|
622 // --------------------------------------------------------------------------- |
|
623 // |
|
624 void CSVPUtility::SetAudioCodecsMTL( CRCSEProfileEntry& aVoIPProfile, |
|
625 CMceMediaStream& aAudioStream, |
|
626 TInt aKeepAliveValue, |
|
627 TBool aSessionUpdateOngoing ) |
|
628 { |
|
629 SVPDEBUG1("CSVPUtility::SetAudioCodecsMTL In") |
|
630 |
|
631 RArray< TUint32 > codecIds; |
|
632 CleanupClosePushL( codecIds ); |
|
633 |
|
634 GetCodecIdsByVoIPProfileIdL( aVoIPProfile, codecIds ); |
|
635 |
|
636 // create codec profile |
|
637 CRCSEAudioCodecEntry* codecprofile = |
|
638 CRCSEAudioCodecEntry::NewLC(); |
|
639 CRCSEAudioCodecRegistry* rCSEAudioCodec = |
|
640 CRCSEAudioCodecRegistry::NewLC(); |
|
641 |
|
642 // clearing the flag for next session |
|
643 iCodecMatched = EFalse; |
|
644 // Initialize round index variable (for the current session) |
|
645 iRoundIndex = 0; |
|
646 |
|
647 CMceAudioStream& audioStream = |
|
648 static_cast<CMceAudioStream&>( aAudioStream ); |
|
649 |
|
650 const RPointerArray< CMceAudioCodec >& supportedCodecs = |
|
651 audioStream.Codecs(); |
|
652 |
|
653 const TInt suppCodecCount = supportedCodecs.Count(); |
|
654 |
|
655 // loop as many times as needed |
|
656 while ( iRoundIndex < suppCodecCount ) |
|
657 { |
|
658 for ( TInt codecCnt = 0; codecCnt < codecIds.Count(); codecCnt++ ) |
|
659 { |
|
660 if ( !iCodecMatched ) |
|
661 { |
|
662 rCSEAudioCodec->FindL( codecIds[ codecCnt ], *codecprofile ); |
|
663 MtCallCapabilitiesL( audioStream, aVoIPProfile, *codecprofile ); |
|
664 } |
|
665 } |
|
666 |
|
667 if ( iCodecMatched ) |
|
668 { |
|
669 SVPDEBUG1( "CSVPUtility::SetAudioCodecsMTL RED set" ) |
|
670 SetRedundancyL( audioStream ); |
|
671 SVPDEBUG1( "CSVPUtility::SetAudioCodecsMTL RED set done" ) |
|
672 break; |
|
673 } |
|
674 else |
|
675 { |
|
676 iRoundIndex++; |
|
677 } |
|
678 } |
|
679 |
|
680 if ( !iCodecMatched ) |
|
681 { |
|
682 User::Leave( KSVPErrCodecMismatch ); |
|
683 } |
|
684 |
|
685 SetMediaQoSL( aVoIPProfile.iMediaQOS, aAudioStream.Session() ); |
|
686 |
|
687 // if outband DTMF offered, it's used even if inband is provisioned |
|
688 if ( DtmfOBInOffer( audioStream ) ) |
|
689 { |
|
690 SetDtmfCodecOrderL( audioStream ); |
|
691 iTelEv = ETrue; |
|
692 } |
|
693 else |
|
694 { |
|
695 SetDtmfL( aVoIPProfile, audioStream ); |
|
696 } |
|
697 |
|
698 // set comfort noise if provisioned and offered by caller |
|
699 for ( TInt codecCnt = 0; codecCnt < codecIds.Count(); codecCnt++ ) |
|
700 { |
|
701 // fetch codec profile |
|
702 rCSEAudioCodec->FindL( codecIds[ codecCnt ], *codecprofile ); |
|
703 // set comfort noise |
|
704 HBufC8* tempSdpName = |
|
705 HBufC8::NewLC( codecprofile->iMediaSubTypeName.Length() ); |
|
706 TPtr8 ptr = tempSdpName->Des(); |
|
707 ptr.Copy( codecprofile->iMediaSubTypeName ); |
|
708 if ( !tempSdpName->CompareF( KCN ) ) |
|
709 { |
|
710 SVPDEBUG1( "CSVPUtility::SetAudioCodecsMTL - CN Provisioned" ) |
|
711 SetComfortNoiseL( audioStream ); |
|
712 } |
|
713 |
|
714 CleanupStack::PopAndDestroy( tempSdpName ); |
|
715 } |
|
716 |
|
717 RemoveUnnecessaryCodecsL( audioStream ); |
|
718 |
|
719 // CN provisioned and in offer |
|
720 if ( iCN ) |
|
721 { |
|
722 SVPDEBUG1( "CSVPUtility::SetAudioCodecsMTL - CN" ) |
|
723 SetCNKeepAliveL( audioStream, aKeepAliveValue ); |
|
724 } |
|
725 // CN not provisioned or offered |
|
726 else |
|
727 { |
|
728 SVPDEBUG1( "CSVPUtility::SetAudioCodecsMTL - No CN" ) |
|
729 SetKeepAliveL( audioStream, aKeepAliveValue ); |
|
730 } |
|
731 |
|
732 // Check RTCP for actual and bound stream as we do not have knowledge where |
|
733 // the actual RTP sink is residing |
|
734 CheckRtcpSettingL( aVoIPProfile.iRTCP, aAudioStream, aSessionUpdateOngoing ); |
|
735 if ( aAudioStream.BoundStream() ) |
|
736 { |
|
737 CheckRtcpSettingL( aVoIPProfile.iRTCP, aAudioStream.BoundStreamL(), aSessionUpdateOngoing ); |
|
738 } |
|
739 |
|
740 // RCSE objects can be deleted |
|
741 CleanupStack::PopAndDestroy( 3, &codecIds ); |
|
742 |
|
743 SVPDEBUG1( "CSVPUtility::SetAudioCodecsMTL Out" ) |
|
744 } |
|
745 |
|
746 // --------------------------------------------------------------------------- |
|
747 // CSVPUtility::DtmfOBInOffer |
|
748 // --------------------------------------------------------------------------- |
|
749 // |
|
750 TBool CSVPUtility::DtmfOBInOffer( CMceAudioStream& aAudioStream ) |
|
751 { |
|
752 SVPDEBUG1( "CSVPUtility::DtmfOBInOffer In" ) |
|
753 const RPointerArray< CMceAudioCodec >& supportedCodecs = |
|
754 aAudioStream.Codecs(); |
|
755 TInt count = supportedCodecs.Count(); |
|
756 while ( count-- ) |
|
757 { |
|
758 if ( !supportedCodecs[ count ]->SdpName().CompareF( KTELEVENT ) ) |
|
759 { |
|
760 SVPDEBUG1( "CSVPUtility::DtmfOBInOffer Outband DTMF in offer" ) |
|
761 return ETrue; |
|
762 } |
|
763 } |
|
764 return EFalse; |
|
765 } |
|
766 |
|
767 // --------------------------------------------------------------------------- |
|
768 // CSVPUtility::RemoveUnnecessaryCodecsL |
|
769 // --------------------------------------------------------------------------- |
|
770 // |
|
771 void CSVPUtility::RemoveUnnecessaryCodecsL( CMceAudioStream& aAudioInStream ) |
|
772 { |
|
773 SVPDEBUG1("CSVPUtility::RemoveUnnecessaryCodecs In"); |
|
774 // if codec was not found, remove code from the codec array |
|
775 if ( !iAMR ) |
|
776 { |
|
777 SVPAudioUtility::RemoveCodecL( aAudioInStream, KAMR ); |
|
778 } |
|
779 if ( !iPCMA ) |
|
780 { |
|
781 SVPAudioUtility::RemoveCodecL( aAudioInStream, KPCMA ); |
|
782 } |
|
783 if ( !iPCMU ) |
|
784 { |
|
785 SVPAudioUtility::RemoveCodecL( aAudioInStream, KPCMU ); |
|
786 } |
|
787 if ( !iILBC ) |
|
788 { |
|
789 SVPAudioUtility::RemoveCodecL( aAudioInStream, KILBC ); |
|
790 } |
|
791 if ( !iG729 ) |
|
792 { |
|
793 SVPAudioUtility::RemoveCodecL( aAudioInStream, KG729 ); |
|
794 } |
|
795 if ( !iTelEv ) |
|
796 { |
|
797 SVPAudioUtility::RemoveCodecL( aAudioInStream, KTELEVENT ); |
|
798 } |
|
799 if ( !iCN ) |
|
800 { |
|
801 SVPAudioUtility::RemoveCodecL( aAudioInStream, KCN ); |
|
802 iCN = EFalse; |
|
803 } |
|
804 if ( !iRed ) |
|
805 { |
|
806 SVPAudioUtility::RemoveCodecL( aAudioInStream, KRED ); |
|
807 } |
|
808 if ( !iAMRWB ) |
|
809 { |
|
810 SVPAudioUtility::RemoveCodecL( aAudioInStream, KAMRWB ); |
|
811 } |
|
812 |
|
813 // clear codec flags for next session |
|
814 iAMR = EFalse; |
|
815 iPCMA = EFalse; |
|
816 iPCMU = EFalse; |
|
817 iILBC = EFalse; |
|
818 iG729 = EFalse; |
|
819 iRed = EFalse; |
|
820 iAMRWB = EFalse; |
|
821 |
|
822 SVPDEBUG1("CSVPUtility::RemoveUnnecessaryCodecs Out"); |
|
823 } |
|
824 |
|
825 // --------------------------------------------------------------------------- |
|
826 // CSVPUtility::GetCodecIdsByVoIPProfileIdL |
|
827 // --------------------------------------------------------------------------- |
|
828 // |
|
829 void CSVPUtility::GetCodecIdsByVoIPProfileIdL( |
|
830 const CRCSEProfileEntry& aProfile, |
|
831 RArray< TUint32 >& aCodecIds ) const |
|
832 { |
|
833 SVPDEBUG1("CSVPUtility::GetCodecIdsByVoIPProfileIdL IN"); |
|
834 |
|
835 aCodecIds.Reset(); |
|
836 |
|
837 const TInt codCount = aProfile.iPreferredCodecs.Count(); |
|
838 for ( TInt codecCnt = 0; codecCnt < codCount; codecCnt++ ) |
|
839 { |
|
840 // append codec id's in preference order |
|
841 aCodecIds.AppendL( aProfile.iPreferredCodecs[ codecCnt ] ); |
|
842 } |
|
843 |
|
844 SVPDEBUG1("CSVPUtility::GetCodecIdsByVoIPProfileIdL OUT"); |
|
845 } |
|
846 |
|
847 // --------------------------------------------------------------------------- |
|
848 // CSVPUtility::MtCallCapabilitiesL |
|
849 // --------------------------------------------------------------------------- |
|
850 // |
|
851 void CSVPUtility::MtCallCapabilitiesL( |
|
852 CMceAudioStream& aAudioInStream, |
|
853 const CRCSEProfileEntry& aVoIPProfile, |
|
854 const CRCSEAudioCodecEntry& aCodecProfile ) |
|
855 { |
|
856 SVPDEBUG1( "CSVPUtility::MtCallCapabilitiesL IN" ) |
|
857 |
|
858 // fetch the codecs mce supports |
|
859 const RPointerArray< CMceAudioCodec >& supportedCodecs = |
|
860 aAudioInStream.Codecs(); |
|
861 |
|
862 SVPDEBUG2( "CSVPUtility::MtCallCapabilitiesL: Supp. codec count: %d", |
|
863 supportedCodecs.Count() ) |
|
864 |
|
865 HBufC8* tempSdpName = |
|
866 HBufC8::NewLC( aCodecProfile.iMediaSubTypeName.Length() ); |
|
867 |
|
868 TPtr8 ptr = tempSdpName->Des(); |
|
869 ptr.Copy( aCodecProfile.iMediaSubTypeName ); |
|
870 |
|
871 // compare offered codec to codec supported by app. |
|
872 if ( *tempSdpName != supportedCodecs[ iRoundIndex ]->SdpName() || |
|
873 !supportedCodecs[ iRoundIndex ]->SdpName().CompareF( KCN ) || |
|
874 !supportedCodecs[ iRoundIndex ]->SdpName().CompareF( KTELEVENT ) || |
|
875 !supportedCodecs[ iRoundIndex ]->SdpName().CompareF( KRED ) ) |
|
876 { |
|
877 SVPDEBUG1( "CSVPUtility::MtCallCapabilitiesL do nothing" ) |
|
878 } |
|
879 else |
|
880 { |
|
881 SVPDEBUG2( "CSVPUtility::MtCallCapabilitiesL Mediasubtypename: %S", |
|
882 &aCodecProfile.iMediaSubTypeName ) |
|
883 SVPDEBUG2( "CSVPUtility::MtCallCapabilitiesL - ptime: %d", |
|
884 aCodecProfile.iPtime ) |
|
885 SVPDEBUG2( "CSVPUtility::MtCallCapabilitiesL - maxptime: %d", |
|
886 aCodecProfile.iMaxptime ) |
|
887 |
|
888 if ( aVoIPProfile.iStartMediaPort ) |
|
889 { |
|
890 aAudioInStream.SetLocalMediaPortL( aVoIPProfile.iStartMediaPort ); |
|
891 |
|
892 SVPDEBUG1( "CSVPUtility::MtCallCapabilitiesL start media port set" ) |
|
893 } |
|
894 |
|
895 SVPDEBUG2( "CSVPUtility::MtCallCapabilitiesL codec ptime: %u", |
|
896 supportedCodecs[ iRoundIndex ]->PTime() ) |
|
897 SVPDEBUG2( "CSVPUtility::MtCallCapabilitiesL codec maxptime: %u", |
|
898 supportedCodecs[ iRoundIndex ]->MaxPTime() ) |
|
899 |
|
900 if ( aCodecProfile.iPtime >= 0 && |
|
901 aCodecProfile.iMaxptime < |
|
902 supportedCodecs[ iRoundIndex ]->PTime() ) |
|
903 { |
|
904 supportedCodecs[ iRoundIndex ]->SetPTime( aCodecProfile.iPtime ); |
|
905 } |
|
906 |
|
907 if ( !aCodecProfile.iMediaSubTypeName.CompareF( KAudioCodecAMR ) ) |
|
908 { |
|
909 // No actions taken in MT calls for AMR parameters. We accept |
|
910 // them as-is for improved IOP. |
|
911 iAMR = ETrue; |
|
912 } |
|
913 |
|
914 if ( !aCodecProfile.iMediaSubTypeName.CompareF( KAudioCodecPCMA ) ) |
|
915 { |
|
916 iPCMA = ETrue; |
|
917 } |
|
918 |
|
919 if ( !aCodecProfile.iMediaSubTypeName.CompareF( KAudioCodecPCMU ) ) |
|
920 { |
|
921 iPCMU = ETrue; |
|
922 } |
|
923 |
|
924 if ( !aCodecProfile.iMediaSubTypeName.CompareF( KAudioCodeciLBC ) ) |
|
925 { |
|
926 iILBC = ETrue; |
|
927 } |
|
928 |
|
929 if ( !aCodecProfile.iMediaSubTypeName.CompareF( KAudioCodecAMRWB ) ) |
|
930 { |
|
931 iAMRWB = ETrue; |
|
932 } |
|
933 |
|
934 if ( !aCodecProfile.iMediaSubTypeName.CompareF( KAudioCodecG729 ) ) |
|
935 { |
|
936 // AnnexB is not set if it is not in the offer. MO side may not |
|
937 // support AnnexB so we do not want to enforce it. |
|
938 iG729 = ETrue; |
|
939 } |
|
940 else |
|
941 { |
|
942 // set VAD if other than G729 codec case |
|
943 if ( CRCSEAudioCodecEntry::EOONotSet != aCodecProfile.iVAD ) |
|
944 { |
|
945 SVPDEBUG1( "CSVPUtility::MtCallCapabilitiesL, codec and boundcodec VAD" ); |
|
946 // Setting VAD for codec |
|
947 SetVADL( aAudioInStream, aCodecProfile.iVAD, *tempSdpName ); |
|
948 |
|
949 // Setting VAD also for bound codec |
|
950 CMceAudioStream& boundStream = |
|
951 static_cast< CMceAudioStream& > ( aAudioInStream.BoundStreamL() ); |
|
952 SetVADL( boundStream, aCodecProfile.iVAD, *tempSdpName ); |
|
953 } |
|
954 } |
|
955 |
|
956 // Take the largest jitterbuffer size from settings. NB. this does |
|
957 // not actually take into account that we have codec spesific |
|
958 // jitterbuffer sizes and MCE has session level jitterbuffer size. |
|
959 // So we may end up using wrong jitterbuffer size if codec spesific |
|
960 // jitterbuffer settings are different amongst each other. |
|
961 if ( aCodecProfile.iJitterBufferSize > iJitterBufferSize ) |
|
962 { |
|
963 iJitterBufferSize = aCodecProfile.iJitterBufferSize; |
|
964 } |
|
965 |
|
966 SVPDEBUG2( "CSVPUtility::MtCallCapabilitiesL iJitterBufferSize: %d", |
|
967 iJitterBufferSize ) |
|
968 |
|
969 // set codec matched flag to ETrue, codec matched and set up |
|
970 iCodecMatched = ETrue; |
|
971 } |
|
972 |
|
973 CleanupStack::PopAndDestroy( tempSdpName ); |
|
974 |
|
975 SVPDEBUG1( "CSVPUtility::MtCallCapabilitiesL OUT" ) |
|
976 } |
|
977 |
|
978 // --------------------------------------------------------------------------- |
|
979 // CSVPUtility::SetRedundancyL |
|
980 // --------------------------------------------------------------------------- |
|
981 // |
|
982 void CSVPUtility::SetRedundancyL( CMceAudioStream& aAudioStream ) |
|
983 { |
|
984 SVPDEBUG1( "CSVPUtility::SetRedundancyL In"); |
|
985 const RPointerArray< CMceAudioCodec >& codecs = aAudioStream.Codecs(); |
|
986 for ( TInt z = 0; z < codecs.Count(); z++ ) |
|
987 { |
|
988 if ( !codecs[ z ]->SdpName().CompareF( KRED ) ) |
|
989 { |
|
990 SVPDEBUG1( "CSVPUtility::SetRedundancyL Setting Red pref."); |
|
991 // set preference |
|
992 aAudioStream.Codecs()[ z ]-> |
|
993 SetPreferenceL( codecs.Count() ); |
|
994 // set red flag so red media attribute is not removed |
|
995 iRed = ETrue; |
|
996 } |
|
997 } |
|
998 SVPDEBUG1( "CSVPUtility::SetRedundancyL Out"); |
|
999 } |
|
1000 // --------------------------------------------------------------------------- |
|
1001 // CSVPUtility::MoCallCapabilitiesL |
|
1002 // --------------------------------------------------------------------------- |
|
1003 // |
|
1004 void CSVPUtility::MoCallCapabilitiesL( |
|
1005 CMceAudioStream& aAudioInStream, |
|
1006 const CRCSEProfileEntry& aVoIPProfile, |
|
1007 const CRCSEAudioCodecEntry& aCodecProfile ) |
|
1008 { |
|
1009 SVPDEBUG1("CSVPUtility::MoCallCapabilitiesL In") |
|
1010 |
|
1011 // fetch the codecs mce supports |
|
1012 const RPointerArray< CMceAudioCodec >& supportedCodecs = |
|
1013 aAudioInStream.Codecs(); |
|
1014 |
|
1015 SVPDEBUG2("CSVPUtility::MoCallCapabilitiesL, Supported codec count: %d", |
|
1016 supportedCodecs.Count() ); |
|
1017 |
|
1018 HBufC8* tempSdpName = |
|
1019 HBufC8::NewLC( aCodecProfile.iMediaSubTypeName.Length() ); |
|
1020 |
|
1021 SVPDEBUG2("CSVPUtility::MoCallCapabilitiesL Mediasubtypename: %S", |
|
1022 &aCodecProfile.iMediaSubTypeName ); |
|
1023 |
|
1024 // go through the array and find Sdp name match |
|
1025 for ( TInt z = 0; z < supportedCodecs.Count(); z++ ) |
|
1026 { |
|
1027 TPtr8 ptr = tempSdpName->Des(); |
|
1028 ptr.Copy( aCodecProfile.iMediaSubTypeName ); |
|
1029 |
|
1030 if ( *tempSdpName == supportedCodecs[ z ]->SdpName() ) |
|
1031 { |
|
1032 // first setting audio capabilities common for all codecs |
|
1033 |
|
1034 // set codec priority order |
|
1035 SVPDEBUG2("CSVPUtility::MoCallCapabilitiesL Codec order: %d", |
|
1036 iPreferredCodec ); |
|
1037 |
|
1038 supportedCodecs[ z ]->SetPreferenceL( iPreferredCodec++ ); |
|
1039 |
|
1040 // set media port |
|
1041 if ( aVoIPProfile.iStartMediaPort ) |
|
1042 { |
|
1043 aAudioInStream.SetLocalMediaPortL( aVoIPProfile.iStartMediaPort ); |
|
1044 SVPDEBUG1("CSVPUtility::MoCallCapabilitiesL start media port set"); |
|
1045 } |
|
1046 |
|
1047 // set VAD |
|
1048 if ( CRCSEAudioCodecEntry::EOONotSet != aCodecProfile.iVAD ) |
|
1049 { |
|
1050 SVPDEBUG1( "CSVPUtility::MoCallCapabilitiesL Setting codec VAD" ); |
|
1051 |
|
1052 // Setting VAD for codec |
|
1053 SetVADL( aAudioInStream, aCodecProfile.iVAD, *tempSdpName ); |
|
1054 |
|
1055 SVPDEBUG1( "CSVPUtility::MoCallCapabilitiesL Setting bound VAD" ); |
|
1056 // Setting VAD also for bound codec |
|
1057 CMceAudioStream& boundStream = |
|
1058 static_cast< CMceAudioStream& > ( aAudioInStream.BoundStreamL() ); |
|
1059 SetVADL( boundStream, aCodecProfile.iVAD, *tempSdpName ); |
|
1060 } |
|
1061 |
|
1062 // set maxptime |
|
1063 if ( aCodecProfile.iMaxptime >= 0 ) |
|
1064 { |
|
1065 supportedCodecs[ z ]->SetMaxPTime( aCodecProfile.iMaxptime ); |
|
1066 |
|
1067 SVPDEBUG2("CSVPUtility::MoCallCapabilitiesL iMaxptime: %d", |
|
1068 aCodecProfile.iMaxptime ); |
|
1069 } |
|
1070 |
|
1071 // set ptime |
|
1072 if ( aCodecProfile.iPtime >= 0 ) |
|
1073 { |
|
1074 SVPDEBUG2("CSVPUtility::MoCallCapabilitiesL, PTime: %d", |
|
1075 aCodecProfile.iPtime ); |
|
1076 |
|
1077 supportedCodecs[ z ]->SetPTime( aCodecProfile.iPtime ); |
|
1078 } |
|
1079 |
|
1080 if ( !aCodecProfile.iMediaSubTypeName.CompareF( KAudioCodecAMR ) ) |
|
1081 { |
|
1082 iAMR = ETrue; |
|
1083 |
|
1084 // AMR specific settings: mode-set, mode-change-period, |
|
1085 // mode-change-neighbor and octet alignment vs. bw-efficient |
|
1086 // mode |
|
1087 SetAMRParameters( aAudioInStream, aCodecProfile, z ); |
|
1088 if ( CRCSEAudioCodecEntry::EOn == aCodecProfile.iOctetAlign ) |
|
1089 { |
|
1090 // use octet-alignment for MO call |
|
1091 supportedCodecs[ z ]->SetCodecMode( |
|
1092 EMceOctetAligned ); |
|
1093 } |
|
1094 } |
|
1095 |
|
1096 if ( !aCodecProfile.iMediaSubTypeName. |
|
1097 CompareF( KAudioCodecPCMA ) ) |
|
1098 { |
|
1099 iPCMA = ETrue; |
|
1100 } |
|
1101 if ( !aCodecProfile.iMediaSubTypeName. |
|
1102 CompareF( KAudioCodecPCMU ) ) |
|
1103 { |
|
1104 iPCMU = ETrue; |
|
1105 } |
|
1106 if ( !aCodecProfile.iMediaSubTypeName. |
|
1107 CompareF( KAudioCodeciLBC ) ) |
|
1108 { |
|
1109 iILBC = ETrue; |
|
1110 // Set mode according to mode-set. |
|
1111 if ( aCodecProfile.iModeSet.Count() ) |
|
1112 { |
|
1113 if ( KSvpilbcMode20ms == aCodecProfile.iModeSet[0] ) |
|
1114 { |
|
1115 supportedCodecs[ z ]->SetBitrate( |
|
1116 KMceiLBCLevel20Bitrate ); |
|
1117 } |
|
1118 else if( KSvpilbcMode30ms == aCodecProfile.iModeSet[0] ) |
|
1119 { |
|
1120 supportedCodecs[ z ]->SetBitrate( |
|
1121 KMceiLBCLevel30Bitrate ); |
|
1122 } |
|
1123 } |
|
1124 } |
|
1125 |
|
1126 if ( !aCodecProfile.iMediaSubTypeName. |
|
1127 CompareF( KAudioCodecG729 ) ) |
|
1128 { |
|
1129 iG729 = ETrue; |
|
1130 // set annexb |
|
1131 if ( CRCSEAudioCodecEntry::EOn == aCodecProfile.iAnnexb ) |
|
1132 { |
|
1133 supportedCodecs[ z ]->EnableVAD( ETrue ); |
|
1134 } |
|
1135 } |
|
1136 |
|
1137 if ( !aCodecProfile.iMediaSubTypeName.CompareF( KAudioCodecAMRWB ) ) |
|
1138 { |
|
1139 iAMRWB = ETrue; |
|
1140 |
|
1141 // AMR-WB specific settings: mode-set, mode-change-period, |
|
1142 // mode-change-neighbor and octet alignment vs. bw-efficient |
|
1143 // mode |
|
1144 SetAmrWbParameters( aAudioInStream, aCodecProfile, z ); |
|
1145 if ( CRCSEAudioCodecEntry::EOn == aCodecProfile.iOctetAlign ) |
|
1146 { |
|
1147 // use octet-alignment for MO call |
|
1148 supportedCodecs[ z ]->SetCodecMode( |
|
1149 EMceOctetAligned ); |
|
1150 } |
|
1151 } |
|
1152 |
|
1153 // Take the largest jitterbuffer size from settings. NB. this does |
|
1154 // not actually take into account that we have codec spesific |
|
1155 // jitterbuffer sizes and MCE has session level jitterbuffer size. |
|
1156 // So we may end up using wrong jitterbuffer size if codec spesific |
|
1157 // jitterbuffer settings are different amongst each other. |
|
1158 if ( aCodecProfile.iJitterBufferSize > iJitterBufferSize ) |
|
1159 { |
|
1160 iJitterBufferSize = aCodecProfile.iJitterBufferSize; |
|
1161 } |
|
1162 |
|
1163 SVPDEBUG2( "CSVPUtility::MoCallCapabilitiesL iJitterBufferSize: %d", |
|
1164 iJitterBufferSize ); |
|
1165 } |
|
1166 } |
|
1167 CleanupStack::PopAndDestroy( tempSdpName ); |
|
1168 |
|
1169 SVPDEBUG1( "CSVPUtility::MoCallCapabilitiesL OUT" ); |
|
1170 } |
|
1171 |
|
1172 |
|
1173 // --------------------------------------------------------------------------- |
|
1174 // CSVPUtility::SetAMRParameters |
|
1175 // --------------------------------------------------------------------------- |
|
1176 // |
|
1177 void CSVPUtility::SetAMRParameters( CMceAudioStream& aAudioInStream, |
|
1178 const CRCSEAudioCodecEntry& aCodecProfile, |
|
1179 TInt aCodecNumber ) |
|
1180 { |
|
1181 SVPDEBUG1( "CSVPUtility::SetAMRParameters Entry" ) |
|
1182 |
|
1183 TUint allowedBitrates( 0 ); |
|
1184 |
|
1185 // Set correct mode-set (default 0,1,2,3,4,5,6,7): |
|
1186 const RArray< TUint32 >& modeSetArray = aCodecProfile.iModeSet; |
|
1187 for ( TInt i = 0; i < modeSetArray.Count(); i++ ) |
|
1188 { |
|
1189 TUint value = modeSetArray[ i ]; |
|
1190 switch ( value ) |
|
1191 { |
|
1192 case 0: { allowedBitrates |= KMceAllowedAmrNbBitrate475; break; } |
|
1193 case 1: { allowedBitrates |= KMceAllowedAmrNbBitrate515; break; } |
|
1194 case 2: { allowedBitrates |= KMceAllowedAmrNbBitrate590; break; } |
|
1195 case 3: { allowedBitrates |= KMceAllowedAmrNbBitrate670; break; } |
|
1196 case 4: { allowedBitrates |= KMceAllowedAmrNbBitrate740; break; } |
|
1197 case 5: { allowedBitrates |= KMceAllowedAmrNbBitrate795; break; } |
|
1198 case 6: { allowedBitrates |= KMceAllowedAmrNbBitrate102; break; } |
|
1199 case 7: { allowedBitrates |= KMceAllowedAmrNbBitrate122; break; } |
|
1200 } |
|
1201 |
|
1202 SVPDEBUG3( "CSVPUtility::SetAMRParameters round %d, value: %u", |
|
1203 i, value ) |
|
1204 SVPDEBUG2( "CSVPUtility::SetAMRParameters allowedBitrates 0x%x", |
|
1205 allowedBitrates ) |
|
1206 } |
|
1207 |
|
1208 if ( !allowedBitrates ) |
|
1209 { |
|
1210 allowedBitrates = KMceAllowedAmrNbBitrateAll; |
|
1211 } |
|
1212 |
|
1213 SVPDEBUG2( "CSVPUtility::SetAMRParameters mode-set 0x%x", allowedBitrates ) |
|
1214 |
|
1215 if ( 2 == aCodecProfile.iModeChangePeriod ) |
|
1216 { |
|
1217 // Set correct mode-change-period (default == 1): |
|
1218 allowedBitrates |= KMceAllowedAmrNbChangePeriod2; |
|
1219 } |
|
1220 |
|
1221 // Set correct mode-change-neighbor (default == 0) |
|
1222 if ( CRCSEAudioCodecEntry::EOn == aCodecProfile.iModeChangeNeighbor ) |
|
1223 { |
|
1224 allowedBitrates |= KMceAllowedAmrNbChangeNeighbor1; |
|
1225 } |
|
1226 |
|
1227 aAudioInStream.Codecs()[ aCodecNumber ]->SetAllowedBitrates( |
|
1228 allowedBitrates ); |
|
1229 |
|
1230 SVPDEBUG2( "CSVPUtility::SetAMRParameters, Exit 0x%x", allowedBitrates ) |
|
1231 } |
|
1232 |
|
1233 // --------------------------------------------------------------------------- |
|
1234 // CSVPUtility::GetCCPError |
|
1235 // --------------------------------------------------------------------------- |
|
1236 // |
|
1237 TCCPError CSVPUtility::GetCCPError( TInt& aErrorCode, TCCPTone& aTone ) const |
|
1238 { |
|
1239 SVPDEBUG2( "CSVPUtility::GetCCPError aErrorCode: %d", aErrorCode ) |
|
1240 |
|
1241 // See ccpdefs.h - this may require additional checking so that the |
|
1242 // tones are really correct. |
|
1243 TCCPError error = ECCPErrorNone; |
|
1244 TCCPTone tone = ECCPNoSoundSequence; |
|
1245 |
|
1246 switch ( aErrorCode ) |
|
1247 { |
|
1248 case KSVPDeclineVal: |
|
1249 case KSVPBusyHereVal: |
|
1250 case KSVPBusyEverywhereVal: |
|
1251 { |
|
1252 error = ECCPErrorBusy; |
|
1253 tone = ECCPToneUserBusy; |
|
1254 break; |
|
1255 } |
|
1256 |
|
1257 case KSVPLoopDetectedVal: |
|
1258 case KSVPTooManyHopsVal: |
|
1259 case KSVPServerInternalErrorVal: |
|
1260 case KSVPNotImplementedVal: |
|
1261 case KSVPBadGatewayVal: |
|
1262 case KSVPServiceUnavailableVal: |
|
1263 case KSVPServerTimeoutVal: |
|
1264 case KSVPVersionNotSupportedVal: |
|
1265 case KSVPMessageTooLargeVal: |
|
1266 case KSVPPreconditionFailureVal: |
|
1267 { |
|
1268 error = ECCPErrorNetworkOutOfOrder; |
|
1269 tone = ECCPToneCongestion; |
|
1270 break; |
|
1271 } |
|
1272 |
|
1273 case KSVPUseProxyVal: |
|
1274 case KSVPAlternativeServiceVal: |
|
1275 { |
|
1276 error = ECCPErrorNotReached; |
|
1277 tone = ECCPToneSpecialInformation; |
|
1278 break; |
|
1279 } |
|
1280 |
|
1281 |
|
1282 case KSVPRequestUriTooLongVal: |
|
1283 case KSVPUnsupportedUriSchemeVal: |
|
1284 case KSVPAddressIncompleteVal: |
|
1285 case KSVPAmbiguousVal: |
|
1286 { |
|
1287 error = ECCPErrorInvalidURI; |
|
1288 tone = ECCPToneSpecialInformation; |
|
1289 break; |
|
1290 } |
|
1291 |
|
1292 case KSVPBadRequestVal: |
|
1293 case KSVPMethodNotAllowedVal: |
|
1294 case KSVPUnsupportedMediaTypeVal: |
|
1295 case KSVP406NotAcceptableVal: |
|
1296 case KSVPRequestEntityTooLargeVal: |
|
1297 case KSVPBadExtensionVal: |
|
1298 case KSVPExtensionRequiredVal: |
|
1299 case KSVPCallDoesNotExistVal: |
|
1300 case KSVPNotAcceptableHereVal: |
|
1301 case KSVPNotAcceptableVal: |
|
1302 { |
|
1303 error = ECCPErrorNotAcceptable; |
|
1304 tone = ECCPToneRadioPathNotAvailable; |
|
1305 break; |
|
1306 } |
|
1307 |
|
1308 case KSVPRequestTerminatedVal: |
|
1309 case KSVPNotFoundVal: |
|
1310 case KSVPTemporarilyUnavailableVal: |
|
1311 { |
|
1312 error = ECCPErrorNotResponding; |
|
1313 tone = ECCPToneUserBusy; |
|
1314 break; |
|
1315 } |
|
1316 |
|
1317 case KSVPMovedPermanentlyVal: |
|
1318 case KSVPGoneVal: |
|
1319 case KSVPDoesNotExistAnywhereVal: |
|
1320 { |
|
1321 error = ECCPErrorMovedPermanently; |
|
1322 tone = ECCPToneRadioPathNotAvailable; |
|
1323 break; |
|
1324 } |
|
1325 |
|
1326 case KSVPRequestTimeoutVal: |
|
1327 { |
|
1328 error = ECCPErrorConnectionErrorRedial; |
|
1329 tone = ECCPToneSpecialInformation; |
|
1330 break; |
|
1331 } |
|
1332 |
|
1333 case KSVPUnauthorizedVal: |
|
1334 case KSVPPaymentRequiredVal: |
|
1335 case KSVPForbiddenVal: |
|
1336 case KSVPProxyAuthenticationRequiredVal: |
|
1337 case KSVPIntervalTooBriefVal: |
|
1338 case KSVPBadEventVal: |
|
1339 case KSVPSecurityAgreementRequiredVal: |
|
1340 { |
|
1341 error = ECCPErrorNoService; |
|
1342 tone = ECCPToneCongestion; |
|
1343 break; |
|
1344 } |
|
1345 |
|
1346 default: |
|
1347 { |
|
1348 if ( 299 < aErrorCode && 400 > aErrorCode ) |
|
1349 { |
|
1350 // Received a 3XX response not handled above |
|
1351 error = ECCPErrorNotReached; |
|
1352 break; |
|
1353 } |
|
1354 else if ( 399 < aErrorCode && 500 > aErrorCode ) |
|
1355 { |
|
1356 // Received a 4XX response not handled above |
|
1357 error = ECCPErrorNotAcceptable; |
|
1358 tone = ECCPToneRadioPathNotAvailable; |
|
1359 break; |
|
1360 } |
|
1361 else if ( 499 < aErrorCode && 600 > aErrorCode ) |
|
1362 { |
|
1363 // Received a 5XX response not handled above |
|
1364 error = ECCPErrorNetworkOutOfOrder; |
|
1365 tone = ECCPToneCongestion; |
|
1366 break; |
|
1367 } |
|
1368 else if ( 599 < aErrorCode && 700 > aErrorCode ) |
|
1369 { |
|
1370 // Received a 6XX response not handled above |
|
1371 error = ECCPGlobalFailure; |
|
1372 tone = ECCPToneUserBusy; |
|
1373 break; |
|
1374 } |
|
1375 else |
|
1376 { |
|
1377 SVPDEBUG1("CSVPUtility::GetCCPError Not an error code") |
|
1378 aErrorCode = KErrNone; |
|
1379 tone = ECCPNoSoundSequence; |
|
1380 break; |
|
1381 } |
|
1382 } |
|
1383 } |
|
1384 SVPDEBUG3( "CSVPUtility::GetCCPError error: %d, tone: %d", |
|
1385 error, tone ) |
|
1386 |
|
1387 aTone = tone; |
|
1388 return error; |
|
1389 } |
|
1390 |
|
1391 |
|
1392 // --------------------------------------------------------------------------- |
|
1393 // CSVPUtility::LogVoipEventL |
|
1394 // --------------------------------------------------------------------------- |
|
1395 // |
|
1396 void CSVPUtility::LogVoipEventL( TInt aErrorCode, TUint32 aSipProfileId, |
|
1397 const TDesC& aRemoteURI, const TDesC& aMethod ) const |
|
1398 { |
|
1399 SVPDEBUG1( "CSVPUtility::LogVoipEventL In" ); |
|
1400 HBufC* remote = NULL; |
|
1401 |
|
1402 if ( iVoipEventLogger ) |
|
1403 { |
|
1404 // set the profile id and remote URI to the error text parameter |
|
1405 // tab is used as value delimiter |
|
1406 TBuf<KSVPTempStringlength> entryArguments; |
|
1407 entryArguments.AppendNum( aSipProfileId ); |
|
1408 entryArguments.Append( KSVPLogFieldDelimiter ); |
|
1409 |
|
1410 // parse "sip:" away from the remote address |
|
1411 if ( aRemoteURI.Length() > 0 ) |
|
1412 { |
|
1413 remote = aRemoteURI.AllocLC(); |
|
1414 |
|
1415 if ( 0 == remote->Find( KSVPSipPrefix2 ) ) |
|
1416 { |
|
1417 remote->Des().Delete( 0, KSVPSipPrefixLength ); |
|
1418 } |
|
1419 |
|
1420 entryArguments.Append( *remote ); |
|
1421 |
|
1422 CleanupStack::PopAndDestroy( remote ); |
|
1423 } |
|
1424 else |
|
1425 { |
|
1426 entryArguments.Append( aRemoteURI ); |
|
1427 } |
|
1428 |
|
1429 entryArguments.Append( KSVPLogFieldDelimiter ); |
|
1430 entryArguments.Append( aMethod ); |
|
1431 |
|
1432 CVoipErrorEntry* entry = CVoipErrorEntry::NewLC( aErrorCode, |
|
1433 entryArguments ); |
|
1434 iVoipEventLogger->WriteError( *entry ); |
|
1435 |
|
1436 CleanupStack::PopAndDestroy( entry ); |
|
1437 |
|
1438 SVPDEBUG3( "CSVPUtility::LogVoipEventL: \ |
|
1439 err: %d, aMethod: %S", aErrorCode, &aMethod ); |
|
1440 |
|
1441 } |
|
1442 |
|
1443 SVPDEBUG1( "CSVPUtility::LogVoipEventL Out" ); |
|
1444 } |
|
1445 |
|
1446 |
|
1447 // --------------------------------------------------------------------------- |
|
1448 // CSVPUtility::GetDtmfEvent |
|
1449 // --------------------------------------------------------------------------- |
|
1450 // |
|
1451 MCCPDTMFObserver::TCCPDtmfEvent CSVPUtility::GetDtmfEvent( |
|
1452 MMceDtmfObserver::TMceDtmfEvent aEvent, |
|
1453 TBool aDtmfStringSending ) |
|
1454 { |
|
1455 SVPDEBUG1( "CSVPUtility::GetDtmfEvent In" ) |
|
1456 |
|
1457 MCCPDTMFObserver::TCCPDtmfEvent event = MCCPDTMFObserver::ECCPDtmfUnknown; |
|
1458 |
|
1459 switch ( aEvent ) |
|
1460 { |
|
1461 case MMceDtmfObserver::EDtmfSendStarted: |
|
1462 { |
|
1463 if ( aDtmfStringSending ) |
|
1464 { |
|
1465 SVPDEBUG1( "CSVPUtility::GetDtmfEvent ECCPDtmfSequenceStart" ) |
|
1466 |
|
1467 event = MCCPDTMFObserver::ECCPDtmfSequenceStart; |
|
1468 } |
|
1469 else |
|
1470 { |
|
1471 SVPDEBUG1( "CSVPUtility::GetDtmfEvent ECCPDtmfManualStart" ) |
|
1472 |
|
1473 event = MCCPDTMFObserver::ECCPDtmfManualStart; |
|
1474 } |
|
1475 |
|
1476 break; |
|
1477 } |
|
1478 case MMceDtmfObserver::EDtmfSendCompleted: |
|
1479 { |
|
1480 if ( aDtmfStringSending ) |
|
1481 { |
|
1482 SVPDEBUG1( "CSVPUtility::GetDtmfEvent ECCPDtmfStringSendingCompleted" ) |
|
1483 |
|
1484 event = MCCPDTMFObserver::ECCPDtmfStringSendingCompleted; |
|
1485 } |
|
1486 // else NOP |
|
1487 |
|
1488 break; |
|
1489 } |
|
1490 default: |
|
1491 { |
|
1492 // This block should never be reached. |
|
1493 SVPDEBUG1( "CSVPUtility::GetDtmfEvent default case!" ) |
|
1494 |
|
1495 event = MCCPDTMFObserver::ECCPDtmfUnknown; |
|
1496 break; |
|
1497 } |
|
1498 } |
|
1499 |
|
1500 return event; |
|
1501 } |
|
1502 |
|
1503 |
|
1504 |
|
1505 // --------------------------------------------------------------------------- |
|
1506 // CSVPUtility::SetProvisioningDataL |
|
1507 // --------------------------------------------------------------------------- |
|
1508 // |
|
1509 void CSVPUtility::SetProvisioningDataL( CRCSEProfileEntry& aVoipProfile, |
|
1510 CDesC8Array& aUserAgentHeaders, |
|
1511 TUint32& aSecurityStatus, |
|
1512 TBuf<KSVPMaxTerminalTypeLength>& aTerminalType, |
|
1513 TBuf<KSVPWlanMacAddressLength>& aWlanMACAddress ) const |
|
1514 { |
|
1515 SVPDEBUG1("CSVPUtility::SetProvisioningDataL In" ); |
|
1516 |
|
1517 // fetch security status |
|
1518 aSecurityStatus = aVoipProfile.iSecureCallPreference; |
|
1519 |
|
1520 SVPDEBUG2("CSVPUtility::SetProvisioningDataL: aSecurityStatus = %d", |
|
1521 aSecurityStatus ); |
|
1522 |
|
1523 TBool terminalTypeEnabled = aVoipProfile.iSIPVoIPUAHTerminalType; |
|
1524 SVPDEBUG2("CSVPUtility::SetProvisioningDataL: terminalTypeEnabled = %d", |
|
1525 terminalTypeEnabled ); |
|
1526 |
|
1527 TBool wlanMacEnabled = aVoipProfile.iSIPVoIPUAHeaderWLANMAC; |
|
1528 |
|
1529 SVPDEBUG2("CSVPUtility::SetProvisioningDataL: wlanMacEnabled = %d", |
|
1530 wlanMacEnabled ); |
|
1531 |
|
1532 // temp descriptor for user-agent header |
|
1533 TBuf< KSVPMaxUAFreeTextLength > uaHeaderFreeString; |
|
1534 |
|
1535 // SIP VoIP User Agent header string |
|
1536 uaHeaderFreeString = aVoipProfile.iSIPVoIPUAHeaderString; |
|
1537 |
|
1538 // UA header found, append header name |
|
1539 TBuf8<KSVPTempStringlength> userAgentString; |
|
1540 userAgentString.Append( KSVPUserAgent ); |
|
1541 |
|
1542 // add terminat type |
|
1543 if( terminalTypeEnabled ) |
|
1544 { |
|
1545 userAgentString.Append( KSVPSpaceMark ); |
|
1546 userAgentString.Append( aTerminalType ); |
|
1547 SVPDEBUG2("CSVPUtility::SetProvisioningDataL: aTerminalType = %S", |
|
1548 &aTerminalType ); |
|
1549 userAgentString.Append( KSVPSpaceMark ); |
|
1550 } |
|
1551 // add wlan mac address |
|
1552 if( wlanMacEnabled ) |
|
1553 { |
|
1554 userAgentString.Append( aWlanMACAddress ); |
|
1555 SVPDEBUG2("CSVPUtility::SetProvisioningDataL: aWlanMACAddress = %S", |
|
1556 &aWlanMACAddress ); |
|
1557 userAgentString.Append( KSVPSpaceMark ); |
|
1558 } |
|
1559 // add free string |
|
1560 if( 0 != uaHeaderFreeString.Length() ) |
|
1561 { |
|
1562 // append user agent header string part |
|
1563 userAgentString.Append( uaHeaderFreeString ); |
|
1564 SVPDEBUG2("CSVPUtility::SetProvisioningDataL:\ |
|
1565 uaHeaderFreeString = %S", &uaHeaderFreeString ); |
|
1566 userAgentString.Append( KSVPSpaceMark ); |
|
1567 } |
|
1568 |
|
1569 // match language code and add to user-agent header |
|
1570 TInt langCode = User::Language(); |
|
1571 TBuf< KSVPMaxLangCodeLength > languageTag; |
|
1572 if ( langCode > 0 ) |
|
1573 { |
|
1574 SVPDEBUG2("CSVPUtility::SetProvisioningDataL\ |
|
1575 Language code: %d", langCode ); |
|
1576 |
|
1577 MatchLanguageTags( langCode, languageTag ); |
|
1578 |
|
1579 if ( languageTag.Length() != 0 ) |
|
1580 { |
|
1581 SVPDEBUG2("CSVPUtility::SetProvisioninDataL ISO\ |
|
1582 stanard language code: %S", &languageTag ); |
|
1583 // add language tag to user agent string |
|
1584 userAgentString.Append( KSVPOpeningBracket ); |
|
1585 userAgentString.Append( languageTag ); |
|
1586 userAgentString.Append( KSVPClosingBracket ); |
|
1587 } |
|
1588 } |
|
1589 |
|
1590 // add collected User-Agent string to header |
|
1591 aUserAgentHeaders.AppendL( userAgentString ); |
|
1592 |
|
1593 // add accept language header |
|
1594 TBuf8<KSVPAcceptLangStringLength> acceptLanguageString; |
|
1595 acceptLanguageString.Append( KSVPAcceptLanguage ); |
|
1596 acceptLanguageString.Append( languageTag ); |
|
1597 |
|
1598 // add expires header |
|
1599 // add accept language header |
|
1600 TBuf8<KSVPExpiresHeaderLength> expiresHeaderString; |
|
1601 expiresHeaderString.Append( KSVPExpiresHeader ); |
|
1602 expiresHeaderString.Append( KSVPExpires ); |
|
1603 |
|
1604 aUserAgentHeaders.AppendL( acceptLanguageString ); |
|
1605 aUserAgentHeaders.AppendL( expiresHeaderString ); |
|
1606 |
|
1607 // Add Privacy header |
|
1608 TBuf8<KSVPPrivacyLength> privacyString; |
|
1609 privacyString.Append( KSVPPrivacy ); |
|
1610 |
|
1611 if ( IsCLIROnL() ) |
|
1612 { |
|
1613 privacyString.Append( KSVPId ); |
|
1614 } |
|
1615 else |
|
1616 { |
|
1617 privacyString.Append( KSVPNone ); |
|
1618 } |
|
1619 aUserAgentHeaders.AppendL( privacyString ); |
|
1620 } |
|
1621 |
|
1622 // --------------------------------------------------------------------------- |
|
1623 // CSVPUtility::IsCLIROnL |
|
1624 // --------------------------------------------------------------------------- |
|
1625 // |
|
1626 TBool CSVPUtility::IsCLIROnL() const |
|
1627 { |
|
1628 |
|
1629 TInt valueCLIR( KSVPClirOff ); |
|
1630 TBool clirOn = EFalse; |
|
1631 |
|
1632 CRepository* repository = NULL; |
|
1633 repository = CRepository::NewL( KCRUidRichCallSettings ); |
|
1634 repository->Get( KRCSEClir, valueCLIR ); |
|
1635 delete repository; |
|
1636 repository = NULL; |
|
1637 |
|
1638 SVPDEBUG2("CSVPUtility::IsCLIROnL valueCLIR : %d", valueCLIR ); |
|
1639 if ( KSVPClirOn == valueCLIR ) |
|
1640 { |
|
1641 // 0 = KRCSEClirOff |
|
1642 clirOn = ETrue; |
|
1643 } |
|
1644 else |
|
1645 { |
|
1646 // 1 = KRCSEClirOn or 2 = KRCSEClirDefault |
|
1647 clirOn = EFalse; |
|
1648 } |
|
1649 |
|
1650 SVPDEBUG2("CSVPUtility::IsCLIROnL returns %d", clirOn); |
|
1651 return clirOn; |
|
1652 } |
|
1653 |
|
1654 // --------------------------------------------------------------------------- |
|
1655 // CSVPUtility::SetMoFromHeaderLC |
|
1656 // --------------------------------------------------------------------------- |
|
1657 // |
|
1658 HBufC8* CSVPUtility::SetMoFromHeaderLC( TUint aSecurityStatus ) |
|
1659 { |
|
1660 |
|
1661 HBufC8* fromheader = NULL; |
|
1662 |
|
1663 if ( IsCLIROnL() ) |
|
1664 { |
|
1665 SVPDEBUG1("CSVPMoSession::SetMoFromHeaderLC CLIR is ON"); |
|
1666 if ( KSVPStatusNonSecure == aSecurityStatus ) |
|
1667 { |
|
1668 fromheader = HBufC8::NewLC(KSVPMyAnonymousAddress.iTypeLength); |
|
1669 fromheader->Des().Append( KSVPMyAnonymousAddress ); |
|
1670 } |
|
1671 else |
|
1672 { |
|
1673 fromheader = HBufC8::NewLC(KSVPMyAnonymousSecAddress.iTypeLength); |
|
1674 fromheader->Des().Append( KSVPMyAnonymousSecAddress ); |
|
1675 } |
|
1676 } |
|
1677 else |
|
1678 { |
|
1679 SVPDEBUG1("CSVPMoSession::SetMoFromHeaderLC CLIR is OFF"); |
|
1680 fromheader = HBufC8::NewLC(KSVPEmpty.iTypeLength); |
|
1681 fromheader->Des().Append( KSVPEmpty ); |
|
1682 } |
|
1683 |
|
1684 return fromheader; |
|
1685 } |
|
1686 |
|
1687 // --------------------------------------------------------------------------- |
|
1688 // CSVPUtility::GetTerminalTypeL |
|
1689 // --------------------------------------------------------------------------- |
|
1690 // |
|
1691 void CSVPUtility::GetTerminalTypeL( |
|
1692 TBuf< KSVPMaxTerminalTypeLength >& aTerminalType ) |
|
1693 { |
|
1694 // Using ipapputils functionality |
|
1695 TBuf<KSVPMaxTerminalTypeLength> terminalType (KNullDesC); |
|
1696 |
|
1697 CIpAppPhoneUtils* libIpAppPhoneUtils = CIpAppPhoneUtils::NewLC(); |
|
1698 |
|
1699 libIpAppPhoneUtils->GetTerminalTypeL( terminalType ); |
|
1700 |
|
1701 CleanupStack::PopAndDestroy( libIpAppPhoneUtils ); |
|
1702 aTerminalType.Copy( terminalType ); |
|
1703 } |
|
1704 |
|
1705 // --------------------------------------------------------------------------- |
|
1706 // CSVPUtility::GetWlanMACAddressL |
|
1707 // --------------------------------------------------------------------------- |
|
1708 // |
|
1709 void CSVPUtility::GetWlanMACAddressL( |
|
1710 TBuf< KSVPWlanMacAddressLength >& aWlanMACAddress ) |
|
1711 { |
|
1712 // Using ipapputils functionality |
|
1713 TBuf8<KSVPWlanMacAddressLength> wlanMacAddress (KNullDesC8); |
|
1714 |
|
1715 CIPAppUtilsAddressResolver* addressResolver = |
|
1716 CIPAppUtilsAddressResolver::NewLC(); |
|
1717 |
|
1718 TInt ret = addressResolver->GetWlanMACAddress( wlanMacAddress, |
|
1719 KSVPWlanMacAddressFrmt ); |
|
1720 |
|
1721 SVPDEBUG2("CSVPUtility::GetWlanMACAddressL ret: %d", ret ); |
|
1722 |
|
1723 CleanupStack::PopAndDestroy( addressResolver ); |
|
1724 aWlanMACAddress.Copy( wlanMacAddress ); |
|
1725 } |
|
1726 |
|
1727 // --------------------------------------------------------------------------- |
|
1728 // CSVPUtility::ResolveSecurityMechanismL |
|
1729 // --------------------------------------------------------------------------- |
|
1730 // |
|
1731 void CSVPUtility::ResolveSecurityMechanismL( const CSIPProfile& aProfile, |
|
1732 TUint32& aSecureCallPreference ) |
|
1733 { |
|
1734 const TDesC8* securityMechanism = NULL; |
|
1735 const TDesC8* sipUserAor = NULL; |
|
1736 const TDesC8* sipOutboundProxy = NULL; |
|
1737 const TDesC8* registeredContact = NULL; |
|
1738 |
|
1739 aProfile.GetParameter( KSIPNegotiatedSecurityMechanism, |
|
1740 securityMechanism ); |
|
1741 aProfile.GetParameter( KSIPUserAor, |
|
1742 sipUserAor ); |
|
1743 aProfile.GetParameter( KSIPOutboundProxy, |
|
1744 KSIPServerAddress, |
|
1745 sipOutboundProxy ); |
|
1746 aProfile.GetParameter( KSIPRegisteredContact, |
|
1747 KSIPServerAddress, |
|
1748 registeredContact ); |
|
1749 |
|
1750 if ( KErrNotFound == securityMechanism->Find( KSVPTLS ) && |
|
1751 KErrNotFound == sipUserAor->Find( KSVPSipsPrefix ) && |
|
1752 KErrNotFound == sipOutboundProxy->Find( KSVPSipsPrefix ) && |
|
1753 KErrNotFound == registeredContact->Find( KSVPSipsPrefix ) ) |
|
1754 { |
|
1755 SVPDEBUG1("CSVPUtility::ResolveSecurityMechanism:\ |
|
1756 TLS not enabled (tls and sips: wasn't found)"); |
|
1757 aSecureCallPreference = 0; |
|
1758 } |
|
1759 } |
|
1760 |
|
1761 // --------------------------------------------------------------------------- |
|
1762 // CSVPUtility::MatchLanguageTags |
|
1763 // --------------------------------------------------------------------------- |
|
1764 // |
|
1765 void CSVPUtility::MatchLanguageTags( TInt aLanguageCode, |
|
1766 TDes& aLangMatch ) |
|
1767 { |
|
1768 SVPDEBUG2("CSVPUtility::MatchLanguageTags Langcode: %d", aLanguageCode ); |
|
1769 |
|
1770 switch( aLanguageCode) |
|
1771 { |
|
1772 case ESVPLangEnglish: |
|
1773 { |
|
1774 SVPDEBUG1("CSVPUtility::MatchLanguageTags -> English"); |
|
1775 aLangMatch.Copy( KSVPLanguageTagEn ); |
|
1776 break; |
|
1777 } |
|
1778 case ESVPLangFrench: |
|
1779 { |
|
1780 aLangMatch.Copy( KSVPLanguageTagFr ); |
|
1781 break; |
|
1782 } |
|
1783 case ESVPLangGerman: |
|
1784 { |
|
1785 aLangMatch.Copy( KSVPLanguageTagDe ); |
|
1786 break; |
|
1787 } |
|
1788 case ESVPLangSpanish: |
|
1789 { |
|
1790 aLangMatch.Copy( KSVPLanguageTagEs ); |
|
1791 break; |
|
1792 } |
|
1793 case ESVPLangItalian: |
|
1794 { |
|
1795 aLangMatch.Copy( KSVPLanguageTagIt ); |
|
1796 break; |
|
1797 } |
|
1798 case ESVPLangSwedish: |
|
1799 { |
|
1800 aLangMatch.Copy( KSVPLanguageTagSv ); |
|
1801 break; |
|
1802 } |
|
1803 case ESVPLangDanish: |
|
1804 { |
|
1805 aLangMatch.Copy( KSVPLanguageTagDa ); |
|
1806 break; |
|
1807 } |
|
1808 case ESVPLangNorwegian: |
|
1809 { |
|
1810 aLangMatch.Copy( KSVPLanguageTagNo ); |
|
1811 break; |
|
1812 } |
|
1813 case ESVPLangFinnish: |
|
1814 { |
|
1815 aLangMatch.Copy( KSVPLanguageTagFi ); |
|
1816 break; |
|
1817 } |
|
1818 case ESVPLangAmerican: |
|
1819 { |
|
1820 aLangMatch.Copy( KSVPLanguageTagEn ); |
|
1821 break; |
|
1822 } |
|
1823 case ESVPLangSwissFrench: |
|
1824 { |
|
1825 aLangMatch.Copy( KSVPLanguageTagFr ); |
|
1826 break; |
|
1827 } |
|
1828 case ESVPLangSwissGerman: |
|
1829 { |
|
1830 aLangMatch.Copy( KSVPLanguageTagDe ); |
|
1831 break; |
|
1832 } |
|
1833 case ESVPLangPortuguese: |
|
1834 { |
|
1835 aLangMatch.Copy( KSVPLanguageTagPt ); |
|
1836 break; |
|
1837 } |
|
1838 case ESVPLangTurkish: |
|
1839 { |
|
1840 aLangMatch.Copy( KSVPLanguageTagTr ); |
|
1841 break; |
|
1842 } |
|
1843 case ESVPLangIcelandic: |
|
1844 { |
|
1845 aLangMatch.Copy( KSVPLanguageTagIs ); |
|
1846 break; |
|
1847 } |
|
1848 case ESVPLangRussian: |
|
1849 { |
|
1850 aLangMatch.Copy( KSVPLanguageTagRu ); |
|
1851 break; |
|
1852 } |
|
1853 case ESVPLangHungarian: |
|
1854 { |
|
1855 aLangMatch.Copy( KSVPLanguageTagHu ); |
|
1856 break; |
|
1857 } |
|
1858 case ESVPLangDutch: |
|
1859 { |
|
1860 aLangMatch.Copy( KSVPLanguageTagNl ); |
|
1861 break; |
|
1862 } |
|
1863 case ESVPLangBelgianFlemish: |
|
1864 { |
|
1865 aLangMatch.Copy( KSVPLanguageTagNl ); |
|
1866 break; |
|
1867 } |
|
1868 case ESVPLangAustralian: |
|
1869 { |
|
1870 aLangMatch.Copy( KSVPLanguageTagEn ); |
|
1871 break; |
|
1872 } |
|
1873 case ESVPLangBelgianFrench: |
|
1874 { |
|
1875 aLangMatch.Copy( KSVPLanguageTagFr ); |
|
1876 break; |
|
1877 } |
|
1878 case ESVPLangAustrian: |
|
1879 { |
|
1880 aLangMatch.Copy( KSVPLanguageTagDe ); |
|
1881 break; |
|
1882 } |
|
1883 case ESVPLangNewZealand: |
|
1884 { |
|
1885 aLangMatch.Copy( KSVPLanguageTagEn ); |
|
1886 break; |
|
1887 } |
|
1888 case ESVPLangInternationalFrench: |
|
1889 { |
|
1890 aLangMatch.Copy( KSVPLanguageTagFr ); |
|
1891 break; |
|
1892 } |
|
1893 case ESVPLangCzech: |
|
1894 { |
|
1895 aLangMatch.Copy( KSVPLanguageTagCs ); |
|
1896 break; |
|
1897 } |
|
1898 case ESVPLangSlovak: |
|
1899 { |
|
1900 aLangMatch.Copy( KSVPLanguageTagSk ); |
|
1901 break; |
|
1902 } |
|
1903 case ESVPLangPolish: |
|
1904 { |
|
1905 aLangMatch.Copy( KSVPLanguageTagPl ); |
|
1906 break; |
|
1907 } |
|
1908 case ESVPLangSlovenian: |
|
1909 { |
|
1910 aLangMatch.Copy( KSVPLanguageTagSl ); |
|
1911 break; |
|
1912 } |
|
1913 case ESVPLangTaiwanChinese: |
|
1914 { |
|
1915 aLangMatch.Copy( KSVPLanguageTagTaiwaneseChinese ); |
|
1916 break; |
|
1917 } |
|
1918 case ESVPLangHongKongChinese: |
|
1919 { |
|
1920 aLangMatch.Copy( KSVPLanguageTagHongKongChinese ); |
|
1921 break; |
|
1922 } |
|
1923 case ESVPLangPrcChinese: |
|
1924 { |
|
1925 aLangMatch.Copy( KSVPLanguageTagChinese ); |
|
1926 break; |
|
1927 } |
|
1928 case ESVPLangJapanese: |
|
1929 { |
|
1930 aLangMatch.Copy( KSVPLanguageTagJa ); |
|
1931 break; |
|
1932 } |
|
1933 case ESVPLangThai: |
|
1934 { |
|
1935 aLangMatch.Copy( KSVPLanguageTagTh ); |
|
1936 break; |
|
1937 } |
|
1938 case ESVPLangAfrikaans: |
|
1939 { |
|
1940 aLangMatch.Copy( KSVPLanguageTagAf ); |
|
1941 break; |
|
1942 } |
|
1943 case ESVPLangAlbanian: |
|
1944 { |
|
1945 aLangMatch.Copy( KSVPLanguageTagSq ); |
|
1946 break; |
|
1947 } |
|
1948 case ESVPLangAmharic: |
|
1949 { |
|
1950 aLangMatch.Copy( KSVPLanguageTagAm ); |
|
1951 break; |
|
1952 } |
|
1953 case ESVPLangArabic: |
|
1954 { |
|
1955 aLangMatch.Copy( KSVPLanguageTagAr ); |
|
1956 break; |
|
1957 } |
|
1958 case ESVPLangArmenian: |
|
1959 { |
|
1960 aLangMatch.Copy( KSVPLanguageTagHy ); |
|
1961 break; |
|
1962 } |
|
1963 case ESVPLangTagalog: |
|
1964 { |
|
1965 aLangMatch.Copy( KSVPLanguageTagTl ); |
|
1966 break; |
|
1967 } |
|
1968 case ESVPLangBelarussian: |
|
1969 { |
|
1970 aLangMatch.Copy( KSVPLanguageTagBe ); |
|
1971 break; |
|
1972 } |
|
1973 case ESVPLangBengali: |
|
1974 { |
|
1975 aLangMatch.Copy( KSVPLanguageTagBn ); |
|
1976 break; |
|
1977 } |
|
1978 case ESVPLangBulgarian: |
|
1979 { |
|
1980 aLangMatch.Copy( KSVPLanguageTagBg ); |
|
1981 break; |
|
1982 } |
|
1983 case ESVPLangBurmese: |
|
1984 { |
|
1985 aLangMatch.Copy( KSVPLanguageTagMy ); |
|
1986 break; |
|
1987 } |
|
1988 case ESVPLangCatalan: |
|
1989 { |
|
1990 aLangMatch.Copy( KSVPLanguageTagCa ); |
|
1991 break; |
|
1992 } |
|
1993 case ESVPLangCroatian: |
|
1994 { |
|
1995 aLangMatch.Copy( KSVPLanguageTagHr ); |
|
1996 break; |
|
1997 } |
|
1998 case ESVPLangCanadianEnglish: |
|
1999 case ESVPLangInternationalEnglish: |
|
2000 case ESVPLangSouthAfricanEnglish: |
|
2001 { |
|
2002 aLangMatch.Copy( KSVPLanguageTagEn ); |
|
2003 break; |
|
2004 } |
|
2005 case ESVPLangEstonian: |
|
2006 { |
|
2007 aLangMatch.Copy( KSVPLanguageTagEt ); |
|
2008 break; |
|
2009 } |
|
2010 case ESVPLangFarsi: |
|
2011 { |
|
2012 aLangMatch.Copy( KSVPLanguageTagFa ); |
|
2013 break; |
|
2014 } |
|
2015 case ESVPLangCanadianFrench: |
|
2016 { |
|
2017 aLangMatch.Copy( KSVPLanguageTagCanadianFrench ); |
|
2018 break; |
|
2019 } |
|
2020 case ESVPLangScotsGaelic: |
|
2021 { |
|
2022 aLangMatch.Copy( KSVPLanguageTagGd ); |
|
2023 break; |
|
2024 } |
|
2025 case ESVPLangGeorgian: |
|
2026 { |
|
2027 aLangMatch.Copy( KSVPLanguageTagKa ); |
|
2028 break; |
|
2029 } |
|
2030 case ESVPLangGreek: |
|
2031 { |
|
2032 aLangMatch.Copy( KSVPLanguageTagEl ); |
|
2033 break; |
|
2034 } |
|
2035 case ESVPLangCyprusGreek: |
|
2036 { |
|
2037 aLangMatch.Copy( KSVPLanguageTagCyprusGreek ); |
|
2038 break; |
|
2039 } |
|
2040 case ESVPLangGujarati: |
|
2041 { |
|
2042 aLangMatch.Copy( KSVPLanguageTagGu ); |
|
2043 break; |
|
2044 } |
|
2045 case ESVPLangHebrew: |
|
2046 { |
|
2047 aLangMatch.Copy( KSVPLanguageTagHe ); |
|
2048 break; |
|
2049 } |
|
2050 case ESVPLangHindi: |
|
2051 { |
|
2052 aLangMatch.Copy( KSVPLanguageTagHi ); |
|
2053 break; |
|
2054 } |
|
2055 case ESVPLangIndonesian: |
|
2056 { |
|
2057 aLangMatch.Copy( KSVPLanguageTagId ); |
|
2058 break; |
|
2059 } |
|
2060 case ESVPLangIrish: |
|
2061 { |
|
2062 aLangMatch.Copy( KSVPLanguageTagGa ); |
|
2063 break; |
|
2064 } |
|
2065 case ESVPLangSwissItalian: |
|
2066 { |
|
2067 aLangMatch.Copy( KSVPLanguageTagSwissItalian ); |
|
2068 break; |
|
2069 } |
|
2070 case ESVPLangKannada: |
|
2071 { |
|
2072 aLangMatch.Copy( KSVPLanguageTagKn ); |
|
2073 break; |
|
2074 } |
|
2075 case ESVPLangKazakh: |
|
2076 { |
|
2077 aLangMatch.Copy( KSVPLanguageTagKk ); |
|
2078 break; |
|
2079 } |
|
2080 case ESVPLangKhmer: |
|
2081 { |
|
2082 aLangMatch.Copy( KSVPLanguageTagKm ); |
|
2083 break; |
|
2084 } |
|
2085 case ESVPLangKorean: |
|
2086 { |
|
2087 aLangMatch.Copy( KSVPLanguageTagKo ); |
|
2088 break; |
|
2089 } |
|
2090 case ESVPLangLao: |
|
2091 { |
|
2092 aLangMatch.Copy( KSVPLanguageTagLo ); |
|
2093 break; |
|
2094 } |
|
2095 case ESVPLangLatvian: |
|
2096 { |
|
2097 aLangMatch.Copy( KSVPLanguageTagLv ); |
|
2098 break; |
|
2099 } |
|
2100 case ESVPLangLithuanian: |
|
2101 { |
|
2102 aLangMatch.Copy( KSVPLanguageTagLt ); |
|
2103 break; |
|
2104 } |
|
2105 case ESVPLangMacedonian: |
|
2106 { |
|
2107 aLangMatch.Copy( KSVPLanguageTagMk ); |
|
2108 break; |
|
2109 } |
|
2110 case ESVPLangMalay: |
|
2111 { |
|
2112 aLangMatch.Copy( KSVPLanguageTagMs ); |
|
2113 break; |
|
2114 } |
|
2115 case ESVPLangMalayalam: |
|
2116 { |
|
2117 aLangMatch.Copy( KSVPLanguageTagMl ); |
|
2118 break; |
|
2119 } |
|
2120 case ESVPLangMarathi: |
|
2121 { |
|
2122 aLangMatch.Copy( KSVPLanguageTagMr ); |
|
2123 break; |
|
2124 } |
|
2125 case ESVPLangMoldavian: |
|
2126 { |
|
2127 aLangMatch.Copy( KSVPLanguageTagMo ); |
|
2128 break; |
|
2129 } |
|
2130 case ESVPLangMongolian: |
|
2131 { |
|
2132 aLangMatch.Copy( KSVPLanguageTagMn ); |
|
2133 break; |
|
2134 } |
|
2135 case ESVPLangNorwegianNynorsk: |
|
2136 { |
|
2137 aLangMatch.Copy( KSVPLanguageTagNorwegianNynorsk ); |
|
2138 break; |
|
2139 } |
|
2140 case ESVPLangBrazilianPortuguese: |
|
2141 { |
|
2142 aLangMatch.Copy( KSVPLanguageTagBrazilianPortugese ); |
|
2143 break; |
|
2144 } |
|
2145 case ESVPLangPunjabi: |
|
2146 { |
|
2147 aLangMatch.Copy( KSVPLanguageTagPa ); |
|
2148 break; |
|
2149 } |
|
2150 case ESVPLangRomanian: |
|
2151 { |
|
2152 aLangMatch.Copy( KSVPLanguageTagRo ); |
|
2153 break; |
|
2154 } |
|
2155 case ESVPLangSerbian: |
|
2156 { |
|
2157 aLangMatch.Copy( KSVPLanguageTagSr ); |
|
2158 break; |
|
2159 } |
|
2160 case ESVPLangSinhalese: |
|
2161 { |
|
2162 aLangMatch.Copy( KSVPLanguageTagSi ); |
|
2163 break; |
|
2164 } |
|
2165 case ESVPLangSomali: |
|
2166 { |
|
2167 aLangMatch.Copy( KSVPLanguageTagSo ); |
|
2168 break; |
|
2169 } |
|
2170 case ESVPLangInternationalSpanish: |
|
2171 { |
|
2172 aLangMatch.Copy( KSVPLanguageTagEs ); |
|
2173 break; |
|
2174 } |
|
2175 case ESVPLangLatinAmericanSpanish: |
|
2176 { |
|
2177 aLangMatch.Copy( KSVPLanguageTagAmericanSpanish ); |
|
2178 break; |
|
2179 } |
|
2180 case ESVPLangSwahili: |
|
2181 { |
|
2182 aLangMatch.Copy( KSVPLanguageTagSw ); |
|
2183 break; |
|
2184 } |
|
2185 case ESVPLangFinlandSwedish: |
|
2186 { |
|
2187 aLangMatch.Copy( KSVPLanguageTagFinlandSwedish ); |
|
2188 break; |
|
2189 } |
|
2190 case ESVPLangReserved1: |
|
2191 { |
|
2192 aLangMatch.Copy( KSVPLanguageTagReserved ); |
|
2193 break; |
|
2194 } |
|
2195 case ESVPLangTamil: |
|
2196 { |
|
2197 aLangMatch.Copy( KSVPLanguageTagTa ); |
|
2198 break; |
|
2199 } |
|
2200 case ESVPLangTelugu: |
|
2201 { |
|
2202 aLangMatch.Copy( KSVPLanguageTagTe ); |
|
2203 break; |
|
2204 } |
|
2205 case ESVPLangTibetan: |
|
2206 { |
|
2207 aLangMatch.Copy( KSVPLanguageTagBo ); |
|
2208 break; |
|
2209 } |
|
2210 case ESVPLangTigrinya: |
|
2211 { |
|
2212 aLangMatch.Copy( KSVPLanguageTagTi ); |
|
2213 break; |
|
2214 } |
|
2215 case ESVPLangCyprusTurkish: |
|
2216 { |
|
2217 aLangMatch.Copy( KSVPLanguageTagCyprusTurkish ); |
|
2218 break; |
|
2219 } |
|
2220 case ESVPLangTurkmen: |
|
2221 { |
|
2222 aLangMatch.Copy( KSVPLanguageTagTurkaem ); |
|
2223 break; |
|
2224 } |
|
2225 case ESVPLangUkrainian: |
|
2226 { |
|
2227 aLangMatch.Copy( KSVPLanguageTagUk ); |
|
2228 break; |
|
2229 } |
|
2230 case ESVPLangUrdu: |
|
2231 { |
|
2232 aLangMatch.Copy( KSVPLanguageTagUr ); |
|
2233 break; |
|
2234 } |
|
2235 case ESVPLangReserved2: |
|
2236 { |
|
2237 aLangMatch.Copy( KSVPLanguageTagReserved ); |
|
2238 break; |
|
2239 } |
|
2240 case ESVPLangVietnamese: |
|
2241 { |
|
2242 aLangMatch.Copy( KSVPLanguageTagVi ); |
|
2243 break; |
|
2244 } |
|
2245 |
|
2246 case ESVPLangWelsh: |
|
2247 { |
|
2248 aLangMatch.Copy( KSVPLanguageTagCy ); |
|
2249 break; |
|
2250 } |
|
2251 case ESVPLangZulu: |
|
2252 { |
|
2253 aLangMatch.Copy( KSVPLanguageTagZu ); |
|
2254 break; |
|
2255 } |
|
2256 case ESVPLangOther: |
|
2257 { |
|
2258 break; |
|
2259 } |
|
2260 case ESVPLangSouthSotho: |
|
2261 { |
|
2262 aLangMatch.Copy( KSVPLanguageTagSoth ); |
|
2263 break; |
|
2264 } |
|
2265 case ESVPLangManufacturerEnglish: |
|
2266 case ESVPLangEnglish_Apac: |
|
2267 case ESVPLangEnglish_Taiwan: |
|
2268 case ESVPLangEnglish_HongKong: |
|
2269 case ESVPLangEnglish_Prc: |
|
2270 case ESVPLangEnglish_Japan: |
|
2271 case ESVPLangEnglish_Thailand: |
|
2272 { |
|
2273 aLangMatch.Copy( KSVPLanguageTagEn ); |
|
2274 break; |
|
2275 } |
|
2276 case ESVPLangMalay_Apac: |
|
2277 { |
|
2278 aLangMatch.Copy( KSVPLanguageTagMalay ); |
|
2279 break; |
|
2280 } |
|
2281 case ESVPLangNone: |
|
2282 case ESVPLangMaximum: |
|
2283 { |
|
2284 SVPDEBUG1("CSVPUtility::MatchLanguageTags Lang none/maximum"); |
|
2285 break; |
|
2286 } |
|
2287 default: |
|
2288 { |
|
2289 SVPDEBUG1("CSVPUtility::MatchLanguageTags Default"); |
|
2290 aLangMatch.Copy( KSVPLanguageTagEn ); |
|
2291 } |
|
2292 } |
|
2293 } |
|
2294 |
|
2295 // --------------------------------------------------------------------------- |
|
2296 // CSVPUtility::UpdateJitterBufferSizeL |
|
2297 // --------------------------------------------------------------------------- |
|
2298 // |
|
2299 void CSVPUtility::UpdateJitterBufferSizeL( CMceRtpSource& aRtpSource ) |
|
2300 { |
|
2301 // Convert the jitterbuffer size from milliseconds to RTP packets. This |
|
2302 // does not take into account the fact that RTP packet can hold n |
|
2303 // milliseconds of audio. Also G.711 may use 10ms frames, so and we are |
|
2304 // assuming 20ms frames here. But, MCC actually has the logic to handle |
|
2305 // this issue, as it also assumes initially that G.711 has 20ms frames and |
|
2306 // then adjusts accordingly. |
|
2307 TInt32 jBufSize = KSvpJitterBufferLength; |
|
2308 if ( iJitterBufferSize ) |
|
2309 { |
|
2310 jBufSize = iJitterBufferSize / KJitterBufferFrameSize; |
|
2311 } |
|
2312 |
|
2313 SVPDEBUG2( "CSVPUtility::UpdateJitterBufferSizeL size: %d", jBufSize ); |
|
2314 SVPDEBUG2( "CSVPUtility::UpdateJitterBufferSizeL iJitterBufferSize: %d", |
|
2315 iJitterBufferSize ); |
|
2316 |
|
2317 // If jitterbuffer size goes to zero, then force it back to default. We |
|
2318 // cannot tolerate zero size jitterbuffer. |
|
2319 if ( !jBufSize ) |
|
2320 { |
|
2321 SVPDEBUG1( "CSVPUtility::UpdateJitterBufferSizeL need to default" ) |
|
2322 |
|
2323 jBufSize = KSvpJitterBufferLength; |
|
2324 } |
|
2325 |
|
2326 aRtpSource.UpdateL( jBufSize, |
|
2327 KSvpJitterBufferThreshold, |
|
2328 KSvpStandbyTimerInMillisecs ); |
|
2329 |
|
2330 iJitterBufferSize = 0; |
|
2331 } |
|
2332 |
|
2333 // --------------------------------------------------------------------------- |
|
2334 // CSVPUtility::SetDtmfCodecOrderL |
|
2335 // --------------------------------------------------------------------------- |
|
2336 // |
|
2337 void CSVPUtility::SetDtmfCodecOrderL( CMceAudioStream& aAudioStream ) const |
|
2338 { |
|
2339 SVPDEBUG1( "CSVPUtility::SetDtmfCodecOrderL In" ); |
|
2340 |
|
2341 const RPointerArray<CMceAudioCodec>& codecs = aAudioStream.Codecs(); |
|
2342 const TInt codCount( codecs.Count() ); |
|
2343 |
|
2344 // loop through codecs in in stream |
|
2345 for ( TInt i = 0; i < codCount; i++ ) |
|
2346 { |
|
2347 // Check if codec is DTMF, note the return values of CompareF |
|
2348 if( !codecs[ i ]->SdpName().CompareF( KTELEVENT ) ) |
|
2349 { |
|
2350 codecs[ i ]->SetPreferenceL( iPreferredCodec ); |
|
2351 } |
|
2352 } |
|
2353 SVPDEBUG1( "CSVPUtility::SetDtmfCodecOrderL Out" ); |
|
2354 } |
|
2355 |
|
2356 // --------------------------------------------------------------------------- |
|
2357 // CSVPUtility::SetMediaQoSL |
|
2358 // --------------------------------------------------------------------------- |
|
2359 // |
|
2360 void CSVPUtility::SetMediaQoSL( TUint32 aQosValue, |
|
2361 CMceSession* aSession ) const |
|
2362 { |
|
2363 SVPDEBUG2( "CSVPUtility::SetMediaQoSL aQosValue: %u", aQosValue ); |
|
2364 |
|
2365 __ASSERT_ALWAYS( aSession, User::Leave( KErrArgument ) ); |
|
2366 |
|
2367 // We need to do bitshifting on the IP TOS, because it's the upper 6 bits |
|
2368 // that are set and settings provide us the IP TOS as the lower 6 bits. |
|
2369 // The lower 2 bits are reserver for explicit congestion notification. |
|
2370 // See also more from: |
|
2371 // Symbian Developer Library / in_sock.h Global variables / KSoIpTOS |
|
2372 const TInt ipTosShift( 2 ); |
|
2373 const TUint32 tosBits( aQosValue << ipTosShift ); |
|
2374 |
|
2375 SVPDEBUG2( "CSVPUtility::SetMediaQoSL tosBits: %u", tosBits ); |
|
2376 |
|
2377 aSession->SetServiceTypeL( tosBits ); |
|
2378 |
|
2379 SVPDEBUG1( "CSVPUtility::SetMediaQoSL out" ); |
|
2380 } |
|
2381 |
|
2382 // --------------------------------------------------------------------------- |
|
2383 // CSVPUtility::GetKeepAliveByIapIdL |
|
2384 // --------------------------------------------------------------------------- |
|
2385 // |
|
2386 TBool CSVPUtility::GetKeepAliveByIapIdL( TUint32 aIapId, |
|
2387 TInt& aKeepAliveValue ) const |
|
2388 { |
|
2389 SVPDEBUG2( "CSVPUtility::SetKeepAliveIapIdL IN, aIapId = %d", aIapId ); |
|
2390 |
|
2391 TBool found = EFalse; |
|
2392 TInt keepAliveValue = 0; |
|
2393 aKeepAliveValue = KSVPDefaultUDPRefreshInterval; |
|
2394 RArray< TUint32 > keys; |
|
2395 CleanupClosePushL( keys ); |
|
2396 |
|
2397 CRepository* rep = CRepository::NewLC( KCRUidUNSAFProtocols ); |
|
2398 |
|
2399 TInt err = rep->FindEqL( KUNSAFProtocolsIAPIdMask, |
|
2400 KUNSAFProtocolsFieldTypeMask, |
|
2401 static_cast<TInt>(aIapId), |
|
2402 keys ); |
|
2403 |
|
2404 if ( KErrNone == err && keys.Count() == 1 ) |
|
2405 { |
|
2406 |
|
2407 TUint32 key = ( KUNSAFProtocolsIAPIdMask^( keys[ 0 ] ) ); |
|
2408 key |= KUNSAFProtocolsIAPTableMask; |
|
2409 |
|
2410 // UDP refresh interval |
|
2411 SVPDEBUG2( "CSVPUtility::SetKeepAliveIapIdL UDP refresh interval key = %d", key ); |
|
2412 if ( KErrNone == rep->Get( KUNSAFProtocolsIntervalUDPMask|key, keepAliveValue ) ) |
|
2413 { |
|
2414 aKeepAliveValue = keepAliveValue; |
|
2415 found = ETrue; |
|
2416 } |
|
2417 } |
|
2418 |
|
2419 CleanupStack::PopAndDestroy( 2, &keys ); // keys & rep |
|
2420 SVPDEBUG3( "CSVPUtility::SetKeepAliveIapIdL OUT keepAliveValue = %d found = %d", |
|
2421 keepAliveValue, found ); |
|
2422 return found; |
|
2423 } |
|
2424 |
|
2425 // --------------------------------------------------------------------------- |
|
2426 // CSVPUtility::GetKeepAliveByAORL |
|
2427 // --------------------------------------------------------------------------- |
|
2428 // |
|
2429 TBool CSVPUtility::GetKeepAliveByAORL( const TDesC8& aAor, |
|
2430 TInt& aKeepAliveValue ) const |
|
2431 { |
|
2432 SVPDEBUG1( "CSVPUtility::GetKeepAliveByAORL In" ); |
|
2433 |
|
2434 HBufC8* newAor = aAor.AllocLC(); |
|
2435 // Domain name is what is after @ character |
|
2436 newAor->Des().Delete( 0, newAor->Find( KSVPAt ) + 1 ); |
|
2437 |
|
2438 TBool found = EFalse; |
|
2439 TInt keepAliveValue = 0; |
|
2440 aKeepAliveValue = KSVPDefaultUDPRefreshInterval; |
|
2441 RArray<TUint32> keys; |
|
2442 CleanupClosePushL( keys ); |
|
2443 |
|
2444 CRepository* rep = CRepository::NewLC( KCRUidUNSAFProtocols ); |
|
2445 |
|
2446 TInt err = rep->FindEqL( KUNSAFProtocolsDomainMask, |
|
2447 KUNSAFProtocolsFieldTypeMask, |
|
2448 *newAor, |
|
2449 keys ); |
|
2450 |
|
2451 if ( KErrNone == err && keys.Count() == 1 ) |
|
2452 { |
|
2453 TUint32 key = ( KUNSAFProtocolsDomainMask^( keys[0] ) ); |
|
2454 key |= KUNSAFProtocolsDomainTableMask; |
|
2455 |
|
2456 // UDP refresh interval |
|
2457 if ( KErrNone == |
|
2458 rep->Get( KUNSAFProtocolsDomainIntervalUDPMask|key, keepAliveValue ) ) |
|
2459 { |
|
2460 aKeepAliveValue = keepAliveValue; |
|
2461 found = ETrue; |
|
2462 } |
|
2463 } |
|
2464 |
|
2465 CleanupStack::PopAndDestroy( 3, newAor ); |
|
2466 |
|
2467 if ( !found ) |
|
2468 { |
|
2469 // Neither IapId nor Domain spesific keepalive value was not found. |
|
2470 SVPDEBUG1( "CSVPUtility::GetKeepAliveByAORL::GetKeepAliveByAORL use default keepalive" ); |
|
2471 |
|
2472 aKeepAliveValue = KSVPDefaultUDPRefreshInterval; |
|
2473 } |
|
2474 |
|
2475 SVPDEBUG2( "CSVPUtility::GetKeepAliveByAORL Out found: %d", found ); |
|
2476 return found; |
|
2477 } |
|
2478 |
|
2479 // --------------------------------------------------------------------------- |
|
2480 // CSVPUtility::CheckRtcpSettingL |
|
2481 // --------------------------------------------------------------------------- |
|
2482 // |
|
2483 void CSVPUtility::CheckRtcpSettingL( TUint32 aRtcp, |
|
2484 CMceMediaStream& aStream, TBool aSessionUpdateOngoing ) const |
|
2485 { |
|
2486 SVPDEBUG2( "CSVPUtility::CheckRtcpSettingL aRtcp: %u", aRtcp ); |
|
2487 |
|
2488 TBool rtcpsuppression = ETrue; |
|
2489 if ( CRCSEProfileEntry::EOn == aRtcp ) |
|
2490 { |
|
2491 SVPDEBUG1("CSVPUtility::CheckRtcpSettingL RTCP=ON"); |
|
2492 rtcpsuppression = EFalse; |
|
2493 } |
|
2494 |
|
2495 // At this point we should have only audio streams. Thus the leave. |
|
2496 if ( KMceAudio == aStream.Type() ) |
|
2497 { |
|
2498 if ( !aStream.Source()->IsEnabled() && aSessionUpdateOngoing ) |
|
2499 { |
|
2500 aStream.Source()->EnableL(); |
|
2501 } |
|
2502 |
|
2503 const RPointerArray<CMceMediaSink>& sinks = aStream.Sinks(); |
|
2504 const TInt snkCount = sinks.Count(); |
|
2505 for ( TInt k = 0; k < snkCount; k++ ) |
|
2506 { |
|
2507 |
|
2508 if ( !sinks[k]->IsEnabled()&& aSessionUpdateOngoing ) |
|
2509 { |
|
2510 sinks[k]->EnableL(); |
|
2511 } |
|
2512 |
|
2513 if ( KMceRTPSink == sinks[k]->Type() ) |
|
2514 { |
|
2515 SVPDEBUG2( "CSVPUtility::CheckRtcpSettingL updating: %d", k ); |
|
2516 static_cast<CMceRtpSink*>( |
|
2517 sinks[k] )->UpdateL( rtcpsuppression ); |
|
2518 SVPDEBUG1( "CSspUtility::CheckRtcpSettingL update done" ); |
|
2519 } |
|
2520 } |
|
2521 } |
|
2522 else |
|
2523 { |
|
2524 SVPDEBUG1( "CSspUtility::CheckRtcpSettingL KErrArgument" ); |
|
2525 User::Leave( KErrArgument ); |
|
2526 } |
|
2527 |
|
2528 SVPDEBUG1( "CSspUtility::CheckRtcpSettingL Exit" ); |
|
2529 } |
|
2530 |
|
2531 // --------------------------------------------------------------------------- |
|
2532 // CSVPUtility::SetVADL |
|
2533 // --------------------------------------------------------------------------- |
|
2534 // |
|
2535 void CSVPUtility::SetVADL( CMceAudioStream& aInAudioStream, |
|
2536 TBool aVADSetting, |
|
2537 const TDesC8& aCodecName ) |
|
2538 { |
|
2539 SVPDEBUG1( "CSVPUtility::SetVADL In" ) |
|
2540 |
|
2541 __ASSERT_ALWAYS( &aCodecName, User::Leave( KErrArgument ) ); |
|
2542 |
|
2543 if ( &aInAudioStream ) |
|
2544 { |
|
2545 CMceAudioCodec* codec = SVPAudioUtility::FindCodec( aInAudioStream, aCodecName ); |
|
2546 if ( codec ) |
|
2547 { |
|
2548 SVPDEBUG2( "CSVPUtility aInAudioStream and codec valid, setting VAD with %d", aVADSetting ) |
|
2549 codec->EnableVAD( aVADSetting ); |
|
2550 } |
|
2551 } |
|
2552 |
|
2553 SVPDEBUG1( "CSVPUtility::SetVADL Out" ) |
|
2554 } |
|
2555 |
|
2556 // --------------------------------------------------------------------------- |
|
2557 // CSVPUtility::SetAmrWbParameters |
|
2558 // --------------------------------------------------------------------------- |
|
2559 // |
|
2560 void CSVPUtility::SetAmrWbParameters( CMceAudioStream& aAudioInStream, |
|
2561 const CRCSEAudioCodecEntry& aCodecProfile, |
|
2562 TInt aCodecNumber ) |
|
2563 { |
|
2564 SVPDEBUG1( "CSVPUtility::SetAmrWbParameters In" ) |
|
2565 |
|
2566 TUint allowedBitrates( 0 ); |
|
2567 |
|
2568 // Set correct mode-set |
|
2569 const RArray< TUint32 >& modeSetArray = aCodecProfile.iModeSet; |
|
2570 for ( TInt i = 0; i < modeSetArray.Count(); i++ ) |
|
2571 { |
|
2572 TUint value = modeSetArray[ i ]; |
|
2573 switch ( value ) |
|
2574 { |
|
2575 case 0: { allowedBitrates |= KMceAllowedAmrWbBitrate660; break; } |
|
2576 case 1: { allowedBitrates |= KMceAllowedAmrWbBitrate885; break; } |
|
2577 case 2: { allowedBitrates |= KMceAllowedAmrWbBitrate1265; break; } |
|
2578 case 3: { allowedBitrates |= KMceAllowedAmrWbBitrate1425; break; } |
|
2579 case 4: { allowedBitrates |= KMceAllowedAmrWbBitrate1585; break; } |
|
2580 case 5: { allowedBitrates |= KMceAllowedAmrWbBitrate1825; break; } |
|
2581 case 6: { allowedBitrates |= KMceAllowedAmrWbBitrate1985; break; } |
|
2582 case 7: { allowedBitrates |= KMceAllowedAmrWbBitrate2305; break; } |
|
2583 case 8: { allowedBitrates |= KMceAllowedAmrWbBitrate2305; break; } |
|
2584 case 9: { allowedBitrates |= KMceAllowedAmrWbBitrate2385; break; } |
|
2585 default: { allowedBitrates |= KMceAllowedAmrWbBitrateAll; break; } |
|
2586 } |
|
2587 |
|
2588 SVPDEBUG3( "SetAmrWbParameters round %d, value: %u", |
|
2589 i, value ) |
|
2590 SVPDEBUG2( "SetAmrWbParameters allowedBitrates 0x%x", |
|
2591 allowedBitrates ) |
|
2592 } |
|
2593 |
|
2594 SVPDEBUG2( "SetAmrWbParameters mode-set 0x%x", allowedBitrates ) |
|
2595 |
|
2596 // Set correct mode-change-period (mode-change-period=1): |
|
2597 if ( 2 == aCodecProfile.iModeChangePeriod ) |
|
2598 { |
|
2599 allowedBitrates |= KMceAllowedAmrWbModeChangePeriod2; |
|
2600 } |
|
2601 |
|
2602 // Set correct mode-change-neighbor (mode-change-neighbor=0) |
|
2603 if ( CRCSEAudioCodecEntry::EOn == aCodecProfile.iModeChangeNeighbor ) |
|
2604 { |
|
2605 allowedBitrates |= KMceAllowedAmrWbModeChangeNeighbor1; |
|
2606 } |
|
2607 |
|
2608 aAudioInStream.Codecs()[ aCodecNumber ]->SetAllowedBitrates( |
|
2609 allowedBitrates ); |
|
2610 |
|
2611 SVPDEBUG2( "CSVPUtility::SetAmrWbParameters Out, 0x%x", allowedBitrates ) |
|
2612 } |
|
2613 |
|
2614 // EOF |
|