realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileStateUnregistered.cpp
branchRCL_3
changeset 2 1e1cc61f56c3
parent 0 307788aac0a8
child 12 a7d1e54a7332
equal deleted inserted replaced
1:dd3853b8dc3f 2:1e1cc61f56c3
    25 #include "sipconcreteprofile.h"
    25 #include "sipconcreteprofile.h"
    26 #include "SipProfileCacheItem.h"
    26 #include "SipProfileCacheItem.h"
    27 #include "sipplugindirector.h"
    27 #include "sipplugindirector.h"
    28 #include "sipalrmonitor.h"
    28 #include "sipalrmonitor.h"
    29 #include "SipProfileLog.h"
    29 #include "SipProfileLog.h"
       
    30 #include <featmgr.h>
    30 
    31 
    31 // ============================ MEMBER FUNCTIONS ===============================
    32 // ============================ MEMBER FUNCTIONS ===============================
    32 
    33 
    33 // -----------------------------------------------------------------------------
    34 // -----------------------------------------------------------------------------
    34 // CSIPProfileStateUnregistered::NewL
    35 // CSIPProfileStateUnregistered::NewL
   108     // to oldProfile still, and it got crashes
   109     // to oldProfile still, and it got crashes
   109 	aItem.ClearMigrationProfiles();
   110 	aItem.ClearMigrationProfiles();
   110 	if (aItem.IsActiveState())
   111 	if (aItem.IsActiveState())
   111 		{
   112 		{
   112 		aItem.SendUnregisteredStatusEventL();
   113 		aItem.SendUnregisteredStatusEventL();
   113 
   114 		TBool isVpnInUse = (FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn )
   114 		if (aItem.IsReferred() && !aItem.IsShutdownInitiated() && !aItem.IsRfsInprogress())
   115                                 && aItem.IsVpnInUse());
   115 			{
   116 		
   116 			aItem.ClearOldProfile();
   117         if ( aItem.IsReferred() && !aItem.IsShutdownInitiated() &&
   117 			aItem.StartRegisterL(*iWaitForIAP, *iRegInProg, getIap);
   118                 !aItem.IsRfsInprogress() && !isVpnInUse)
   118 			// CSIPProfileCacheItem::MonitorSnapL stops ALR monitor later if
   119             {
   119 			// updating SNAP.			
   120             aItem.ClearOldProfile();
   120 			return;
   121             aItem.StartRegisterL(*iWaitForIAP, *iRegInProg, getIap);
   121 			}
   122             // CSIPProfileCacheItem::MonitorSnapL stops ALR monitor later if
   122 		}
   123             // updating SNAP.           
       
   124             return;
       
   125             }
       
   126         }
   123 	// Stay unregistered, no need to monitor SNAP
   127 	// Stay unregistered, no need to monitor SNAP
   124 	aItem.StopSnapMonitoring();
   128 	aItem.StopSnapMonitoring();
   125 	iPluginDirector.TerminateHandling(aItem.UsedProfile());
   129 	iPluginDirector.TerminateHandling(aItem.UsedProfile());
   126 	iPluginDirector.StartTimerForCleanup();
   130 	iPluginDirector.StartTimerForCleanup();
   127 	aItem.ClearOldProfile();
   131 	aItem.ClearOldProfile();
   226 
   230 
   227 	CSIPConcreteProfile::TStatus state;
   231 	CSIPConcreteProfile::TStatus state;
   228 	__ASSERT_ALWAYS(
   232 	__ASSERT_ALWAYS(
   229 		iPluginDirector.State(state, aItem.Profile()) == KErrNotFound ||
   233 		iPluginDirector.State(state, aItem.Profile()) == KErrNotFound ||
   230 		state == CSIPConcreteProfile::EUnregistered, User::Leave(KErrArgument));
   234 		state == CSIPConcreteProfile::EUnregistered, User::Leave(KErrArgument));
   231 
   235         TBool isVpnInUse = (FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn )
   232 	if (aItem.IsReferred() && !aItem.IsShutdownInitiated())
   236                              && aItem.IsVpnInUse());
   233 		{
   237         
   234 		aItem.StartRegisterL(*iWaitForIAP, *iRegInProg, ETrue);
   238         if (aItem.IsReferred() && !aItem.IsShutdownInitiated() 
   235 		}
   239                       && !aItem.IsRfsInprogress() && !isVpnInUse)
   236 	}
   240             {
       
   241             aItem.StartRegisterL(*iWaitForIAP, *iRegInProg, ETrue);
       
   242             }	
       
   243         }
   237 
   244 
   238 // -----------------------------------------------------------------------------
   245 // -----------------------------------------------------------------------------
   239 // CSIPProfileStateUnregistered::ErrorOccurred
   246 // CSIPProfileStateUnregistered::ErrorOccurred
   240 // -----------------------------------------------------------------------------
   247 // -----------------------------------------------------------------------------
   241 //
   248 //