87 CVPNConnAgt::~CVPNConnAgt() |
87 CVPNConnAgt::~CVPNConnAgt() |
88 { |
88 { |
89 LOG(TName name; |
89 LOG(TName name; |
90 name.AppendFormat(_L("[0x%08x]"), this); |
90 name.AppendFormat(_L("[0x%08x]"), this); |
91 Log::Printf(_L("%s Destructing VPN Connection Agent\n"),name.PtrZ())); |
91 Log::Printf(_L("%s Destructing VPN Connection Agent\n"),name.PtrZ())); |
92 |
92 |
93 if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) ) |
|
94 { |
|
95 delete iSipObserver; |
|
96 iSipObserver = NULL; |
|
97 } |
|
98 |
|
99 if ( iFeatureManagerInitialized ) |
93 if ( iFeatureManagerInitialized ) |
100 { |
94 { |
101 // We can safely call UnInitializeLib as we have really intialized it. |
95 // We can safely call UnInitializeLib as we have really intialized it. |
102 FeatureManager::UnInitializeLib(); // Decreases ref.count |
96 FeatureManager::UnInitializeLib(); // Decreases ref.count |
103 } |
97 } |
105 iEventMediator.Close(); |
99 iEventMediator.Close(); |
106 |
100 |
107 iServiceStartedCallback.Cancel(); |
101 iServiceStartedCallback.Cancel(); |
108 iConnectCompleteCallback.Cancel(); |
102 iConnectCompleteCallback.Cancel(); |
109 iDisconnectCallback.Cancel(); |
103 iDisconnectCallback.Cancel(); |
|
104 |
|
105 delete iSipObserver; |
|
106 iSipObserver = NULL; |
|
107 |
|
108 LOG_("CVPNConnAgt::~CVPNConnAgt end"); |
110 } |
109 } |
111 |
110 |
112 // --------------------------------------------------------------------------- |
111 // --------------------------------------------------------------------------- |
113 // NewL() |
112 // NewL() |
114 // --------------------------------------------------------------------------- |
113 // --------------------------------------------------------------------------- |
131 LOG_1("[0x%08x] Constructing VPN Connection Agent\n", this); |
130 LOG_1("[0x%08x] Constructing VPN Connection Agent\n", this); |
132 // construct the database and dialog processor |
131 // construct the database and dialog processor |
133 CAgentBase::ConstructL(); |
132 CAgentBase::ConstructL(); |
134 iConnected = EFalse; |
133 iConnected = EFalse; |
135 iDisconnecting = EFalse; |
134 iDisconnecting = EFalse; |
136 LOG_("CVPNConnAgt::ReadConfigurationL EventMediator"); |
135 |
137 User::LeaveIfError(iEventMediator.Connect()); |
|
138 |
|
139 // Initialize Feature Manager. |
136 // Initialize Feature Manager. |
140 FeatureManager::InitializeLibL(); // Successfull call increases reference count |
137 FeatureManager::InitializeLibL(); // Successfull call increases reference count |
141 iFeatureManagerInitialized = ETrue; |
138 iFeatureManagerInitialized = ETrue; |
142 |
139 |
143 // Create CVpnSipObserver for communicating with SIP profile server via |
140 // Create CVpnSipObserver for communicating with SIP profile server via |
144 // P&S keys for SIP de/re-registration. this pointer is passed to have call back. |
141 // P&S keys for SIP de/re-registration. this pointer is passed to have call back. |
145 if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) ) |
142 if ( FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) ) |
146 { |
143 { |
|
144 LOG_("CVPNConnAgt::ConstructL FfImsDeregistrationInVpn"); |
147 iSipObserver = CVpnSipObserver::NewL( *this ); |
145 iSipObserver = CVpnSipObserver::NewL( *this ); |
148 } |
146 } |
|
147 |
|
148 User::LeaveIfError(iEventMediator.Connect()); |
|
149 |
|
150 LOG_("CVPNConnAgt::ConstructL end"); |
149 } |
151 } |
150 |
152 |
151 // --------------------------------------------------------------------------- |
153 // --------------------------------------------------------------------------- |
152 // Info() |
154 // Info() |
153 // --------------------------------------------------------------------------- |
155 // --------------------------------------------------------------------------- |