author | hgs |
Fri, 23 Jul 2010 12:55:58 +0300 | |
changeset 52 | a49bfe5190e4 |
parent 46 | bc5a64e5bc3c |
child 51 | f39ed5e045e0 |
child 65 | 2a5d4ab426d3 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2002-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: This file contains the implementation of CPECallHandling class |
|
15 |
* member functions. |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
||
20 |
// INCLUDE FILES |
|
21 |
#include "cpecallhandling.h" |
|
22 |
#include "cpevideocallhandling.h" |
|
23 |
#include "cpesinglecall.h" |
|
24 |
#include "cpedtmfhandling.h" |
|
25 |
#include "cpesupplementaryservicesmonitor.h" |
|
26 |
#include "mpephonemodelinternal.h" |
|
27 |
#include "cpeconferencecall.h" |
|
28 |
#include "cpecallarrayowner.h" |
|
29 |
#include "mpecallhandling.h" |
|
30 |
#include "cpecceobserver.h" |
|
31 |
#include "cpesystemcallstate.h" |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
32 |
#include "tpematcher.h" |
37 | 33 |
|
34 |
#include <gsmerror.h> |
|
35 |
#include <mpedatastore.h> |
|
36 |
#include <pepanic.pan> |
|
37 |
#include <talogger.h> |
|
38 |
#include <PSVariables.h> |
|
39 |
#include <ctsydomainpskeys.h> |
|
40 |
#include <mccecall.h> |
|
41 |
#include <psetsaobserver.h> |
|
42 |
#include <cccecallparameters.h> |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
43 |
#include <centralrepository.h> |
37 | 44 |
|
45 |
// EXTERNAL DATA STRUCTURES |
|
46 |
// None |
|
47 |
||
48 |
// EXTERNAL FUNCTION PROTOTYPES |
|
49 |
// None |
|
50 |
||
51 |
// CONSTANTS |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
52 |
/****************************************************************************** |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
53 |
* Telephony Configuration API |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
54 |
* Keys under this category are used in defining telephony configuration. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
55 |
******************************************************************************/ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
56 |
const TUid KCRUidTelConfiguration = {0x102828B8}; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
57 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
58 |
/** |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
59 |
* Amount of digits to be used in contact matching. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
60 |
* This allows a customer to variate the amount of digits to be matched. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
61 |
*/ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
62 |
const TUint32 KTelMatchDigits = 0x00000001; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
63 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
64 |
const TInt KPEMatchDefault = 7; |
37 | 65 |
|
66 |
// MACROS |
|
67 |
// None |
|
68 |
||
69 |
// LOCAL CONSTANTS AND MACROS |
|
70 |
||
71 |
// MODULE DATA STRUCTURES |
|
72 |
// None |
|
73 |
||
74 |
// LOCAL FUNCTION PROTOTYPES |
|
75 |
// None |
|
76 |
||
77 |
// FORWARD DECLARATIONS |
|
78 |
// None |
|
79 |
||
80 |
// ============================= LOCAL FUNCTIONS =============================== |
|
81 |
// None |
|
82 |
||
83 |
// ============================ MEMBER FUNCTIONS =============================== |
|
84 |
||
85 |
// ----------------------------------------------------------------------------- |
|
86 |
// CPECallHandling::CPECallHandling |
|
87 |
// C++ default constructor can NOT contain any code, that |
|
88 |
// might leave. |
|
89 |
// ----------------------------------------------------------------------------- |
|
90 |
// |
|
91 |
CPECallHandling::CPECallHandling( |
|
92 |
MPEPhoneModelInternal& aModel, |
|
93 |
CCCE& aConvergedCallEngine, |
|
94 |
MCCEDtmfInterface& aDtmfInterface |
|
95 |
) : iModel( aModel ), |
|
96 |
iConvergedCallEngine( aConvergedCallEngine ), |
|
97 |
iDtmfInterface( aDtmfInterface ), |
|
98 |
iReplaceActive( EFalse ), |
|
99 |
iDialRequest( EFalse ) |
|
100 |
{ |
|
101 |
TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::CPECallHandling()"); |
|
102 |
} |
|
103 |
||
104 |
// Destructor |
|
105 |
EXPORT_C CPECallHandling::~CPECallHandling() |
|
106 |
{ |
|
107 |
TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::~CPECallHandling() start"); |
|
108 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
109 |
delete iRepository; |
37 | 110 |
delete iSystemCallState; |
111 |
delete iDtmfHandling; |
|
112 |
||
113 |
// No need to uninitialize feature manager - this is done in MPEPhoneModelInternal .cpp |
|
114 |
||
115 |
delete iSupplementaryServicesMonitor; |
|
116 |
delete iCCEObserver; |
|
117 |
||
118 |
delete iVideoCallHandling; |
|
119 |
delete iConferenceCall; |
|
120 |
delete iCallArrayOwner; |
|
121 |
delete iPsetSAObserver; |
|
122 |
delete iCallOpenParams; |
|
123 |
||
124 |
TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::~CPECallHandling() complete"); |
|
125 |
} |
|
126 |
||
127 |
// ----------------------------------------------------------------------------- |
|
128 |
// CPECallHandling::NewL |
|
129 |
// Two-phased constructor. |
|
130 |
// ----------------------------------------------------------------------------- |
|
131 |
// |
|
132 |
EXPORT_C CPECallHandling* CPECallHandling::NewL( |
|
133 |
MPEPhoneModelInternal& aModel, |
|
134 |
CCCE& aConvergedCallEngine, |
|
135 |
MCCEDtmfInterface& aDtmfInterface ) |
|
136 |
{ |
|
137 |
TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::NewL start." ); |
|
138 |
CPECallHandling* self = new (ELeave) CPECallHandling( aModel, |
|
139 |
aConvergedCallEngine, aDtmfInterface ); |
|
140 |
CleanupStack::PushL( self ); |
|
141 |
self->ConstructL(); |
|
142 |
CleanupStack::Pop( self ); |
|
143 |
TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::NewL complete." ); |
|
144 |
return self; |
|
145 |
} |
|
146 |
||
147 |
// ----------------------------------------------------------------------------- |
|
148 |
// CPECallHandling::ConstructL |
|
149 |
// Symbian 2nd phase constructor can leave. |
|
150 |
// ----------------------------------------------------------------------------- |
|
151 |
// |
|
152 |
void CPECallHandling::ConstructL() |
|
153 |
{ |
|
154 |
TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::BaseConstructL() start"); |
|
155 |
||
156 |
// Creates a supplementary services monitor |
|
157 |
iSupplementaryServicesMonitor = new (ELeave) CPESupplementaryServicesMonitor( |
|
158 |
*this, *iModel.DataStore() ); |
|
159 |
||
160 |
iCCEObserver = CPECCEObserver::NewL( *this, iModel ); |
|
161 |
||
162 |
iConvergedCallEngine.SetObserver( *iCCEObserver, *iSupplementaryServicesMonitor ); |
|
163 |
||
164 |
// Creates CPEDtmfSender object |
|
165 |
iDtmfHandling = CPEDtmfHandling::NewL( *this, iDtmfInterface ); |
|
166 |
||
167 |
// Creates a call array owner object |
|
168 |
iCallArrayOwner = CPECallArrayOwner::NewL( |
|
169 |
iConvergedCallEngine, |
|
170 |
*this ); |
|
171 |
||
172 |
iVideoCallHandling = CPEVideoCallHandling::NewL( |
|
173 |
*this, |
|
174 |
iModel, |
|
175 |
iConvergedCallEngine, |
|
176 |
*iCallArrayOwner ); |
|
177 |
||
178 |
iCallOpenParams = CCCECallParameters::NewL(); |
|
179 |
||
180 |
iSystemCallState = CPESystemCallState::NewL( *iCallArrayOwner, *iModel.DataStore() ); |
|
181 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
182 |
iRepository = CRepository::NewL( KCRUidTelConfiguration ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
183 |
|
37 | 184 |
TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::BaseConstructL() complete"); |
185 |
} |
|
186 |
||
187 |
// ----------------------------------------------------------------------------- |
|
188 |
// CPECallHandling::SendErrorMessage |
|
189 |
// Reroutes error messages to the Phone Engine, usable by other than call objects |
|
190 |
// ----------------------------------------------------------------------------- |
|
191 |
// |
|
192 |
void CPECallHandling::SendErrorMessage( |
|
193 |
const TInt aErrorCode ) |
|
194 |
{ |
|
195 |
TEFLOGSTRING2( KTAINT, |
|
196 |
"CALL CPECallHandling::SendErrorMessage, error code: %d", |
|
197 |
aErrorCode ); |
|
198 |
||
199 |
iModel.DataStore()->SetErrorCode( aErrorCode ); |
|
200 |
iModel.SendMessage( MEngineMonitor::EPEMessageCallHandlingError ); |
|
201 |
} |
|
202 |
||
203 |
// ----------------------------------------------------------------------------- |
|
204 |
// CPECallHandling::SendErrorMessage |
|
205 |
// Reroutes error messages to the Phone Engine, usable by call objects |
|
206 |
// ----------------------------------------------------------------------------- |
|
207 |
// |
|
208 |
void CPECallHandling::SendErrorMessage( |
|
209 |
const TInt aCallId, |
|
210 |
const TInt aErrorCode ) |
|
211 |
{ |
|
212 |
TEFLOGSTRING3( KTAINT, |
|
213 |
"CALL CPECallHandling::SendErrorMessage, error code: %d, call id: %d", |
|
214 |
aErrorCode, |
|
215 |
aCallId ); |
|
216 |
||
217 |
// Dial request failed - resume held call |
|
218 |
if( aErrorCode == ECCPErrorInvalidFDN ) |
|
219 |
{ |
|
220 |
HandleAutoResume(); |
|
221 |
} |
|
222 |
||
223 |
if ( aCallId == KPECallIdNotUsed ) |
|
224 |
{ |
|
225 |
SendErrorMessage( aErrorCode ); |
|
226 |
} |
|
227 |
else |
|
228 |
{ |
|
229 |
iModel.DataStore()->SetErrorCode( aErrorCode ); |
|
230 |
iModel.SendMessage( MEngineMonitor::EPEMessageCallHandlingError, aCallId ); |
|
231 |
||
232 |
//Handle call objet deleting if dialing fail. |
|
233 |
if( ECCPErrorNone != aErrorCode ) |
|
234 |
{ |
|
235 |
CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId ); |
|
236 |
if( callData ) |
|
237 |
{ |
|
238 |
TEFLOGSTRING2( KTAINT, |
|
239 |
"CALL CPECallHandling::SendErrorMessage, call state %d", callData->GetCallState() ); |
|
240 |
if( callData->GetCallState() == EPEStateIdle ) |
|
241 |
{ |
|
242 |
ReleaseCallObject( aCallId ); |
|
243 |
iDialRequest = EFalse; |
|
244 |
} |
|
245 |
} |
|
246 |
} |
|
247 |
||
248 |
if( ( KPEConferenceCallID == aCallId ) && ( ECCPConferenceErrorAddCall == aErrorCode ) && |
|
249 |
iConferenceCall && ( iConferenceCall->EnumerateCalls() == 0 ) ) |
|
250 |
{ |
|
251 |
delete iConferenceCall; |
|
252 |
iConferenceCall = NULL; |
|
253 |
iModel.DataStore()->ResetCallInfo( aCallId ); |
|
254 |
} |
|
255 |
} |
|
256 |
} |
|
257 |
||
258 |
// ----------------------------------------------------------------------------- |
|
259 |
// CPECallHandling::SendMessage |
|
260 |
// Reroutes messages to the Phone Engine, usable by other than call objects |
|
261 |
// ----------------------------------------------------------------------------- |
|
262 |
// |
|
263 |
void CPECallHandling::SendMessage( |
|
264 |
MEngineMonitor::TPEMessagesFromPhoneEngine aMessage ) |
|
265 |
{ |
|
266 |
TEFLOGSTRING2( KTAINT, |
|
267 |
"CALL CPECallHandling::SendMessage, message id: %d", aMessage ); |
|
268 |
||
269 |
iModel.SendMessage( aMessage ); |
|
270 |
} |
|
271 |
||
272 |
// ----------------------------------------------------------------------------- |
|
273 |
// CPECallHandling::SendMessage |
|
274 |
// Reroutes messages to the Phone Engine, usable by call objects |
|
275 |
// ----------------------------------------------------------------------------- |
|
276 |
// |
|
277 |
void CPECallHandling::SendMessage( |
|
278 |
MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, |
|
279 |
TInt aCallId ) |
|
280 |
{ |
|
281 |
TEFLOGSTRING3( KTAINT, |
|
282 |
"CALL CPECallHandling::SendMessage, message id: %d, call id: %d", |
|
283 |
aMessage, |
|
284 |
aCallId ); |
|
285 |
||
286 |
TInt errorCode( KErrNone ); |
|
287 |
||
288 |
switch ( aMessage ) |
|
289 |
{ |
|
290 |
case MEngineMonitor::EPEMessageDialing: |
|
291 |
{ |
|
292 |
iDialRequest = EFalse; |
|
293 |
CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId ); |
|
294 |
if( callData ) |
|
295 |
{ |
|
296 |
MCCECall& call = callData->Call(); |
|
297 |
iModel.DataStore()->SetCallIndex(call.CallIndex(), aCallId ); |
|
298 |
SetCallOrigin( aCallId, call ); |
|
299 |
} |
|
300 |
break; |
|
301 |
} |
|
302 |
case MEngineMonitor::EPEMessageChangedCallDuration: |
|
303 |
{ |
|
304 |
TTimeIntervalSeconds duration; |
|
305 |
||
306 |
errorCode = GetCallDuration( duration, aCallId ); |
|
307 |
if ( errorCode == KErrNone ) |
|
308 |
{ |
|
309 |
iModel.DataStore()->SetCallDuration( duration, aCallId ); |
|
310 |
} |
|
311 |
break; |
|
312 |
} |
|
313 |
case MEngineMonitor::EPEMessageIdle: |
|
314 |
{ |
|
315 |
HandleAutoResume(); |
|
316 |
break; |
|
317 |
} |
|
318 |
case MEngineMonitor::EPEMessageAddedConferenceMember: |
|
319 |
{ |
|
320 |
TName memberName; |
|
321 |
TInt count; |
|
322 |
||
323 |
errorCode = GetNumberOfParticipants( count ); |
|
324 |
TEFLOGSTRING2( |
|
325 |
KTAMESIN, |
|
326 |
"CALL CPECallHandling::SendMessage EPEMessageAddedConferenceMember errorCode %d", |
|
327 |
errorCode ); |
|
328 |
if ( errorCode == KErrNone ) |
|
329 |
{ |
|
330 |
iModel.DataStore()->SetNumberOfConferenceMembers( count, KPEConferenceCallID ); |
|
331 |
||
332 |
iConferenceCall->GetConferenceMemberName( memberName ); |
|
333 |
||
334 |
if ( errorCode == KErrNone ) |
|
335 |
{ |
|
336 |
iModel.DataStore()->SetConferenceMemberInfo( |
|
337 |
memberName, |
|
338 |
KPEConferenceCallID, |
|
339 |
aCallId ); |
|
340 |
iModel.DataStore()->SetCallConference( aCallId, |
|
341 |
KPEConferenceCallID ); |
|
342 |
} |
|
343 |
} |
|
344 |
break; |
|
345 |
} |
|
346 |
case MEngineMonitor::EPEMessageDroppedConferenceMember: |
|
347 |
{ |
|
348 |
TName memberName; |
|
349 |
TInt memberCallId; |
|
350 |
TInt count; |
|
351 |
||
352 |
errorCode = GetNumberOfParticipants( count ); |
|
353 |
TEFLOGSTRING2( |
|
354 |
KTAMESIN, |
|
355 |
"CALL CPECallHandling::SendMessage EPEMessageAddedConferenceMember EPEMessageDroppedConferenceMember %d", |
|
356 |
errorCode ); |
|
357 |
if ( errorCode == KErrNone ) |
|
358 |
{ |
|
359 |
iModel.DataStore()->SetNumberOfConferenceMembers( count, KPEConferenceCallID ); |
|
360 |
||
361 |
errorCode = GetConferenceMemberNameAndId( memberName, |
|
362 |
memberCallId ); |
|
363 |
||
364 |
// Member has been taken to OneToOne conversation and is still alive |
|
365 |
if ( errorCode == KErrNone ) |
|
366 |
{ |
|
367 |
iModel.DataStore()->SetConferenceMemberInfo( |
|
368 |
memberName, |
|
369 |
KPECallIdNotUsed, |
|
370 |
aCallId ); |
|
371 |
iModel.DataStore()->SetCallConference( |
|
372 |
KPENormalVoiceCall, |
|
373 |
memberCallId ); |
|
374 |
} |
|
375 |
else |
|
376 |
{ |
|
377 |
// Member has been dropped and its state is idle, so no |
|
378 |
// information can be found... |
|
379 |
// So actually not an error situation memberName is empty |
|
380 |
// (set in GetConferenceMemberNameAndId method) |
|
381 |
iModel.DataStore()->SetConferenceMemberInfo( |
|
382 |
memberName, |
|
383 |
KPECallIdNotUsed, |
|
384 |
aCallId ); |
|
385 |
errorCode = KErrNone; |
|
386 |
} |
|
387 |
} |
|
388 |
break; |
|
389 |
} |
|
390 |
case MEngineMonitor::EPEMessageCallControlCapsChanged: |
|
391 |
{ |
|
392 |
TPECallControlCaps callControlCaps; |
|
393 |
errorCode = GetCallControlCaps( callControlCaps, aCallId ); |
|
394 |
if ( errorCode == KErrNone ) |
|
395 |
{ |
|
396 |
iModel.DataStore()->SetCallControlCaps( |
|
397 |
callControlCaps, |
|
398 |
aCallId ); |
|
399 |
} |
|
400 |
break; |
|
401 |
} |
|
402 |
case MEngineMonitor::EPEMessageConferenceCapsChange: |
|
403 |
{ |
|
404 |
TUint32 caps; |
|
405 |
errorCode = GetConferenceCallCaps( caps ); |
|
406 |
if ( errorCode == KErrNone ) |
|
407 |
{ |
|
408 |
iModel.DataStore()->SetConferenceCallCaps( caps, aCallId ); |
|
409 |
} |
|
410 |
break; |
|
411 |
} |
|
412 |
case MEngineMonitor::EPEMessageDisconnecting: |
|
413 |
{ |
|
414 |
CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId ); |
|
415 |
if ( callData ) |
|
416 |
{ |
|
417 |
TCCPTone inbandTone = callData->Tone(); |
|
418 |
iModel.DataStore()->SetInbandTone( inbandTone ); |
|
419 |
} |
|
420 |
break; |
|
421 |
} |
|
422 |
case MEngineMonitor::EPEMessageConferenceErrorAddCall: |
|
423 |
case MEngineMonitor::EPEMessageConferenceErrorRemoveCall: |
|
424 |
case MEngineMonitor::EPEMessageConferenceErrorSwap: |
|
425 |
case MEngineMonitor::EPEMessageConferenceErrorHold: |
|
426 |
case MEngineMonitor::EPEMessageConferenceErrorResume: |
|
427 |
case MEngineMonitor::EPEMessageConferenceErrorGoOneToOne: |
|
428 |
case MEngineMonitor::EPEMessageConferenceErrorCurrentCallsToConference: |
|
429 |
{ |
|
430 |
errorCode = KErrGeneral; |
|
431 |
if( iConferenceCall && ( iConferenceCall->EnumerateCalls() == 0 ) ) |
|
432 |
{ |
|
433 |
delete iConferenceCall; |
|
434 |
iConferenceCall = NULL; |
|
435 |
} |
|
436 |
break; |
|
437 |
} |
|
438 |
case MEngineMonitor::EPEMessageCallSecureStatusChanged: |
|
439 |
{ |
|
440 |
iModel.DataStore()->SetCallSecureStatus( |
|
441 |
IsSecureCall( aCallId ), |
|
442 |
aCallId ); |
|
443 |
// Secure is specified |
|
444 |
iModel.DataStore()->SetSecureSpecified( ETrue ); |
|
445 |
break; |
|
446 |
} |
|
447 |
case MEngineMonitor::EPEMessageSecureNotSpecified: |
|
448 |
{ |
|
449 |
iModel.DataStore()->SetSecureSpecified( EFalse ); |
|
450 |
break; |
|
451 |
} |
|
452 |
||
453 |
case MEngineMonitor::EPEMessageRemotePartyInfoChanged: |
|
454 |
{ |
|
455 |
TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged"); |
|
456 |
// HO cases call type can changes |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
457 |
CPESingleCall* call; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
458 |
call = static_cast<CPESingleCall*>( iCallArrayOwner->CallByCallId( aCallId ) ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
459 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
460 |
MCCECall& connectedCall = call->Call(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
461 |
CCPCall::TCallType callType = connectedCall.Parameters().CallType(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
462 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
463 |
if ( EPEStateConnected == call->GetCallState() ) |
37 | 464 |
{ |
465 |
if ( callType == CCPCall::ECallTypePS ) |
|
466 |
{ |
|
467 |
TEFLOGSTRING( KTAMESINT, |
|
468 |
"CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to PS"); |
|
469 |
iModel.DataStore()->SetCallType( EPECallTypeVoIP, aCallId ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
470 |
iModel.DataStore()->SetServiceIdCommand( call->Call().Parameters().ServiceId() ); |
37 | 471 |
iCallOpenParams->SetCallType( CCPCall::ECallTypePS); |
472 |
} |
|
473 |
else if ( callType == CCPCall::ECallTypeCSVoice ) |
|
474 |
{ |
|
475 |
TEFLOGSTRING( KTAMESINT, |
|
476 |
"CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to CS"); |
|
477 |
iCallOpenParams->SetCallType( CCPCall::ECallTypeCSVoice ); |
|
478 |
iModel.DataStore()->SetServiceIdCommand( 1 ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
479 |
iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
480 |
if ( UpdateColpNumber( aCallId, connectedCall )) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
481 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
482 |
iModel.SendMessage( MEngineMonitor::EPEMessageColpNumberAvailable, aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
483 |
} |
37 | 484 |
} |
485 |
} |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
486 |
// CNAP informations must be in incoming call |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
487 |
iModel.DataStore()->SetRemotePartyName( connectedCall.RemotePartyName(), aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
488 |
iModel.DataStore()->SetRemotePhoneNumber( connectedCall.RemoteParty().Left( KPEPhoneNumberMaxLength ), aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
489 |
iModel.DataStore()->SetCallIndex( connectedCall.CallIndex(), aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
490 |
break; |
37 | 491 |
} |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
492 |
|
37 | 493 |
case MEngineMonitor::EPEMessageIncoming: |
494 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
495 |
TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::SendMessage -> EPEMessageIncoming"); |
37 | 496 |
CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId ); |
497 |
if( callData ) |
|
498 |
{ |
|
499 |
MCCECall& call = callData->Call(); |
|
500 |
iModel.DataStore()->SetRemotePartyName( call.RemotePartyName(), aCallId ); |
|
501 |
iModel.DataStore()->SetRemotePhoneNumber( call.RemoteParty().Left( KPEPhoneNumberMaxLength ), aCallId ); |
|
502 |
iModel.DataStore()->SetCallIndex(call.CallIndex(), aCallId ); |
|
503 |
} |
|
504 |
break; |
|
505 |
} |
|
506 |
case MEngineMonitor::EPEMessageForwardUnconditionalModeActive: |
|
507 |
{ |
|
508 |
UpdateSaSetting(); |
|
509 |
break; |
|
510 |
} |
|
511 |
case MEngineMonitor::EPEMessageUnattendedTransferRequest: |
|
512 |
{ |
|
513 |
CPESingleCall* call = iCallArrayOwner->GetCallObject( aCallId ); |
|
514 |
__ASSERT_DEBUG( NULL != call, Panic( EPEPanicIllegalCommand ) ); |
|
515 |
if ( call ) |
|
516 |
{ |
|
517 |
iModel.DataStore()->SetUnattendedTransferTarget( |
|
518 |
call->UnattendedTransferTarget(), aCallId ); |
|
519 |
} |
|
520 |
||
521 |
break; |
|
522 |
} |
|
523 |
case MEngineMonitor::EPEMessageALSLineChanged: |
|
524 |
{ |
|
525 |
SetActiveLine(); |
|
526 |
break; |
|
527 |
} |
|
528 |
case MEngineMonitor::EPEMessageMovedPermanently: |
|
529 |
case MEngineMonitor::EPEMessageMultipleChoices: |
|
530 |
{ |
|
531 |
/* Incoming moved permanently request from server, |
|
532 |
* store target addresses for later use |
|
533 |
*/ |
|
534 |
CPESingleCall* call = iCallArrayOwner->GetCallObject( aCallId ); |
|
535 |
__ASSERT_DEBUG( NULL != call, Panic( EPEPanicIllegalCommand ) ); |
|
536 |
if ( call ) |
|
537 |
{ |
|
538 |
iModel.DataStore()->SetForwardAddressChoices( |
|
539 |
call->ForwardAddressChoices(), aCallId ); |
|
540 |
} |
|
541 |
||
542 |
break; |
|
543 |
} |
|
544 |
default: |
|
545 |
// Other messages cause no action. |
|
546 |
break; |
|
547 |
} |
|
548 |
||
549 |
if( aCallId != KPECallIdNotUsed ) |
|
550 |
{ |
|
551 |
// Preferred to be before sendmessage |
|
552 |
// f.e active idle update before display to screen |
|
553 |
iSystemCallState->NotifySystemCallStateChanged( aMessage, aCallId ); |
|
554 |
} |
|
555 |
||
556 |
if ( errorCode ) |
|
557 |
{ |
|
558 |
SendErrorMessage( aCallId, errorCode ); |
|
559 |
} |
|
560 |
else |
|
561 |
{ |
|
562 |
iModel.SendMessage( aMessage, aCallId ); |
|
563 |
} |
|
564 |
||
565 |
// Call obect deleting in idle state is handled here because phoneengine |
|
566 |
// uses call object during idle state handling |
|
567 |
if( aMessage == MEngineMonitor::EPEMessageIdle ) |
|
568 |
{ |
|
569 |
TEFLOGSTRING2( KTAINT, |
|
570 |
"CALL CPECallHandling::SendMessage DeleteCallObject %d", aCallId ); |
|
571 |
iCallArrayOwner->DeleteCallObject( aCallId ); |
|
572 |
} |
|
573 |
else if( aMessage == MEngineMonitor::EPEMessageConferenceIdle ) |
|
574 |
{ |
|
575 |
delete iConferenceCall; |
|
576 |
iConferenceCall = NULL; |
|
577 |
if ( iReplaceActive ) |
|
578 |
{ |
|
579 |
AnswerCall(); |
|
580 |
iReplaceActive = EFalse; |
|
581 |
} |
|
582 |
} |
|
583 |
} |
|
584 |
||
585 |
// ----------------------------------------------------------------------------- |
|
586 |
// CPECallHandling::AnswerCall |
|
587 |
// Answers an incoming call |
|
588 |
// ----------------------------------------------------------------------------- |
|
589 |
// |
|
590 |
EXPORT_C TInt CPECallHandling::AnswerCall() |
|
591 |
{ |
|
592 |
TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::AnswerCall"); |
|
593 |
TInt callIndex; |
|
594 |
CPESingleCall* callData; |
|
595 |
CPESingleCall* connectedCall; |
|
596 |
TInt errorCode( ECCPErrorNotFound ); |
|
597 |
||
598 |
callData = VoiceCallDataByState( EPEStateRinging, callIndex ); |
|
599 |
connectedCall = iCallArrayOwner->CallPointerByState( EPEStateConnected ); |
|
600 |
if( connectedCall && !iReplaceActive ) |
|
601 |
{ |
|
602 |
CCPCall::TCallType callType = connectedCall->Call().Parameters().CallType(); |
|
603 |
TEFLOGSTRING2( KTAINT, |
|
604 |
"CALL CPECallHandling::AnswerCall EPEStateConnected type %d", callType ); |
|
605 |
if( callType == CCPCall::ECallTypeVideo ) |
|
606 |
{ |
|
607 |
TEFLOGSTRING( KTAINT, |
|
608 |
"CALL CPECallHandling::AnswerCall ECCPErrorNotAllowed" ); |
|
609 |
return ECCPErrorNotAllowed; |
|
610 |
} |
|
611 |
} |
|
612 |
||
613 |
if ( callData ) |
|
614 |
{ |
|
615 |
TEFLOGSTRING2( KTAINT, |
|
616 |
"CALL CPECallHandling::AnswerCall > CPESingleCall::Answer %d", |
|
617 |
callData->GetCallId() ); |
|
618 |
errorCode = callData->Answer(); |
|
619 |
} |
|
620 |
else |
|
621 |
{ |
|
622 |
TEFLOGSTRING( KTAINT, |
|
623 |
"CALL CPECallHandling::AnswerCall > iVideoCallHandling->AnswerCall"); |
|
624 |
errorCode = iVideoCallHandling->AnswerCall(); |
|
625 |
} |
|
626 |
||
627 |
return errorCode; |
|
628 |
} |
|
629 |
||
630 |
// ----------------------------------------------------------------------------- |
|
631 |
// CPECallHandling::DialCall |
|
632 |
// creates dial request to the CPESingleCall object |
|
633 |
// ----------------------------------------------------------------------------- |
|
634 |
// |
|
635 |
EXPORT_C TInt CPECallHandling::DialCall( |
|
636 |
const TPEPhoneNumber& aNumber, |
|
637 |
TInt& aCallId ) |
|
638 |
{ |
|
639 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DialCall" ); |
|
640 |
CPESingleCall* callData( NULL ); |
|
641 |
TInt errorCode( KErrNone ); |
|
642 |
||
643 |
// If there is allready video call, one dial in connecting, dialing or disconnecting state, |
|
644 |
// we just ignore new dial request and send KErrInUse back to UI |
|
645 |
if( iDialRequest ) |
|
646 |
{ |
|
647 |
// Dial request already send, waiting for dialing state. |
|
648 |
errorCode = KErrGeneral; |
|
649 |
TEFLOGSTRING( KTAERROR, |
|
650 |
"CALL CPECALLHANDLING::DIALCALL ! DIAL FAILED: DIAL REQUEST ALREADY ACTIVE" ); |
|
651 |
} |
|
652 |
else if ( IsDialAllowed ( EFalse ) ) |
|
653 |
{ |
|
654 |
// Set user to user info call params. |
|
655 |
// Set user to user info call params. |
|
656 |
||
657 |
const CCCECallParameters& params = iModel.DataStore()->CallParameters(); |
|
658 |
iCallOpenParams->SetBearer( params.Bearer() ); |
|
659 |
iCallOpenParams->SetSubAddress( params.SubAddress() ); |
|
660 |
iCallOpenParams->SetOrigin( params.Origin() ); |
|
661 |
iCallOpenParams->SetUUSId( iModel.DataStore()->UserToUserInformation() ); |
|
662 |
||
663 |
TRAP( errorCode, callData = OpenNewCallL( aNumber ) ); |
|
664 |
if( errorCode == KErrNone ) |
|
665 |
{ |
|
666 |
if( iModel.DataStore()->CallOriginCommand() == EPECallOriginSAT ) |
|
667 |
{ |
|
668 |
// disable number matching for SAT calls |
|
669 |
callData->DisableFDNCheck(); |
|
670 |
} |
|
671 |
||
672 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DialCall > Dial" ); |
|
673 |
iDialRequest = ETrue; |
|
674 |
errorCode = callData->Dial( aNumber ); |
|
675 |
||
676 |
if ( errorCode != KErrNone ) |
|
677 |
{ |
|
678 |
iDialRequest = EFalse; |
|
679 |
// Dial failed: clean up |
|
680 |
ReleaseCallObject( callData->GetCallId() ); |
|
681 |
TEFLOGSTRING2( KTAERROR, |
|
682 |
"CALL CPECALLHANDLING::DIALCALL ! DIAL FAILED: MAY NOT PROCEED! %d", errorCode ); |
|
683 |
} |
|
684 |
else |
|
685 |
{ |
|
686 |
// Dial request passed on successfully: forward new call id |
|
687 |
aCallId = callData->GetCallId(); |
|
688 |
} |
|
689 |
} |
|
690 |
} |
|
691 |
else |
|
692 |
{ |
|
693 |
errorCode = KErrInUse; |
|
694 |
} |
|
695 |
||
696 |
return errorCode; |
|
697 |
} |
|
698 |
||
699 |
// ----------------------------------------------------------------------------- |
|
700 |
// CPECallHandling::DialMultimedia |
|
701 |
// creates dial request to the CPESingleCall object |
|
702 |
// ----------------------------------------------------------------------------- |
|
703 |
// |
|
704 |
EXPORT_C TInt CPECallHandling::DialMultimedia( |
|
705 |
const TPEPhoneNumber& aNumber, |
|
706 |
TInt& aCallId |
|
707 |
) |
|
708 |
{ |
|
709 |
TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::DialMultimedia"); |
|
710 |
TInt errorCode( ECCPErrorNone ); |
|
711 |
||
712 |
// If there is allready call, one dial in connecting, dialing or disconnecting state, |
|
713 |
// we just ignore new dial request and send KErrInUse back to UI |
|
714 |
if ( IsDialAllowed ( ETrue ) ) |
|
715 |
{ |
|
716 |
errorCode = iVideoCallHandling->DialCall( aNumber, aCallId ); |
|
717 |
} |
|
718 |
else |
|
719 |
{ |
|
720 |
errorCode = ECCPErrorAlreadyInUse; |
|
721 |
} |
|
722 |
return errorCode; |
|
723 |
} |
|
724 |
// ----------------------------------------------------------------------------- |
|
725 |
// CPECallHandling::IsDialAllowed |
|
726 |
// |
|
727 |
// ----------------------------------------------------------------------------- |
|
728 |
// |
|
729 |
TBool CPECallHandling::IsDialAllowed( TBool aMultimediaDial ) |
|
730 |
{ |
|
731 |
TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::IsDialAllowed"); |
|
732 |
||
733 |
CPESingleCall* call = iCallArrayOwner->CallPointerByState( EPEStateConnected ); |
|
734 |
CPESingleCall* heldCall = iCallArrayOwner->CallPointerByState( EPEStateHeld ); |
|
735 |
||
736 |
TBool status = EFalse; |
|
737 |
||
738 |
if( ( call || heldCall ) && aMultimediaDial ) |
|
739 |
{ |
|
740 |
// A call was found when tried video call |
|
741 |
TEFLOGSTRING( KTAERROR, |
|
742 |
"CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A VIDEO CALL IN CALL STATE!"); |
|
743 |
} |
|
744 |
else if( call && iVideoCallHandling->IsMultimedia( call->GetCallId() ) ) |
|
745 |
{ |
|
746 |
// A video call was found when tried voice or video call |
|
747 |
TEFLOGSTRING( KTAERROR, |
|
748 |
"CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A CALL IN VIDEO CALL STATE!"); |
|
749 |
} |
|
750 |
else if( iCallArrayOwner->CallPointerByState( EPEStateDialing ) ) |
|
751 |
{ |
|
752 |
// A dialing call was found |
|
753 |
TEFLOGSTRING( KTAERROR, |
|
754 |
"CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A CALL IN DIALING STATE!"); |
|
755 |
} |
|
756 |
else if( iCallArrayOwner->CallPointerByState( EPEStateConnecting ) ) |
|
757 |
{ |
|
758 |
// A connecting call was found |
|
759 |
TEFLOGSTRING( KTAERROR, |
|
760 |
"CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A CALL IN CONNECTING STATE!"); |
|
761 |
||
762 |
} |
|
763 |
else if( iCallArrayOwner->CallPointerByState( EPEStateDisconnecting ) ) |
|
764 |
{ |
|
765 |
// A disconnecting call was found |
|
766 |
TEFLOGSTRING( KTAERROR, |
|
767 |
"CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A CALL IN DISCONNECTING STATE!"); |
|
768 |
} |
|
769 |
else if( ( iConferenceCall && iConferenceCall->GetCallState() == EPEStateConnectedConference && ( heldCall ) ) || |
|
770 |
( iConferenceCall && iConferenceCall->GetCallState() == EPEStateHeldConference && ( call ) ) ) |
|
771 |
{ |
|
772 |
// coference and single call found |
|
773 |
TEFLOGSTRING( KTAERROR, |
|
774 |
"CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A CALL IN CONFERENCE AND SINGLE STATE!"); |
|
775 |
} |
|
776 |
else |
|
777 |
{ |
|
778 |
status = ETrue; // Dial allowed |
|
779 |
} |
|
780 |
return status; |
|
781 |
} |
|
782 |
||
783 |
// ----------------------------------------------------------------------------- |
|
784 |
// CPECallHandling::HangUp |
|
785 |
// Terminates an ongoing call |
|
786 |
// ----------------------------------------------------------------------------- |
|
787 |
// |
|
788 |
EXPORT_C TInt CPECallHandling::HangUp( |
|
789 |
TInt aCallId, |
|
790 |
TPEHangUpOptions aAutoResumeOption ) |
|
791 |
{ |
|
792 |
TEFLOGSTRING3( KTAMESINT, "CALL CPECallHandling::HangUp aCallId= %d aAutoResumeOption= %d ", aCallId, aAutoResumeOption ); |
|
793 |
TInt errorCode( ECCPErrorNotFound ); |
|
794 |
||
795 |
CPESingleCall* heldcall = iCallArrayOwner->CallPointerByState( EPEStateHeld ); |
|
796 |
||
797 |
if( aAutoResumeOption == ETPEHangUpResumeHeldCall ) |
|
798 |
{ |
|
799 |
if( heldcall ) |
|
800 |
{ |
|
801 |
iModel.DataStore()->SetResumeHeldCall( ETrue, heldcall->GetCallId() ); |
|
802 |
} |
|
803 |
else if( iConferenceCall && ( iConferenceCall->GetCallState() == EPEStateHeldConference ) ) |
|
804 |
{ |
|
805 |
iModel.DataStore()->SetResumeHeldCall( ETrue, KPEConferenceCallID ); |
|
806 |
} |
|
807 |
} |
|
808 |
else if( aAutoResumeOption == ETPEHangUpNotResumeHeldCall ) |
|
809 |
{ |
|
810 |
if( heldcall ) |
|
811 |
{ |
|
812 |
iModel.DataStore()->SetResumeHeldCall( EFalse, heldcall->GetCallId() ); |
|
813 |
} |
|
814 |
else if( iConferenceCall && ( iConferenceCall->GetCallState() == EPEStateHeldConference ) ) |
|
815 |
{ |
|
816 |
iModel.DataStore()->SetResumeHeldCall( EFalse, KPEConferenceCallID ); |
|
817 |
} |
|
818 |
} |
|
819 |
||
820 |
if ( CallIdCheck::IsVoice( aCallId )) |
|
821 |
{ |
|
822 |
CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId ); |
|
823 |
if( callData ) |
|
824 |
{ |
|
825 |
// conference call that is not yet created, must be cancelled. |
|
826 |
if( iConferenceCall && iConferenceCall->GetCallState() == EPEStateCreatingConference ) |
|
827 |
{ |
|
828 |
TEFLOGSTRING( KTAERROR, |
|
829 |
"CPECallHandling::HangUp Delete conference call."); |
|
830 |
delete iConferenceCall; |
|
831 |
iConferenceCall = NULL; |
|
832 |
} |
|
833 |
||
834 |
errorCode = callData->HangUp(); |
|
835 |
} |
|
836 |
else |
|
837 |
{ |
|
838 |
TEFLOGSTRING( KTAERROR, |
|
839 |
"CALL CPECALLHANDLING::HANGUP ! CALL OBJECT IN IDLE STATE OR ALREADY HANGING UP" ); |
|
840 |
} |
|
841 |
} |
|
842 |
||
843 |
else if ( CallIdCheck::IsVideo( aCallId ) ) |
|
844 |
{ |
|
845 |
errorCode = iVideoCallHandling->HangUp( aCallId ); |
|
846 |
} |
|
847 |
||
848 |
else if ( CallIdCheck::IsConference( aCallId ) ) |
|
849 |
{ |
|
850 |
if( iConferenceCall ) |
|
851 |
{ |
|
852 |
errorCode = iConferenceCall->HangUp(); |
|
853 |
} |
|
854 |
} |
|
855 |
return errorCode; |
|
856 |
} |
|
857 |
||
858 |
// ----------------------------------------------------------------------------- |
|
859 |
// CPECallHandling::TerminateAllConnections |
|
860 |
// Terminates all ringing voice and data calls |
|
861 |
// ----------------------------------------------------------------------------- |
|
862 |
// |
|
863 |
EXPORT_C TInt CPECallHandling::TerminateAllConnections() |
|
864 |
{ |
|
865 |
CPESingleCall* callData; |
|
866 |
TPEState callState; |
|
867 |
||
868 |
TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::TerminateAllConnections"); |
|
869 |
||
870 |
RejectCall(); // Rejects ringing call if one exists. |
|
871 |
||
872 |
if ( iConferenceCall ) |
|
873 |
{ |
|
874 |
TEFLOGSTRING( KTAMESOUT, |
|
875 |
"CALL CPECallHandling::TerminateAllConnections: Hanging Up conference call" ); |
|
876 |
iConferenceCall->HangUp(); |
|
877 |
} |
|
878 |
||
879 |
// Hangup normal Voice Calls |
|
880 |
for( TInt callId = 0; callId < KPEMaximumNumberOfVoiceCalls; callId++ ) |
|
881 |
{ |
|
882 |
callData = iCallArrayOwner->GetCallObject( callId ); |
|
883 |
if( callData ) |
|
884 |
{ |
|
885 |
callState = callData->GetCallState(); |
|
886 |
if ( callState != EPEStateIdle ) |
|
887 |
{ |
|
888 |
TEFLOGSTRING2( KTAREQOUT, |
|
889 |
"CALL CPECallHandling::TerminateAllConnections: Hanging Up call id %d...", |
|
890 |
callId ); |
|
891 |
callData->HangUp(); |
|
892 |
} |
|
893 |
} |
|
894 |
} |
|
895 |
//Terminate all ringing data calls, connected data calls and packet data connections |
|
896 |
return iVideoCallHandling->TerminateAllConnections(); |
|
897 |
} |
|
898 |
||
899 |
// ----------------------------------------------------------------------------- |
|
900 |
// CPECallHandling::IsCallInState |
|
901 |
// returns ETrue if there is a call in given state; otherwise EFalse |
|
902 |
// ----------------------------------------------------------------------------- |
|
903 |
// |
|
904 |
EXPORT_C TBool CPECallHandling::IsCallInState( TPEState aState ) const |
|
905 |
{ |
|
906 |
TBool isCallInState( EFalse ); |
|
907 |
iCallArrayOwner->CallPointerByState( aState ) ? isCallInState = ETrue : isCallInState = EFalse; |
|
908 |
||
909 |
return isCallInState; |
|
910 |
} |
|
911 |
||
912 |
// ----------------------------------------------------------------------------- |
|
913 |
// CPECallHandling::GetCallIdByState |
|
914 |
// returns return callid is there is a call; otherwise KPECallIdNotUsed( -1 ). |
|
915 |
// ----------------------------------------------------------------------------- |
|
916 |
// |
|
917 |
EXPORT_C TInt CPECallHandling::GetCallIdByState( TPEState aState ) const |
|
918 |
{ |
|
919 |
TInt callId( KPECallIdNotUsed ); |
|
920 |
CPESingleCall* call = iCallArrayOwner->CallPointerByState( aState ); |
|
921 |
if( call ) |
|
922 |
{ |
|
923 |
callId = call->GetCallId(); |
|
924 |
} |
|
925 |
TEFLOGSTRING2( KTAREQOUT, |
|
926 |
"CALL CPECallHandling::GetCallIdByState: callid %d", |
|
927 |
callId ); |
|
928 |
return callId; |
|
929 |
} |
|
930 |
||
931 |
// ----------------------------------------------------------------------------- |
|
932 |
// CPECallHandling::GetMissedCall |
|
933 |
// Returns the missed voice call indicator. |
|
934 |
// Method checks that call id is valid number |
|
935 |
// Method gets CPECallData object from the CArrayPtrFlat and |
|
936 |
// Method gets the missed voice call indicator from CPECallData object |
|
937 |
// ----------------------------------------------------------------------------- |
|
938 |
// |
|
939 |
EXPORT_C TInt CPECallHandling::GetMissedCall( |
|
940 |
TBool& aMissedCall, |
|
941 |
TInt aCallId ) |
|
942 |
{ |
|
943 |
TInt errorCode( ECCPErrorNotFound ); |
|
944 |
||
945 |
CPESingleCall* voiceCall = iCallArrayOwner->GetCallObject( aCallId ); |
|
946 |
if( voiceCall ) |
|
947 |
{ |
|
948 |
errorCode = voiceCall->GetMissedCall( aMissedCall ); |
|
949 |
} |
|
950 |
else |
|
951 |
{ |
|
952 |
__ASSERT_DEBUG( EFalse, Panic( EPEPanicIllegalCommand) ); |
|
953 |
} |
|
954 |
||
955 |
return errorCode; |
|
956 |
} |
|
957 |
||
958 |
// ----------------------------------------------------------------------------- |
|
959 |
// CPECallHandling::GetCallInfo |
|
960 |
// Returns call info |
|
961 |
// ----------------------------------------------------------------------------- |
|
962 |
// |
|
963 |
EXPORT_C TInt CPECallHandling::GetCallInfo( |
|
964 |
RMobileCall::TMobileCallInfoV3& aCallInfo, |
|
965 |
TInt aCallId ) |
|
966 |
{ |
|
967 |
CPESingleCall* callData; |
|
968 |
TInt errorCode( ECCPErrorNotFound ); |
|
969 |
||
970 |
if ( CallIdCheck::IsVoice( aCallId )) |
|
971 |
{ |
|
972 |
callData = iCallArrayOwner->GetCallObject( aCallId ); |
|
973 |
if( callData ) |
|
974 |
{ |
|
975 |
errorCode = callData->GetCallInfo( aCallInfo ); |
|
976 |
} |
|
977 |
else |
|
978 |
{ |
|
979 |
__ASSERT_DEBUG( EFalse, Panic( EPEPanicIllegalCommand) ); |
|
980 |
} |
|
981 |
} |
|
982 |
||
983 |
else if ( CallIdCheck::IsVideo( aCallId ) ) |
|
984 |
{ |
|
985 |
errorCode = iVideoCallHandling->GetCallInfo( aCallInfo, aCallId ); |
|
986 |
} |
|
987 |
||
988 |
return errorCode; |
|
989 |
} |
|
990 |
||
991 |
// ----------------------------------------------------------------------------- |
|
992 |
// CPECallHandling::GetCallState |
|
993 |
// Returns call state |
|
994 |
// ----------------------------------------------------------------------------- |
|
995 |
// |
|
996 |
EXPORT_C TPEState CPECallHandling::GetCallState( |
|
997 |
TInt aCallId ) |
|
998 |
{ |
|
999 |
TPEState callState( EPEStateUnknown ); |
|
1000 |
||
1001 |
if ( CallIdCheck::IsConference( aCallId ) ) |
|
1002 |
{ |
|
1003 |
if( iConferenceCall ) |
|
1004 |
{ |
|
1005 |
callState = iConferenceCall->GetCallState(); |
|
1006 |
} |
|
1007 |
else |
|
1008 |
{ |
|
1009 |
callState = EPEStateConferenceIdle; |
|
1010 |
} |
|
1011 |
} |
|
1012 |
else |
|
1013 |
{ |
|
1014 |
CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId ); |
|
1015 |
if( callData ) |
|
1016 |
{ |
|
1017 |
callState = callData->GetCallState(); |
|
1018 |
} |
|
1019 |
else |
|
1020 |
{ |
|
1021 |
callState = EPEStateIdle; |
|
1022 |
} |
|
1023 |
} |
|
1024 |
||
1025 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GetCallState, callState: %d", callState ); |
|
1026 |
return callState; |
|
1027 |
} |
|
1028 |
||
1029 |
// ----------------------------------------------------------------------------- |
|
1030 |
// CPECallHandling::GetNumberOfCalls |
|
1031 |
// Returns number of non-idle calls |
|
1032 |
// ----------------------------------------------------------------------------- |
|
1033 |
// |
|
1034 |
EXPORT_C TInt CPECallHandling::GetNumberOfCalls() |
|
1035 |
{ |
|
1036 |
// Count ongoing calls |
|
1037 |
return iCallArrayOwner->ActiveCallCount(); |
|
1038 |
} |
|
1039 |
||
1040 |
// ----------------------------------------------------------------------------- |
|
1041 |
// CPECallHandling::GetCallDuration |
|
1042 |
// Returns voice call duration. |
|
1043 |
// ----------------------------------------------------------------------------- |
|
1044 |
// |
|
1045 |
EXPORT_C TInt CPECallHandling::GetCallDuration( |
|
1046 |
TTimeIntervalSeconds& aDuration, |
|
1047 |
TInt aCallId ) |
|
1048 |
{ |
|
1049 |
TInt errorCode( KErrNone ); |
|
1050 |
||
1051 |
if ( CallIdCheck::IsVoice( aCallId )) |
|
1052 |
{ |
|
1053 |
CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId ); |
|
1054 |
if( callData ) |
|
1055 |
{ |
|
1056 |
callData->GetCallDuration( aDuration ); |
|
1057 |
} |
|
1058 |
else |
|
1059 |
{ |
|
1060 |
__ASSERT_DEBUG( EFalse, Panic( EPEPanicIllegalCommand) ); |
|
1061 |
} |
|
1062 |
} |
|
1063 |
else if ( CallIdCheck::IsVideo( aCallId ) ) |
|
1064 |
{ |
|
1065 |
iVideoCallHandling->GetCallDuration( aDuration, aCallId ); |
|
1066 |
} |
|
1067 |
else if ( CallIdCheck::IsConference( aCallId ) ) |
|
1068 |
{ |
|
1069 |
if( iConferenceCall ) |
|
1070 |
{ |
|
1071 |
iConferenceCall->GetCallDuration( aDuration ); |
|
1072 |
errorCode = KErrNone; |
|
1073 |
} |
|
1074 |
else |
|
1075 |
{ |
|
1076 |
errorCode = ECCPErrorNotFound; |
|
1077 |
} |
|
1078 |
} |
|
1079 |
else |
|
1080 |
{ |
|
1081 |
errorCode = ECCPErrorNotFound; |
|
1082 |
} |
|
1083 |
return errorCode; |
|
1084 |
} |
|
1085 |
||
1086 |
// ----------------------------------------------------------------------------- |
|
1087 |
// CPECallHandling::RejectCall |
|
1088 |
// rejects the incoming call |
|
1089 |
// ----------------------------------------------------------------------------- |
|
1090 |
// |
|
1091 |
EXPORT_C TInt CPECallHandling::RejectCall() |
|
1092 |
{ |
|
1093 |
TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::RejectCall"); |
|
1094 |
TInt callIndex; |
|
1095 |
TInt errorCode( ECCPErrorNotFound ); |
|
1096 |
||
1097 |
CPESingleCall* callData = VoiceCallDataByState( EPEStateRinging, callIndex ); |
|
1098 |
if( callIndex >= 0 ) |
|
1099 |
{ |
|
1100 |
callData->HangUp(); |
|
1101 |
errorCode = KErrNone; |
|
1102 |
} |
|
1103 |
else |
|
1104 |
{ |
|
1105 |
// Data call reject |
|
1106 |
errorCode = iVideoCallHandling->RejectCall(); |
|
1107 |
} |
|
1108 |
return errorCode; |
|
1109 |
} |
|
1110 |
||
1111 |
// ----------------------------------------------------------------------------- |
|
1112 |
// CPECallHandling::ReleaseAll |
|
1113 |
// Release ongoing calls |
|
1114 |
// ----------------------------------------------------------------------------- |
|
1115 |
// |
|
1116 |
EXPORT_C TInt CPECallHandling::ReleaseAll() |
|
1117 |
{ |
|
1118 |
TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::ReleaseAll"); |
|
1119 |
CPESingleCall* callData; |
|
1120 |
TInt errorCode( ECCPErrorNotFound ); |
|
1121 |
||
1122 |
// Normal Voice Calls |
|
1123 |
for ( TInt callId=0; callId < KPEMaximumNumberOfVoiceCalls; callId++ ) |
|
1124 |
{ |
|
1125 |
callData = iCallArrayOwner->GetCallObject( callId ); |
|
1126 |
if( callData && |
|
1127 |
callData->GetCallState() != EPEStateIdle && |
|
1128 |
callData->GetCallState() != EPEStateRinging ) |
|
1129 |
{ |
|
1130 |
callData->HangUp(); |
|
1131 |
errorCode = KErrNone; |
|
1132 |
} |
|
1133 |
} |
|
1134 |
||
1135 |
// Release ongoing data calls |
|
1136 |
errorCode ? errorCode = iVideoCallHandling->ReleaseAll() : iVideoCallHandling->ReleaseAll(); |
|
1137 |
||
1138 |
TEFLOGSTRING2( KTAINT, "PE CPECallHandling::ReleaseAll, error id: %d", |
|
1139 |
errorCode ); |
|
1140 |
||
1141 |
return errorCode; |
|
1142 |
} |
|
1143 |
||
1144 |
// ----------------------------------------------------------------------------- |
|
1145 |
// CPECallHandling::SendDtmf |
|
1146 |
// sends dtmf string |
|
1147 |
// ----------------------------------------------------------------------------- |
|
1148 |
// |
|
1149 |
EXPORT_C TInt CPECallHandling::SendDtmf( |
|
1150 |
const TPEDtmfString& aDtmfString ) |
|
1151 |
{ |
|
1152 |
return iDtmfHandling->SendDtmfString( aDtmfString ); |
|
1153 |
} |
|
1154 |
||
1155 |
// ----------------------------------------------------------------------------- |
|
1156 |
// CPECallHandling::ContinueDtmfSending |
|
1157 |
// Continues dtmf sending after 'w'-character |
|
1158 |
// ----------------------------------------------------------------------------- |
|
1159 |
// |
|
1160 |
EXPORT_C void CPECallHandling::ContinueDtmfSending() |
|
1161 |
{ |
|
1162 |
iDtmfHandling->ContinueDtmfSending(); |
|
1163 |
} |
|
1164 |
||
1165 |
// ----------------------------------------------------------------------------- |
|
1166 |
// CPECallHandling::StartDtmfTone |
|
1167 |
// sends dtmf tone to the remote party |
|
1168 |
// ----------------------------------------------------------------------------- |
|
1169 |
// |
|
1170 |
EXPORT_C TInt CPECallHandling::StartDtmfTone( |
|
1171 |
const TChar& aTone ) |
|
1172 |
{ |
|
1173 |
iDtmfHandling->StartDtmfTone(aTone); |
|
1174 |
return KErrNone; |
|
1175 |
} |
|
1176 |
||
1177 |
// ----------------------------------------------------------------------------- |
|
1178 |
// CPECallHandling::StopDtmfSending |
|
1179 |
// Stops dtmf sending after 'w'-character |
|
1180 |
// ----------------------------------------------------------------------------- |
|
1181 |
// |
|
1182 |
EXPORT_C void CPECallHandling::StopDtmfSending() |
|
1183 |
{ |
|
1184 |
iDtmfHandling->StopDtmfSending(); |
|
1185 |
} |
|
1186 |
||
1187 |
// ----------------------------------------------------------------------------- |
|
1188 |
// CPECallHandling::StopDtmfTone |
|
1189 |
// stops sending dtmf tone to the remote party |
|
1190 |
// ----------------------------------------------------------------------------- |
|
1191 |
// |
|
1192 |
EXPORT_C TInt CPECallHandling::StopDtmfTone() |
|
1193 |
{ |
|
1194 |
iDtmfHandling->StopDtmfTone(); |
|
1195 |
return KErrNone; |
|
1196 |
} |
|
1197 |
||
1198 |
// ----------------------------------------------------------------------------- |
|
1199 |
// CPECallHandling::CancelDtmfPlay |
|
1200 |
// Cancels Dtmf string sending |
|
1201 |
// ----------------------------------------------------------------------------- |
|
1202 |
// |
|
1203 |
EXPORT_C void CPECallHandling::CancelDtmfPlay() |
|
1204 |
{ |
|
1205 |
iDtmfHandling->CancelDtmfString(); |
|
1206 |
} |
|
1207 |
||
1208 |
// ----------------------------------------------------------------------------- |
|
1209 |
// CPECallHandling::VoiceCallDataByState |
|
1210 |
// returns CPESingleCall voice call object by State |
|
1211 |
// ----------------------------------------------------------------------------- |
|
1212 |
// |
|
1213 |
EXPORT_C CPESingleCall* CPECallHandling::VoiceCallDataByState( |
|
1214 |
TPEState aState, |
|
1215 |
TInt& aIndex ) const |
|
1216 |
{ |
|
1217 |
aIndex = KPECallIdNotUsed; |
|
1218 |
CPESingleCall* returnValue = NULL; |
|
1219 |
if ( aState != EPEStateIdle ) |
|
1220 |
{ |
|
1221 |
for ( TInt callId=0; callId < KPEMaximumNumberOfVoiceCalls; callId++ ) |
|
1222 |
{ |
|
1223 |
CPESingleCall* callData = iCallArrayOwner->GetCallObject( callId ); |
|
1224 |
if( callData ) |
|
1225 |
{ |
|
1226 |
if ( callData->GetCallState() == aState ) |
|
1227 |
{ |
|
1228 |
TEFLOGSTRING2( |
|
1229 |
KTAREQEND, |
|
1230 |
"CALL CPECallHandling::VoiceCallDataByState: , aState: %d", |
|
1231 |
aState ); |
|
1232 |
TEFLOGSTRING2( |
|
1233 |
KTAREQEND, |
|
1234 |
"CALL CPECallHandling::VoiceCallDataByState: , callId: %d", |
|
1235 |
aState ); |
|
1236 |
aIndex = callId; |
|
1237 |
returnValue = callData; |
|
1238 |
break; |
|
1239 |
} |
|
1240 |
} |
|
1241 |
} |
|
1242 |
} |
|
1243 |
return returnValue; |
|
1244 |
} |
|
1245 |
||
1246 |
// ----------------------------------------------------------------------------- |
|
1247 |
// From base class MPECallInitiator |
|
1248 |
// Initialises (incoming,external) voice call. |
|
1249 |
// ----------------------------------------------------------------------------- |
|
1250 |
// |
|
1251 |
void CPECallHandling::InitVoiceCall( MCCECall& aNewCall ) |
|
1252 |
{ |
|
1253 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::InitVoiceCall" ); |
|
1254 |
CPESingleCall* callData( NULL ); |
|
1255 |
TRAP_IGNORE( ( callData = iCallArrayOwner->CreateCallL( *this ) ) ); |
|
1256 |
||
1257 |
if ( callData ) |
|
1258 |
{ |
|
1259 |
iModel.DataStore()->SetPhoneNumber( KNullDesC() ); |
|
1260 |
iModel.DataStore()->SetServiceId( callData->GetCallId(), aNewCall.ServiceId() ); |
|
1261 |
const CCCPCallParameters& callParameters = aNewCall.Parameters(); |
|
1262 |
||
1263 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::InitVoiceCall call type: %d", callParameters.CallType() ); |
|
1264 |
switch ( callParameters.CallType() ) |
|
1265 |
{ |
|
1266 |
case CCPCall::ECallTypeCSVoice: |
|
1267 |
{ |
|
1268 |
iModel.DataStore()->SetCallType( EPECallTypeCSVoice, callData->GetCallId() ); |
|
1269 |
// Set incoming Call's Als line |
|
1270 |
const CCCECallParameters& cceparams = |
|
1271 |
static_cast<const CCCECallParameters&> (callParameters); |
|
1272 |
iModel.DataStore()->SetCallALSLine( cceparams.LineType(), callData->GetCallId() ); |
|
1273 |
} |
|
1274 |
break; |
|
1275 |
case CCPCall::ECallTypePS: |
|
1276 |
{ |
|
1277 |
iModel.DataStore()->SetCallType( EPECallTypeVoIP, callData->GetCallId() ); |
|
1278 |
} |
|
1279 |
break; |
|
1280 |
default: |
|
1281 |
__ASSERT_DEBUG( EFalse, Panic( EPEPanicIndexOutOfRange )); |
|
1282 |
break; |
|
1283 |
} |
|
1284 |
callData->SetCall( aNewCall ); |
|
1285 |
TPECallControlCaps callControlCaps; |
|
1286 |
TInt err = GetCallControlCaps( callControlCaps, callData->GetCallId() ); |
|
1287 |
if ( err == KErrNone ) |
|
1288 |
{ |
|
1289 |
iModel.DataStore()->SetCallControlCaps( callControlCaps, callData->GetCallId() ); |
|
1290 |
} |
|
1291 |
iModel.DataStore()->SetCallSecureStatus( IsSecureCall( callData->GetCallId() ), callData->GetCallId() ); |
|
1292 |
iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() ); |
|
1293 |
} |
|
1294 |
else |
|
1295 |
{ |
|
1296 |
Panic( EPEPanicNoFreeCalls ); |
|
1297 |
} |
|
1298 |
} |
|
1299 |
||
1300 |
// ----------------------------------------------------------------------------- |
|
1301 |
// From base class MPECallInitiator |
|
1302 |
// Initialises (incoming,external) video call. |
|
1303 |
// ----------------------------------------------------------------------------- |
|
1304 |
// |
|
1305 |
void CPECallHandling::InitVideoCall( MCCECall& aNewCall ) |
|
1306 |
{ |
|
1307 |
iVideoCallHandling->InitCall( aNewCall ); |
|
1308 |
} |
|
1309 |
||
1310 |
// ----------------------------------------------------------------------------- |
|
1311 |
// CPECallHandling::ConnectedCalls |
|
1312 |
// Indicates if there is any connected calls |
|
1313 |
// ----------------------------------------------------------------------------- |
|
1314 |
// |
|
1315 |
EXPORT_C TBool CPECallHandling::ConnectedCalls() |
|
1316 |
{ |
|
1317 |
TInt index; |
|
1318 |
return ( VoiceCallDataByState( EPEStateConnected, index ) || |
|
1319 |
VoiceCallDataByState( EPEStateHeld, index ) || |
|
1320 |
iVideoCallHandling->ConnectedCalls() ); |
|
1321 |
} |
|
1322 |
||
1323 |
||
1324 |
// ----------------------------------------------------------------------------- |
|
1325 |
// CPECallHandling::StartUp |
|
1326 |
// Starts monitoring incoming data calls |
|
1327 |
// ----------------------------------------------------------------------------- |
|
1328 |
// |
|
1329 |
EXPORT_C void CPECallHandling::StartUp() |
|
1330 |
{ |
|
1331 |
} |
|
1332 |
||
1333 |
// ----------------------------------------------------------------------------- |
|
1334 |
// CPECallHandling::SetCallParams |
|
1335 |
// |
|
1336 |
// ----------------------------------------------------------------------------- |
|
1337 |
// |
|
1338 |
void CPECallHandling::SetCallParams( TInt aCallId ) |
|
1339 |
{ |
|
1340 |
iCallOpenParams->SetLineType( iActiveLine ); |
|
1341 |
iModel.DataStore()->SetCallALSLine( iActiveLine, aCallId ); |
|
1342 |
switch ( iModel.DataStore()->CallTypeCommand() ) |
|
1343 |
{ |
|
1344 |
case EPECallTypeCSVoice: |
|
1345 |
{ |
|
1346 |
iCallOpenParams->SetCallType( CCPCall::ECallTypeCSVoice ); |
|
1347 |
iModel.DataStore()->SetServiceIdCommand( 1 ); |
|
1348 |
iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId ); |
|
1349 |
} |
|
1350 |
break; |
|
1351 |
case EPECallTypeVideo: |
|
1352 |
{ |
|
1353 |
iCallOpenParams->SetCallType( CCPCall::ECallTypeVideo); |
|
1354 |
iModel.DataStore()->SetServiceIdCommand( 1 ); |
|
1355 |
iModel.DataStore()->SetCallType( EPECallTypeVideo, aCallId ); |
|
1356 |
} |
|
1357 |
break; |
|
1358 |
case EPECallTypeVoIP: |
|
1359 |
{ |
|
1360 |
iCallOpenParams->SetCallType( CCPCall::ECallTypePS); |
|
1361 |
iModel.DataStore()->SetCallType( EPECallTypeVoIP, aCallId ); |
|
1362 |
//PhoneApp set service id in voip call case |
|
1363 |
} |
|
1364 |
break; |
|
1365 |
case EPECallTypeUninitialized: |
|
1366 |
default: |
|
1367 |
iCallOpenParams->SetCallType( CCPCall::ECallTypeCSVoice); |
|
1368 |
iModel.DataStore()->SetServiceIdCommand( 1 ); |
|
1369 |
iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId ); |
|
1370 |
break; |
|
1371 |
} |
|
1372 |
iCallOpenParams->SetServiceId( iModel.DataStore()->ServiceIdCommand() ); |
|
1373 |
} |
|
1374 |
||
1375 |
// ----------------------------------------------------------------------------- |
|
1376 |
// CPECallHandling::SendMessage |
|
1377 |
// Reroutes messages to the Phone Engine |
|
1378 |
// ----------------------------------------------------------------------------- |
|
1379 |
// |
|
1380 |
void CPECallHandling::SendMessage( |
|
1381 |
const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, |
|
1382 |
const TName& aName ) |
|
1383 |
{ |
|
1384 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::SendMessage, message id: %d", aMessage ); |
|
1385 |
TInt callId( KPECallIdNotUsed ); |
|
1386 |
MPECall* call = iCallArrayOwner->CallByName( aName ); |
|
1387 |
if( call ) |
|
1388 |
{ |
|
1389 |
callId = call->GetCallId(); |
|
1390 |
} |
|
1391 |
||
1392 |
SendMessage( aMessage, callId ); |
|
1393 |
} |
|
1394 |
||
1395 |
// ----------------------------------------------------------------------------- |
|
1396 |
// CPECallHandling::HandleInternalMessage |
|
1397 |
// Reroutes messages to the Phone Engine |
|
1398 |
// ----------------------------------------------------------------------------- |
|
1399 |
// |
|
1400 |
void CPECallHandling::HandleInternalMessage( |
|
1401 |
TInt aMessage ) |
|
1402 |
{ |
|
1403 |
iModel.HandleInternalMessage( aMessage ); |
|
1404 |
} |
|
1405 |
||
1406 |
// ----------------------------------------------------------------------------- |
|
1407 |
// CPECallHandling::OpenNewCallL |
|
1408 |
// returns ETrue if hangup active |
|
1409 |
// ----------------------------------------------------------------------------- |
|
1410 |
// |
|
1411 |
CPESingleCall* CPECallHandling::OpenNewCallL( const TPEPhoneNumber& aNumber ) |
|
1412 |
{ |
|
1413 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::OpenNewCallL"); |
|
1414 |
TInt errorCode( KErrNone ); |
|
1415 |
CPESingleCall* callData( NULL ); |
|
1416 |
MCCECall* cceCall( NULL ); |
|
1417 |
callData = iCallArrayOwner->CreateCallL( *this ); |
|
1418 |
SetCallParams( callData->GetCallId() ); |
|
1419 |
||
1420 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::OpenNewCallL > CCCE::OpenNewCallL"); |
|
1421 |
TRAP( errorCode, |
|
1422 |
cceCall = &( iConvergedCallEngine.OpenNewCallL( aNumber, |
|
1423 |
*iCallOpenParams, |
|
1424 |
*callData ) ) ); |
|
1425 |
if ( errorCode == KErrNone ) |
|
1426 |
{ |
|
1427 |
callData->SetCall( *cceCall ); |
|
1428 |
iModel.DataStore()->SetServiceId( callData->GetCallId(), cceCall->ServiceId() ); |
|
1429 |
iModel.DataStore()->SetCallSecureStatus( callData->IsSecureCall(), callData->GetCallId() ); |
|
1430 |
iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() ); |
|
1431 |
TPECallControlCaps callControlCaps; |
|
1432 |
TInt err = GetCallControlCaps( callControlCaps, callData->GetCallId() ); |
|
1433 |
if ( err == KErrNone ) |
|
1434 |
{ |
|
1435 |
iModel.DataStore()->SetCallControlCaps( callControlCaps, callData->GetCallId() ); |
|
1436 |
} |
|
1437 |
} |
|
1438 |
else |
|
1439 |
{ |
|
1440 |
// Open new call failed |
|
1441 |
ReleaseCallObject( callData->GetCallId() ); |
|
1442 |
TEFLOGSTRING2( KTAERROR, |
|
1443 |
"CALL CPECALLHANDLING::OPENNEWCALLL ! OPENNEWCALL FAILED: MAY NOT PROCEED! %d", errorCode ); |
|
1444 |
User::Leave( errorCode ); |
|
1445 |
} |
|
1446 |
return callData; |
|
1447 |
} |
|
1448 |
||
1449 |
// ----------------------------------------------------------------------------- |
|
1450 |
// CPECallHandling::SetActiveLine |
|
1451 |
// Sets active line |
|
1452 |
// ----------------------------------------------------------------------------- |
|
1453 |
// |
|
1454 |
EXPORT_C void CPECallHandling::SetActiveLine() |
|
1455 |
{ |
|
1456 |
TEFLOGSTRING( KTAINT, "PE CPECallHandling::SetActiveLine" ); |
|
1457 |
iActiveLine = iModel.DataStore()->ALSLine(); |
|
1458 |
} |
|
1459 |
||
1460 |
// ----------------------------------------------------------------------------- |
|
1461 |
// CPECallHandling::IsSecureCall |
|
1462 |
// Returns the call secure status |
|
1463 |
// ----------------------------------------------------------------------------- |
|
1464 |
// |
|
1465 |
TBool CPECallHandling::IsSecureCall( const TInt aCallId ) const |
|
1466 |
{ |
|
1467 |
TEFLOGSTRING2( |
|
1468 |
KTAINT, |
|
1469 |
"PE CPECallHandling::IsSecureCall: aCallId = %d", |
|
1470 |
aCallId ); |
|
1471 |
CPESingleCall* call = iCallArrayOwner->GetCallObject( aCallId ); |
|
1472 |
||
1473 |
__ASSERT_DEBUG( call, Panic( EPEPanicIndexOutOfRange ) ); |
|
1474 |
TBool secured( EFalse ); |
|
1475 |
if( call ) |
|
1476 |
{ |
|
1477 |
secured = call->IsSecureCall(); |
|
1478 |
} |
|
1479 |
return secured; |
|
1480 |
} |
|
1481 |
||
1482 |
// ----------------------------------------------------------------------------- |
|
1483 |
// CPECallHandling::GetNumberOfParticipants |
|
1484 |
// returns number of conference members |
|
1485 |
// ----------------------------------------------------------------------------- |
|
1486 |
// |
|
1487 |
TInt CPECallHandling::GetNumberOfParticipants( |
|
1488 |
TInt& aCount ) // The Number of participants |
|
1489 |
{ |
|
1490 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::GetNumberOfParticipants" ); |
|
1491 |
TInt errorCode( ECCPErrorNotFound ); |
|
1492 |
||
1493 |
if ( iConferenceCall ) |
|
1494 |
{ |
|
1495 |
aCount = iConferenceCall->EnumerateCalls(); |
|
1496 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GetNumberOfParticipants count %d", aCount ); |
|
1497 |
errorCode = KErrNone; |
|
1498 |
} |
|
1499 |
return errorCode; |
|
1500 |
} |
|
1501 |
||
1502 |
// ----------------------------------------------------------------------------- |
|
1503 |
// CPECallHandling::GetConferenceMemberNameAndId |
|
1504 |
// Returns added or removeds members TName information and CallId. |
|
1505 |
// ----------------------------------------------------------------------------- |
|
1506 |
// |
|
1507 |
TInt CPECallHandling::GetConferenceMemberNameAndId( |
|
1508 |
TName& aCallName, // Added or removed members TName information is returned here |
|
1509 |
TInt& aMemberCallId ) // Added or removed members callid is returned here |
|
1510 |
{ |
|
1511 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::GetConferenceMemberNameAndId" ); |
|
1512 |
TInt errorCode( ECCPErrorNotFound ); |
|
1513 |
||
1514 |
if ( iConferenceCall ) |
|
1515 |
{ |
|
1516 |
iConferenceCall->GetConferenceMemberName( aCallName ); |
|
1517 |
MPECall* call = iCallArrayOwner->CallByName( aCallName ); |
|
1518 |
||
1519 |
if( call ) |
|
1520 |
{ |
|
1521 |
aMemberCallId = call->GetCallId(); |
|
1522 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GetConferenceMemberNameAndId CallId %d", aMemberCallId ); |
|
1523 |
errorCode = KErrNone; |
|
1524 |
} |
|
1525 |
else |
|
1526 |
{ |
|
1527 |
aMemberCallId = -1; |
|
1528 |
aCallName = KNullDesC; |
|
1529 |
} |
|
1530 |
} |
|
1531 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GetConferenceMemberNameAndId errorCode %d", errorCode ); |
|
1532 |
return errorCode; |
|
1533 |
} |
|
1534 |
||
1535 |
// ----------------------------------------------------------------------------- |
|
1536 |
// CPECallHandling::GetCallControlCaps |
|
1537 |
// returns call info |
|
1538 |
// Method checks that call id is valid number |
|
1539 |
// Method gets CPESingleCall object from the CArrayPtrFlat and |
|
1540 |
// Method gets call info from CPESingleCall object |
|
1541 |
// ----------------------------------------------------------------------------- |
|
1542 |
// |
|
1543 |
TInt CPECallHandling::GetCallControlCaps( |
|
1544 |
TPECallControlCaps& aCallControlCaps, |
|
1545 |
TInt aCallId ) |
|
1546 |
{ |
|
1547 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GetCallControlCaps %d", aCallId ); |
|
1548 |
CPESingleCall* callData; |
|
1549 |
TInt errorCode( ECCPErrorNotFound ); |
|
1550 |
MCCECallObserver::TCCECallControlCaps callControlCaps; |
|
1551 |
callData = iCallArrayOwner->GetCallObject( aCallId ); |
|
1552 |
||
1553 |
if ( callData ) |
|
1554 |
{ |
|
1555 |
callData->GetCallControlCaps( callControlCaps ); |
|
1556 |
aCallControlCaps = static_cast<TPECallControlCaps>( callControlCaps ); |
|
1557 |
errorCode = KErrNone; |
|
1558 |
} |
|
1559 |
return errorCode; |
|
1560 |
} |
|
1561 |
||
1562 |
// ----------------------------------------------------------------------------- |
|
1563 |
// CPECallHandling::GetConferenceCallCaps |
|
1564 |
// returns conference call capabilities |
|
1565 |
// Checks that call id is valid and gets CPEConferenceCall object and calls its method |
|
1566 |
// to get capabilities |
|
1567 |
// ----------------------------------------------------------------------------- |
|
1568 |
// |
|
1569 |
TInt CPECallHandling::GetConferenceCallCaps( |
|
1570 |
TUint32& aCaps ) // capabilities are returned in this parameter |
|
1571 |
{ |
|
1572 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::GetConferenceCallCaps" ); |
|
1573 |
TInt errorCode( ECCPErrorNotFound ); |
|
1574 |
if ( iConferenceCall ) |
|
1575 |
{ |
|
1576 |
aCaps = iConferenceCall->CallCaps(); |
|
1577 |
errorCode = KErrNone; |
|
1578 |
} |
|
1579 |
return errorCode; |
|
1580 |
} |
|
1581 |
||
1582 |
// ----------------------------------------------------------------------------- |
|
1583 |
// CPECallHandling::AddMember |
|
1584 |
// Adds member to the conference call |
|
1585 |
// ----------------------------------------------------------------------------- |
|
1586 |
// |
|
1587 |
TInt CPECallHandling::AddMember( |
|
1588 |
TInt aCallId ) |
|
1589 |
{ |
|
1590 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::AddMember %d", aCallId ); |
|
1591 |
TInt errorCode( KErrNone ); |
|
1592 |
TRAP( errorCode, AddMemberL( aCallId )); |
|
1593 |
return errorCode; |
|
1594 |
} |
|
1595 |
||
1596 |
||
1597 |
// ----------------------------------------------------------------------------- |
|
1598 |
// CPECallHandling::AddMemberL |
|
1599 |
// Adds member to the conference call |
|
1600 |
// ----------------------------------------------------------------------------- |
|
1601 |
// |
|
1602 |
void CPECallHandling::AddMemberL( |
|
1603 |
TInt aCallId ) |
|
1604 |
{ |
|
1605 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::AddMemberL" ); |
|
1606 |
CPESingleCall* callData; |
|
1607 |
callData = iCallArrayOwner->GetCallObject( aCallId ); |
|
1608 |
||
1609 |
if ( callData && iConferenceCall && CallIdCheck::IsVoice( aCallId )) |
|
1610 |
{ |
|
1611 |
iConferenceCall->AddCallL( callData->Call() ); |
|
1612 |
} |
|
1613 |
else |
|
1614 |
{ |
|
1615 |
User::Leave( ECCPErrorNotFound ); |
|
1616 |
} |
|
1617 |
} |
|
1618 |
||
1619 |
// ----------------------------------------------------------------------------- |
|
1620 |
// CPECallHandling::CallTerminatedError |
|
1621 |
// Handles RemoteTerminated. |
|
1622 |
// ----------------------------------------------------------------------------- |
|
1623 |
// |
|
1624 |
EXPORT_C TInt CPECallHandling::CallTerminatedError( |
|
1625 |
const TInt aCallId ) |
|
1626 |
{ |
|
1627 |
TInt errorCode( KErrNone ); |
|
1628 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::CallTerminatedError" ); |
|
1629 |
CPESingleCall* callObject = iCallArrayOwner->GetCallObject( aCallId ); |
|
1630 |
if ( callObject ) |
|
1631 |
{ |
|
1632 |
callObject->GetErrorCode( errorCode ); |
|
1633 |
} |
|
1634 |
||
1635 |
return errorCode; |
|
1636 |
} |
|
1637 |
||
1638 |
// ----------------------------------------------------------------------------- |
|
1639 |
// CPECallHandling::BuildConference |
|
1640 |
// creates conference call |
|
1641 |
// ----------------------------------------------------------------------------- |
|
1642 |
// |
|
1643 |
EXPORT_C TInt CPECallHandling::BuildConference() |
|
1644 |
{ |
|
1645 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::BuildConference" ); |
|
1646 |
TInt heldcallid; |
|
1647 |
CPESingleCall* heldcall( NULL ); |
|
1648 |
TInt connectedcallid; |
|
1649 |
CPESingleCall* connectedcall( NULL ); |
|
1650 |
TInt errorCode( ECCPErrorNotAllowed ); |
|
1651 |
||
1652 |
heldcall = VoiceCallDataByState( EPEStateHeld, heldcallid ); |
|
1653 |
if ( heldcall ) |
|
1654 |
{ |
|
1655 |
connectedcall = VoiceCallDataByState( EPEStateConnected, connectedcallid ); |
|
1656 |
||
1657 |
if ( connectedcall ) |
|
1658 |
{ |
|
1659 |
TRAP( errorCode, CreateConferenceCallL( *heldcall, *connectedcall ) ); |
|
1660 |
} |
|
1661 |
} |
|
1662 |
||
1663 |
return errorCode; |
|
1664 |
} |
|
1665 |
||
1666 |
// ----------------------------------------------------------------------------- |
|
1667 |
// CPECallHandling::SwapCalls |
|
1668 |
// resumes a held call |
|
1669 |
// Method search active and held call |
|
1670 |
// Method gets CPESingleCall object from the CArrayPtrFlat and |
|
1671 |
// Method checks that call is in held state |
|
1672 |
// Method makes swap request to CPESingleCall object. |
|
1673 |
// ----------------------------------------------------------------------------- |
|
1674 |
// |
|
1675 |
EXPORT_C TInt CPECallHandling::SwapCalls() |
|
1676 |
{ |
|
1677 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::SwapCalls" ); |
|
1678 |
TInt callIndex; |
|
1679 |
CPESingleCall* callData; |
|
1680 |
TInt errorCode( ECCPErrorNotFound ); |
|
1681 |
||
1682 |
if ( ( iConferenceCall ) && |
|
1683 |
( iConferenceCall->GetCallState() == EPEStateConnectedConference ) ) |
|
1684 |
{ |
|
1685 |
errorCode = iConferenceCall->Swap(); |
|
1686 |
} |
|
1687 |
else |
|
1688 |
{ |
|
1689 |
callData = VoiceCallDataByState( EPEStateConnected, callIndex ); |
|
1690 |
if( callData ) |
|
1691 |
{ |
|
1692 |
errorCode = callData->Swap(); |
|
1693 |
} |
|
1694 |
} |
|
1695 |
||
1696 |
return errorCode; |
|
1697 |
} |
|
1698 |
||
1699 |
// ----------------------------------------------------------------------------- |
|
1700 |
// CPECallHandling::AddConferenceMember |
|
1701 |
// Handles add conference member |
|
1702 |
// ----------------------------------------------------------------------------- |
|
1703 |
// |
|
1704 |
EXPORT_C TInt CPECallHandling::AddConferenceMember() |
|
1705 |
{ |
|
1706 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::AddConferenceMember" ); |
|
1707 |
||
1708 |
CPESingleCall* callData; |
|
1709 |
TInt errorCode( ECCPErrorNotFound ); |
|
1710 |
TPEState callState; |
|
1711 |
||
1712 |
// Checks that call is single call and state of call is connected or held |
|
1713 |
for( TInt callId = 0; callId < KPEMaximumNumberOfVoiceCalls; callId++ ) |
|
1714 |
{ |
|
1715 |
callData = iCallArrayOwner->GetCallObject( callId ); |
|
1716 |
if( callData ) |
|
1717 |
{ |
|
1718 |
// Check that call is not already join to Conference |
|
1719 |
if ( iModel.DataStore()->IsConferenceMemberId( callId ) == KPECallIdNotUsed ) |
|
1720 |
{ |
|
1721 |
callState = callData->GetCallState(); |
|
1722 |
if ( callState == EPEStateConnected || callState == EPEStateHeld ) |
|
1723 |
{ |
|
1724 |
TEFLOGSTRING2( KTAINT, |
|
1725 |
"CALL CPECallHandling::AddConferenceMember > AddMember, CallId = %d" |
|
1726 |
, callId ); |
|
1727 |
errorCode = AddMember( callId ); |
|
1728 |
break; |
|
1729 |
} |
|
1730 |
} |
|
1731 |
} |
|
1732 |
} |
|
1733 |
return errorCode; |
|
1734 |
} |
|
1735 |
||
1736 |
// ----------------------------------------------------------------------------- |
|
1737 |
// CPECallHandling::DropMember |
|
1738 |
// drops member from the conference call |
|
1739 |
// ----------------------------------------------------------------------------- |
|
1740 |
// |
|
1741 |
EXPORT_C TInt CPECallHandling::DropMember( |
|
1742 |
TInt aCallId ) |
|
1743 |
{ |
|
1744 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::DropMember %d", aCallId ); |
|
1745 |
CPESingleCall* callData; |
|
1746 |
TInt errorCode( ECCPErrorNotFound ); |
|
1747 |
||
1748 |
if ( CallIdCheck::IsVoice( aCallId )) |
|
1749 |
{ |
|
1750 |
callData = iCallArrayOwner->GetCallObject( aCallId ); |
|
1751 |
if ( callData ) |
|
1752 |
{ |
|
1753 |
callData->HangUp(); |
|
1754 |
errorCode = KErrNone; |
|
1755 |
} |
|
1756 |
} |
|
1757 |
return errorCode; |
|
1758 |
} |
|
1759 |
||
1760 |
// ----------------------------------------------------------------------------- |
|
1761 |
// CPECallHandling::GoOneToOne |
|
1762 |
// Splits one call to private conversation. |
|
1763 |
// ----------------------------------------------------------------------------- |
|
1764 |
// |
|
1765 |
EXPORT_C TInt CPECallHandling::GoOneToOne( |
|
1766 |
TInt aCallId ) |
|
1767 |
{ |
|
1768 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GoOneToOne %d", aCallId ); |
|
1769 |
TInt errorCode( ECCPErrorNotFound ); |
|
1770 |
CPESingleCall* callData; |
|
1771 |
||
1772 |
callData = iCallArrayOwner->GetCallObject( aCallId ); |
|
1773 |
||
1774 |
if ( iConferenceCall && callData ) |
|
1775 |
{ |
|
1776 |
TRAP( errorCode, iConferenceCall->GoOneToOneL( callData->Call() ) ); |
|
1777 |
} |
|
1778 |
return errorCode; |
|
1779 |
} |
|
1780 |
||
1781 |
// ----------------------------------------------------------------------------- |
|
1782 |
// CPECallHandling::HoldCall |
|
1783 |
// holds an active call |
|
1784 |
// Method checks that call id is valid number and |
|
1785 |
// Method gets CPESingleCall object from the CArrayPtrFlat and |
|
1786 |
// Method checks that call is in connected state |
|
1787 |
// Method makes hold request to CPESingleCall object. |
|
1788 |
// ----------------------------------------------------------------------------- |
|
1789 |
// |
|
1790 |
EXPORT_C TInt CPECallHandling::HoldCall() |
|
1791 |
{ |
|
1792 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::HoldCall" ); |
|
1793 |
CPESingleCall* callData; |
|
1794 |
TInt callIndex; |
|
1795 |
TInt errorCode( ECCPErrorNotAllowed ); |
|
1796 |
||
1797 |
if ( iConferenceCall && ( iConferenceCall->GetCallState() == EPEStateConnectedConference ) ) |
|
1798 |
{ |
|
1799 |
// hold was explicitly requested by the user, |
|
1800 |
// update information to engine info |
|
1801 |
iModel.DataStore()->SetResumeHeldCall( EFalse, KPEConferenceCallID ); |
|
1802 |
errorCode = iConferenceCall->Swap(); |
|
1803 |
} |
|
1804 |
else |
|
1805 |
{ |
|
1806 |
callData = VoiceCallDataByState( EPEStateConnected, callIndex ); |
|
1807 |
if( callData ) |
|
1808 |
{ |
|
1809 |
// hold was explicitly requested by the user, |
|
1810 |
// update information to engine info |
|
1811 |
iModel.DataStore()->SetResumeHeldCall( EFalse, callIndex ); |
|
1812 |
errorCode = callData->Hold(); |
|
1813 |
} |
|
1814 |
} |
|
1815 |
||
1816 |
return errorCode; |
|
1817 |
} |
|
1818 |
||
1819 |
// ----------------------------------------------------------------------------- |
|
1820 |
// CPECallHandling::ResumeCall |
|
1821 |
// resumes a held call |
|
1822 |
// Method checks that call id is valid number and |
|
1823 |
// Method gets CPESingleCall object from the CArrayPtrFlat and |
|
1824 |
// Method checks that call is in held state |
|
1825 |
// Method makes resume request to CPESingleCall object. |
|
1826 |
// ----------------------------------------------------------------------------- |
|
1827 |
// |
|
1828 |
EXPORT_C TInt CPECallHandling::ResumeCall() |
|
1829 |
{ |
|
1830 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::ResumeCall" ); |
|
1831 |
CPESingleCall* callData; |
|
1832 |
TInt callIndex; |
|
1833 |
TInt errorCode( ECCPErrorNotAllowed ); |
|
1834 |
||
1835 |
if ( iConferenceCall && ( iConferenceCall->GetCallState() == EPEStateHeldConference ) ) |
|
1836 |
{ |
|
1837 |
// resume was explicitly requested by the user, update information to engine info |
|
1838 |
iModel.DataStore()->SetResumeHeldCall( ETrue, KPEConferenceCallID ); |
|
1839 |
errorCode = iConferenceCall->Swap(); |
|
1840 |
} |
|
1841 |
else |
|
1842 |
{ |
|
1843 |
callData = VoiceCallDataByState( EPEStateHeld, callIndex ); |
|
1844 |
if( callData ) |
|
1845 |
{ |
|
1846 |
// resume was explicitly requested by the user, update information to engine info |
|
1847 |
iModel.DataStore()->SetResumeHeldCall( ETrue, callIndex ); |
|
1848 |
errorCode = callData->Resume(); |
|
1849 |
} |
|
1850 |
} |
|
1851 |
||
1852 |
return errorCode; |
|
1853 |
} |
|
1854 |
||
1855 |
// ----------------------------------------------------------------------------- |
|
1856 |
// CPECallHandling::TransferCalls |
|
1857 |
// transfers the held party to the active party |
|
1858 |
// Method search active and held call |
|
1859 |
// Method gets CPESingleCall object from the CArrayPtrFlat and |
|
1860 |
// Method checks that call is in held state |
|
1861 |
// Method makes transfer request to CPESingleCall object. |
|
1862 |
// ----------------------------------------------------------------------------- |
|
1863 |
// |
|
1864 |
EXPORT_C TInt CPECallHandling::TransferCalls() |
|
1865 |
{ |
|
1866 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::TransferCalls" ); |
|
1867 |
TInt callIndex; |
|
1868 |
CPESingleCall* callData; |
|
1869 |
CPESingleCall* callDataHeld; |
|
1870 |
TInt errorCode( ECCPErrorNotAllowed ); |
|
1871 |
||
1872 |
callDataHeld = VoiceCallDataByState( EPEStateHeld, callIndex ); |
|
1873 |
if( callDataHeld && !iConferenceCall ) |
|
1874 |
{ // found one held call |
|
1875 |
callData = VoiceCallDataByState( EPEStateConnected, callIndex ); |
|
1876 |
if ( callData ) // found the connected call |
|
1877 |
{ |
|
1878 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::TransferCalls > Transfer" ); |
|
1879 |
callDataHeld->Transfer( callData->Call().DialledParty() ); |
|
1880 |
errorCode = KErrNone; |
|
1881 |
} |
|
1882 |
else |
|
1883 |
{ |
|
1884 |
callData = VoiceCallDataByState( EPEStateConnecting, callIndex ); |
|
1885 |
if ( callData ) // The connecting call found |
|
1886 |
{ |
|
1887 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::TransferCalls > Transfer" ); |
|
1888 |
callDataHeld->Transfer( callData->Call().DialledParty() ); |
|
1889 |
errorCode = KErrNone; |
|
1890 |
} |
|
1891 |
} |
|
1892 |
} |
|
1893 |
||
1894 |
return errorCode; |
|
1895 |
} |
|
1896 |
||
1897 |
// ----------------------------------------------------------------------------- |
|
1898 |
// CPECallHandling::DialEmergencyCall |
|
1899 |
// creates emergency dial request to the CPESingleCall object |
|
1900 |
// Method gets CPESingleCall object from the CArrayPtrFlat |
|
1901 |
// Method makes emergency dial request |
|
1902 |
// ----------------------------------------------------------------------------- |
|
1903 |
// |
|
1904 |
EXPORT_C void CPECallHandling::DialEmergencyCall( const TPEPhoneNumber& aEmergencyNumber ) |
|
1905 |
{ |
|
1906 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DialEmergencyCall" ); |
|
1907 |
||
1908 |
SendMessage( MEngineMonitor::EPEMessageInitiatedEmergencyCall ); |
|
1909 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DialEmergencyCall start emergency dialing" ); |
|
1910 |
CPESingleCall* callData = iCallArrayOwner->GetCallObject( KPEEmergencyCallId ); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1911 |
if ( callData ) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1912 |
{ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1913 |
callData->DialEmergency( aEmergencyNumber ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1914 |
} |
37 | 1915 |
} |
1916 |
||
1917 |
// ----------------------------------------------------------------------------- |
|
1918 |
// CPECallHandling::GetCallTerminatedDiagnostics |
|
1919 |
// Returns call terminated diagnostics of a call |
|
1920 |
// Method returns valid info only after call state has changed to Idle. |
|
1921 |
// ----------------------------------------------------------------------------- |
|
1922 |
// |
|
1923 |
EXPORT_C TInt CPECallHandling::GetCallTerminatedDiagnostics( |
|
1924 |
TName& /*aCallName*/ ) const |
|
1925 |
{ |
|
1926 |
||
1927 |
TInt diagnosticsInfo = 0/*iCustomAPI.GetDiagnosticInfo( aCallName )*/; |
|
1928 |
TEFLOGSTRING2( KTAMESIN, |
|
1929 |
"CALL CPECallHandling::GetCallTerminatedDiagnostics: RMmCustomAPI::GetDiagnosticInfo, diagnosticInfo: %d", |
|
1930 |
diagnosticsInfo ); |
|
1931 |
return diagnosticsInfo; |
|
1932 |
} |
|
1933 |
||
1934 |
// ----------------------------------------------------------------------------- |
|
1935 |
// CPECallHandling::CreateConferenceCallL |
|
1936 |
// ----------------------------------------------------------------------------- |
|
1937 |
// |
|
1938 |
void CPECallHandling::CreateConferenceCallL( |
|
1939 |
CPESingleCall& aCall1, |
|
1940 |
CPESingleCall& aCall2 ) |
|
1941 |
{ |
|
1942 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::CreateConferenceCallL start" ); |
|
1943 |
if( !iConferenceCall ) |
|
1944 |
{ |
|
1945 |
iConferenceCall = CPEConferenceCall::NewL( *this, iConvergedCallEngine ); |
|
1946 |
iConferenceCall->SetCallId( KPEConferenceCallID ); |
|
1947 |
iConferenceCall->AddCallL( aCall1.Call() ); |
|
1948 |
iConferenceCall->AddCallL( aCall2.Call() ); |
|
1949 |
InitialiseConferenceCallInfo( aCall1.Call(), aCall2.Call() ); |
|
1950 |
} |
|
1951 |
else |
|
1952 |
{ |
|
1953 |
TEFLOGSTRING( KTAERROR, "CALL CPECallHandling::CreateConferenceCallL already exist" ); |
|
1954 |
User::Leave( KErrAlreadyExists ); |
|
1955 |
} |
|
1956 |
||
1957 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::CreateConferenceCallL end" ); |
|
1958 |
} |
|
1959 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1960 |
|
37 | 1961 |
// ----------------------------------------------------------------------------- |
1962 |
// CPECallHandling::UpdateSaSetting |
|
1963 |
// ----------------------------------------------------------------------------- |
|
1964 |
// |
|
1965 |
void CPECallHandling::UpdateSaSetting() |
|
1966 |
{ |
|
1967 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::UpdateSaSetting start" ); |
|
1968 |
||
1969 |
TUnconditionalCFStatus status( KCFIndicatorUnknown ); |
|
1970 |
TSelectedLine line( ENotSupportedLine ); |
|
1971 |
CCCECallParameters::TCCELineType lineType( CCCECallParameters::ECCELineTypePrimary ); |
|
1972 |
CPESingleCall* call( NULL ); |
|
1973 |
TCallDivertNotifySetting notifySet; |
|
1974 |
notifySet.Initialize(); |
|
1975 |
notifySet.iCfActivated = ETrue; |
|
1976 |
||
1977 |
// Get dialing call object |
|
1978 |
call = iCallArrayOwner->CallPointerByState( EPEStateDialing ); |
|
1979 |
||
1980 |
// Determinate als support and used line |
|
1981 |
lineType = iModel.DataStore()->ALSLine(); |
|
1982 |
if( iModel.DataStore()->ALSLineSupport() ) |
|
1983 |
{ |
|
1984 |
if( CCCECallParameters::ECCELineTypePrimary == lineType ) |
|
1985 |
{ |
|
1986 |
line = EPrimaryLine; |
|
1987 |
} |
|
1988 |
else |
|
1989 |
{ |
|
1990 |
line = EAuxiliaryLine; |
|
1991 |
} |
|
1992 |
} |
|
1993 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::UpdateSaSetting line %d", line ); |
|
1994 |
||
1995 |
// Determinate basic service code |
|
1996 |
notifySet.iBasicServiceCode = DefineDivertBsc( lineType, call ); |
|
1997 |
||
1998 |
// Create phonesetting connection |
|
1999 |
if( !iPsetSAObserver ) |
|
2000 |
{ |
|
2001 |
TRAPD( errorCode, iPsetSAObserver = CPsetSAObserver::NewL() ); |
|
2002 |
if( errorCode != KErrNone ) |
|
2003 |
{ |
|
2004 |
TEFLOGSTRING2( |
|
2005 |
KTAERROR, |
|
2006 |
"CALL CPECallHandling::UpdateSaSetting FAIL with error %d", |
|
2007 |
errorCode ); |
|
2008 |
return; |
|
2009 |
} |
|
2010 |
} |
|
2011 |
||
2012 |
// Get diver status |
|
2013 |
TInt error = iPsetSAObserver->GetCurrentDivertStatus( status ); |
|
2014 |
if ( error != KErrNone ) |
|
2015 |
{ |
|
2016 |
status = KCFNoCallsForwarded; |
|
2017 |
} |
|
2018 |
notifySet.iPreviousCfStatus = status; |
|
2019 |
||
2020 |
// Update dovert indicator. |
|
2021 |
iPsetSAObserver->NotifyDivertChange( |
|
2022 |
line, |
|
2023 |
notifySet, |
|
2024 |
0 ); |
|
2025 |
||
2026 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::UpdateSaSetting end" ); |
|
2027 |
} |
|
2028 |
||
2029 |
// ----------------------------------------------------------------------------- |
|
2030 |
// CPECallHandling::DefineDivertBsc |
|
2031 |
// ----------------------------------------------------------------------------- |
|
2032 |
// |
|
2033 |
TInt CPECallHandling::DefineDivertBsc( CCCECallParameters::TCCELineType aLineType, |
|
2034 |
CPESingleCall* call ) |
|
2035 |
{ |
|
2036 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc start" ); |
|
2037 |
TInt bsc( EAllTele ); |
|
2038 |
||
2039 |
if ( !call ) |
|
2040 |
{ |
|
2041 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc EUnknown" ); |
|
2042 |
bsc = EUnknown; |
|
2043 |
return bsc; |
|
2044 |
} |
|
2045 |
else if ( call->Call().Parameters().CallType() == CCPCall::ECallTypeVideo ) |
|
2046 |
{ |
|
2047 |
// If initiated call is video set bsc as ESyncData. |
|
2048 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc ESyncData" ); |
|
2049 |
bsc = ESyncData; |
|
2050 |
return bsc; |
|
2051 |
} |
|
2052 |
||
2053 |
switch ( aLineType ) |
|
2054 |
{ |
|
2055 |
case CCCECallParameters::ECCELineTypePrimary: |
|
2056 |
// Call is done using line 1. |
|
2057 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc EAllTele" ); |
|
2058 |
bsc = EAllTele; |
|
2059 |
break; |
|
2060 |
case CCCECallParameters::ECCELineTypeAux: |
|
2061 |
// Call is done using line 2. |
|
2062 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc EAltTele" ); |
|
2063 |
bsc = EAltTele; |
|
2064 |
break; |
|
2065 |
default: |
|
2066 |
// Defauld case no alternate line service. |
|
2067 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc EAllTele default" ); |
|
2068 |
bsc = EAllTele; |
|
2069 |
break; |
|
2070 |
} |
|
2071 |
||
2072 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::DefineDivertBsc end, bsc = %d", bsc ); |
|
2073 |
return bsc; |
|
2074 |
} |
|
2075 |
||
2076 |
// ----------------------------------------------------------------------------- |
|
2077 |
// CPECallHandling::ReplaceActive |
|
2078 |
// Terminates an active call and answer waiting call |
|
2079 |
// ----------------------------------------------------------------------------- |
|
2080 |
// |
|
2081 |
EXPORT_C TInt CPECallHandling::ReplaceActive() |
|
2082 |
{ |
|
2083 |
TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::ReplaceActive"); |
|
2084 |
TInt errorCode( ECCPErrorNotFound ); |
|
2085 |
TInt callIdConnected = KPECallIdNotUsed; |
|
2086 |
||
2087 |
CPESingleCall* replacingcall = iCallArrayOwner->CallPointerByState( EPEStateRinging ); |
|
2088 |
||
2089 |
if( iConferenceCall && iConferenceCall->GetCallState() == EPEStateConnectedConference ) |
|
2090 |
{ |
|
2091 |
callIdConnected = iConferenceCall->GetCallId(); |
|
2092 |
} |
|
2093 |
else |
|
2094 |
{ |
|
2095 |
CPESingleCall* connectedcall = iCallArrayOwner->CallPointerByState( EPEStateConnected ); |
|
2096 |
if ( connectedcall ) |
|
2097 |
{ |
|
2098 |
callIdConnected = connectedcall->GetCallId(); |
|
2099 |
} |
|
2100 |
} |
|
2101 |
if ( callIdConnected != KPECallIdNotUsed && replacingcall ) |
|
2102 |
{ |
|
2103 |
if( CallIdCheck::IsConference( callIdConnected ) || CallIdCheck::IsVoice( callIdConnected ) ) |
|
2104 |
{ |
|
2105 |
iReplaceActive = ETrue; |
|
2106 |
errorCode = HangUp( callIdConnected , ETPEHangUpNotResumeHeldCall ); |
|
2107 |
TEFLOGSTRING2( KTAMESINT, "CALL CPECallHandling::ReplaceActive HangUp error %d", errorCode ); |
|
2108 |
if ( !CallIdCheck::IsConference( callIdConnected ) && errorCode == KErrNone ) // Conference replace when idle |
|
2109 |
{ |
|
2110 |
errorCode = AnswerCall(); |
|
2111 |
iReplaceActive = EFalse; |
|
2112 |
TEFLOGSTRING2( KTAMESINT, "CALL CPECallHandling::ReplaceActive AnswerCall error %d", errorCode ); |
|
2113 |
} |
|
2114 |
else if ( errorCode != KErrNone ) |
|
2115 |
{ |
|
2116 |
iReplaceActive = EFalse; |
|
2117 |
} |
|
2118 |
} |
|
2119 |
else |
|
2120 |
{ |
|
2121 |
errorCode = iVideoCallHandling->ReplaceActive( callIdConnected ); |
|
2122 |
TEFLOGSTRING2( KTAMESINT, "CALL CPECallHandling::ReplaceActive DataCallHandling::ReplaceActive error %d", errorCode ); |
|
2123 |
} |
|
2124 |
} |
|
2125 |
else |
|
2126 |
{ |
|
2127 |
TEFLOGSTRING( KTAERROR, "CALL CPECALLHANDLING::REPLACEACTIVE ! CALL OBJECT NOT FOUND" ); |
|
2128 |
} |
|
2129 |
||
2130 |
return errorCode; |
|
2131 |
} |
|
2132 |
||
2133 |
// ----------------------------------------------------------------------------- |
|
2134 |
// CPECallHandling::AcceptUnattendedTransfer |
|
2135 |
// ----------------------------------------------------------------------------- |
|
2136 |
// |
|
2137 |
EXPORT_C TInt CPECallHandling::AcceptUnattendedTransfer() |
|
2138 |
{ |
|
2139 |
TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::AcceptUnattendedTransfer" ); |
|
2140 |
||
2141 |
TInt callId = iModel.DataStore()->CallId(); |
|
2142 |
CPESingleCall* call = iCallArrayOwner->GetCallObject( callId ); |
|
2143 |
__ASSERT_DEBUG( NULL != call, Panic( EPEPanicIllegalCommand ) ); |
|
2144 |
if ( NULL != call ) |
|
2145 |
{ |
|
2146 |
return call->AcceptUnattendedTransfer(); |
|
2147 |
} |
|
2148 |
else |
|
2149 |
{ |
|
2150 |
return KErrNotFound; |
|
2151 |
} |
|
2152 |
} |
|
2153 |
||
2154 |
// ----------------------------------------------------------------------------- |
|
2155 |
// CPECallHandling::RejectUnattendedTransfer |
|
2156 |
// ----------------------------------------------------------------------------- |
|
2157 |
// |
|
2158 |
EXPORT_C TInt CPECallHandling::RejectUnattendedTransfer() |
|
2159 |
{ |
|
2160 |
TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::RejectUnattendedTransfer" ); |
|
2161 |
||
2162 |
TInt callId = iModel.DataStore()->CallId(); |
|
2163 |
CPESingleCall* call = iCallArrayOwner->GetCallObject( callId ); |
|
2164 |
__ASSERT_DEBUG( NULL != call, Panic( EPEPanicIllegalCommand ) ); |
|
2165 |
if ( NULL != call ) |
|
2166 |
{ |
|
2167 |
return call->RejectUnattendedTransfer(); |
|
2168 |
} |
|
2169 |
else |
|
2170 |
{ |
|
2171 |
return KErrNotFound; |
|
2172 |
} |
|
2173 |
} |
|
2174 |
||
2175 |
// ----------------------------------------------------------------------------- |
|
2176 |
// CPECallHandling::DoUnattendedTransfer |
|
2177 |
// Does unattended transfer request for the connected VoIP call |
|
2178 |
// ----------------------------------------------------------------------------- |
|
2179 |
// |
|
2180 |
EXPORT_C TInt CPECallHandling::DoUnattendedTransfer( const TDesC& aTransferTarget ) |
|
2181 |
{ |
|
2182 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DoUnattendedTransfer" ); |
|
2183 |
CPESingleCall* callData; |
|
2184 |
TInt callIndex; |
|
2185 |
TInt errorCode( ECCPErrorNotAllowed ); |
|
2186 |
callData = VoiceCallDataByState( EPEStateConnected, callIndex ); |
|
2187 |
||
2188 |
if( callData ) |
|
2189 |
{ |
|
2190 |
errorCode = callData->UnattendedTransfer( aTransferTarget ); |
|
2191 |
} |
|
2192 |
||
2193 |
return errorCode; |
|
2194 |
} |
|
2195 |
||
2196 |
// ----------------------------------------------------------------------------- |
|
2197 |
// CPECallHandling::ForwardCallToAddress |
|
2198 |
// Forwards call by user selected address |
|
2199 |
// ----------------------------------------------------------------------------- |
|
2200 |
// |
|
2201 |
EXPORT_C TInt CPECallHandling::ForwardCallToAddress( TInt aIndex ) |
|
2202 |
{ |
|
2203 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::ForwardCallToAddress" ); |
|
2204 |
CPESingleCall* callData; |
|
2205 |
TInt callIndex; |
|
2206 |
TInt errorCode( ECCPErrorNotAllowed ); |
|
2207 |
callData = VoiceCallDataByState( EPEStateDialing, callIndex ); |
|
2208 |
||
2209 |
if ( NULL == callData ) |
|
2210 |
{ |
|
2211 |
callData = VoiceCallDataByState( EPEStateConnecting, callIndex ); |
|
2212 |
} |
|
2213 |
||
2214 |
if ( NULL == callData ) |
|
2215 |
{ |
|
2216 |
callData = VoiceCallDataByState( EPEStateConnected, callIndex ); |
|
2217 |
} |
|
2218 |
||
2219 |
if( callData ) |
|
2220 |
{ |
|
2221 |
errorCode = callData->ForwardCallToAddress( aIndex ); |
|
2222 |
} |
|
2223 |
||
2224 |
return errorCode; |
|
2225 |
} |
|
2226 |
||
2227 |
// ----------------------------------------------------------------------------- |
|
2228 |
// CPECallHandling::SecureSpecified |
|
2229 |
// Returns the call secure specified status |
|
2230 |
// ----------------------------------------------------------------------------- |
|
2231 |
// |
|
2232 |
TBool CPECallHandling::SecureSpecified( const TInt aCallId ) const |
|
2233 |
{ |
|
2234 |
CPESingleCall* call = iCallArrayOwner->GetCallObject( aCallId ); |
|
2235 |
||
2236 |
__ASSERT_DEBUG( call, Panic( EPEPanicIndexOutOfRange ) ); |
|
2237 |
TBool secureSpecified( ETrue ); |
|
2238 |
if( call ) |
|
2239 |
{ |
|
2240 |
secureSpecified = call->SecureSpecified(); |
|
2241 |
} |
|
2242 |
||
2243 |
TEFLOGSTRING3( |
|
2244 |
KTAINT, |
|
2245 |
"PE CPECallHandling::SecureSpecified securespecified:%d aCallId:%d", |
|
2246 |
secureSpecified, aCallId ); |
|
2247 |
||
2248 |
return secureSpecified; |
|
2249 |
} |
|
2250 |
||
2251 |
// ----------------------------------------------------------------------------- |
|
2252 |
// CPECallHandling::InitConferenceCall |
|
2253 |
// ----------------------------------------------------------------------------- |
|
2254 |
// |
|
2255 |
void CPECallHandling::InitConferenceCall( MCCEConferenceCall& aConference ) |
|
2256 |
{ |
|
2257 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::InitConferenceCall start" ); |
|
2258 |
if( iConferenceCall ) |
|
2259 |
{ |
|
2260 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::InitConferenceCall already exist" ); |
|
2261 |
delete iConferenceCall; |
|
2262 |
iConferenceCall = NULL; |
|
2263 |
} |
|
2264 |
||
2265 |
TRAPD( error, ( iConferenceCall = CPEConferenceCall::NewL( *this, aConference ) ) ); |
|
2266 |
if( error != KErrNone ) |
|
2267 |
{ |
|
2268 |
SendMessage( MEngineMonitor::EPEMessageConferenceErrorCurrentCallsToConference ); |
|
2269 |
RPointerArray<MCCECall> callArray; |
|
2270 |
TInt err = aConference.GetCallArray( callArray ); |
|
2271 |
for( TInt index = 0 ; index < callArray.Count() ; index++ ) |
|
2272 |
{ |
|
2273 |
TRAP_IGNORE( aConference.RemoveCallL( *callArray[index] ) ); |
|
2274 |
} |
|
2275 |
aConference.Release(); |
|
2276 |
callArray.Close(); |
|
2277 |
TEFLOGSTRING( KTAERROR, "CALL CPECallHandling::InitConferenceCall FAIL" ); |
|
2278 |
} |
|
2279 |
else |
|
2280 |
{ |
|
2281 |
iConferenceCall->SetCallId( KPEConferenceCallID ); |
|
2282 |
||
2283 |
RPointerArray<MCCECall> callArray; |
|
2284 |
TInt err = aConference.GetCallArray( callArray ); |
|
2285 |
||
2286 |
if( err == KErrNone && callArray.Count() >= 2 ) |
|
2287 |
{ |
|
2288 |
InitialiseConferenceCallInfo( *callArray[0], *callArray[1] ); |
|
2289 |
iConferenceCall->CallStateChanged( MCCEConferenceCallObserver::ECCEConferenceActive ); |
|
2290 |
} |
|
2291 |
callArray.Close(); |
|
2292 |
} |
|
2293 |
||
2294 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::InitConferenceCall end" ); |
|
2295 |
} |
|
2296 |
||
2297 |
// ----------------------------------------------------------------------------- |
|
2298 |
// CPECallHandling::CallOwner |
|
2299 |
// ----------------------------------------------------------------------------- |
|
2300 |
// |
|
2301 |
EXPORT_C MPECallOwner& CPECallHandling::CallOwner() const |
|
2302 |
{ |
|
2303 |
return *iCallArrayOwner; |
|
2304 |
} |
|
2305 |
||
2306 |
// ----------------------------------------------------------------------------- |
|
2307 |
// CPECallHandling::InitialiseConferenceCallInfo |
|
2308 |
// ----------------------------------------------------------------------------- |
|
2309 |
// |
|
2310 |
void CPECallHandling::InitialiseConferenceCallInfo( |
|
2311 |
MCCECall& aCall1, |
|
2312 |
MCCECall& aCall2 ) |
|
2313 |
{ |
|
2314 |
TTimeIntervalSeconds call1Duration, call2Duration; |
|
2315 |
call1Duration = aCall1.CallDuration(); |
|
2316 |
call2Duration = aCall2.CallDuration(); |
|
2317 |
||
2318 |
// Set conference call duration to match the longest running call. |
|
2319 |
// If this is not done, zero call duration is shown in case the |
|
2320 |
// conference call fails or user rejects it instantly |
|
2321 |
// --- See CPEGsmMessageHandler::HandleConferenceIdleState how |
|
2322 |
// the duration is handled in these scenarios. |
|
2323 |
if ( call1Duration > call2Duration ) |
|
2324 |
{ |
|
2325 |
iModel.DataStore()->SetCallDuration( call1Duration.Int(), KPEConferenceCallID ); |
|
2326 |
} |
|
2327 |
else |
|
2328 |
{ |
|
2329 |
iModel.DataStore()->SetCallDuration( call2Duration.Int(), KPEConferenceCallID ); |
|
2330 |
} |
|
2331 |
||
2332 |
if ( aCall1.Parameters().CallType() |
|
2333 |
== CCPCall::ECallTypeCSVoice ) |
|
2334 |
{ |
|
2335 |
iModel.DataStore()->SetCallType( EPECallTypeCSVoice, KPEConferenceCallID ); |
|
2336 |
} |
|
2337 |
else if ( aCall1.Parameters().CallType() |
|
2338 |
== CCPCall::ECallTypePS ) |
|
2339 |
{ |
|
2340 |
iModel.DataStore()->SetCallType( EPECallTypeVoIP, KPEConferenceCallID ); |
|
2341 |
} |
|
2342 |
||
2343 |
__ASSERT_DEBUG( aCall1.ServiceId() == aCall2.ServiceId(), |
|
2344 |
Panic( EPEPanicInvalidParameter ) ); |
|
2345 |
iModel.DataStore()->SetServiceId( KPEConferenceCallID, aCall1.ServiceId() ); |
|
2346 |
} |
|
2347 |
||
2348 |
// ----------------------------------------------------------------------------- |
|
2349 |
// CPECallHandling::HandleAutoResume |
|
2350 |
// ----------------------------------------------------------------------------- |
|
2351 |
// |
|
2352 |
void CPECallHandling::HandleAutoResume() |
|
2353 |
{ |
|
2354 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::HandleAutoResume" ); |
|
2355 |
if ( iConferenceCall && ( iConferenceCall->GetCallState() == EPEStateHeldConference ) ) |
|
2356 |
{ |
|
2357 |
// Check that no conference + single case |
|
2358 |
CPESingleCall* callData = iCallArrayOwner->CallPointerByState( EPEStateConnected ); |
|
2359 |
if( !callData && iModel.DataStore()->ResumeHeldCall( KPEConferenceCallID )) |
|
2360 |
{ |
|
2361 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::HandleAutoResume conference" ); |
|
2362 |
iConferenceCall->Swap(); |
|
2363 |
} |
|
2364 |
} |
|
2365 |
else |
|
2366 |
{ |
|
2367 |
CPESingleCall* callData = iCallArrayOwner->CallPointerByState( EPEStateHeld ); |
|
2368 |
// Check that no actice and held call, if waiting call gets idle |
|
2369 |
CPESingleCall* connectedCallData = iCallArrayOwner->CallPointerByState( EPEStateConnected ); |
|
2370 |
if( callData && ( iModel.DataStore()->ResumeHeldCall( callData->GetCallId() ) ) |
|
2371 |
&& !connectedCallData ) |
|
2372 |
{ |
|
2373 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::HandleAutoResume single" ); |
|
2374 |
callData->Resume(); |
|
2375 |
} |
|
2376 |
} |
|
2377 |
} |
|
2378 |
||
2379 |
// ----------------------------------------------------------------------------- |
|
2380 |
// CPECallHandling::ReleaseCallObject |
|
2381 |
// ----------------------------------------------------------------------------- |
|
2382 |
// |
|
2383 |
TInt CPECallHandling::ReleaseCallObject( const TInt aCallId ) |
|
2384 |
{ |
|
2385 |
TInt error(KErrNone); |
|
2386 |
TEFLOGSTRING2( KTAINT, |
|
2387 |
"CALL CPECallHandling::ReleaseCallObject ReleaseCallObject %d", aCallId ); |
|
2388 |
error = iCallArrayOwner->DeleteCallObject( aCallId ); |
|
2389 |
// Reset datastore to prevent invalid usage in next call |
|
2390 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::ReleaseCallObject, Reset CallInfo" ); |
|
2391 |
iModel.DataStore()->ResetCallInfo( aCallId ); |
|
2392 |
return error; |
|
2393 |
} |
|
2394 |
||
2395 |
// ----------------------------------------------------------------------------- |
|
2396 |
// CPECallHandling::SetCallOrigin |
|
2397 |
// ----------------------------------------------------------------------------- |
|
2398 |
// |
|
2399 |
void CPECallHandling::SetCallOrigin( const TInt aCallId, const MCCECall& aCall ) const |
|
2400 |
{ |
|
2401 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::SetCallOrigin" ); |
|
2402 |
||
2403 |
//ToDo: casting not needed when CCE API is fixed. |
|
2404 |
const CCCPCallParameters& parameters = aCall.Parameters(); |
|
2405 |
CCPCall::TCallType callType = parameters.CallType(); |
|
2406 |
if ( callType == CCPCall::ECallTypeCSVoice || callType == CCPCall::ECallTypeVideo ) |
|
2407 |
{ |
|
2408 |
const CCCECallParameters& params = static_cast<const CCCECallParameters&>( parameters ); |
|
2409 |
||
2410 |
if ( params.Origin() == CCCECallParameters::ECCECallOriginSAT ) |
|
2411 |
{ |
|
2412 |
iModel.DataStore()->SetCallOrigin( EPECallOriginSAT, aCallId ); |
|
2413 |
iModel.DataStore()->SetRemoteName( params.AlphaId(), aCallId ); |
|
2414 |
iModel.DataStore()->SetRemotePhoneNumber( KNullDesC(), aCallId ); |
|
2415 |
} |
|
2416 |
} |
|
2417 |
} |
|
2418 |
||
2419 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2420 |
// ----------------------------------------------------------------------------- |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2421 |
// CPECallHandling::UpdateColpNumber |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2422 |
// ----------------------------------------------------------------------------- |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2423 |
// |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2424 |
TBool CPECallHandling::UpdateColpNumber( TInt aCallId, const MCCECall& aCall ) const |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2425 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2426 |
TEFLOGSTRING( KTAINT, "CALL CPECallHandling::UpdateColpNumber" ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2427 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2428 |
TBool updateDone( EFalse ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2429 |
TInt errorCode( KErrNone ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2430 |
TInt value( KPEMatchDefault ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2431 |
TPEMatcher matcher; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2432 |
TPEPhoneNumber remoteNumber; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2433 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2434 |
MPEDataStore* dataStore = iModel.DataStore(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2435 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2436 |
if ( dataStore->RemoteColpNumber( aCallId ).Length() ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2437 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2438 |
remoteNumber = dataStore->RemoteColpNumber( aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2439 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2440 |
else |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2441 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2442 |
remoteNumber = dataStore->RemotePhoneNumber( aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2443 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2444 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2445 |
const TPEPhoneNumber& updatedNumber = aCall.RemoteParty(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2446 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2447 |
errorCode = iRepository->Get( KTelMatchDigits, value ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2448 |
if ( !errorCode == KErrNone ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2449 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2450 |
TEFLOGSTRING( KTAOBJECT, "Reading KTelMatchDigits failed, use default value for matching"); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2451 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2452 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2453 |
//check if remote number is different from dialled number |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2454 |
if ( !matcher.numbersMatch( remoteNumber, updatedNumber, value ) ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2455 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2456 |
//set COLP number |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2457 |
dataStore->SetRemoteColpNumber( updatedNumber, aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2458 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2459 |
TEFLOGSTRING3( KTAMESINT, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2460 |
"CPECallHandling::UpdateColpNumber, colp number: '%S', call id: %d", |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2461 |
&updatedNumber, aCallId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2462 |
updateDone = ETrue; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2463 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2464 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2465 |
return updateDone; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2466 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2467 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
2468 |
|
37 | 2469 |
// End of File |