3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
8 * Version : %version: be1sipx1#42.1.4.1.4 % << Don't touch! Updated by Synergy at check-out. |
|
9 * |
8 * |
10 * Initial Contributors: |
9 * Initial Contributors: |
11 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
12 * |
11 * |
13 * Contributors: |
12 * Contributors: |
93 // |
92 // |
94 void CMusAvaRegisterAvailability::ConstructL() |
93 void CMusAvaRegisterAvailability::ConstructL() |
95 { |
94 { |
96 iSharedObj = CMusAvaSharedObject::GetSingletonL(); |
95 iSharedObj = CMusAvaSharedObject::GetSingletonL(); |
97 iSharedObj->MusAvaSip().AddAdapterL( *this ); |
96 iSharedObj->MusAvaSip().AddAdapterL( *this ); |
98 iOperatorVariant = MultimediaSharingSettings::OperatorVariantSettingL(); |
|
99 } |
97 } |
100 |
98 |
101 |
99 |
102 // ----------------------------------------------------------------------------- |
100 // ----------------------------------------------------------------------------- |
103 // Constructor. |
101 // Constructor. |
118 // |
116 // |
119 void CMusAvaRegisterAvailability::DoExecuteL() |
117 void CMusAvaRegisterAvailability::DoExecuteL() |
120 { |
118 { |
121 MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::DoExecuteL " ) |
119 MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::DoExecuteL " ) |
122 SetState( MMusAvaObserver::EMusAvaStatusInProgress ); |
120 SetState( MMusAvaObserver::EMusAvaStatusInProgress ); |
123 TRAPD( err, RegisterL() ); |
121 RegisterL(); |
124 if( err != KErrNone ) |
|
125 { |
|
126 SetState( MMusAvaObserver::EMusAvaStatusNotRegistered ); |
|
127 } |
|
128 // TBD: SetState( MMusAvaObserver::EMusAvaNameRegistration ); |
122 // TBD: SetState( MMusAvaObserver::EMusAvaNameRegistration ); |
129 |
123 |
130 MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::DoExecuteL " ) |
124 MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::DoExecuteL " ) |
131 } |
125 } |
132 |
126 |
282 |
276 |
283 case MSIPProfileRegistryObserver::EProfileDeregistered: |
277 case MSIPProfileRegistryObserver::EProfileDeregistered: |
284 { |
278 { |
285 MUS_LOG( "mus: [MUSAVA] Profile is deregistered" ) |
279 MUS_LOG( "mus: [MUSAVA] Profile is deregistered" ) |
286 SetState( MMusAvaObserver::EMusAvaStatusNotRegistered ); |
280 SetState( MMusAvaObserver::EMusAvaStatusNotRegistered ); |
287 iSharedObj->MusAvaSip().DeleteSIPConnection(); |
|
288 } |
281 } |
289 break; |
282 break; |
290 |
283 |
291 case MSIPProfileRegistryObserver::EProfileDestroyed: |
284 case MSIPProfileRegistryObserver::EProfileDestroyed: |
292 { |
285 { |
315 // corresponding profile instantiated. |
308 // corresponding profile instantiated. |
316 // ----------------------------------------------------------------------------- |
309 // ----------------------------------------------------------------------------- |
317 // |
310 // |
318 void CMusAvaRegisterAvailability::ProfileRegistryErrorOccurred( |
311 void CMusAvaRegisterAvailability::ProfileRegistryErrorOccurred( |
319 TUint32 aProfileId, |
312 TUint32 aProfileId, |
320 TInt aError ) |
313 TInt /* aError */ ) |
321 { |
314 { |
322 MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::\ |
315 MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::\ |
323 ProfileRegistryErrorOccurred" ) |
316 ProfileRegistryErrorOccurred" ) |
324 |
317 |
325 CSIPProfile* profile = iSharedObj->MusAvaSip().Profile(); |
318 CSIPProfile* profile = iSharedObj->MusAvaSip().Profile(); |
332 |
325 |
333 profile->GetParameter( KSIPProfileId, profileId ); |
326 profile->GetParameter( KSIPProfileId, profileId ); |
334 |
327 |
335 if( profileId == aProfileId ) |
328 if( profileId == aProfileId ) |
336 { |
329 { |
337 if ( iOperatorVariant == MusSettingsKeys::EOperatorSpecific && |
330 SetState( MMusAvaObserver::EMusAvaStatusNotRegistered ); |
338 aError == KErrGeneral ) |
|
339 { |
|
340 MUS_LOG( "SIP profile is disabled by the user" ) |
|
341 SetState( MMusAvaObserver::EMusActivationError ); |
|
342 } |
|
343 else |
|
344 { |
|
345 MUS_LOG1("Error %d",aError ) |
|
346 SetState( MMusAvaObserver::EMusAvaStatusNotRegistered ); |
|
347 } |
|
348 } |
331 } |
349 |
332 |
350 MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::\ |
333 MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::\ |
351 ProfileRegistryErrorOccurred" ) |
334 ProfileRegistryErrorOccurred" ) |
352 } |
335 } |
501 void CMusAvaRegisterAvailability::EnableRegisterL() |
484 void CMusAvaRegisterAvailability::EnableRegisterL() |
502 { |
485 { |
503 MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::EnableRegisterL " ) |
486 MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::EnableRegisterL " ) |
504 MUS_LOG( "mus: [MUSAVA] Fetch SIP ProfileRegistry" ) |
487 MUS_LOG( "mus: [MUSAVA] Fetch SIP ProfileRegistry" ) |
505 |
488 |
506 CSIPProfileRegistry& registry = iSharedObj->MusAvaSip().ProfileRegistryL(); |
489 CSIPProfileRegistry& registry = iSharedObj->MusAvaSip().ProfileRegistryL(); |
507 MUS_LOG( "mus: [MUSAVA] Profile status" ) |
490 MUS_LOG( "mus: [MUSAVA] Profile status" ) |
508 if ( !registry.IsEnabled( *iSharedObj->MusAvaSip().Profile() ) ) |
491 if ( !registry.IsEnabled( *iSharedObj->MusAvaSip().Profile() ) ) |
509 { |
492 { |
510 MUS_LOG("mus: [MUSAVA] Calling EnableL()" ) |
493 MUS_LOG("mus: [MUSAVA] Calling EnableL()" ) |
511 registry.EnableL( *iSharedObj->MusAvaSip().Profile(), |
494 registry.EnableL( *iSharedObj->MusAvaSip().Profile(), |
512 iSharedObj->MusAvaSip().ConnectionObserver() ); |
495 iSharedObj->MusAvaSip().ConnectionObserver() ); |
513 } |
496 } |
514 |
497 |
515 // Try to write client information to CenRep of client resolver. |
498 // Try to write client information to CenRep of client resolver. |
516 // This functionality is needed in __VOIP enabled terminals. |
499 // This functionality is needed in __VOIP enabled terminals. |
517 // In __VOIP disabled builds this will fail because of a lack of needed |
500 // In __VOIP disabled builds this will fail because of a lack of needed |
518 // CenRep UID. To avoid branching, we just try to do this and let it fail |
501 // CenRep UID. To avoid branching, we just try to do this and let it fail |
519 // in normal build. |
502 // in normal build. |
520 CMusAvaClientResolverUtil* resolver = |
503 CMusAvaClientResolverUtil* resolver = |
521 iSharedObj->MusAvaSip().ClientResolverUtil(); |
504 iSharedObj->MusAvaSip().ClientResolverUtil(); |
522 if ( resolver ) |
505 if ( resolver ) |
523 { |
506 { |
524 TRAP_IGNORE( resolver->RegisterClientWithUserL( |
507 TRAP_IGNORE( resolver->RegisterClientWithUserL( |
525 *iSharedObj->MusAvaSip().Profile() ) ) |
508 *iSharedObj->MusAvaSip().Profile() ) ) |
526 } |
509 } |
527 |
510 |
528 MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::EnableRegisterL " ) |
511 MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::EnableRegisterL " ) |
529 } |
512 } |
530 |
513 |
531 |
514 |
532 // ----------------------------------------------------------------------------- |
515 // ----------------------------------------------------------------------------- |
533 // Update SIP Registration. |
516 // Update SIP Registration. |