author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 00:16:48 +0300 | |
changeset 77 | 2be0b271d017 |
parent 56 | 5bcb308bd24d |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Implementation of CPhoneVoIPErrorMessagesHandler class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// INCLUDES |
|
19 |
||
20 |
#include <ccpdefs.h> |
|
21 |
#include <mpeengineinfo.h> |
|
22 |
#include <StringLoader.h> |
|
23 |
#include <spsettings.h> |
|
24 |
#include <spentry.h> |
|
25 |
#include <telephonydomainpskeys.h> |
|
26 |
#include <aknnotedialog.h> |
|
27 |
#include "cphonevoiperrormessageshandler.h" |
|
28 |
#include "cphonemainerrormessageshandler.h" |
|
29 |
#include "cphoneerrormessageshandler.h" |
|
30 |
#include "cphonestatehandle.h" |
|
31 |
#include "phonerssvoip.h" |
|
32 |
#include "phonelogger.h" |
|
33 |
#include "tphonecmdparamglobalnote.h" |
|
34 |
#include "tphonecmdparaminteger.h" |
|
35 |
#include "cphonemainresourceresolver.h" |
|
36 |
#include "phoneui.pan" |
|
37 |
#include "cphonepubsubproxy.h" |
|
38 |
#include "tphonecmdparamboolean.h" |
|
39 |
#include "cphonestatemachinevoip.h" |
|
40 |
#include "cphonecustomizationvoip.h" |
|
41 |
||
42 |
// ================= MEMBER FUNCTIONS ======================= |
|
43 |
||
44 |
// C++ default constructor can NOT contain any code, that |
|
45 |
// might leave. |
|
46 |
// |
|
47 |
CPhoneVoIPErrorMessagesHandler::CPhoneVoIPErrorMessagesHandler( |
|
48 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
49 |
MPhoneStateMachine* aPhoneStateMachine ) : |
|
50 |
CPhoneErrorMessagesHandler( aViewCommandHandle, aPhoneStateMachine ) |
|
51 |
{ |
|
52 |
static_cast<CPhoneStateMachineVoIP*>( iStateMachine )-> |
|
53 |
SetVoipErrorMessageHandler( *this ); |
|
54 |
} |
|
55 |
||
56 |
// ----------------------------------------------------------- |
|
57 |
// CPhoneErrorMessagesHandler::~CPhoneErrorMessagesHandler() |
|
58 |
// Destructor |
|
59 |
// (other items were commented in a header). |
|
60 |
// ----------------------------------------------------------- |
|
61 |
// |
|
62 |
CPhoneVoIPErrorMessagesHandler::~CPhoneVoIPErrorMessagesHandler() |
|
63 |
{ |
|
64 |
||
65 |
} |
|
66 |
||
67 |
// ----------------------------------------------------------------------------- |
|
68 |
// CPhoneVoIPErrorMessagesHandler::ConstructL |
|
69 |
// Symbian 2nd phase constructor can leave. |
|
70 |
// ----------------------------------------------------------------------------- |
|
71 |
// |
|
72 |
void CPhoneVoIPErrorMessagesHandler::ConstructL() |
|
73 |
{ |
|
74 |
// Register error handler |
|
75 |
CPhoneMainErrorMessagesHandler::Instance()-> |
|
76 |
RegisterErrorMessagesHandler( this ); |
|
77 |
} |
|
78 |
||
79 |
// ----------------------------------------------------------- |
|
80 |
// CPhoneVoIPErrorMessagesHandler::NewL() |
|
81 |
// Constructor |
|
82 |
// ----------------------------------------------------------- |
|
83 |
// |
|
84 |
CPhoneVoIPErrorMessagesHandler* CPhoneVoIPErrorMessagesHandler::NewL( |
|
85 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
86 |
MPhoneStateMachine* aPhoneStateMachine ) |
|
87 |
{ |
|
88 |
CPhoneVoIPErrorMessagesHandler* self = |
|
89 |
new( ELeave ) CPhoneVoIPErrorMessagesHandler( |
|
90 |
aViewCommandHandle, |
|
91 |
aPhoneStateMachine ); |
|
92 |
CleanupStack::PushL( self ); |
|
93 |
self->ConstructL(); |
|
94 |
CleanupStack::Pop( self ); |
|
95 |
return self; |
|
96 |
} |
|
97 |
||
98 |
// ----------------------------------------------------------- |
|
99 |
// CPhoneVoIPErrorMessagesHandler::ShowErrorSpecificNoteL |
|
100 |
// ----------------------------------------------------------- |
|
101 |
// |
|
102 |
void CPhoneVoIPErrorMessagesHandler::ShowErrorSpecificNoteL( |
|
103 |
const TPEErrorInfo& aErrorInfo ) |
|
104 |
{ |
|
105 |
__LOGMETHODSTARTEND(PhoneUIVoIPExtension, "CPhoneVoipErrorMessagesHandler::ShowErrorSpecificNoteL()"); |
|
106 |
||
107 |
__PHONELOG1( EBasic, PhoneUIVoIPExtension, |
|
108 |
"CPhoneVoIPErrorMessagesHandler::ShowErrorSpecificNoteL - aErrorInfo.iErrorCode =%d ", |
|
109 |
aErrorInfo.iErrorCode); |
|
110 |
||
111 |
if ( aErrorInfo.iErrorType == EPECcp && IsVoIPCall( aErrorInfo.iCallId ) ) |
|
112 |
{ |
|
113 |
switch( aErrorInfo.iErrorCode ) |
|
114 |
{ |
|
115 |
case ECCPErrorNotAcceptable: |
|
116 |
case ECCPErrorCCServiceNotImplemented: |
|
117 |
SendGlobalErrorNoteL( EPhoneVoIPNoAudioSupport ); |
|
118 |
break; |
|
119 |
||
120 |
case ECCPLocalResumeFail: |
|
121 |
if ( HasSwapFailed() ) |
|
122 |
{ |
|
123 |
SendGlobalErrorNoteL( EPhoneVoIPSwapFail ); |
|
124 |
} |
|
125 |
else |
|
126 |
{ |
|
127 |
HandleHoldErrorNotesL( aErrorInfo.iCallId, EFalse ); |
|
128 |
} |
|
129 |
break; |
|
130 |
case ECCPLocalHoldFail: |
|
131 |
if ( HasSwapFailed() ) |
|
132 |
{ |
|
133 |
SendGlobalErrorNoteL( EPhoneVoIPSwapFail ); |
|
134 |
} |
|
135 |
else |
|
136 |
{ |
|
137 |
HandleHoldErrorNotesL( aErrorInfo.iCallId, ETrue ); |
|
138 |
} |
|
139 |
break; |
|
140 |
||
141 |
case ECCPServerFailure: |
|
142 |
case ECCPErrorNetworkBusy: |
|
143 |
SendGlobalErrorNoteL( EPhoneVoIPNoService ); |
|
144 |
break; |
|
145 |
||
146 |
case ECCPErrorNotReached: |
|
147 |
SendGlobalErrorNoteL( EPhoneVoIPNotFound ); |
|
148 |
break; |
|
149 |
case ECCPErrorCCIncompatibleDestination: |
|
150 |
SendGlobalErrorNoteL( EPhoneVoIPAddressNotInUse ); |
|
151 |
break; |
|
152 |
||
153 |
case ECCPErrorTimedOut: |
|
154 |
case ECCPErrorCCNoRouteToDestination: |
|
155 |
SendGlobalErrorNoteL( EPhoneVoIPRequestTimeOut ); |
|
156 |
break; |
|
157 |
||
158 |
case KErrArgument: |
|
159 |
case ECCPErrorInvalidPhoneNumber: |
|
160 |
case ECCPErrorInvalidURI: |
|
161 |
SendGlobalErrorNoteL( EPhoneVoIPInvalidRecipientAddress ); |
|
162 |
break; |
|
163 |
||
164 |
case ECCPErrorBusy: |
|
165 |
case ECCPErrorCCCallRejected: |
|
166 |
SendGlobalErrorNoteL( EPhoneVoIPNumberBusy ); |
|
167 |
break; |
|
168 |
||
169 |
case ECCPErrorMovedPermanently: |
|
170 |
SendGlobalErrorNoteL( EPhoneVoIPAddressNotInUse ); |
|
171 |
break; |
|
172 |
||
173 |
case ECCPErrorCCUserNotResponding: |
|
174 |
case ECCPErrorNotResponding: |
|
175 |
||
176 |
SendGlobalErrorNoteL( EPhoneVoIPNoAnswer ); |
|
177 |
break; |
|
178 |
||
179 |
case ECCPGlobalFailure: |
|
180 |
SendGlobalErrorNoteL( EPhoneVoIPErrorInConnection ); |
|
181 |
break; |
|
182 |
||
183 |
case ECCPSecureCallFailed: |
|
184 |
case ECCPErrorUnacceptableChannel: |
|
185 |
SendGlobalErrorNoteL( EPhoneSSNotificationTextVoipSipsFailed ); |
|
186 |
break; |
|
187 |
||
188 |
case ECCPErrorNetworkOutOfOrder: |
|
189 |
case ECCPErrorMedia: |
|
190 |
SendGlobalErrorNoteL( EPhoneVoIPNetworkError ); |
|
191 |
break; |
|
192 |
||
193 |
case ECCPTransferFailed: |
|
194 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote ); |
|
195 |
SendGlobalErrorNoteL( EPhoneVoIPTransferFail ); |
|
196 |
break; |
|
197 |
||
198 |
case ECCPErrorNoService: |
|
199 |
{ |
|
200 |
TInt serviceID = iStateMachine->PhoneEngineInfo()->ServiceId( |
|
201 |
aErrorInfo.iCallId ); |
|
202 |
ShowErrorNoteWithServiceNameL( EPhoneVoIPServiceUnavailable, |
|
203 |
serviceID ); |
|
204 |
} |
|
205 |
break; |
|
206 |
default: |
|
207 |
CPhoneErrorMessagesHandler::ShowErrorSpecificNoteL( aErrorInfo ); |
|
208 |
break; |
|
209 |
} |
|
210 |
} |
|
211 |
else if ( aErrorInfo.iErrorType == EPECch ) |
|
212 |
{ |
|
213 |
ShowRegistrationErrorNotesL( aErrorInfo.iErrorCode ); |
|
214 |
} |
|
215 |
else |
|
216 |
{ |
|
217 |
CPhoneErrorMessagesHandler::ShowErrorSpecificNoteL( aErrorInfo ); |
|
218 |
} |
|
219 |
} |
|
220 |
||
221 |
// ----------------------------------------------------------- |
|
222 |
// CPhoneVoipErrorMessagesHandler::IsVoIPCall |
|
223 |
// ----------------------------------------------------------- |
|
224 |
// |
|
225 |
TBool CPhoneVoIPErrorMessagesHandler::IsVoIPCall( const TInt aCallId ) const |
|
226 |
{ |
|
227 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension, "CPhoneVoIPErrorMessagesHandler::IsVoipCall() "); |
|
228 |
||
229 |
if( aCallId == KErrNotFound ) |
|
230 |
{ |
|
231 |
// Illegal call id, check call type command |
|
232 |
return ( iStateMachine->PhoneEngineInfo()->CallTypeCommand() |
|
233 |
== EPECallTypeVoIP ); |
|
234 |
} |
|
235 |
||
236 |
return ( iStateMachine->PhoneEngineInfo() |
|
237 |
->CallType( aCallId )== EPECallTypeVoIP ); |
|
238 |
} |
|
239 |
||
240 |
// ----------------------------------------------------------- |
|
241 |
// CPhoneVoipErrorMessagesHandler::HandleHoldErrorNotesL |
|
242 |
// ----------------------------------------------------------- |
|
243 |
// |
|
244 |
void CPhoneVoIPErrorMessagesHandler::HandleHoldErrorNotesL( |
|
245 |
const TInt aCallId, TBool aHold ) |
|
246 |
{ |
|
247 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension, "CPhoneVoIPErrorMessagesHandler::HandleHoldNoteL()"); |
|
248 |
||
249 |
TPhoneCmdParamGlobalNote globalNoteParam; |
|
250 |
HBufC* text = HBufC::NewLC( KPhoneContactNameMaxLength ); |
|
251 |
TPtr tmp = text->Des(); |
|
252 |
||
253 |
// Should add name( or RemotePartyName or CompanyName) to Note, if someone found |
|
254 |
GetRemoteInfoDataL( aCallId, tmp ); |
|
255 |
||
256 |
if ( text->Length() ) |
|
257 |
{ |
|
258 |
// RemotePartyName, CompanyName or RemoteName found |
|
259 |
// Resource text which will use found text will be loaded later |
|
260 |
TInt resource( EPhoneVoIPResumeFail ); |
|
261 |
if ( aHold ) |
|
262 |
{ |
|
263 |
resource = EPhoneVoIPHoldFail; |
|
264 |
} |
|
265 |
||
266 |
// qtn_voip_resume_failed / qtn_voip_hold_failed |
|
267 |
globalNoteParam.SetTextResourceId( |
|
268 |
CPhoneMainResourceResolver::Instance()-> |
|
269 |
ResolveResourceID( resource ) ); |
|
270 |
} |
|
271 |
else |
|
272 |
{ |
|
273 |
// Decides note with call id |
|
274 |
// Resource is loaded here |
|
275 |
TInt resource = EPhoneVoIPResumeNumberFail; |
|
276 |
if ( aHold ) |
|
277 |
{ |
|
278 |
resource = EPhoneVoIPHoldNumberFail; |
|
279 |
} |
|
280 |
||
281 |
// qtn_voip_resume_number_failed / qtn_voip_hold_number_failed |
|
282 |
const TInt tmpResourceId = CPhoneMainResourceResolver::Instance()-> |
|
283 |
ResolveResourceID( resource ); |
|
284 |
||
285 |
TInt callId = aCallId; |
|
286 |
callId++; // Real call id index starts from 0, increase value by one |
|
287 |
CleanupStack::PopAndDestroy( text ); // Delete reserver buffer |
|
288 |
text = StringLoader::LoadLC( |
|
289 |
tmpResourceId, |
|
290 |
callId, |
|
291 |
CCoeEnv::Static() ); // Load new buffer |
|
292 |
||
293 |
} |
|
294 |
||
295 |
globalNoteParam.SetText( *text ); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
296 |
globalNoteParam.SetType( EPhoneMessageBoxInformation ); |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
297 |
|
37 | 298 |
|
299 |
iViewCommandHandle->ExecuteCommandL( |
|
300 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
|
301 |
||
302 |
CleanupStack::PopAndDestroy( text ); |
|
303 |
} |
|
304 |
||
305 |
// ----------------------------------------------------------- |
|
306 |
// CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL |
|
307 |
// ----------------------------------------------------------- |
|
308 |
// |
|
309 |
void CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL( |
|
310 |
TInt aCallId, |
|
311 |
TDes& aData ) const |
|
312 |
{ |
|
313 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension, |
|
314 |
"CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL()" ); |
|
315 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
316 |
Panic( EPhoneCtrlInvariant ) ); |
|
317 |
||
318 |
// Note next if-statements are in priority order so be careful if you change order |
|
319 |
// or add new if-statements. |
|
320 |
if ( iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length() ) |
|
321 |
{ |
|
322 |
__PHONELOG1( EBasic, PhoneUIVoIPExtension, |
|
323 |
"CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL - remote name = %S", |
|
324 |
&iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ) ); |
|
325 |
||
326 |
if ( iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length() |
|
327 |
< KPhoneContactNameMaxLength ) |
|
328 |
{ |
|
329 |
// Display the contact name if it is available |
|
330 |
aData.Copy( iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ) ); |
|
331 |
} |
|
332 |
} |
|
333 |
else if ( iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() ) |
|
334 |
{ |
|
335 |
__PHONELOG1( EBasic, PhoneUIVoIPExtension, |
|
336 |
"CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL - remote company name = %S", |
|
337 |
&iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ) ); |
|
338 |
||
339 |
if ( iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() |
|
340 |
< KPhoneContactNameMaxLength ) |
|
341 |
{ |
|
342 |
// Display the company name if it is available |
|
343 |
aData.Copy( iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ) ); |
|
344 |
} |
|
345 |
} |
|
346 |
else if( iStateMachine->PhoneEngineInfo()->RemotePartyName( aCallId ).Length() ) |
|
347 |
{ |
|
348 |
__PHONELOG1( EBasic, PhoneUIVoIPExtension, |
|
349 |
"CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL - remote party name = %S", |
|
350 |
&iStateMachine->PhoneEngineInfo()->RemotePartyName( aCallId ) ); |
|
351 |
||
352 |
if ( iStateMachine->PhoneEngineInfo()->RemotePartyName( aCallId ).Length() |
|
353 |
< KPhoneContactNameMaxLength ) |
|
354 |
{ |
|
355 |
// Display the remote party name if it is available |
|
356 |
aData.Copy( iStateMachine->PhoneEngineInfo()->RemotePartyName( aCallId ) ); |
|
357 |
} |
|
358 |
} |
|
359 |
else |
|
360 |
{ |
|
361 |
__PHONELOG( EBasic, PhoneUIVoIPExtension, |
|
362 |
"CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL - not found" ); |
|
363 |
aData.Zero(); |
|
364 |
} |
|
365 |
} |
|
366 |
||
367 |
// ----------------------------------------------------------- |
|
368 |
// CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL |
|
369 |
// ----------------------------------------------------------- |
|
370 |
// |
|
371 |
void CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL( |
|
372 |
TInt /*aErrorCode*/ ) |
|
373 |
{ |
|
374 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension, |
|
375 |
"CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL()" ); |
|
376 |
// Dismiss service enabling wait note |
|
377 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalWaitNote ); |
|
378 |
} |
|
379 |
||
380 |
// --------------------------------------------------------- |
|
381 |
// CPhoneVoIPErrorMessagesHandler::SendGlobalErrorNoteWithTextL |
|
382 |
// --------------------------------------------------------- |
|
383 |
// |
|
384 |
void CPhoneVoIPErrorMessagesHandler::SendGlobalErrorNoteWithTextL( |
|
385 |
TInt aResourceId, |
|
386 |
RBuf& aText ) |
|
387 |
{ |
|
388 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension, |
|
389 |
"CPhoneVoIPErrorMessagesHandler::SendGlobalErrorNoteL()" ); |
|
390 |
__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
391 |
||
392 |
||
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
393 |
// Re-enable global notes |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
394 |
TPhoneCmdParamBoolean globalNotifierParam; |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
395 |
globalNotifierParam.SetBoolean( EFalse ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
396 |
iViewCommandHandle->ExecuteCommandL( |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
397 |
EPhoneViewSetGlobalNotifiersDisabled, |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
398 |
&globalNotifierParam ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
399 |
|
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
400 |
TPhoneCmdParamGlobalNote globalNoteParam; |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
401 |
globalNoteParam.SetType( EPhoneMessageBoxInformation ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
402 |
globalNoteParam.SetTextResourceId( |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
403 |
CPhoneMainResourceResolver::Instance()-> |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
404 |
ResolveResourceID( aResourceId ) ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
405 |
globalNoteParam.SetText( aText ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
406 |
|
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
407 |
iViewCommandHandle->ExecuteCommandL( |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
408 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
37 | 409 |
} |
410 |
||
411 |
// ----------------------------------------------------------- |
|
412 |
// CPhoneVoIPErrorMessagesHandler::GetServiceProviderNameL |
|
413 |
// ----------------------------------------------------------- |
|
414 |
// |
|
415 |
void CPhoneVoIPErrorMessagesHandler::GetServiceProviderNameL( |
|
416 |
RBuf& aServiceName, |
|
417 |
TUint32 aServiceId ) |
|
418 |
{ |
|
419 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension, |
|
420 |
"CPhoneVoIPErrorMessagesHandler::GetServiceProviderNameL" ) |
|
421 |
CSPEntry* serviceEntry = CSPEntry::NewLC(); |
|
422 |
||
423 |
CSPSettings* serviceProviderSettings = CSPSettings::NewLC(); |
|
424 |
||
425 |
User::LeaveIfError( |
|
426 |
serviceProviderSettings->FindEntryL( aServiceId, *serviceEntry ) ); |
|
427 |
||
428 |
User::LeaveIfError( |
|
429 |
aServiceName.Create( serviceEntry->GetServiceName() ) ); |
|
430 |
||
431 |
CleanupStack::PopAndDestroy( serviceProviderSettings ); |
|
432 |
CleanupStack::PopAndDestroy( serviceEntry ); |
|
433 |
} |
|
434 |
||
435 |
// ----------------------------------------------------------- |
|
436 |
// CPhoneVoIPErrorMessagesHandler::ShowErrorNoteContainingServiceNameL |
|
437 |
// ----------------------------------------------------------- |
|
438 |
// |
|
439 |
void CPhoneVoIPErrorMessagesHandler::ShowErrorNoteWithServiceNameL( |
|
440 |
TInt aResourceId, |
|
441 |
TUint32 aServiceId ) |
|
442 |
{ |
|
443 |
__LOGMETHODSTARTEND( PhoneUIVoIPExtension, |
|
444 |
"CPhoneVoIPErrorMessagesHandler::ShowErrorNoteWithServiceNameL" ) |
|
445 |
RBuf serviceName; |
|
446 |
CleanupClosePushL( serviceName ); |
|
447 |
GetServiceProviderNameL( serviceName, aServiceId ); |
|
448 |
SendGlobalErrorNoteWithTextL( aResourceId, serviceName ); |
|
449 |
CleanupStack::PopAndDestroy( &serviceName ); |
|
450 |
} |
|
451 |
||
452 |
// ----------------------------------------------------------- |
|
453 |
// CPhoneVoIPErrorMessagesHandler::HasSwapFailed |
|
454 |
// ----------------------------------------------------------- |
|
455 |
// |
|
456 |
TBool CPhoneVoIPErrorMessagesHandler::HasSwapFailed() const |
|
457 |
{ |
|
458 |
TPEState callState( EPEStateUnknown ); |
|
459 |
TPECallType callType( EPECallTypeUninitialized ); |
|
460 |
TPEState confCallState( EPEStateUnknown ); |
|
461 |
||
462 |
TInt connectedCalls( 0 ); |
|
463 |
TInt heldCalls( 0 ); |
|
464 |
TInt voipCalls( 0 ); |
|
465 |
TBool ret( EFalse ); |
|
466 |
||
467 |
for ( TInt i=0; i < KPEMaximumNumberOfVoiceCalls; i++ ) |
|
468 |
{ |
|
469 |
callState = iStateMachine->PhoneEngineInfo()->CallState( i ); |
|
470 |
callType = iStateMachine->PhoneEngineInfo()->CallType( i ); |
|
471 |
||
472 |
if ( EPEStateConnected == callState ) |
|
473 |
{ |
|
474 |
connectedCalls++; |
|
475 |
||
476 |
if ( EPECallTypeVoIP == callType ) |
|
477 |
{ |
|
478 |
voipCalls++; |
|
479 |
} |
|
480 |
} |
|
481 |
else if ( EPEStateHeld == callState ) |
|
482 |
{ |
|
483 |
heldCalls++; |
|
484 |
||
485 |
if ( EPECallTypeVoIP == callType ) |
|
486 |
{ |
|
487 |
voipCalls++; |
|
488 |
} |
|
489 |
} |
|
490 |
} |
|
491 |
||
492 |
confCallState = iStateMachine->PhoneEngineInfo()->CallState( KPEConferenceCallID ); |
|
493 |
||
494 |
// At least one of the calls is VoIP call (conference or single) |
|
495 |
if ( voipCalls ) |
|
496 |
{ |
|
497 |
if ( EPEStateConferenceIdle == confCallState ) |
|
498 |
{ |
|
499 |
// Look for connected/hold and hold/hold combinations |
|
500 |
if ( ( 1 == connectedCalls && 1 == heldCalls ) || |
|
501 |
2 == heldCalls ) |
|
502 |
{ |
|
503 |
ret = ETrue; |
|
504 |
} |
|
505 |
} |
|
506 |
/* Check scenario that the other call is conference |
|
507 |
* 1) Putting VoIP call on hold fails, as a result there is a single connected |
|
508 |
* call and conference is on hold |
|
509 |
* 2) Resuming VoIP call fails, all calls are on hold (because conference is |
|
510 |
* first put on hold successfully) |
|
511 |
*/ |
|
512 |
else if ( ( 1 == connectedCalls && EPEStateHeldConference == confCallState ) || |
|
513 |
( 0 == connectedCalls && EPEStateHeldConference == confCallState ) ) |
|
514 |
{ |
|
515 |
ret = ETrue; |
|
516 |
} |
|
517 |
} |
|
518 |
||
519 |
__PHONELOG1( EBasic, PhoneUIVoIPExtension, "CPhoneVoIPErrorMessagesHandler::HasSwapFailed() returned %D", ret ); |
|
520 |
||
521 |
return ret; |
|
522 |
} |
|
523 |
||
524 |
// End of File |