240 // |
240 // |
241 void CSIPProfileServerCore::SIPProfileStatusEvent(CSIPConcreteProfile& aProfile, |
241 void CSIPProfileServerCore::SIPProfileStatusEvent(CSIPConcreteProfile& aProfile, |
242 TUint32 aContextId) |
242 TUint32 aContextId) |
243 { |
243 { |
244 CSIPProfileCacheItem* item = ProfileCacheItem(aProfile.Id()); |
244 CSIPProfileCacheItem* item = ProfileCacheItem(aProfile.Id()); |
|
245 |
|
246 if(aContextId == 0 && item) |
|
247 { |
|
248 if(item->IsApnSwitchEnabled()) |
|
249 { |
|
250 UsePrimaryApn(aProfile.IapId()); |
|
251 } |
|
252 } |
|
253 |
245 TRAPD(err, SIPProfileStatusEventL(aProfile.Id(), aContextId)); |
254 TRAPD(err, SIPProfileStatusEventL(aProfile.Id(), aContextId)); |
246 |
255 |
247 if (err != KErrNone) |
256 if (err != KErrNone) |
248 { |
257 { |
249 if (item) |
258 if (item) |
334 ConfirmSystemstateMonitor(CSipSystemStateMonitor::ESystemState); |
343 ConfirmSystemstateMonitor(CSipSystemStateMonitor::ESystemState); |
335 else if((FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn )&& |
344 else if((FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn )&& |
336 item->IsVpnInUse())) |
345 item->IsVpnInUse())) |
337 ConfirmSystemstateMonitor(CSipSystemStateMonitor::EVpnState); |
346 ConfirmSystemstateMonitor(CSipSystemStateMonitor::EVpnState); |
338 } |
347 } |
339 } |
348 |
|
349 if(FeatureManager::FeatureSupported( KFeatureIdFfSipApnSwitching)) |
|
350 { |
|
351 if(item && item->IsApnSwitchEnabled() && aContextId) |
|
352 { |
|
353 CSIPConcreteProfile::TStatus status; |
|
354 iPluginDirector->State( status, item->Profile() ); |
|
355 if(status == CSIPConcreteProfile::EUnregistered) |
|
356 { |
|
357 UseBackupApn(item->Profile().IapId(), EFalse); |
|
358 } |
|
359 } |
|
360 } |
|
361 } |
340 CheckServerStatus(); |
362 CheckServerStatus(); |
341 } |
363 } |
342 |
364 |
343 // ----------------------------------------------------------------------------- |
365 // ----------------------------------------------------------------------------- |
344 // CSIPProfileServerCore::SIPProfileErrorEvent |
366 // CSIPProfileServerCore::SIPProfileErrorEvent |
1643 // |
1665 // |
1644 void CSIPProfileServerCore::HandleAsyncError(CSIPProfileCacheItem& aItem, |
1666 void CSIPProfileServerCore::HandleAsyncError(CSIPProfileCacheItem& aItem, |
1645 CSIPConcreteProfile::TStatus aStatus, |
1667 CSIPConcreteProfile::TStatus aStatus, |
1646 TInt aError) |
1668 TInt aError) |
1647 { |
1669 { |
1648 TInt err(aError); |
1670 PROFILE_DEBUG3("CSIPProfileServerCore::HandleAsyncError, error", aError) |
1649 if (aStatus == CSIPConcreteProfile::EUnregistrationInProgress) |
1671 TBool isFatal(EFalse); |
1650 { |
1672 if(aError != KErrSIPApnSwitchNonFatalFailure) |
1651 err = KErrNone; |
1673 { |
1652 } |
1674 TInt err(aError); |
1653 |
1675 if (aStatus == CSIPConcreteProfile::EUnregistrationInProgress) |
1654 if (HandleProfileError(aItem, err)) |
1676 { |
1655 { |
1677 err = KErrNone; |
1656 if (err == KErrTotalLossOfPrecision) |
1678 } |
1657 { |
1679 |
1658 TRAP_IGNORE(SendUnregisteredStatusEventL(aItem)) |
1680 if (HandleProfileError(aItem, err)) |
1659 } |
1681 { |
1660 else |
1682 if (err == KErrTotalLossOfPrecision) |
1661 { |
1683 { |
1662 SendErrorEvent(aItem, aStatus, aError); |
1684 TRAP_IGNORE(SendUnregisteredStatusEventL(aItem)) |
1663 } |
1685 } |
1664 } |
1686 else |
|
1687 { |
|
1688 SendErrorEvent(aItem, aStatus, aError); |
|
1689 isFatal = ETrue; |
|
1690 } |
|
1691 } |
|
1692 } |
|
1693 |
1665 if(aItem.IsApnSwitchEnabled()) |
1694 if(aItem.IsApnSwitchEnabled()) |
1666 { |
1695 { |
1667 UseBackupApn(aItem.Profile().IapId(), ETrue); |
1696 UseBackupApn(aItem.Profile().IapId(), isFatal); |
1668 } |
1697 } |
1669 } |
1698 } |
1670 |
1699 |
1671 // ----------------------------------------------------------------------------- |
1700 // ----------------------------------------------------------------------------- |
1672 // CSIPProfileServerCore::ReleaseStorage |
1701 // CSIPProfileServerCore::ReleaseStorage |
2398 // |
2427 // |
2399 void CSIPProfileServerCore::UseBackupApn( TUint32 aIapId, TBool aFatalFailure ) |
2428 void CSIPProfileServerCore::UseBackupApn( TUint32 aIapId, TBool aFatalFailure ) |
2400 { |
2429 { |
2401 PROFILE_DEBUG1("CSIPProfileServerCore::UseBackupApn") |
2430 PROFILE_DEBUG1("CSIPProfileServerCore::UseBackupApn") |
2402 |
2431 |
2403 if ( iApnManager->IsFailed( aIapId ) || aFatalFailure ) |
2432 if ( !iApnManager->IsFailed( aIapId ) || aFatalFailure ) |
2404 { |
2433 { |
2405 iApnManager->SetFailed( aIapId, ETrue, aFatalFailure ); |
2434 iApnManager->SetFailed( aIapId, ETrue, aFatalFailure ); |
2406 } |
2435 } |
2407 |
2436 |
2408 PROFILE_DEBUG1("CSIPIMSProfileAgent::UseBackupApn, exit") |
2437 PROFILE_DEBUG1("CSIPIMSProfileAgent::UseBackupApn, exit") |