vpnengine/vpnconnagt/src/vpnconnagt.cpp
branchRCL_3
changeset 18 74294b43d401
parent 16 f1aca2058253
equal deleted inserted replaced
17:d1a0d37b52a1 18:74294b43d401
   125 // ConstructL() 
   125 // ConstructL() 
   126 // ---------------------------------------------------------------------------
   126 // ---------------------------------------------------------------------------
   127 //
   127 //
   128 inline void CVPNConnAgt::ConstructL()
   128 inline void CVPNConnAgt::ConstructL()
   129     {
   129     {
       
   130     
   130     LOG_1("[0x%08x] Constructing VPN Connection Agent\n", this);
   131     LOG_1("[0x%08x] Constructing VPN Connection Agent\n", this);
   131     // construct the database and dialog processor
   132     // construct the database and dialog processor
   132     CAgentBase::ConstructL();
   133     CAgentBase::ConstructL();
   133     iConnected = EFalse;
   134     iConnected = EFalse;
   134     iDisconnecting = EFalse;
   135     iDisconnecting = EFalse;
   330     // Multiple VPN connection use cases are handled in SIP side.  VPN just notifies SIP
   331     // Multiple VPN connection use cases are handled in SIP side.  VPN just notifies SIP
   331     // a VPN session is about to start.
   332     // a VPN session is about to start.
   332     if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) )
   333     if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) )
   333         {
   334         {
   334         // For some reason, if the request fails, just proceeds.
   335         // For some reason, if the request fails, just proceeds.
   335         if ( iSipObserver->RequestDeregister() != KErrNone )
   336         TInt err = iSipObserver->RequestDeregister();
       
   337         if ( err != KErrNone )
   336             {
   338             {
       
   339             LOG_1( "CVPNConnAgt::ServiceStarted:  iSipObserver->RequestDeregister failed with %d", err );
   337             ProceedServiceStart();
   340             ProceedServiceStart();
   338             }
   341             }
   339         // Return for now. ProceedServiceStart() will be called later by iSipObserver when
   342         // Return for now. ProceedServiceStart() will be called later by iSipObserver when
   340         // deregistration process has been completed. Then VPN start process will be actually
   343         // deregistration process has been completed. Then VPN start process will be actually
   341         // initiated.
   344         // initiated.
   471 
   474 
   472     if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) )
   475     if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) )
   473         {
   476         {
   474         // SIP is re-registered when a VPN session ends.
   477         // SIP is re-registered when a VPN session ends.
   475         // Note: return value ignored. Nothing to do here for error cases.
   478         // Note: return value ignored. Nothing to do here for error cases.
   476         iSipObserver->RequestRegister();
   479         TInt err = iSipObserver->RequestRegister();
       
   480         if (err != KErrNone)
       
   481             {
       
   482             LOG(Log::Printf(_L("SipObserver->RequestRegister failed with %d\n"), err));
       
   483             }
   477         }
   484         }
   478 
   485 
   479     iNotify->AgentProgress(EVPNConnAgtDisconnected, KErrNone);
   486     iNotify->AgentProgress(EVPNConnAgtDisconnected, KErrNone);
   480     iNotify->DisconnectComplete();
   487     iNotify->DisconnectComplete();
   481     iDisconnecting = EFalse;
   488     iDisconnecting = EFalse;
   570                 
   577                 
   571             if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) )
   578             if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) )
   572                 {
   579                 {
   573                 // SIP is re-registered when a VPN session ends.
   580                 // SIP is re-registered when a VPN session ends.
   574                 // Note: return value ignored. Nothing to do here for error cases.
   581                 // Note: return value ignored. Nothing to do here for error cases.
   575                 iSipObserver->RequestRegister();
   582                 TInt err = iSipObserver->RequestRegister();
       
   583                 if (err != KErrNone)
       
   584                     {
       
   585                     LOG(Log::Printf(_L("SipObserver->RequestRegister failed with %d\n"), err));
       
   586                     }
   576                 }    
   587                 }    
   577             
   588             
   578             closeData = (TCloseVpnConnEventData*)(aData->Ptr());
   589             closeData = (TCloseVpnConnEventData*)(aData->Ptr());
   579             if ( closeData->iTaskStatus )
   590             if ( closeData->iTaskStatus )
   580                 {
   591                 {