diff -r 822e1f077722 -r 2cdd984ec527 realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileServerCore.cpp --- a/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileServerCore.cpp Wed Jun 09 10:04:26 2010 +0300 +++ b/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileServerCore.cpp Mon Jun 21 16:03:44 2010 +0300 @@ -242,6 +242,15 @@ TUint32 aContextId) { CSIPProfileCacheItem* item = ProfileCacheItem(aProfile.Id()); + + if(aContextId == 0 && item) + { + if(item->IsApnSwitchEnabled()) + { + UsePrimaryApn(aProfile.IapId()); + } + } + TRAPD(err, SIPProfileStatusEventL(aProfile.Id(), aContextId)); if (err != KErrNone) @@ -336,7 +345,20 @@ item->IsVpnInUse())) ConfirmSystemstateMonitor(CSipSystemStateMonitor::EVpnState); } - } + + if(FeatureManager::FeatureSupported( KFeatureIdFfSipApnSwitching)) + { + if(item && item->IsApnSwitchEnabled() && aContextId) + { + CSIPConcreteProfile::TStatus status; + iPluginDirector->State( status, item->Profile() ); + if(status == CSIPConcreteProfile::EUnregistered) + { + UseBackupApn(item->Profile().IapId(), EFalse); + } + } + } + } CheckServerStatus(); } @@ -1645,26 +1667,33 @@ CSIPConcreteProfile::TStatus aStatus, TInt aError) { - TInt err(aError); - if (aStatus == CSIPConcreteProfile::EUnregistrationInProgress) + PROFILE_DEBUG3("CSIPProfileServerCore::HandleAsyncError, error", aError) + TBool isFatal(EFalse); + if(aError != KErrSIPApnSwitchNonFatalFailure) { - err = KErrNone; - } + TInt err(aError); + if (aStatus == CSIPConcreteProfile::EUnregistrationInProgress) + { + err = KErrNone; + } - if (HandleProfileError(aItem, err)) - { - if (err == KErrTotalLossOfPrecision) - { - TRAP_IGNORE(SendUnregisteredStatusEventL(aItem)) - } - else - { - SendErrorEvent(aItem, aStatus, aError); - } - } + if (HandleProfileError(aItem, err)) + { + if (err == KErrTotalLossOfPrecision) + { + TRAP_IGNORE(SendUnregisteredStatusEventL(aItem)) + } + else + { + SendErrorEvent(aItem, aStatus, aError); + isFatal = ETrue; + } + } + } + if(aItem.IsApnSwitchEnabled()) { - UseBackupApn(aItem.Profile().IapId(), ETrue); + UseBackupApn(aItem.Profile().IapId(), isFatal); } } @@ -2400,7 +2429,7 @@ { PROFILE_DEBUG1("CSIPProfileServerCore::UseBackupApn") - if ( iApnManager->IsFailed( aIapId ) || aFatalFailure ) + if ( !iApnManager->IsFailed( aIapId ) || aFatalFailure ) { iApnManager->SetFailed( aIapId, ETrue, aFatalFailure ); }