author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 00:16:48 +0300 | |
changeset 77 | 2be0b271d017 |
parent 37 | ba76fc04e6c2 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2002-2007 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 implementation of CPEVideoCallHandling class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDE FILES |
|
20 |
#include "cpevideocallhandling.h" |
|
21 |
#include "cpesinglecall.h" |
|
22 |
#include "pevirtualengine.h" |
|
23 |
#include "cpecallarrayowner.h" |
|
24 |
#include "cpecallarrayowner.h" |
|
25 |
#include "cpegprstermination.h" |
|
26 |
||
27 |
#include <mpephonemodelinternal.h> |
|
28 |
#include <e32property.h> |
|
29 |
#include <gsmerror.h> |
|
30 |
#include <mpedatastore.h> |
|
31 |
#include <networkhandlingdomainpskeys.h> |
|
32 |
#include <pepanic.pan> |
|
33 |
#include <pevirtualengine.h> |
|
34 |
#include <talogger.h> |
|
35 |
#include <ctsydomainpskeys.h> |
|
36 |
#include <connect/sbdefs.h> |
|
37 |
#include <ccce.h> |
|
38 |
#include <mccecall.h> |
|
39 |
||
40 |
// ----------------------------------------------------------------------------- |
|
41 |
// CPEVideoCallHandling::CPEVideoCallHandling |
|
42 |
// C++ default constructor can NOT contain any code, that |
|
43 |
// might leave. |
|
44 |
// ----------------------------------------------------------------------------- |
|
45 |
// |
|
46 |
CPEVideoCallHandling::CPEVideoCallHandling( |
|
47 |
MPEMessageSender& aOwner, |
|
48 |
MPEPhoneModelInternal& aModel, |
|
49 |
CCCE& aConvergedCallEngine, |
|
50 |
CPECallArrayOwner& aCallArrayOwner |
|
51 |
) : iOwner( aOwner ), |
|
52 |
iModel( aModel ), |
|
53 |
iConvergedCallEngine( aConvergedCallEngine ), |
|
54 |
iDataCallName( KNullDesC ), |
|
55 |
iCallArrayOwner( aCallArrayOwner ), |
|
56 |
iDataStore( *( aModel.DataStore( ) ) ), |
|
57 |
iRestoreCauseVTCallReject( EFalse ) |
|
58 |
{ |
|
59 |
} |
|
60 |
||
61 |
// ----------------------------------------------------------------------------- |
|
62 |
// CPEVideoCallHandling::ConstructL |
|
63 |
// Symbian 2nd phase constructor can leave. |
|
64 |
// ----------------------------------------------------------------------------- |
|
65 |
// |
|
66 |
void CPEVideoCallHandling::ConstructL() |
|
67 |
{ |
|
68 |
TEFLOGSTRING( KTAOBJECT, "VID CPEVideoCallHandling::ConstructL start." ); |
|
69 |
||
70 |
iCallOpenParams = CCCECallParameters::NewL(); |
|
71 |
TEFLOGSTRING( KTAOBJECT, "VID CPEVideoCallHandling::ConstructL complete." ); |
|
72 |
} |
|
73 |
||
74 |
// ----------------------------------------------------------------------------- |
|
75 |
// CPEVideoCallHandling::NewL |
|
76 |
// Two-phased constructor. |
|
77 |
// ----------------------------------------------------------------------------- |
|
78 |
// |
|
79 |
CPEVideoCallHandling* CPEVideoCallHandling::NewL( |
|
80 |
MPEMessageSender& aOwner, |
|
81 |
MPEPhoneModelInternal& aModel, |
|
82 |
CCCE& aConvergedCallEngine, |
|
83 |
CPECallArrayOwner& aCallArrayOwner ) |
|
84 |
{ |
|
85 |
TEFLOGSTRING( KTAOBJECT, "VID CPEVideoCallHandling::NewL start." ); |
|
86 |
CPEVideoCallHandling* self = new ( ELeave ) CPEVideoCallHandling( aOwner, |
|
87 |
aModel, |
|
88 |
aConvergedCallEngine, |
|
89 |
aCallArrayOwner ); |
|
90 |
CleanupStack::PushL( self ); |
|
91 |
self->ConstructL(); |
|
92 |
CleanupStack::Pop( self ); |
|
93 |
TEFLOGSTRING( KTAOBJECT, "VID CPEVideoCallHandling::NewL complete." ); |
|
94 |
return self; |
|
95 |
} |
|
96 |
||
97 |
// ----------------------------------------------------------------------------- |
|
98 |
// CPEVideoCallHandling::~CPEVideoCallHandling() |
|
99 |
// Destructor |
|
100 |
// ----------------------------------------------------------------------------- |
|
101 |
// |
|
102 |
CPEVideoCallHandling::~CPEVideoCallHandling() |
|
103 |
{ |
|
104 |
TFLOGSTRING( "CallHandling: CPEVideoCallHandling::~CPEVideoCallHandling() Start"); |
|
105 |
delete iGprsInterface; |
|
106 |
iGprsInterface = NULL; |
|
107 |
delete iCallOpenParams; |
|
108 |
TFLOGSTRING( "CallHandling: CPEVideoCallHandling::~CPEVideoCallHandling() complete"); |
|
109 |
} |
|
110 |
||
111 |
// ----------------------------------------------------------------------------- |
|
112 |
// CPEVideoCallHandling::AnswerCall |
|
113 |
// Answers the incoming call |
|
114 |
// ----------------------------------------------------------------------------- |
|
115 |
// |
|
116 |
TInt CPEVideoCallHandling::AnswerCall() |
|
117 |
{ |
|
118 |
TEFLOGSTRING( KTAINT, "VID CPEVideoCallHandling::AnswerCall"); |
|
119 |
TInt errorCode( KErrNotFound ); |
|
120 |
CPESingleCall* dataCallData = VideoCallByState( EPEStateRinging ); |
|
121 |
if ( dataCallData ) |
|
122 |
{ |
|
123 |
if ( GetNumberOfCalls() == 1 ) |
|
124 |
{ |
|
125 |
TEFLOGSTRING( KTAINT, "VID CPEVideoCallHandling::AnswerCall > CPEDataCall::Answer" ); |
|
126 |
dataCallData->Answer(); |
|
127 |
errorCode = KErrNone; |
|
128 |
} |
|
129 |
else |
|
130 |
{ |
|
131 |
TEFLOGSTRING( KTAERROR, |
|
132 |
"VID CPEVIDEOCALLHANDLING::ANSWERCALL: NOT ALLOWED WITH EXISTING CALLS!" ); |
|
133 |
errorCode = ECCPErrorNotAllowed; |
|
134 |
} |
|
135 |
} |
|
136 |
else |
|
137 |
{ |
|
138 |
TEFLOGSTRING( KTAERROR, |
|
139 |
"VID CPEVIDEOCALLHANDLING::ANSWERCALL: NO RINGING CALLS FOUND!" ); |
|
140 |
} |
|
141 |
||
142 |
return errorCode; |
|
143 |
} |
|
144 |
||
145 |
// ----------------------------------------------------------------------------- |
|
146 |
// CPEVideoCallHandling::VideoCallByState |
|
147 |
// Finds a data call object that is in specified state |
|
148 |
// ----------------------------------------------------------------------------- |
|
149 |
// |
|
150 |
CPESingleCall* CPEVideoCallHandling::VideoCallByState( |
|
151 |
const TPEState aState ) const |
|
152 |
{ |
|
153 |
TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::DataCallByState" ); |
|
154 |
CPESingleCall* returnValue( NULL ); |
|
155 |
CPESingleCall* callData; |
|
156 |
||
157 |
for ( TInt callId = KPEDataCallIdBase; |
|
158 |
callId < ( KPEDataCallIdBase + KPEMaximumNumberOfDataCalls ); |
|
159 |
callId++ ) |
|
160 |
{ |
|
161 |
callData = iCallArrayOwner.GetCallObject( callId ); |
|
162 |
if ( callData |
|
163 |
&& ( callData->GetCallState() == aState ) ) |
|
164 |
{ |
|
165 |
returnValue = callData; |
|
166 |
TEFLOGSTRING2( KTAINT, |
|
167 |
"CALL CPEVideoCallHandling::DataCallByState %d", callId ); |
|
168 |
break; |
|
169 |
} |
|
170 |
} |
|
171 |
return returnValue; |
|
172 |
} |
|
173 |
||
174 |
// ----------------------------------------------------------------------------- |
|
175 |
// CPEVideoCallHandling::CallTerminatedError |
|
176 |
// Handles RemoteTerminated. |
|
177 |
// ----------------------------------------------------------------------------- |
|
178 |
// |
|
179 |
TInt CPEVideoCallHandling::CallTerminatedError( const TInt aCallId ) |
|
180 |
{ |
|
181 |
TEFLOGSTRING2( KTAINT, |
|
182 |
"VID CPEVideoCallHandling::CallTerminatedError, aCallId: %d", |
|
183 |
aCallId ); |
|
184 |
||
185 |
TInt errorCode( KErrNone ); |
|
186 |
CPESingleCall* dataCall = iCallArrayOwner.GetCallObject( aCallId ); |
|
187 |
if ( dataCall ) |
|
188 |
{ |
|
189 |
dataCall->GetErrorCode( errorCode ); |
|
190 |
} |
|
191 |
||
192 |
TEFLOGSTRING2( KTAINT, |
|
193 |
"VID CPEVideoCallHandling::CallTerminatedError, errorCode: %d", |
|
194 |
errorCode ); |
|
195 |
return errorCode; |
|
196 |
} |
|
197 |
||
198 |
// ----------------------------------------------------------------------------- |
|
199 |
// CPEVideoCallHandling::DataPortInUse |
|
200 |
// Tells if the call has reserved serial communications data port for use |
|
201 |
// The default value is EFalse, i.e. the data port has not been reserved for |
|
202 |
// use. The data port is recovered when no longer needed. |
|
203 |
// ----------------------------------------------------------------------------- |
|
204 |
// |
|
205 |
TBool CPEVideoCallHandling::DataPortInUse( |
|
206 |
TInt aCallId ) const |
|
207 |
{ |
|
208 |
TBool dataPortInUse( EFalse ); |
|
209 |
TPEState state; |
|
210 |
||
211 |
if ( CallIdCheck::IsVideo( aCallId ) ) |
|
212 |
{ |
|
213 |
CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId ); |
|
214 |
if( callData ) |
|
215 |
{ |
|
216 |
state = callData->GetCallState(); |
|
217 |
if( state == EPEStateConnected ) |
|
218 |
{ |
|
219 |
dataPortInUse = ETrue; |
|
220 |
} |
|
221 |
} |
|
222 |
} |
|
223 |
return dataPortInUse; |
|
224 |
} |
|
225 |
||
226 |
// ----------------------------------------------------------------------------- |
|
227 |
// CPEVideoCallHandling::DialCall |
|
228 |
// Creates dialing request to the Multimode ETel. |
|
229 |
// This request is for creating a new multimedia (=data) call |
|
230 |
// ----------------------------------------------------------------------------- |
|
231 |
// |
|
232 |
TInt CPEVideoCallHandling::DialCall( |
|
233 |
const TPEPhoneNumber& aNumber, |
|
234 |
TInt& aCallId ) |
|
235 |
{ |
|
236 |
TEFLOGSTRING( KTAINT, "VID CPEVideoCallHandling::DialCall" ); |
|
237 |
TInt errorCode( KErrNone ); |
|
238 |
TInt networkMode( ENWNetworkModeUnknown ); |
|
239 |
CPESingleCall* callData( NULL ); |
|
240 |
||
241 |
RProperty::Get( KPSUidNetworkInfo, KNWTelephonyNetworkMode, networkMode ); |
|
242 |
||
243 |
TInt restoreValue; |
|
244 |
RProperty::Get( KUidSystemCategory, conn::KUidBackupRestoreKey, restoreValue ); |
|
245 |
||
246 |
if ( networkMode == ENWNetworkModeWcdma && |
|
247 |
!( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial )) ) |
|
248 |
{ |
|
249 |
TRAP( errorCode, callData = OpenNewCallL( aNumber ) ); |
|
250 |
if( errorCode == KErrNone ) |
|
251 |
{ |
|
252 |
TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::DialCall > Dial" ); |
|
253 |
errorCode = callData->Dial( aNumber ); |
|
254 |
if ( errorCode != KErrNone ) |
|
255 |
{ |
|
256 |
// Dial failed: clean up |
|
257 |
ReleaseCallObject( callData->GetCallId() ); |
|
258 |
TEFLOGSTRING2( KTAERROR, |
|
259 |
"VID CALL CPEVideoCallHandling::DialCall ! DIAL FAILED: MAY NOT PROCEED! %d", |
|
260 |
errorCode ); |
|
261 |
} |
|
262 |
else |
|
263 |
{ |
|
264 |
// Dial request passed on successfully: forward new call id |
|
265 |
aCallId = callData->GetCallId(); |
|
266 |
} |
|
267 |
} |
|
268 |
} |
|
269 |
else |
|
270 |
{ |
|
271 |
TEFLOGSTRING( KTAERROR, |
|
272 |
"VID CPEVideoCallHandling::DialCall: Attempting video call in 2G network!" ); |
|
273 |
errorCode = ( networkMode != ENWNetworkModeWcdma ) ? |
|
274 |
ECCPErrorVideoCallNotSupportedByNetwork : |
|
275 |
ECCPErrorVideoCallNotAllowedDuringRestore; |
|
276 |
} |
|
277 |
||
278 |
return errorCode; |
|
279 |
} |
|
280 |
||
281 |
// ----------------------------------------------------------------------------- |
|
282 |
// CPEVideoCallHandling::HangUp |
|
283 |
// terminates an ongoing call |
|
284 |
// Method checks that call id is valid number and |
|
285 |
// hangups conference or data call or reroutes call to base class. |
|
286 |
// (other items were commented in a header). |
|
287 |
// ----------------------------------------------------------------------------- |
|
288 |
// |
|
289 |
TInt CPEVideoCallHandling::HangUp( TInt aCallId ) |
|
290 |
{ |
|
291 |
TEFLOGSTRING( KTAINT, "VID CPEVideoCallHandling::HangUp" ); |
|
292 |
TInt errorCode( KErrNotFound ); |
|
293 |
CPESingleCall* videoCall = iCallArrayOwner.GetCallObject( aCallId ); |
|
294 |
||
295 |
if ( videoCall && CallIdCheck::IsVideo( aCallId ) ) |
|
296 |
{ |
|
297 |
||
298 |
errorCode = videoCall->HangUp(); |
|
299 |
} |
|
300 |
return errorCode; |
|
301 |
} |
|
302 |
||
303 |
// ----------------------------------------------------------------------------- |
|
304 |
// CPEVideoCallHandling::InitCall |
|
305 |
// Handles the initializing of a single data/video call. |
|
306 |
// ----------------------------------------------------------------------------- |
|
307 |
// |
|
308 |
void CPEVideoCallHandling::InitCall( MCCECall& aCall ) |
|
309 |
{ |
|
310 |
TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::InitCall" ); |
|
311 |
CPESingleCall* callData( NULL ); |
|
312 |
TRAP_IGNORE( callData = iCallArrayOwner.CreateDataCallL( *this ) ); |
|
313 |
||
314 |
if ( callData ) |
|
315 |
{ |
|
316 |
iModel.DataStore()->SetPhoneNumber( KNullDesC() ); |
|
317 |
iModel.DataStore()->SetServiceId( callData->GetCallId(), aCall.ServiceId() ); |
|
318 |
callData->SetCall( aCall ); |
|
319 |
iModel.DataStore()->SetCallSecureStatus( callData->IsSecureCall(), callData->GetCallId() ); |
|
320 |
iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() ); |
|
321 |
||
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
322 |
RMobileCall::TMobileCallInfoV3 callInfo; |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
323 |
GetCallInfo(callInfo, callData->GetCallId()); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
324 |
iModel.DataStore()->SetIncomingCallForwarded( callInfo.iForwarded, callData->GetCallId() ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
325 |
|
37 | 326 |
const CCCPCallParameters& callParameters = aCall.Parameters(); |
327 |
switch ( callParameters.CallType() ) |
|
328 |
{ |
|
329 |
case CCPCall::ECallTypeCSVoice: |
|
330 |
{ |
|
331 |
iModel.DataStore()->SetCallType( EPECallTypeCSVoice, callData->GetCallId() ); |
|
332 |
} |
|
333 |
break; |
|
334 |
case CCPCall::ECallTypeVideo: |
|
335 |
{ |
|
336 |
iModel.DataStore()->SetCallType( EPECallTypeVideo, callData->GetCallId() ); |
|
337 |
} |
|
338 |
break; |
|
339 |
case CCPCall::ECallTypePS: |
|
340 |
{ |
|
341 |
iModel.DataStore()->SetCallType( EPECallTypeVoIP, callData->GetCallId() ); |
|
342 |
} |
|
343 |
break; |
|
344 |
default: |
|
345 |
__ASSERT_DEBUG( EFalse, Panic( EPEPanicIndexOutOfRange )); |
|
346 |
break; |
|
347 |
} |
|
348 |
} |
|
349 |
else |
|
350 |
{ |
|
351 |
Panic( EPEPanicNoFreeCalls ); |
|
352 |
} |
|
353 |
} |
|
354 |
||
355 |
// ----------------------------------------------------------------------------- |
|
356 |
// CPEVideoCallHandling::IsMultimedia |
|
357 |
// Checks if the data call is a multimedia call. Requires that the data call has |
|
358 |
// already been opened. |
|
359 |
// ----------------------------------------------------------------------------- |
|
360 |
// |
|
361 |
TBool CPEVideoCallHandling::IsMultimedia( TInt aCallId ) const |
|
362 |
{ |
|
363 |
TEFLOGSTRING2( KTAINT, "VID CPEVideoCallHandling::IsMultimedia %d", aCallId ); |
|
364 |
||
365 |
TBool multimedia( EFalse ); |
|
366 |
CPESingleCall* videoCall = iCallArrayOwner.GetCallObject( aCallId ); |
|
367 |
||
368 |
if ( videoCall && CallIdCheck::IsVideo( aCallId ) |
|
369 |
&& videoCall->Call().Parameters().CallType() |
|
370 |
== CCPCall::ECallTypeVideo ) |
|
371 |
{ |
|
372 |
multimedia = ETrue; |
|
373 |
} |
|
374 |
||
375 |
return multimedia; |
|
376 |
} |
|
377 |
||
378 |
// ----------------------------------------------------------------------------- |
|
379 |
// CPEVideoCallHandling::NotifySystemCallStateChanged |
|
380 |
// Notifies system for changes to the call state. |
|
381 |
// ----------------------------------------------------------------------------- |
|
382 |
// |
|
383 |
void CPEVideoCallHandling::NotifySystemCallStateChanged( |
|
384 |
MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, // The enumeration number of the message |
|
385 |
TInt aCallId ) |
|
386 |
{ |
|
387 |
TEFLOGSTRING2( KTAINT, "VID CPEVideoCallHandling::NotifySystemCallStateChanged %d", aCallId ); |
|
388 |
// this needs to be checked because this function is called for all data calls |
|
389 |
if ( IsMultimedia( aCallId ) ) |
|
390 |
{ |
|
391 |
if ( aMessage == MEngineMonitor::EPEMessageIncoming || |
|
392 |
aMessage == MEngineMonitor::EPEMessageDialing ) |
|
393 |
{ |
|
394 |
TInt updateError = RProperty::Set( KPSUidCtsyCallInformation, |
|
395 |
KCTsyCallType, EPSCTsyCallTypeH324Multimedia ); |
|
396 |
TEFLOGSTRING2( updateError?KTAERROR:KTAMESOUT, |
|
397 |
"VID CPEVideoCallHandling::NotifySystemCallStateChanged request RProperty::Set, EPSCTsyCallTypeH324Multimedia, updateError: ", |
|
398 |
updateError ); |
|
399 |
} |
|
400 |
} |
|
401 |
} |
|
402 |
||
403 |
// ----------------------------------------------------------------------------- |
|
404 |
// CPEVideoCallHandling::SendMessage |
|
405 |
// Overrides CPECallHandling::SendMessage to provide internal handling for gsm events |
|
406 |
// and common events related to multimedia calls. |
|
407 |
// ----------------------------------------------------------------------------- |
|
408 |
// |
|
409 |
void CPEVideoCallHandling::SendMessage( |
|
410 |
MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, |
|
411 |
TInt aCallId ) |
|
412 |
{ |
|
413 |
TEFLOGSTRING3( KTAINT, |
|
414 |
"VID CPEVideoCallHandling::SendMessage, message id: %d, call id: %d", |
|
415 |
aMessage, |
|
416 |
aCallId ); |
|
417 |
||
418 |
TInt error( KErrNone ); |
|
419 |
CPESingleCall* videoCall = iCallArrayOwner.GetCallObject( aCallId ); |
|
420 |
CPESingleCall* connectedVideoCall = VideoCallByState( EPEStateConnected ); |
|
421 |
||
422 |
if ( IsMultimedia( aCallId ) ) |
|
423 |
{ |
|
424 |
switch ( aMessage ) |
|
425 |
{ |
|
426 |
case MEngineMonitor::EPEMessageIncoming: |
|
427 |
case MEngineMonitor::EPEMessageDialing: |
|
428 |
{ |
|
429 |
TInt restoreValue; |
|
430 |
RProperty::Get( KUidSystemCategory, conn::KUidBackupRestoreKey, restoreValue ); |
|
431 |
if( ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial ) ) ) |
|
432 |
{ |
|
433 |
// First phase VT and restore: Check if there is a arriving VT |
|
434 |
// call and Restore ongoing. |
|
435 |
TEFLOGSTRING( KTAINT, |
|
436 |
"VID CPEVideoCallHandling::SendMessage > HangUp restore active " ); |
|
437 |
iRestoreCauseVTCallReject = ETrue; |
|
438 |
if( videoCall ) |
|
439 |
{ |
|
440 |
videoCall->HangUp(); |
|
441 |
} |
|
442 |
aMessage = MEngineMonitor::EPEMessageDoNotSendMe; |
|
443 |
} |
|
444 |
break; |
|
445 |
} |
|
446 |
case MEngineMonitor::EPEMessageDisconnecting: |
|
447 |
{ |
|
448 |
if( iRestoreCauseVTCallReject ) |
|
449 |
{ |
|
450 |
// Second phase VT and restore: Check if there is a rejected arriving VT call |
|
451 |
// and Restore ongoing, then don't notify observers. |
|
452 |
iRestoreCauseVTCallReject = EFalse; |
|
453 |
TEFLOGSTRING( KTAINT, |
|
454 |
"VID CPEVideoCallHandling::SendMessage Second phase Restore and VT call" ); |
|
455 |
aMessage = MEngineMonitor::EPEMessageDoNotSendMe; |
|
456 |
} |
|
457 |
break; |
|
458 |
} |
|
459 |
case MEngineMonitor::EPEMessageIdle: |
|
460 |
{ |
|
461 |
iRestoreCauseVTCallReject = EFalse; |
|
462 |
// Check reject video cace, if there is connect VT call don't disconnect |
|
463 |
if( !connectedVideoCall ) |
|
464 |
{ |
|
465 |
if ( CallTerminatedError( aCallId ) == KErrGsmCCIncompatibleDestination ) |
|
466 |
{ |
|
467 |
error = KErrGsmCCIncompatibleDestination; |
|
468 |
} |
|
469 |
} |
|
470 |
break; |
|
471 |
} |
|
472 |
default: |
|
473 |
{ |
|
474 |
TEFLOGSTRING2( |
|
475 |
KTAINT, |
|
476 |
"VID CPEVideoCallHandling::SendMessage: multimedia call, message: %d", |
|
477 |
aMessage ); |
|
478 |
break; |
|
479 |
} |
|
480 |
} |
|
481 |
} |
|
482 |
else |
|
483 |
{ |
|
484 |
TEFLOGSTRING2( |
|
485 |
KTAINT, |
|
486 |
"VID CPEVideoCallHandling::SendMessage, isMultimedia: %d", |
|
487 |
IsMultimedia( aCallId ) ); |
|
488 |
} |
|
489 |
if ( error == KErrNone ) |
|
490 |
{ |
|
491 |
iOwner.SendMessage( aMessage, aCallId ); |
|
492 |
} |
|
493 |
else |
|
494 |
{ |
|
495 |
SendErrorMessage( aCallId, error ); |
|
496 |
} |
|
497 |
} |
|
498 |
||
499 |
// ----------------------------------------------------------------------------- |
|
500 |
// CPEVideoCallHandling::VideoCallInState |
|
501 |
// Checks if there are any data calls in the specified state |
|
502 |
// ----------------------------------------------------------------------------- |
|
503 |
// |
|
504 |
TBool CPEVideoCallHandling::VideoCallInState( const TPEState& aState ) const |
|
505 |
{ |
|
506 |
TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::DataCallInState" ); |
|
507 |
TBool returnValue( EFalse ); |
|
508 |
if( VideoCallByState( aState ) ) |
|
509 |
{ |
|
510 |
returnValue = ETrue; |
|
511 |
} |
|
512 |
return returnValue; |
|
513 |
} |
|
514 |
||
515 |
||
516 |
// ----------------------------------------------------------------------------- |
|
517 |
// CPEVideoCallHandling::IsPhoneNumberAvailable |
|
518 |
// ----------------------------------------------------------------------------- |
|
519 |
// |
|
520 |
TBool CPEVideoCallHandling::IsPhoneNumberAvailable( const TInt aCallId ) |
|
521 |
{ |
|
522 |
TEFLOGSTRING2( KTAINT, |
|
523 |
"VID CPEVideoCallHandling::IsPhoneNumberAvailable, aCallId: %d" |
|
524 |
, aCallId ); |
|
525 |
TBool phoneNumberAvailable ( EFalse ); |
|
526 |
||
527 |
if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileOriginated ) |
|
528 |
{ |
|
529 |
phoneNumberAvailable = ETrue; |
|
530 |
} |
|
531 |
else |
|
532 |
{ |
|
533 |
RMobileCall::TMobileCallRemoteIdentityStatus remoteIdentity; |
|
534 |
remoteIdentity = iDataStore.RemoteIdentity( aCallId ); |
|
535 |
TEFLOGSTRING2( KTAINT, |
|
536 |
"VID CPEVideoCallHandling::IsPhoneNumberAvailable, remoteIdentity: %d", |
|
537 |
remoteIdentity); |
|
538 |
phoneNumberAvailable = ( remoteIdentity == RMobileCall::ERemoteIdentityAvailable ); |
|
539 |
} |
|
540 |
TEFLOGSTRING2( KTAINT, |
|
541 |
"VID CPEVideoCallHandling::IsPhoneNumberAvailable, isAvailable: %d", |
|
542 |
phoneNumberAvailable ); |
|
543 |
return phoneNumberAvailable; |
|
544 |
} |
|
545 |
||
546 |
// ----------------------------------------------------------------------------- |
|
547 |
// CPEVideoCallHandling::VideoCallByState |
|
548 |
// returns CPEVoiceCall video call object by State |
|
549 |
// ----------------------------------------------------------------------------- |
|
550 |
// |
|
551 |
CPESingleCall* CPEVideoCallHandling::VideoCallByState( TPEState aState ) |
|
552 |
{ |
|
553 |
TEFLOGSTRING2( KTAINT, |
|
554 |
"CPEVideoCallHandling::VideoCallByState, aState: %d", aState ); |
|
555 |
TPEState state; |
|
556 |
CPESingleCall* returnValue( NULL ); |
|
557 |
||
558 |
for ( TInt callId = KPEDataCallIdBase; |
|
559 |
callId < ( KPEDataCallIdBase + KPEMaximumNumberOfDataCalls ); |
|
560 |
callId++ ) |
|
561 |
{ |
|
562 |
CPESingleCall* callData = iCallArrayOwner.GetCallObject( callId ); |
|
563 |
if( callData ) |
|
564 |
{ |
|
565 |
state = callData->GetCallState(); |
|
566 |
||
567 |
if ( state == aState ) |
|
568 |
{ |
|
569 |
returnValue = callData; |
|
570 |
break; |
|
571 |
} |
|
572 |
} |
|
573 |
} |
|
574 |
return returnValue; |
|
575 |
} |
|
576 |
||
577 |
// ----------------------------------------------------------------------------- |
|
578 |
// Replace active video call with a waiting video call |
|
579 |
// NOT SUPPORTED AS OF 5.1 |
|
580 |
// ----------------------------------------------------------------------------- |
|
581 |
// |
|
582 |
TInt CPEVideoCallHandling::ReplaceActive( TInt /*aCallId*/ ) |
|
583 |
{ |
|
584 |
return KErrNone; |
|
585 |
} |
|
586 |
||
587 |
// ----------------------------------------------------------------------------- |
|
588 |
// CPEVideoCallHandling::SetCallParams |
|
589 |
// |
|
590 |
// ----------------------------------------------------------------------------- |
|
591 |
// |
|
592 |
void CPEVideoCallHandling::SetCallParams( TInt aCallId ) |
|
593 |
{ |
|
594 |
TEFLOGSTRING2( KTAINT, |
|
595 |
"VID CCPEVideoCallHandling::SetCallParams, aCallId: %d", aCallId ); |
|
596 |
iCallOpenParams->SetLineType( CCCECallParameters::ECCELineTypePrimary ); |
|
597 |
||
598 |
switch ( iModel.DataStore()->CallTypeCommand() ) |
|
599 |
{ |
|
600 |
case EPECallTypeVideo: |
|
601 |
{ |
|
602 |
iCallOpenParams->SetCallType( CCPCall::ECallTypeVideo ); |
|
603 |
iModel.DataStore()->SetServiceIdCommand( 1 ); |
|
604 |
iModel.DataStore()->SetCallType( EPECallTypeVideo, aCallId ); |
|
605 |
} |
|
606 |
break; |
|
607 |
default: |
|
608 |
__ASSERT_DEBUG( EFalse, Panic( EPEPanicIndexOutOfRange )); |
|
609 |
iCallOpenParams->SetCallType( CCPCall::ECallTypeVideo ); |
|
610 |
iModel.DataStore()->SetServiceIdCommand( 1 ); |
|
611 |
iModel.DataStore()->SetCallType( EPECallTypeVideo, aCallId ); |
|
612 |
break; |
|
613 |
} |
|
614 |
iCallOpenParams->SetServiceId( iModel.DataStore()->ServiceIdCommand() ); |
|
615 |
} |
|
616 |
||
617 |
// ----------------------------------------------------------------------------- |
|
618 |
// CPEVideoCallHandling::OpenNewCallL |
|
619 |
// returns ETrue if hangup active |
|
620 |
// ----------------------------------------------------------------------------- |
|
621 |
// |
|
622 |
CPESingleCall* CPEVideoCallHandling::OpenNewCallL( const TPEPhoneNumber& aNumber ) |
|
623 |
{ |
|
624 |
TEFLOGSTRING( KTAINT, "VID CPEVideoCallHandling::OpenNewCallL"); |
|
625 |
TInt errorCode( KErrNone ); |
|
626 |
CPESingleCall* callData( NULL ); |
|
627 |
MCCECall* cceCall( NULL ); |
|
628 |
||
629 |
callData = iCallArrayOwner.CreateDataCallL( *this ); |
|
630 |
SetCallParams( callData->GetCallId() ); |
|
631 |
||
632 |
TEFLOGSTRING( KTAINT, |
|
633 |
"VID CPEVideoCallHandling::OpenNewCallL > CCCE::OpenNewCallL"); |
|
634 |
TRAP( errorCode, |
|
635 |
cceCall = &( iConvergedCallEngine.OpenNewCallL( aNumber, |
|
636 |
*iCallOpenParams, |
|
637 |
*callData ) ) ); |
|
638 |
if ( errorCode == KErrNone ) |
|
639 |
{ |
|
640 |
callData->SetCall( *cceCall ); |
|
641 |
iModel.DataStore()->SetServiceId( callData->GetCallId(), cceCall->ServiceId() ); |
|
642 |
iModel.DataStore()->SetCallSecureStatus( callData->IsSecureCall(), callData->GetCallId() ); |
|
643 |
iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() ); |
|
644 |
} |
|
645 |
else |
|
646 |
{ |
|
647 |
// Open new call failed |
|
648 |
ReleaseCallObject( callData->GetCallId() ); |
|
649 |
TEFLOGSTRING2( KTAERROR, |
|
650 |
"VID CPEVideoCallHandling::DIALCALL ! OPENNEWCALL FAILED: MAY NOT PROCEED! %d", |
|
651 |
errorCode ); |
|
652 |
User::Leave( errorCode ); |
|
653 |
} |
|
654 |
return callData; |
|
655 |
} |
|
656 |
||
657 |
// ----------------------------------------------------------------------------- |
|
658 |
// CPEVideoCallHandling::GetCallState |
|
659 |
// Returns call state information. |
|
660 |
// ----------------------------------------------------------------------------- |
|
661 |
// |
|
662 |
TPEState CPEVideoCallHandling::GetCallState( TInt aCallId ) |
|
663 |
{ |
|
664 |
TEFLOGSTRING2( KTAINT, |
|
665 |
"CALL CPEVideoCallHandling::GetCallState %d", aCallId ); |
|
666 |
TPEState callState( EPEStateUnknown ); |
|
667 |
CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId ); |
|
668 |
if( callData ) |
|
669 |
{ |
|
670 |
callState = callData->GetCallState(); |
|
671 |
} |
|
672 |
else |
|
673 |
{ |
|
674 |
callState = EPEStateIdle; |
|
675 |
} |
|
676 |
TEFLOGSTRING2( KTAINT, |
|
677 |
"CALL CPEVideoCallHandling::GetCallState, callState: %d", |
|
678 |
callState ); |
|
679 |
return callState; |
|
680 |
} |
|
681 |
||
682 |
// ----------------------------------------------------------------------------- |
|
683 |
// CPEVideoCallHandling::VideoCallById |
|
684 |
// returns CPESingleCall video call object by State |
|
685 |
// ----------------------------------------------------------------------------- |
|
686 |
// |
|
687 |
CPESingleCall* CPEVideoCallHandling::VideoCallById( TInt aCallId ) |
|
688 |
{ |
|
689 |
TEFLOGSTRING2( KTAINT, "VID CPEVideoCallHandling::VideoCallById %d", aCallId ); |
|
690 |
return iCallArrayOwner.GetCallObject( aCallId ); |
|
691 |
} |
|
692 |
||
693 |
// ----------------------------------------------------------------------------- |
|
694 |
// CPEVideoCallHandling::GetNumberOfCalls |
|
695 |
// Returns number of data calls. |
|
696 |
// ----------------------------------------------------------------------------- |
|
697 |
// |
|
698 |
TInt CPEVideoCallHandling::GetNumberOfCalls() |
|
699 |
{ |
|
700 |
TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::GetNumberOfCalls" ); |
|
701 |
// Count ongoing calls |
|
702 |
return iCallArrayOwner.ActiveCallCount(); |
|
703 |
} |
|
704 |
||
705 |
||
706 |
// ----------------------------------------------------------------------------- |
|
707 |
// CPEVideoCallHandling::SendMessage |
|
708 |
// Reroutes messages to the Phone Engine |
|
709 |
// ----------------------------------------------------------------------------- |
|
710 |
// |
|
711 |
void CPEVideoCallHandling::SendMessage( |
|
712 |
MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, |
|
713 |
const TName& aName ) |
|
714 |
{ |
|
715 |
TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::SendMessage, message id: %d", aMessage ); |
|
716 |
CPESingleCall* videoCall = VideoCallByName( aName ); |
|
717 |
if( videoCall ) |
|
718 |
{ |
|
719 |
SendMessage( aMessage, videoCall->GetCallId() ); |
|
720 |
} |
|
721 |
} |
|
722 |
||
723 |
// ----------------------------------------------------------------------------- |
|
724 |
// CPEVideoCallHandling::VideoCallByName |
|
725 |
// returns data call object by name |
|
726 |
// ----------------------------------------------------------------------------- |
|
727 |
// |
|
728 |
CPESingleCall* CPEVideoCallHandling::VideoCallByName( const TName& aName ) |
|
729 |
{ |
|
730 |
TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::DataCallByName" ); |
|
731 |
CPESingleCall* returnValue( NULL ); |
|
732 |
CPESingleCall* callData; |
|
733 |
for ( TInt callId = KPEDataCallIdBase; |
|
734 |
callId < ( KPEDataCallIdBase + KPEMaximumNumberOfDataCalls ); |
|
735 |
callId++ ) |
|
736 |
{ |
|
737 |
callData = iCallArrayOwner.GetCallObject( callId ); |
|
738 |
||
739 |
if ( callData |
|
740 |
&& ( VideoCallName( callId ) == aName ) ) |
|
741 |
{ |
|
742 |
returnValue = callData; |
|
743 |
TEFLOGSTRING2( KTAINT, |
|
744 |
"CALL CPEVideoCallHandling::DataCallByName %d", callId ); |
|
745 |
break; |
|
746 |
} |
|
747 |
} |
|
748 |
return returnValue; |
|
749 |
} |
|
750 |
||
751 |
// ----------------------------------------------------------------------------- |
|
752 |
// CPEVideoCallHandling::VideoCallName |
|
753 |
// Finds data call name given the call id. |
|
754 |
// ----------------------------------------------------------------------------- |
|
755 |
// |
|
756 |
TName& CPEVideoCallHandling::VideoCallName( const TInt aCallId ) |
|
757 |
{ |
|
758 |
TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::DataCallName" ); |
|
759 |
||
760 |
iDataCallName = KNullDesC; |
|
761 |
TInt errorCode( KErrNone ); |
|
762 |
||
763 |
if ( CallIdCheck::IsVideo( aCallId ) ) |
|
764 |
{ |
|
765 |
RMobileCall::TMobileCallInfoV3* dataCallInfo = NULL; |
|
766 |
dataCallInfo = new RMobileCall::TMobileCallInfoV3; |
|
767 |
||
768 |
if ( dataCallInfo ) |
|
769 |
{ |
|
770 |
errorCode = GetCallInfo( *dataCallInfo, aCallId ); |
|
771 |
TEFLOGSTRING2( KTAINT, |
|
772 |
"CALL CPEVideoCallHandling::DataCallName > GetCallInfo, error code: %d", |
|
773 |
errorCode ); |
|
774 |
||
775 |
if ( errorCode == KErrNone ) |
|
776 |
{ |
|
777 |
iDataCallName = dataCallInfo->iCallName; |
|
778 |
} |
|
779 |
} |
|
780 |
else |
|
781 |
{ |
|
782 |
errorCode = KErrNoMemory; |
|
783 |
TEFLOGSTRING( KTAINT, |
|
784 |
"CALL CPEVideoCallHandling::DataCallName, error code = KErrNoMemory" ); |
|
785 |
} |
|
786 |
delete dataCallInfo; |
|
787 |
} |
|
788 |
return iDataCallName; |
|
789 |
} |
|
790 |
||
791 |
||
792 |
// ----------------------------------------------------------------------------- |
|
793 |
// CPEVideoCallHandling::GetCallInfo |
|
794 |
// Returns data call information. |
|
795 |
// ----------------------------------------------------------------------------- |
|
796 |
// |
|
797 |
TInt CPEVideoCallHandling::GetCallInfo( |
|
798 |
RMobileCall::TMobileCallInfoV3& aCallInfo, |
|
799 |
TInt aCallId ) |
|
800 |
{ |
|
801 |
TEFLOGSTRING2( KTAINT, "CALL CPEVideoCallHandling::GetCallInfo %d", aCallId ); |
|
802 |
CPESingleCall* videoCall( NULL ); |
|
803 |
TInt errorCode( KErrNotFound ); |
|
804 |
videoCall = iCallArrayOwner.GetCallObject( aCallId ); |
|
805 |
if ( videoCall && CallIdCheck::IsVideo( aCallId ) ) |
|
806 |
{ |
|
807 |
errorCode = videoCall->GetCallInfo( aCallInfo ); |
|
808 |
errorCode = KErrNone; |
|
809 |
} |
|
810 |
else |
|
811 |
{ |
|
812 |
__ASSERT_DEBUG( EFalse, Panic( EPEPanicIllegalCommand) ); |
|
813 |
} |
|
814 |
return errorCode; |
|
815 |
} |
|
816 |
||
817 |
// ----------------------------------------------------------------------------- |
|
818 |
// CPEVideoCallHandling::SendErrorMessage |
|
819 |
// Reroutes error code to Call Handling interface. |
|
820 |
// ----------------------------------------------------------------------------- |
|
821 |
// |
|
822 |
void CPEVideoCallHandling::SendErrorMessage( |
|
823 |
const TInt aCallId, |
|
824 |
const TInt aErrorCode ) |
|
825 |
{ |
|
826 |
TEFLOGSTRING3( KTAINT, |
|
827 |
"CALL CPEVideoCallHandling::SendErrorMessage, error code: %d, error cause: %d, call id: %d", |
|
828 |
aErrorCode, |
|
829 |
aCallId ); |
|
830 |
iOwner.SendErrorMessage( aCallId, aErrorCode ); |
|
831 |
} |
|
832 |
||
833 |
||
834 |
// ----------------------------------------------------------------------------- |
|
835 |
// CPEVideoCallHandling::HandleInternalMessage |
|
836 |
// Reroutes messages to the Phone Engine |
|
837 |
// ----------------------------------------------------------------------------- |
|
838 |
// |
|
839 |
void CPEVideoCallHandling::HandleInternalMessage( TInt aMessage ) |
|
840 |
{ |
|
841 |
TEFLOGSTRING2( KTAINT, "CALL CPEVideoCallHandling::HandleInternalMessage, message: %d", aMessage ); |
|
842 |
iOwner.HandleInternalMessage( aMessage ); |
|
843 |
} |
|
844 |
||
845 |
// ----------------------------------------------------------------------------- |
|
846 |
// CPEVideoCallHandling::ConnectedCalls |
|
847 |
// Indicates if there are any connected calls. |
|
848 |
// ----------------------------------------------------------------------------- |
|
849 |
// |
|
850 |
TBool CPEVideoCallHandling::ConnectedCalls() |
|
851 |
{ |
|
852 |
TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::ConnectedCalls" ); |
|
853 |
TBool returnValue( EFalse ); |
|
854 |
if( VideoCallByState( EPEStateConnected ) ) |
|
855 |
{ |
|
856 |
returnValue = ETrue; |
|
857 |
} |
|
858 |
return returnValue ; |
|
859 |
} |
|
860 |
||
861 |
// ----------------------------------------------------------------------------- |
|
862 |
// CPEVideoCallHandling::RejectCall |
|
863 |
// Rejects the incoming call. |
|
864 |
// ----------------------------------------------------------------------------- |
|
865 |
// |
|
866 |
TInt CPEVideoCallHandling::RejectCall() |
|
867 |
{ |
|
868 |
TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::RejectCall" ); |
|
869 |
TInt errorCode( KErrNotFound ); |
|
870 |
||
871 |
CPESingleCall* videoCall = VideoCallByState( EPEStateRinging ); |
|
872 |
if( videoCall ) |
|
873 |
{ |
|
874 |
videoCall->HangUp(); |
|
875 |
errorCode = KErrNone; |
|
876 |
} |
|
877 |
return errorCode; |
|
878 |
} |
|
879 |
||
880 |
// ----------------------------------------------------------------------------- |
|
881 |
// CPEVideoCallHandling::ReleaseAll |
|
882 |
// Releases all ongoing calls. |
|
883 |
// ----------------------------------------------------------------------------- |
|
884 |
// |
|
885 |
TInt CPEVideoCallHandling::ReleaseAll() |
|
886 |
{ |
|
887 |
CPESingleCall* callData; |
|
888 |
TInt errorCode( KErrNotFound ); |
|
889 |
TPEState callState; |
|
890 |
||
891 |
TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::ReleaseAll " ); |
|
892 |
||
893 |
for ( TInt callId = KPEDataCallIdBase; |
|
894 |
callId < ( KPEDataCallIdBase + KPEMaximumNumberOfDataCalls ); |
|
895 |
callId++ ) |
|
896 |
{ |
|
897 |
callData = iCallArrayOwner.GetCallObject( callId ); |
|
898 |
if ( callData ) |
|
899 |
{ |
|
900 |
callState = callData->GetCallState(); |
|
901 |
if ( callState != EPEStateIdle && callState != EPEStateRinging ) |
|
902 |
{ |
|
903 |
TEFLOGSTRING2( KTAINT, |
|
904 |
"CALL CPEVideoCallHandling::ReleaseAll, call id: %d", |
|
905 |
callId ); |
|
906 |
HangUp( callId ); |
|
907 |
errorCode = KErrNone; |
|
908 |
} |
|
909 |
} |
|
910 |
} |
|
911 |
||
912 |
TEFLOGSTRING2( KTAINT, |
|
913 |
"CALL CPEVideoCallHandling::ReleaseAll, error code: %d", |
|
914 |
errorCode ); |
|
915 |
||
916 |
return errorCode; |
|
917 |
} |
|
918 |
||
919 |
// ----------------------------------------------------------------------------- |
|
920 |
// CPEVideoCallHandling::TerminateAllConnections |
|
921 |
// Terminates all ringing data calls, connected data calls and packet data |
|
922 |
// connections. |
|
923 |
// ----------------------------------------------------------------------------- |
|
924 |
// |
|
925 |
TInt CPEVideoCallHandling::TerminateAllConnections() |
|
926 |
{ |
|
927 |
TEFLOGSTRING( KTAMESINT, |
|
928 |
"CALL CPEVideoCallHandling::TerminateAllConnections"); |
|
929 |
// Terminate GPRS connection. |
|
930 |
// If GPRS connections are being terminated, |
|
931 |
// then we do not start again. |
|
932 |
TBool canBeDeleted = ETrue; |
|
933 |
if ( iGprsInterface ) |
|
934 |
{ |
|
935 |
canBeDeleted = !iGprsInterface->IsTerminating(); |
|
936 |
} |
|
937 |
||
938 |
TInt error( KErrNone ); |
|
939 |
if ( canBeDeleted ) |
|
940 |
{ |
|
941 |
delete iGprsInterface; |
|
942 |
iGprsInterface = NULL; |
|
943 |
TRAP( error, |
|
944 |
iGprsInterface = new (ELeave) CPEGprsTermination; |
|
945 |
iGprsInterface->StartL() ); |
|
946 |
} |
|
947 |
// Hangup Data calls |
|
948 |
ReleaseAll(); |
|
949 |
||
950 |
return error; |
|
951 |
} |
|
952 |
||
953 |
// ----------------------------------------------------------------------------- |
|
954 |
// CPEVideoCallHandling::GetCallDuration |
|
955 |
// Returns voice and conference (master call) call duration. |
|
956 |
// Method checks that call id is valid number and gets |
|
957 |
// call duration from conference or data call object or from |
|
958 |
// calls base class for voice call duration. |
|
959 |
// ----------------------------------------------------------------------------- |
|
960 |
// |
|
961 |
TInt CPEVideoCallHandling::GetCallDuration( |
|
962 |
TTimeIntervalSeconds& aDuration, |
|
963 |
TInt aCallId ) |
|
964 |
{ |
|
965 |
TEFLOGSTRING2( KTAINT, "CALL CPEVideoCallHandling::GetCallDuration %d", aCallId ); |
|
966 |
TInt errorCode( KErrNotFound ); |
|
967 |
CPESingleCall* callData( NULL ); |
|
968 |
callData = iCallArrayOwner.GetCallObject( aCallId ); |
|
969 |
||
970 |
if ( callData && CallIdCheck::IsVideo( aCallId ) ) |
|
971 |
{ |
|
972 |
callData->GetCallDuration( aDuration ); |
|
973 |
errorCode = KErrNone; |
|
974 |
} |
|
975 |
else |
|
976 |
{ |
|
977 |
__ASSERT_DEBUG( EFalse, Panic( EPEPanicIllegalCommand) ); |
|
978 |
} |
|
979 |
||
980 |
return errorCode; |
|
981 |
} |
|
982 |
||
983 |
// ----------------------------------------------------------------------------- |
|
984 |
// CPEVideoCallHandling::ReleaseCallObject |
|
985 |
// ----------------------------------------------------------------------------- |
|
986 |
// |
|
987 |
TInt CPEVideoCallHandling::ReleaseCallObject( const TInt aCallId ) |
|
988 |
{ |
|
989 |
TInt error(KErrNone); |
|
990 |
TEFLOGSTRING2( KTAINT, |
|
991 |
"CALL CPEVideoCallHandling::ReleaseCallObject ReleaseCallObject %d", aCallId ); |
|
992 |
error = iCallArrayOwner.DeleteCallObject( aCallId ); |
|
993 |
// Reset datastore to prevent invalid usage in next call |
|
994 |
TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::ReleaseCallObject, Reset CallInfo" ); |
|
995 |
iModel.DataStore()->ResetCallInfo( aCallId ); |
|
996 |
return error; |
|
997 |
} |
|
998 |
||
999 |
// End of File |