author | hgs |
Fri, 03 Sep 2010 13:33:36 +0300 | |
changeset 65 | 2a5d4ab426d3 |
parent 60 | 1eef62f5c541 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
65 | 2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
37 | 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: Implements class CSPCall which provides call functionality |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include <etelmm.h> |
|
20 |
#include <etel.h> |
|
21 |
#include <centralrepository.h> |
|
22 |
#include <settingsinternalcrkeys.h> |
|
23 |
#include <ccpdefs.h> |
|
24 |
#include <gsmerror.h> |
|
25 |
#include <etelsat.h> |
|
26 |
#include <cccpcallparameters.h> |
|
27 |
||
28 |
#include "cspcall.h" |
|
29 |
#include "cspetelcallrequester.h" |
|
30 |
#include "cspetelcalleventmonitor.h" |
|
31 |
#include "cspcallinfomonitor.h" |
|
32 |
#include "cspetelcallstatusmonitor.h" |
|
33 |
#include "cspetelcallcapsmonitor.h" |
|
34 |
#include "csptransferprovider.h" |
|
35 |
#include "cspforwardprovider.h" |
|
36 |
#include "csplogger.h" |
|
37 |
#include "csppanic.pan" |
|
38 |
#include "cspconsts.h" |
|
39 |
#include "cspaudiohandler.h" |
|
40 |
#include "mcspcommoninfo.h" |
|
41 |
#include "mcspsecuritysettingobserver.h" |
|
42 |
#include "tcspskypeidparser.h" |
|
43 |
#include "cspuuimonitor.h" |
|
44 |
#include "cspuuimessagesender.h" |
|
45 |
||
46 |
const TInt KTimesToSplitValue = 16; |
|
65 | 47 |
const TInt KStreamsStartWaitTime = 2000000; //2 sec |
37 | 48 |
|
49 |
// --------------------------------------------------------------------------- |
|
50 |
// CSPCall::~CSPCall |
|
51 |
// --------------------------------------------------------------------------- |
|
52 |
// |
|
53 |
CSPCall::~CSPCall() |
|
54 |
{ |
|
55 |
CSPLOGSTRING(CSPOBJECT, "CSPCall::~CSPCall <"); |
|
56 |
||
57 |
delete iParams; |
|
58 |
iCommonInfo.IndicateHangupComplete( *this ); |
|
65 | 59 |
|
60 |
if ( iAudioHandler |
|
37 | 61 |
&& iAudioStatus == ECSPCallAudioStatusActive ) |
62 |
{ |
|
63 |
iAudioStatus = ECSPCallAudioStatusInactive; |
|
64 |
iAudioHandler->Stop(); |
|
65 |
} |
|
65 | 66 |
|
67 |
delete iUserToUserInformation; |
|
68 |
delete iRequester; |
|
37 | 69 |
delete iCallEventMonitor; |
70 |
delete iCallStatusMonitor; |
|
65 | 71 |
delete iCallCapsMonitor; |
37 | 72 |
delete iCallInfoMonitor; |
73 |
delete iForwardProvider; |
|
74 |
delete iTransferProvider; |
|
75 |
delete iUUIMonitor; |
|
76 |
delete iUUIMessageSender; |
|
77 |
delete iSkypeId; |
|
78 |
||
65 | 79 |
iObservers.Close(); |
37 | 80 |
if ( iCall.SubSessionHandle() ) |
81 |
{ |
|
82 |
iCall.Close(); |
|
83 |
} |
|
65 | 84 |
|
37 | 85 |
CSPLOGSTRING(CSPOBJECT, "CSPCall::~CSPCall >"); |
86 |
} |
|
87 |
||
88 |
// --------------------------------------------------------------------------- |
|
89 |
// CSPCall::SetAudioHandler |
|
90 |
// --------------------------------------------------------------------------- |
|
91 |
// |
|
65 | 92 |
void CSPCall::SetAudioHandler( CSPAudioHandlerBase* aHandler ) |
37 | 93 |
{ |
94 |
CSPLOGSTRING2(CSPINT, "CSPCall::SetAudioHandler handler: %x", aHandler); |
|
95 |
iAudioHandler = aHandler; |
|
65 | 96 |
|
97 |
if (iAudioHandler) |
|
98 |
{ |
|
99 |
iAudioHandler->SetObserver(*this); |
|
100 |
} |
|
37 | 101 |
} |
102 |
||
103 |
// --------------------------------------------------------------------------- |
|
104 |
// CSPCall::SecuritySettingChanged |
|
105 |
// --------------------------------------------------------------------------- |
|
106 |
// |
|
107 |
void CSPCall::SecuritySettingChanged( TInt aValue ) |
|
108 |
{ |
|
109 |
switch ( aValue ) |
|
110 |
{ |
|
65 | 111 |
case MCSPSecuritySettingObserver::ESecureCall: |
37 | 112 |
{ |
65 | 113 |
CSPLOGSTRING(CSPINT, |
37 | 114 |
"CSPCall::SecuritySettingChanged Sending 'secure call' event"); |
115 |
NotifyCallEventOccurred( MCCPCallObserver::ECCPSecureCall ); |
|
65 | 116 |
break; |
117 |
} |
|
118 |
case MCSPSecuritySettingObserver::ENotSecureCall: |
|
37 | 119 |
{ |
65 | 120 |
CSPLOGSTRING(CSPINT, |
37 | 121 |
"CSPCall::SecuritySettingChanged Sending 'not secure call' event"); |
122 |
NotifyCallEventOccurred( MCCPCallObserver::ECCPNotSecureCall ); |
|
65 | 123 |
break; |
37 | 124 |
} |
65 | 125 |
case MCSPSecuritySettingObserver::ESecureNotSpecified: |
37 | 126 |
{ |
65 | 127 |
CSPLOGSTRING(CSPINT, |
37 | 128 |
"CSPCall::SecuritySettingChanged Sending SecureNotSpecified"); |
129 |
NotifyCallEventOccurred( MCCPCallObserver::ECCPSecureNotSpecified ); |
|
65 | 130 |
break; |
37 | 131 |
} |
132 |
||
65 | 133 |
default: |
37 | 134 |
{ |
135 |
CSPLOGSTRING(CSPERROR, "CSPCall::SecuritySettingChanged, \ |
|
65 | 136 |
unknown event"); |
137 |
break; |
|
37 | 138 |
} |
139 |
} |
|
140 |
} |
|
141 |
||
142 |
// --------------------------------------------------------------------------- |
|
143 |
// CSPCall::RemoteAlertingToneStatusChanged |
|
65 | 144 |
// Sends EarlyMediaStarted event to observer if network has started to |
37 | 145 |
// play remote alerting tone. There is only one known use case: Network |
65 | 146 |
// starts playing alerting tone during connecting state. |
37 | 147 |
// |
65 | 148 |
// This RemoteAlertingToneStatusChanged is called for every call, |
149 |
// so it is calls responsibility to determine if the |
|
37 | 150 |
// observer should be notified. |
151 |
// --------------------------------------------------------------------------- |
|
152 |
// |
|
153 |
void CSPCall::RemoteAlertingToneStatusChanged( |
|
154 |
RMmCustomAPI::TRemoteAlertingToneStatus aNewStatus ) |
|
155 |
{ |
|
65 | 156 |
CSPLOGSTRING2(CSPINT, |
37 | 157 |
"CSPCall::RemoteAlertingToneStatusChanged new status: %d", aNewStatus ); |
65 | 158 |
|
37 | 159 |
if ( aNewStatus == RMmCustomAPI::EUiStopTone || |
65 | 160 |
aNewStatus == RMmCustomAPI::EUiNoTone ) // NW tells us to stop playing |
37 | 161 |
{ |
162 |
// Connecting is only state where network starts playing the tone. |
|
163 |
if ( iCallState == MCCPCallObserver::ECCPStateConnecting ) |
|
164 |
{ |
|
65 | 165 |
NotifyCallEventOccurred( |
37 | 166 |
MCCPCallObserver::ECCCSPEarlyMediaStarted ); |
167 |
} |
|
168 |
} |
|
169 |
} |
|
170 |
||
171 |
// --------------------------------------------------------------------------- |
|
172 |
// CSPCall::NotifyCallStateChangedETel |
|
173 |
// Notifies observers about state changes |
|
174 |
// --------------------------------------------------------------------------- |
|
175 |
// |
|
65 | 176 |
void CSPCall::NotifyCallStateChangedETel( RMobileCall::TMobileCallStatus aState ) |
37 | 177 |
{ |
65 | 178 |
CSPLOGSTRING3(CSPINT, |
179 |
"CSPCall::NotifyCallStateChangedETel < state: %d this: %x", |
|
37 | 180 |
aState, this ); |
181 |
switch ( aState ) |
|
182 |
{ |
|
183 |
/* |
|
184 |
Cannot receive any mapping call statuses from ETel to following |
|
185 |
optional states: |
|
65 | 186 |
|
37 | 187 |
ECCPStateForwarding MO call is being forwarded at receiver end |
188 |
ECCPStateQueued Call is queued locally. |
|
65 | 189 |
|
37 | 190 |
The commented observer calls are for CS specific call states. |
191 |
*/ |
|
65 | 192 |
|
37 | 193 |
// Indicates that the call is idle or unknown. |
194 |
case RMobileCall::EStatusIdle: |
|
195 |
case RMobileCall::EStatusUnknown: |
|
196 |
{ |
|
197 |
CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Idle"); |
|
198 |
||
199 |
// If audio still active |
|
65 | 200 |
if ( iAudioStatus == ECSPCallAudioStatusActive |
37 | 201 |
&& iAudioHandler |
202 |
&& iParams->CallType() == CCPCall::ECallTypeCSVoice ) |
|
203 |
{ |
|
204 |
iAudioStatus = ECSPCallAudioStatusInactive; |
|
205 |
iAudioHandler->Stop(); |
|
206 |
} |
|
65 | 207 |
|
37 | 208 |
// Notify error in case not going through disconnecting |
65 | 209 |
if ( iCallState != MCCPCallObserver::ECCPStateDisconnecting |
37 | 210 |
&& !iTerminationErrorNotified ) |
211 |
{ |
|
212 |
CheckAndNotifyTerminationError(); |
|
213 |
} |
|
65 | 214 |
|
37 | 215 |
NotifyCallStateChanged( MCCPCallObserver::ECCPStateIdle ); |
216 |
iCommonInfo.IndicateHangupComplete( *this ); |
|
217 |
break; |
|
218 |
} |
|
219 |
// The call is dialling. |
|
220 |
case RMobileCall::EStatusDialling: |
|
221 |
CSPLOGSTRING(CSPINT, "CSPCall callstate Dialling"); |
|
222 |
{ |
|
223 |
if ( iAudioHandler && iParams->CallType() == CCPCall:: ECallTypeCSVoice ) |
|
224 |
{ |
|
225 |
iAudioStatus = ECSPCallAudioStatusActive; |
|
226 |
iAudioHandler->Start(); |
|
227 |
} |
|
65 | 228 |
|
37 | 229 |
iDontReportTerm = EFalse; |
230 |
NotifyCallStateChanged( MCCPCallObserver::ECCPStateDialling ); |
|
231 |
break; |
|
65 | 232 |
} |
233 |
// Indicates that the MT call is ringing but not answered yet by |
|
37 | 234 |
// the local user |
235 |
case RMobileCall::EStatusRinging: |
|
236 |
{ |
|
237 |
CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Ringing"); |
|
238 |
NotifyCallStateChanged( MCCPCallObserver::ECCPStateRinging ); |
|
239 |
break; |
|
240 |
} |
|
241 |
// Indicates that the local user has answered the MT call but |
|
65 | 242 |
// the network has not acknowledged the call connection yet. |
37 | 243 |
case RMobileCall::EStatusAnswering: |
244 |
{ |
|
245 |
CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Answering"); |
|
246 |
||
247 |
if ( !iMobileOriginated |
|
65 | 248 |
&& iAudioHandler |
37 | 249 |
&& iAudioStatus == ECSPCallAudioStatusInactive |
250 |
&& iParams->CallType() == CCPCall::ECallTypeCSVoice ) |
|
251 |
{ |
|
252 |
iAudioStatus = ECSPCallAudioStatusActive; |
|
253 |
iAudioHandler->Start(); |
|
254 |
} |
|
255 |
||
256 |
NotifyCallStateChanged( MCCPCallObserver::ECCPStateAnswering ); |
|
257 |
break; |
|
258 |
} |
|
259 |
// MO Call: the network notifies to the MS that the remote party |
|
65 | 260 |
// is now ringing. |
37 | 261 |
case RMobileCall::EStatusConnecting: |
262 |
{ |
|
263 |
CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETelConnecting"); |
|
65 | 264 |
RMmCustomAPI::TRemoteAlertingToneStatus tone = |
37 | 265 |
iCommonInfo.GetRemoteAlertingToneStatus(); |
266 |
if ( tone == RMmCustomAPI::EUiNoTone || |
|
267 |
tone == RMmCustomAPI::EUiStopTone ) |
|
268 |
{ |
|
269 |
NotifyCallStateChangedWithInband( MCCPCallObserver::ECCPStateConnecting ); |
|
270 |
} |
|
271 |
else |
|
272 |
{ |
|
273 |
NotifyCallStateChanged( MCCPCallObserver::ECCPStateConnecting ); |
|
274 |
} |
|
275 |
break; |
|
276 |
} |
|
277 |
// Indicates that call is connected and active. |
|
278 |
case RMobileCall::EStatusConnected: |
|
279 |
{ |
|
280 |
CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Connected"); |
|
281 |
||
65 | 282 |
// Expect MCSPAudioHandlerObserver::AudioStartingFailed callback |
283 |
// when call audio control streams fail to start within specified |
|
284 |
// timeout. |
|
285 |
if (iAudioHandler && (iParams->CallType() == CCPCall::ECallTypeCSVoice)) |
|
286 |
{ |
|
287 |
iAudioHandler->ReportAudioFailureAfterTimeout( |
|
288 |
KStreamsStartWaitTime); |
|
289 |
} |
|
290 |
||
37 | 291 |
iDontReportTerm = ETrue; |
292 |
NotifyCallStateChanged( MCCPCallObserver::ECCPStateConnected ); |
|
65 | 293 |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
294 |
// Agreement with TSY is that the |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
295 |
// COLP number is available in connected state. |
65 | 296 |
NotifyRemotePartyNumberChanged(); |
37 | 297 |
break; |
298 |
} |
|
299 |
// Indicates that call is disconnecting. (Same as RCall::HangingUp) |
|
300 |
case RMobileCall::EStatusDisconnecting: |
|
301 |
{ |
|
302 |
CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Disconnecting"); |
|
303 |
||
304 |
if ( !iTerminationErrorNotified ) |
|
305 |
{ |
|
306 |
CheckAndNotifyTerminationError(); |
|
307 |
} |
|
65 | 308 |
|
309 |
NotifyCallStateChanged( MCCPCallObserver::ECCPStateDisconnecting ); |
|
37 | 310 |
break; |
311 |
} |
|
312 |
// Indicates that the call is disconnecting with inband data |
|
313 |
// (to enable the network to send an audio tone), signifying |
|
314 |
// that the call is not to be released until user terminates call |
|
315 |
case RMobileCall::EStatusDisconnectingWithInband: |
|
316 |
{ |
|
65 | 317 |
CSPLOGSTRING(CSPINT, |
37 | 318 |
"CSPCall::NotifyCallStateChangedETel DisconnectingWithInband"); |
319 |
||
320 |
if ( !iTerminationErrorNotified ) |
|
321 |
{ |
|
322 |
CheckAndNotifyTerminationError(); |
|
323 |
} |
|
65 | 324 |
|
325 |
NotifyCallStateChangedWithInband( |
|
326 |
MCCPCallObserver::ECCPStateDisconnecting ); |
|
37 | 327 |
break; |
328 |
} |
|
65 | 329 |
// Indicates that the call is connected but on hold. |
37 | 330 |
case RMobileCall::EStatusHold: |
331 |
{ |
|
332 |
CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Hold"); |
|
333 |
NotifyCallStateChanged( MCCPCallObserver::ECCPStateHold ); |
|
334 |
break; |
|
335 |
} |
|
336 |
case RMobileCall::EStatusTransferring: |
|
337 |
{ |
|
338 |
CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Transferring"); |
|
339 |
NotifyCallStateChanged( MCCPCallObserver::ECCPStateTransferring ); |
|
340 |
break; |
|
341 |
} |
|
65 | 342 |
|
37 | 343 |
// Indicates that call is undergoing temporary channel loss |
65 | 344 |
// and it may or may not be reconnected. |
345 |
case RMobileCall::EStatusReconnectPending: // fall through |
|
37 | 346 |
//Indicates that the call is the non-active half of an alternating |
347 |
// call. This call is waiting for its active half or the remote |
|
348 |
// end to switch alternating call mode. |
|
349 |
case RMobileCall::EStatusWaitingAlternatingCallSwitch: // fall through |
|
350 |
case RMobileCall::EStatusTransferAlerting: |
|
351 |
{ |
|
65 | 352 |
CSPLOGSTRING2(CSPINT, |
37 | 353 |
"CSPCall::NotifyCallStateChangedETel no special handling for state %d", |
65 | 354 |
aState); |
37 | 355 |
break; |
356 |
} |
|
357 |
||
358 |
default: |
|
359 |
{ |
|
65 | 360 |
CSPLOGSTRING(CSPERROR, |
37 | 361 |
"CSPCall::NotifyCallStateChangedETel callstate UNKNOWN"); |
362 |
break; |
|
363 |
} |
|
364 |
} |
|
365 |
CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyCallStateChangedETel >"); |
|
366 |
} |
|
367 |
||
368 |
// --------------------------------------------------------------------------- |
|
369 |
// CSPCall::NotifyCallEventOccurred |
|
370 |
// Notifies observers about call events |
|
371 |
// --------------------------------------------------------------------------- |
|
372 |
// |
|
65 | 373 |
void CSPCall::NotifyCallEventOccurred( |
37 | 374 |
MCCPCallObserver::TCCPCallEvent aEvent ) |
375 |
{ |
|
65 | 376 |
CSPLOGSTRING2(CSPINT, |
37 | 377 |
"CSPCall::NotifyCallEventOccurred < event: %d", aEvent); |
65 | 378 |
|
37 | 379 |
TInt obsCount = iObservers.Count(); |
380 |
for ( TInt i = 0; i < obsCount; i++ ) |
|
381 |
{ |
|
382 |
CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred obs=%d",i); |
|
383 |
MCCPCallObserver *obs = iObservers[i]; |
|
384 |
if ( obs ) |
|
385 |
{ |
|
386 |
obs->CallEventOccurred( aEvent, this ); |
|
387 |
} |
|
65 | 388 |
|
37 | 389 |
CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred ok obs=%d",i); |
390 |
} |
|
65 | 391 |
|
37 | 392 |
CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred > event: %d", aEvent); |
393 |
} |
|
394 |
||
395 |
// --------------------------------------------------------------------------- |
|
396 |
// CSPCall::NotifyTransferCallEventOccurred |
|
397 |
// Forward notification of transfer event to it's provider |
|
398 |
// --------------------------------------------------------------------------- |
|
399 |
// |
|
65 | 400 |
void CSPCall::NotifyTransferCallEventOccurred( |
401 |
MCCPTransferObserver::TCCPTransferEvent aEvent ) |
|
37 | 402 |
{ |
403 |
CSPLOGSTRING2(CSPINT, "CSPCall::NotifyTransferCallEventOccurred %d", aEvent); |
|
404 |
// forward the method call to CSPTransferProvider object |
|
405 |
iTransferProvider->TransferEventOccurred( aEvent ); |
|
406 |
} |
|
407 |
||
408 |
// --------------------------------------------------------------------------- |
|
409 |
// CSPCall::NotifyForwardEventOccurred |
|
410 |
// Notifies observers about call events |
|
411 |
// --------------------------------------------------------------------------- |
|
412 |
// |
|
65 | 413 |
void CSPCall::NotifyForwardEventOccurred( |
37 | 414 |
MCCPForwardObserver::TCCPForwardEvent aEvent ) |
415 |
{ |
|
416 |
CSPLOGSTRING2(CSPINT, "CSPCall::NotifyForwardEventOccurred %d", aEvent); |
|
65 | 417 |
iForwardProvider->NotifyForwardEventOccurred( aEvent ); |
37 | 418 |
} |
419 |
||
420 |
// --------------------------------------------------------------------------- |
|
421 |
// CSPCall::CallName |
|
422 |
// Get call name |
|
423 |
// --------------------------------------------------------------------------- |
|
424 |
// |
|
425 |
void CSPCall::CallName( TName& aCallName ) |
|
426 |
{ |
|
427 |
CSPLOGSTRING(CSPINT, "CSPCall::CallName"); |
|
428 |
aCallName.Zero(); |
|
429 |
aCallName.Append( iCallName ); |
|
430 |
} |
|
431 |
||
432 |
// --------------------------------------------------------------------------- |
|
433 |
// CSPCall::DialRequestFailed |
|
434 |
// Handles situations when dial fails |
|
435 |
// --------------------------------------------------------------------------- |
|
436 |
// |
|
437 |
void CSPCall::DialRequestFailed( TInt aErrorCode ) |
|
438 |
{ |
|
439 |
CSPLOGSTRING(CSPERROR, "CSPCall::DialRequestFailed"); |
|
440 |
iDialCompletionCode = aErrorCode; |
|
65 | 441 |
|
442 |
// If state has not changed |
|
37 | 443 |
// ( e.g. in case of dial could not be initiated by network problem) |
65 | 444 |
if ( iCallStatusMonitor->State() == |
37 | 445 |
RMobileCall::RMobileCall::EStatusUnknown ) |
446 |
{ |
|
65 | 447 |
NotifyErrorOccurred( iRequester->MapError( aErrorCode ) ); |
448 |
||
37 | 449 |
// Force release since otherwise call remains unreleased |
450 |
CSPLOGSTRING(CSPERROR, "CSPCall::DialRequestFailed() Force Idle"); |
|
451 |
NotifyCallStateChanged( MCCPCallObserver::ECCPStateIdle ); |
|
452 |
} |
|
65 | 453 |
|
37 | 454 |
// If dial request has completed after notifying disconnecting state |
455 |
else if ( iCallState == MCCPCallObserver::ECCPStateDisconnecting |
|
456 |
&& !iTerminationErrorNotified ) |
|
457 |
{ |
|
458 |
CheckAndNotifyTerminationError(); |
|
459 |
} |
|
460 |
} |
|
461 |
||
462 |
// --------------------------------------------------------------------------- |
|
463 |
// CSPCall::EmergencyDialRequestFailed |
|
464 |
// Handles situations when emergency dial fails |
|
465 |
// --------------------------------------------------------------------------- |
|
466 |
// |
|
467 |
void CSPCall::EmergencyDialRequestFailed( TInt /*aErrorCode*/ ) |
|
468 |
{ |
|
469 |
CSPLOGSTRING(CSPERROR, "CSPCall::EmergencyDialRequestFailed"); |
|
65 | 470 |
|
37 | 471 |
// Always same error code for CCE |
472 |
NotifyErrorOccurred( ECCPEmergencyFailed ); |
|
65 | 473 |
|
37 | 474 |
// Mark that exit code will not be used |
475 |
iTerminationErrorNotified = ETrue; |
|
476 |
} |
|
65 | 477 |
|
37 | 478 |
// --------------------------------------------------------------------------- |
479 |
// CSPCall::NotifyErrorOccurred |
|
480 |
// Notifies observers about errors |
|
481 |
// --------------------------------------------------------------------------- |
|
482 |
// |
|
483 |
void CSPCall::NotifyErrorOccurred( TCCPError aError ) |
|
484 |
{ |
|
485 |
CSPLOGSTRING2(CSPERROR, "CSPCall::NotifyErrorOccurred err %d", aError ); |
|
486 |
||
487 |
TInt obsCount = iObservers.Count(); |
|
488 |
for ( TInt i = 0; i < obsCount; i++ ) |
|
489 |
{ |
|
490 |
MCCPCallObserver *obs = iObservers[i]; |
|
491 |
if ( obs ) |
|
492 |
{ |
|
493 |
obs->ErrorOccurred( aError, this ); |
|
494 |
} |
|
495 |
} |
|
496 |
} |
|
65 | 497 |
|
37 | 498 |
// --------------------------------------------------------------------------- |
499 |
// CSPCall::CallCapsChanged |
|
500 |
// Notifies observers about new capabilities. |
|
501 |
// --------------------------------------------------------------------------- |
|
502 |
// |
|
503 |
void CSPCall::CallCapsChanged( const TUint32 aCapsFlags ) |
|
504 |
{ |
|
505 |
CSPLOGSTRING2(CSPERROR, "CSPCall::CallCapsChanged %b", aCapsFlags ); |
|
506 |
iCapsFlags = aCapsFlags; |
|
507 |
TInt obsCount = iObservers.Count(); |
|
508 |
for ( TInt i = 0; i < obsCount; i++ ) |
|
509 |
{ |
|
510 |
MCCPCallObserver *obs = iObservers[i]; |
|
511 |
if ( obs ) |
|
512 |
{ |
|
513 |
obs->CallCapsChanged( aCapsFlags, this ); |
|
514 |
} |
|
515 |
} |
|
516 |
} |
|
517 |
||
518 |
// --------------------------------------------------------------------------- |
|
519 |
// From class MCCPCSCall |
|
520 |
// CSPCall::GetMobileCallInfo |
|
521 |
// --------------------------------------------------------------------------- |
|
522 |
// |
|
523 |
TInt CSPCall::GetMobileCallInfo( TDes8& aCallInfo ) const |
|
524 |
{ |
|
525 |
CSPLOGSTRING(CSPINT, "CSPCall::GetMobileCallInfo"); |
|
526 |
return iCall.GetMobileCallInfo( aCallInfo ); |
|
527 |
} |
|
528 |
||
529 |
// --------------------------------------------------------------------------- |
|
530 |
// From class MCCPCSCall |
|
531 |
// CSPCall::GetMobileDataCallCaps |
|
532 |
// --------------------------------------------------------------------------- |
|
533 |
// |
|
534 |
TInt CSPCall::GetMobileDataCallCaps( TDes8& /*aCaps*/ ) const |
|
535 |
{ |
|
65 | 536 |
CSPLOGSTRING(CSPERROR, |
37 | 537 |
"CSPCall::GetMobileDataCallCaps ERROR, Not supported"); |
538 |
return KErrNotSupported; |
|
539 |
} |
|
540 |
||
541 |
// --------------------------------------------------------------------------- |
|
542 |
// From class MCCPCall |
|
543 |
// CSPCall::Dial |
|
544 |
// --------------------------------------------------------------------------- |
|
545 |
// |
|
546 |
TInt CSPCall::Dial() |
|
547 |
{ |
|
548 |
CSPLOGSTRING( CSPREQIN, "CSPCall::Dial" ); |
|
549 |
// Parameters not given, must create empty descriptor. |
|
550 |
TBuf8<1> params; |
|
551 |
return Dial(params); |
|
552 |
} |
|
553 |
||
554 |
// --------------------------------------------------------------------------- |
|
555 |
// From class MCCPCall |
|
556 |
// CSPCall::RemoteParty |
|
557 |
// --------------------------------------------------------------------------- |
|
558 |
// |
|
559 |
const TDesC& CSPCall::RemoteParty() const |
|
560 |
{ |
|
561 |
CSPLOGSTRING(CSPREQIN, "CSPCall::RemoteParty"); |
|
562 |
return iRemotePartyNumber; |
|
563 |
} |
|
564 |
||
565 |
// --------------------------------------------------------------------------- |
|
566 |
// From class MCCPCall |
|
567 |
// CSPCall::RemotePartyName |
|
568 |
// --------------------------------------------------------------------------- |
|
569 |
// |
|
570 |
const TDesC& CSPCall::RemotePartyName() |
|
571 |
{ |
|
572 |
CSPLOGSTRING(CSPREQIN, "CSPCall::RemotePartyName"); |
|
573 |
return iRemotePartyName; |
|
574 |
} |
|
65 | 575 |
|
37 | 576 |
// --------------------------------------------------------------------------- |
577 |
// From class MCCPCall |
|
578 |
// CSPCall::DialledParty |
|
579 |
// --------------------------------------------------------------------------- |
|
65 | 580 |
// |
581 |
const TDesC& CSPCall::DialledParty() const |
|
37 | 582 |
{ |
583 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::DialledParty %S", &iRemotePartyNumber); |
|
584 |
return iRemotePartyNumber; |
|
585 |
} |
|
65 | 586 |
|
37 | 587 |
// --------------------------------------------------------------------------- |
588 |
// From class MCCPCall |
|
589 |
// CSPCall::Answer |
|
590 |
// --------------------------------------------------------------------------- |
|
591 |
// |
|
592 |
TInt CSPCall::Answer() |
|
593 |
{ |
|
594 |
CSPLOGSTRING(CSPREQIN, "CSPCall::Answer <"); |
|
595 |
TInt ret( KErrNone ); |
|
65 | 596 |
|
597 |
if ( iCallState == MCCPCallObserver::ECCPStateRinging |
|
37 | 598 |
|| iCallState == MCCPCallObserver::ECCPStateQueued ) |
65 | 599 |
{ |
37 | 600 |
if( iMobileOriginated ) |
601 |
{ |
|
602 |
ret = KErrGeneral; |
|
603 |
} |
|
65 | 604 |
else if( iCallState != MCCPCallObserver::ECCPStateRinging && |
37 | 605 |
iCallState != MCCPCallObserver::ECCPStateQueued ) |
606 |
{ |
|
607 |
ret = KErrAccessDenied; |
|
608 |
} |
|
609 |
else |
|
610 |
{ |
|
611 |
ret = iCommonInfo.IndicateAnswerRequest( *this ); |
|
612 |
} |
|
613 |
} |
|
614 |
else |
|
615 |
{ |
|
616 |
// Not correct state for answer |
|
617 |
ret = KErrNotReady; |
|
618 |
} |
|
65 | 619 |
|
37 | 620 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::Answer > ret %d", ret); |
621 |
return ret; |
|
622 |
} |
|
623 |
||
624 |
// --------------------------------------------------------------------------- |
|
625 |
// From class MCCPCallCommandHandling |
|
626 |
// CSPCall::PerformAnswerRequest |
|
627 |
// --------------------------------------------------------------------------- |
|
628 |
// |
|
629 |
TInt CSPCall::PerformAnswerRequest() |
|
630 |
{ |
|
631 |
CSPLOGSTRING(CSPREQIN, "CSPCall::PerformAnswerRequest"); |
|
65 | 632 |
|
37 | 633 |
TInt ret = iRequester->MakeRequest( CSPEtelCallRequester::ERequestTypeAnswer ); |
65 | 634 |
CSPLOGSTRING3(CSPINT, |
37 | 635 |
"CSPCall::Answer request performed, call state %d ret: %d", iCallState, ret); |
636 |
||
637 |
return ret; |
|
638 |
} |
|
639 |
||
640 |
// --------------------------------------------------------------------------- |
|
641 |
// From class MCCPCall |
|
642 |
// CSPCall::Reject |
|
643 |
// --------------------------------------------------------------------------- |
|
644 |
// |
|
645 |
TInt CSPCall::Reject() |
|
646 |
{ |
|
647 |
CSPLOGSTRING(CSPREQIN, "CSPCall::Reject <"); |
|
648 |
TInt ret; |
|
649 |
if ( iCallState == MCCPCallObserver::ECCPStateRinging |
|
650 |
|| iCallState == MCCPCallObserver::ECCPStateQueued |
|
651 |
|| iCallState == MCCPCallObserver::ECCPStateAnswering ) |
|
65 | 652 |
{ |
37 | 653 |
CSPLOGSTRING( CSPREQIN, "CSPCall::Reject 2" ); |
654 |
ret = HangUp(); |
|
655 |
} |
|
656 |
else |
|
657 |
{ |
|
658 |
ret = KErrNotReady; |
|
659 |
} |
|
660 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::Reject > ret: %d", ret ); |
|
661 |
return ret; |
|
662 |
} |
|
663 |
||
664 |
// --------------------------------------------------------------------------- |
|
665 |
// From class MCCPCall |
|
666 |
// CSPCall::Queue |
|
667 |
// --------------------------------------------------------------------------- |
|
668 |
// |
|
669 |
TInt CSPCall::Queue() |
|
670 |
{ |
|
671 |
CSPLOGSTRING(CSPREQIN, "CSPCall::Queue"); |
|
672 |
TBool callWaitingState; |
|
673 |
iDontReportTerm = ETrue; |
|
65 | 674 |
|
37 | 675 |
TRAPD( res, iCommonInfo.GetCallWaitingL( *iParams, callWaitingState ) ); |
676 |
if( res == KErrNone ) |
|
677 |
{ |
|
678 |
if ( callWaitingState ) |
|
679 |
{ |
|
680 |
CSPLOGSTRING(CSPREQIN, "CSPCall::Queue Call Waiting On"); |
|
681 |
iCallState = MCCPCallObserver::ECCPStateQueued; |
|
65 | 682 |
|
37 | 683 |
// Notify Queued state |
684 |
TInt obsCount = iObservers.Count ( ); |
|
685 |
for (TInt i = 0; i < obsCount; i++ ) |
|
686 |
{ |
|
687 |
MCCPCallObserver *obs = iObservers[i]; |
|
688 |
if ( obs ) |
|
689 |
{ |
|
690 |
obs->CallStateChanged ( iCallState, this ); |
|
691 |
} |
|
692 |
} |
|
693 |
CSPLOGSTRING(CSPOBJECT, "CSPCall::Queue ok"); |
|
694 |
||
695 |
return KErrNone; |
|
696 |
} |
|
697 |
else |
|
698 |
{ |
|
699 |
CSPLOGSTRING(CSPREQIN, "CSPCall::Queue Call Waiting Off"); |
|
700 |
} |
|
701 |
} |
|
702 |
else |
|
703 |
{ |
|
65 | 704 |
CSPLOGSTRING2(CSPERROR, |
705 |
"CSPCall::Queue Error %d with CR. Call Waiting Off", |
|
37 | 706 |
res); |
707 |
} |
|
65 | 708 |
|
37 | 709 |
return KErrNotSupported; |
710 |
} |
|
65 | 711 |
|
37 | 712 |
// --------------------------------------------------------------------------- |
713 |
// From class MCCPCall |
|
714 |
// CSPCall::Ringing |
|
715 |
// --------------------------------------------------------------------------- |
|
716 |
// |
|
717 |
TInt CSPCall::Ringing() |
|
718 |
{ |
|
719 |
CSPLOGSTRING(CSPREQIN, "CSPCall::Ringing"); |
|
720 |
iDontReportTerm = ETrue; |
|
65 | 721 |
|
37 | 722 |
// Ringing state is accepted because MT-call goes to ringing |
723 |
// state in the beginning based on ETel state maching. |
|
724 |
if ( iCallState == MCCPCallObserver::ECCPStateIdle || |
|
65 | 725 |
iCallState == MCCPCallObserver::ECCPStateRinging ) |
37 | 726 |
{ |
727 |
NotifyRingingState(); |
|
728 |
return KErrNone; |
|
729 |
} |
|
730 |
else if ( iCallState == MCCPCallObserver::ECCPStateAnswering ) |
|
731 |
{ |
|
65 | 732 |
// Do nothing if already in Answering state (autoanswer). |
733 |
return KErrNone; |
|
37 | 734 |
} |
65 | 735 |
|
37 | 736 |
return KErrNotReady; |
737 |
} |
|
65 | 738 |
|
37 | 739 |
// --------------------------------------------------------------------------- |
740 |
// From class MCCPCall |
|
741 |
// CSPCall::HangUp |
|
742 |
// --------------------------------------------------------------------------- |
|
743 |
// |
|
744 |
TInt CSPCall::HangUp() |
|
745 |
{ |
|
746 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::HangUp this: %x", this); |
|
747 |
TInt ret( KErrNone ); |
|
65 | 748 |
|
37 | 749 |
CSPEtelCallRequester::TRequestType req = iRequester->Request(); |
65 | 750 |
if ( req == CSPEtelCallRequester::ERequestTypeDial || |
37 | 751 |
( req == CSPEtelCallRequester::ERequestTypeDialEmergency ) ) |
752 |
{ |
|
753 |
CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 1: Cancel ongoing dial"); |
|
754 |
ret = iRequester->DialCancel(); |
|
755 |
CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp Canceled"); |
|
756 |
} |
|
757 |
else if ( req == CSPEtelCallRequester::ERequestTypeHangup ) |
|
758 |
{ |
|
759 |
CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 2"); |
|
760 |
ret = KErrAlreadyExists; |
|
761 |
} |
|
65 | 762 |
else if ( req == CSPEtelCallRequester::ERequestTypeNone |
37 | 763 |
&& iCallState != MCCPCallObserver::ECCPStateIdle ) |
764 |
{ |
|
765 |
CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 3"); |
|
766 |
ret = iRequester->MakeRequest( CSPEtelCallRequester::ERequestTypeHangup ); |
|
767 |
iCommonInfo.IndicateActiveHangup( *this ); |
|
768 |
} |
|
769 |
else if ( req == CSPEtelCallRequester::ERequestTypeNone ) |
|
770 |
{ |
|
771 |
CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 4"); |
|
772 |
ret = KErrAlreadyExists; |
|
773 |
} |
|
774 |
else |
|
775 |
{ |
|
776 |
CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 5"); |
|
777 |
// Request pending, must be canceled |
|
778 |
iRequester->Cancel(); |
|
779 |
ret = iRequester->MakeRequest( CSPEtelCallRequester::ERequestTypeHangup ); |
|
780 |
iCommonInfo.IndicateActiveHangup( *this ); |
|
781 |
} |
|
65 | 782 |
|
37 | 783 |
return ret; |
784 |
} |
|
785 |
||
786 |
// --------------------------------------------------------------------------- |
|
787 |
// From class MCCPCall |
|
788 |
// CSPCall::Cancel |
|
789 |
// --------------------------------------------------------------------------- |
|
790 |
// |
|
791 |
TInt CSPCall::Cancel() |
|
792 |
{ |
|
793 |
CSPLOGSTRING(CSPREQIN, "CSPCall::Cancel"); |
|
794 |
return HangUp(); |
|
795 |
} |
|
65 | 796 |
|
37 | 797 |
// --------------------------------------------------------------------------- |
798 |
// From class MCCPCall |
|
799 |
// CSPCall::Hold |
|
800 |
// --------------------------------------------------------------------------- |
|
801 |
// |
|
802 |
TInt CSPCall::Hold() |
|
803 |
{ |
|
804 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::Hold this: %x", this); |
|
805 |
TInt ret; |
|
65 | 806 |
|
37 | 807 |
if ( iCallState == MCCPCallObserver::ECCPStateConnected ) |
808 |
{ |
|
809 |
CSPLOGSTRING(CSPREQOUT, "CSPCall::Hold make request"); |
|
810 |
||
811 |
// Set call on hold |
|
65 | 812 |
ret = iRequester->MakeRequest( |
37 | 813 |
CSPEtelCallRequester::ERequestTypeHold ); |
814 |
if ( ret != KErrNone ) |
|
815 |
{ |
|
65 | 816 |
CSPLOGSTRING2(CSPERROR, |
37 | 817 |
"CSPCall::Hold ERROR: %d", ret); |
818 |
} |
|
819 |
} |
|
820 |
else if ( iCallState == MCCPCallObserver::ECCPStateHold ) |
|
821 |
{ |
|
822 |
CSPLOGSTRING(CSPERROR, "CSPCall::Hold : already held"); |
|
823 |
ret = KErrAlreadyExists; |
|
824 |
} |
|
825 |
else |
|
826 |
{ |
|
827 |
CSPLOGSTRING(CSPERROR, "CSPCall::Hold not allowed"); |
|
828 |
ret = KErrNotReady; |
|
829 |
} |
|
830 |
||
831 |
return ret; |
|
65 | 832 |
} |
37 | 833 |
|
834 |
// --------------------------------------------------------------------------- |
|
835 |
// From class MCCPCall |
|
836 |
// CSPCall::Resume |
|
837 |
// --------------------------------------------------------------------------- |
|
838 |
// |
|
839 |
TInt CSPCall::Resume() |
|
840 |
{ |
|
841 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::Resume this: %x", this); |
|
842 |
TInt ret; |
|
65 | 843 |
|
37 | 844 |
if ( iCallState == MCCPCallObserver::ECCPStateHold ) |
845 |
{ |
|
846 |
CSPLOGSTRING(CSPREQOUT, "CSPCall::Resume request"); |
|
65 | 847 |
|
848 |
ret = iRequester->MakeRequest( |
|
37 | 849 |
CSPEtelCallRequester::ERequestTypeResume ); |
850 |
if ( KErrNone != ret ) |
|
851 |
{ |
|
852 |
CSPLOGSTRING2(CSPERROR, "CSPCall::Resume ERROR %d", ret); |
|
853 |
} |
|
854 |
} |
|
855 |
else if ( iCallState == MCCPCallObserver::ECCPStateConnected ) |
|
856 |
{ |
|
857 |
CSPLOGSTRING(CSPERROR, "CSPCall::Resume already connected" ); |
|
858 |
ret = KErrAlreadyExists; |
|
859 |
} |
|
860 |
else |
|
861 |
{ |
|
862 |
CSPLOGSTRING(CSPERROR, "CSPCall::Resume not held state" ); |
|
863 |
ret = KErrNotReady; |
|
864 |
} |
|
65 | 865 |
|
37 | 866 |
return ret; |
867 |
} |
|
868 |
||
869 |
// --------------------------------------------------------------------------- |
|
870 |
// From class MCCPCall |
|
871 |
// CSPCall::Swap |
|
872 |
// --------------------------------------------------------------------------- |
|
873 |
// |
|
874 |
TInt CSPCall::Swap() |
|
875 |
{ |
|
876 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::Swap this: %x", this); |
|
877 |
TInt ret; |
|
878 |
if ( iCallState == MCCPCallObserver::ECCPStateConnected |
|
879 |
|| iCallState == MCCPCallObserver::ECCPStateHold ) |
|
65 | 880 |
{ |
37 | 881 |
ret = iRequester->MakeRequest( CSPEtelCallRequester::ERequestTypeSwap ); |
882 |
if ( ret ) |
|
883 |
{ |
|
884 |
CSPLOGSTRING2( CSPERROR, "CSPCall::Swap Error %d", ret ); |
|
885 |
} |
|
886 |
} |
|
887 |
else |
|
888 |
{ |
|
889 |
ret = KErrNotReady; |
|
890 |
} |
|
891 |
return ret; |
|
892 |
} |
|
893 |
||
894 |
// --------------------------------------------------------------------------- |
|
895 |
// From class MCCPCall |
|
896 |
// CSPCall::IsMobileOriginated |
|
897 |
// --------------------------------------------------------------------------- |
|
898 |
// |
|
899 |
TBool CSPCall::IsMobileOriginated() const |
|
900 |
{ |
|
901 |
CSPLOGSTRING(CSPREQIN, "CSPCall::IsMobileOriginated"); |
|
902 |
return iMobileOriginated; |
|
903 |
} |
|
904 |
||
905 |
// --------------------------------------------------------------------------- |
|
906 |
// From class MCCPCall |
|
907 |
// CSPCall::State |
|
908 |
// --------------------------------------------------------------------------- |
|
909 |
// |
|
910 |
MCCPCallObserver::TCCPCallState CSPCall::State() const |
|
911 |
{ |
|
912 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::State %d", iCallState); |
|
913 |
return iCallState; |
|
914 |
} |
|
915 |
||
916 |
// --------------------------------------------------------------------------- |
|
917 |
// From class MCCPCall |
|
918 |
// CSPCall::Uid |
|
919 |
// --------------------------------------------------------------------------- |
|
920 |
// |
|
921 |
TUid CSPCall::Uid() const |
|
922 |
{ |
|
923 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::Uid %d", KCSPImplementationUid); |
|
924 |
return KCSPImplementationUid; |
|
925 |
} |
|
926 |
||
927 |
// --------------------------------------------------------------------------- |
|
928 |
// From class MCCPCall |
|
929 |
// CSPCall::Caps |
|
930 |
// --------------------------------------------------------------------------- |
|
931 |
// |
|
932 |
MCCPCallObserver::TCCPCallControlCaps CSPCall::Caps( ) const |
|
933 |
{ |
|
934 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::Caps %b", iCapsFlags ); |
|
935 |
return (MCCPCallObserver::TCCPCallControlCaps) iCapsFlags; |
|
936 |
} |
|
65 | 937 |
|
37 | 938 |
// --------------------------------------------------------------------------- |
939 |
// From class MCCPCall |
|
940 |
// CSPCall::SetParameters |
|
941 |
// --------------------------------------------------------------------------- |
|
942 |
// |
|
943 |
void CSPCall::SetParameters( const CCCPCallParameters& /*aNewParams*/ ) |
|
944 |
{ |
|
945 |
CSPLOGSTRING(CSPOBJECT, "CSPCall::SetParameters ERROR Can't set params"); |
|
946 |
} |
|
947 |
||
948 |
// --------------------------------------------------------------------------- |
|
949 |
// From class MCCPCall |
|
950 |
// CSPCall::Parameters |
|
951 |
// --------------------------------------------------------------------------- |
|
952 |
// |
|
953 |
const CCCPCallParameters& CSPCall::Parameters() const |
|
954 |
{ |
|
955 |
CSPLOGSTRING(CSPINT, "CSPCall::Parameters"); |
|
956 |
return *iParams; |
|
957 |
} |
|
958 |
||
959 |
// --------------------------------------------------------------------------- |
|
960 |
// From class MCCPCall |
|
961 |
// CSPCall::TransferProvider |
|
962 |
// --------------------------------------------------------------------------- |
|
963 |
// |
|
65 | 964 |
MCCPTransferProvider* CSPCall::TransferProviderL(const MCCPTransferObserver& |
37 | 965 |
aObserver ) |
966 |
{ |
|
967 |
CSPLOGSTRING(CSPREQIN, "CSPCall::TransferProvider"); |
|
968 |
iTransferProvider->AddObserverL( aObserver ); |
|
969 |
return iTransferProvider; |
|
970 |
} |
|
65 | 971 |
|
37 | 972 |
// --------------------------------------------------------------------------- |
973 |
// From class MCCPCall |
|
974 |
// CSPCall::ForwardProvider |
|
975 |
// --------------------------------------------------------------------------- |
|
976 |
// |
|
65 | 977 |
MCCPForwardProvider* CSPCall::ForwardProviderL( |
37 | 978 |
const MCCPForwardObserver& aObserver ) |
979 |
{ |
|
980 |
CSPLOGSTRING(CSPREQIN, "CSPCall::ForwardProvider"); |
|
981 |
iForwardProvider->AddObserverL( aObserver ); |
|
982 |
return iForwardProvider; |
|
983 |
} |
|
984 |
||
985 |
// --------------------------------------------------------------------------- |
|
986 |
// From class MCCPCall |
|
987 |
// CSPCall::AddObserverL |
|
988 |
// --------------------------------------------------------------------------- |
|
989 |
// |
|
990 |
void CSPCall::AddObserverL( const MCCPCallObserver& aObserver ) |
|
991 |
{ |
|
992 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::AddObserverL %x", &aObserver); |
|
993 |
if ( iObservers.Find( &aObserver ) == KErrNotFound ) |
|
994 |
{ |
|
995 |
iObservers.AppendL( &aObserver ); |
|
996 |
} |
|
997 |
} |
|
998 |
||
999 |
// --------------------------------------------------------------------------- |
|
1000 |
// From class MCCPCall |
|
1001 |
// Removes observer. |
|
1002 |
// --------------------------------------------------------------------------- |
|
1003 |
// |
|
1004 |
TInt CSPCall::RemoveObserver( const MCCPCallObserver& aObserver ) |
|
1005 |
{ |
|
1006 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::RemoveObserver %x", &aObserver); |
|
65 | 1007 |
|
37 | 1008 |
TInt found = iObservers.Find( &aObserver ); |
1009 |
if ( found != KErrNotFound ) |
|
1010 |
{ |
|
1011 |
iObservers.Remove( found ); |
|
1012 |
return KErrNone; |
|
1013 |
} |
|
65 | 1014 |
|
37 | 1015 |
return found; |
1016 |
} |
|
1017 |
||
1018 |
// --------------------------------------------------------------------------- |
|
1019 |
// From class MCCPCall |
|
1020 |
// CSPCall::IsCallForwarded |
|
1021 |
// --------------------------------------------------------------------------- |
|
1022 |
// |
|
1023 |
TBool CSPCall::IsCallForwarded( ) const |
|
1024 |
{ |
|
1025 |
CSPLOGSTRING(CSPREQIN, "CSPCall::IsCallForwarded <"); |
|
1026 |
TBool ret( EFalse ); |
|
1027 |
TInt err( KErrNone ); |
|
60 | 1028 |
RMobileCall::TMobileCallInfoV7Pckg pck( iEtelCallInfo ); |
1029 |
err = GetMobileCallInfo( pck ); |
|
37 | 1030 |
if (err == KErrNone ) |
1031 |
{ |
|
50 | 1032 |
ret = iEtelCallInfo.iForwarded; |
37 | 1033 |
} |
1034 |
||
1035 |
CSPLOGSTRING2(CSPREQIN, |
|
1036 |
"CSPCall::IsCallForwarded > forwarder: %d", ret ); |
|
1037 |
||
1038 |
return ret; |
|
1039 |
} |
|
1040 |
||
1041 |
// --------------------------------------------------------------------------- |
|
1042 |
// From class MCCPCall |
|
1043 |
// CSPCall::IsSecured |
|
1044 |
// --------------------------------------------------------------------------- |
|
1045 |
// |
|
1046 |
TBool CSPCall::IsSecured( ) const |
|
65 | 1047 |
{ |
37 | 1048 |
CSPLOGSTRING(CSPREQIN, "CSPCall::IsSecured"); |
1049 |
return iCommonInfo.NetworkSecurityStatus(); |
|
1050 |
} |
|
1051 |
||
1052 |
// --------------------------------------------------------------------------- |
|
1053 |
// From class MCCPCall |
|
1054 |
// CSPCall::SecureSpecified |
|
1055 |
// --------------------------------------------------------------------------- |
|
1056 |
// |
|
1057 |
TBool CSPCall::SecureSpecified( ) const |
|
65 | 1058 |
{ |
37 | 1059 |
CSPLOGSTRING(CSPREQIN, "CSPCall::SecureSpecified"); |
1060 |
return iCommonInfo.SecureSpecified(); |
|
1061 |
} |
|
1062 |
||
1063 |
// --------------------------------------------------------------------------- |
|
1064 |
// From class MCCPCall |
|
1065 |
// CSPCall::Tone |
|
1066 |
// --------------------------------------------------------------------------- |
|
1067 |
// |
|
1068 |
TCCPTone CSPCall::Tone() const |
|
1069 |
{ |
|
1070 |
CSPLOGSTRING(CSPREQIN, "CSPCall::Tone <"); |
|
1071 |
TCCPTone tone( ECCPNoSoundSequence ); |
|
1072 |
||
1073 |
if ( iCallState == MCCPCallObserver::ECCPStateConnecting ) |
|
1074 |
{ |
|
1075 |
RMmCustomAPI::TRemoteAlertingToneStatus ts = iCommonInfo.GetRemoteAlertingToneStatus(); |
|
65 | 1076 |
|
37 | 1077 |
if (ts == RMmCustomAPI::EUiRbtTone ) |
1078 |
{ |
|
1079 |
tone = ECCPRemoteAlerting; |
|
1080 |
} |
|
1081 |
else if ( ts == RMmCustomAPI::EUiStopTone ) |
|
1082 |
{ |
|
1083 |
tone = ECCPNoSoundSequence; |
|
1084 |
} |
|
65 | 1085 |
else |
37 | 1086 |
{ |
1087 |
// No tone |
|
1088 |
tone = ECCPNoSoundSequence; |
|
1089 |
} |
|
1090 |
} |
|
1091 |
else |
|
1092 |
{ |
|
65 | 1093 |
// Handle disconnecting tones |
37 | 1094 |
TInt callDisconnectingError = ExitCodeError(); |
1095 |
CSPLOGSTRING2(CSPINT, "CSPCall::Tone exit code err: %d", callDisconnectingError); |
|
1096 |
||
1097 |
switch( callDisconnectingError ) |
|
1098 |
{ |
|
1099 |
case KErrNone: |
|
65 | 1100 |
// GSM: DIAL TONE (optional) - not used in Nokia phones |
37 | 1101 |
CSPLOGSTRING(CSPERROR, "CSPCall::Tone: No sound"); |
1102 |
break; |
|
1103 |
case KErrGsmCCUserBusy: |
|
1104 |
// GSM: SUBSCRIBER BUSY |
|
1105 |
tone = ECCPToneUserBusy; |
|
1106 |
CSPLOGSTRING(CSPINT, "CSPCall::Tone: Subscriber Busy"); |
|
1107 |
break; |
|
1108 |
// Fall through |
|
1109 |
case KErrGsmCCNumberChanged: |
|
1110 |
case KErrGsmCCResponseToStatusEnquiry: |
|
1111 |
case KErrGsmCCNormalUnspecified: |
|
1112 |
// GSM: NONE, Nokia phones: radio path not available |
|
1113 |
tone = ECCPToneRadioPathNotAvailable; |
|
1114 |
CSPLOGSTRING(CSPINT, "CSPCall::Tone: RadioPathNotAvailable"); |
|
65 | 1115 |
break; |
37 | 1116 |
case KErrGsmCCNoChannelAvailable: |
1117 |
case KErrGsmCCTemporaryFailure: |
|
1118 |
case KErrGsmCCSwitchingEquipmentCongestion: |
|
1119 |
case KErrGsmCCRequestedChannelNotAvailable: |
|
1120 |
case KErrGsmCCQualityOfServiceNotAvailable: |
|
1121 |
case KErrGsmCCBearerCapabilityNotCurrentlyAvailable: |
|
1122 |
// GSM: CONGESTION |
|
1123 |
tone = ECCPToneCongestion; |
|
1124 |
CSPLOGSTRING(CSPINT, "CSPCall::Tone: Congestion"); |
|
1125 |
break; |
|
1126 |
case KErrGsmCCUnassignedNumber: |
|
1127 |
case KErrGsmCCNoRouteToDestination: |
|
1128 |
case KErrGsmCCChannelUnacceptable: |
|
1129 |
case KErrGsmCCOperatorDeterminedBarring: |
|
1130 |
case KErrGsmCCUserNotResponding: |
|
1131 |
case KErrGsmCCUserAlertingNoAnswer: |
|
1132 |
case KErrGsmCCCallRejected: |
|
1133 |
case KErrGsmCCNonSelectedUserClearing: |
|
1134 |
case KErrGsmCCDestinationOutOfOrder: |
|
1135 |
case KErrGsmCCInvalidNumberFormat: |
|
1136 |
case KErrGsmCCFacilityRejected: |
|
1137 |
case KErrGsmCCNetworkOutOfOrder: |
|
1138 |
case KErrGsmCCAccessInformationDiscarded: |
|
1139 |
case KErrGsmCCResourceNotAvailable: |
|
1140 |
case KErrGsmCCRequestedFacilityNotSubscribed: |
|
1141 |
case KErrGsmCCIncomingCallsBarredInCug: |
|
1142 |
case KErrGsmCCBearerCapabilityNotAuthorised: |
|
1143 |
case KErrGsmCCServiceNotAvailable: |
|
1144 |
case KErrGsmCCBearerServiceNotImplemented: |
|
1145 |
case KErrGsmCCChannelTypeNotImplemented: |
|
1146 |
case KErrGsmCCAcmGreaterThanAcmMax: |
|
1147 |
case KErrGsmCCRequestedFacilityNotImplemented: |
|
1148 |
case KErrGsmCCOnlyRestrictedDigitalInformationBCAvailable: |
|
1149 |
case KErrGsmCCServiceNotImplemented: |
|
1150 |
case KErrGsmCCInvalidCallReferenceValue: |
|
1151 |
case KErrGsmCCChannelDoesNotExist: |
|
1152 |
case KErrGsmCCSuspendedCallExistsButCallIdentityDoesNotWork: |
|
1153 |
case KErrGsmCCCallIdentityInUse: |
|
1154 |
case KErrGsmCCNoCallSuspended: |
|
1155 |
case KErrGsmCCRequestedCallIdentityAlreadyCleared: |
|
1156 |
case KErrGsmCCUserNotInCug: |
|
1157 |
case KErrGsmCCIncompatibleDestination: |
|
1158 |
case KErrGsmCCInvalidTransitNetworkSelection: |
|
1159 |
case KErrGsmCCIncompatibleSegmentedMessage: |
|
1160 |
case KErrGsmCCSemanticallyIncorrectMessage: |
|
1161 |
case KErrGsmCCInvalidMandatoryInformation: |
|
1162 |
case KErrGsmCCNonExistentMessageType: |
|
1163 |
case KErrGsmCCIncompatibleMessageInProtocolState: |
|
1164 |
case KErrGsmCCNonExistentInformationElement: |
|
1165 |
case KErrGsmCCConditionalIEError: |
|
1166 |
case KErrGsmCCIncompatibleMessageInCallState: |
|
1167 |
case KErrGsmCCRecoveryOnTimerExpiry: |
|
1168 |
case KErrGsmCCUnspecifiedProtocolError: |
|
1169 |
case KErrGsmCCUnspecifiedInterworkingError: |
|
1170 |
// GSM: SPECIAL INFORMATION |
|
1171 |
tone = ECCPToneSpecialInformation; |
|
1172 |
CSPLOGSTRING(CSPINT, "CSPCall::Tone: Special Information"); |
|
1173 |
break; |
|
1174 |
default: |
|
1175 |
CSPLOGSTRING(CSPERROR, "CSPCall::Tone: ERROR not found"); |
|
1176 |
break; |
|
1177 |
} |
|
1178 |
} |
|
65 | 1179 |
|
37 | 1180 |
CSPLOGSTRING2(CSPREQIN, "CSPCall::Tone > tone: %d", tone); |
1181 |
return tone; |
|
1182 |
} |
|
65 | 1183 |
|
37 | 1184 |
// --------------------------------------------------------------------------- |
1185 |
// From class MCCPCSCall |
|
1186 |
// CSPCall::NoFdnCheck |
|
1187 |
// --------------------------------------------------------------------------- |
|
1188 |
// |
|
1189 |
void CSPCall::NoFDNCheck( ) |
|
1190 |
{ |
|
1191 |
CSPLOGSTRING(CSPREQIN, "CSPCall::NoFDNCheck"); |
|
1192 |
iFdnCheck = EFalse; |
|
1193 |
} |
|
65 | 1194 |
|
37 | 1195 |
// --------------------------------------------------------------------------- |
1196 |
// CSPCall::LogDialedNumber |
|
1197 |
// --------------------------------------------------------------------------- |
|
1198 |
// |
|
1199 |
TBool CSPCall::LogDialedNumber() const |
|
1200 |
{ |
|
1201 |
CSPLOGSTRING(CSPREQIN, "CSPCall::LogDialedNumber true"); |
|
1202 |
return ETrue; |
|
1203 |
} |
|
65 | 1204 |
|
37 | 1205 |
// --------------------------------------------------------------------------- |
1206 |
// From class MCCPCSCall |
|
1207 |
// CSPCall::Dial |
|
1208 |
// --------------------------------------------------------------------------- |
|
1209 |
// |
|
1210 |
TInt CSPCall::Dial( const TDesC8& /*aCallParams*/ ) |
|
1211 |
{ |
|
1212 |
CSPLOGSTRING(CSPREQIN, "CSPCall::Dial"); |
|
1213 |
return iCommonInfo.IndicateDialRequest( *this ); |
|
1214 |
} |
|
1215 |
||
1216 |
// --------------------------------------------------------------------------- |
|
1217 |
// From class MCCPCallCommandHandling |
|
1218 |
// CSPCall::PerformDialRequest |
|
1219 |
// --------------------------------------------------------------------------- |
|
1220 |
// |
|
1221 |
TInt CSPCall::PerformDialRequest() |
|
1222 |
{ |
|
1223 |
CSPLOGSTRING(CSPREQIN, "CSPCall::PerformDialRequest"); |
|
1224 |
iDialCompletionCode = KErrNone; |
|
1225 |
iTerminationErrorNotified = EFalse; |
|
65 | 1226 |
|
37 | 1227 |
// Send the User to User Information. |
1228 |
if( iUserToUserInformation->Length() ) |
|
1229 |
{ |
|
1230 |
iUUIMessageSender->SendUUIMessage( *iUserToUserInformation ); |
|
1231 |
} |
|
65 | 1232 |
|
37 | 1233 |
return DialFdnCond( iFdnCheck ); |
1234 |
} |
|
65 | 1235 |
|
1236 |
// --------------------------------------------------------------------------- |
|
1237 |
// From class MCSPAudioHandlerObserver |
|
1238 |
// CSPCall::AudioStartingFailed |
|
1239 |
// --------------------------------------------------------------------------- |
|
1240 |
// |
|
1241 |
void CSPCall::AudioStartingFailed() |
|
1242 |
{ |
|
1243 |
HangUp(); |
|
1244 |
} |
|
1245 |
||
37 | 1246 |
// --------------------------------------------------------------------------- |
1247 |
// CSPCall::CSPCall |
|
1248 |
// --------------------------------------------------------------------------- |
|
1249 |
// |
|
65 | 1250 |
CSPCall::CSPCall( RMobileLine& aLine, |
37 | 1251 |
TBool aMobileOriginated, |
1252 |
const TDesC& aName, |
|
1253 |
MCSPCommonInfo& aCommonInfo, |
|
65 | 1254 |
TBool aIsEmergencyCall ) : |
37 | 1255 |
iLine( aLine ), |
1256 |
iMobileOriginated( aMobileOriginated ), |
|
1257 |
iName( aName ), |
|
60 | 1258 |
iParams( NULL ), |
1259 |
iCallState( MCCPCallObserver::ECCPStateIdle ), |
|
1260 |
iCapsFlags( 0 ), |
|
1261 |
iCallStatusMonitor( NULL ), |
|
1262 |
iCallEventMonitor( NULL ), |
|
1263 |
iCallInfoMonitor( NULL ), |
|
1264 |
iRequester( NULL ), |
|
1265 |
iDialCompletionCode( KErrNone ), |
|
37 | 1266 |
iCommonInfo( aCommonInfo ), |
1267 |
iTerminationErrorNotified( EFalse ), |
|
1268 |
iIsEmergencyCall( aIsEmergencyCall), |
|
60 | 1269 |
iTransferProvider( NULL ), |
1270 |
iForwardProvider( NULL ), |
|
1271 |
iAudioHandler( NULL ), |
|
1272 |
iFdnCheck( ETrue ), |
|
1273 |
iCallCapsMonitor( NULL ), |
|
1274 |
iUUIMonitor( NULL ), |
|
1275 |
iUUIMessageSender( NULL ), |
|
1276 |
iSkypeId( NULL ), |
|
1277 |
iAudioStatus( ECSPCallAudioStatusInactive ), |
|
1278 |
iDontReportTerm( EFalse ), |
|
1279 |
iUserToUserInformation( NULL ) |
|
37 | 1280 |
{ |
1281 |
CSPLOGSTRING(CSPOBJECT, "CSPCall::CSPCall"); |
|
1282 |
} |
|
1283 |
||
1284 |
// --------------------------------------------------------------------------- |
|
1285 |
// CSPCall::ConstructL |
|
1286 |
// Constructing CSPCall in 2nd phase |
|
1287 |
// --------------------------------------------------------------------------- |
|
65 | 1288 |
// |
37 | 1289 |
void CSPCall::ConstructL( const CCCECallParameters& aParams ) |
1290 |
{ |
|
1291 |
CSPLOGSTRING(CSPOBJECT, "CSPCall::ConstructL <"); |
|
1292 |
||
65 | 1293 |
// Create cloned copy of call parameters |
37 | 1294 |
iParams = static_cast<CCCECallParameters*>( aParams.CloneL() ); |
65 | 1295 |
|
1296 |
// Open call handle |
|
1297 |
OpenCallHandleL(); |
|
37 | 1298 |
|
65 | 1299 |
// Update call info |
1300 |
UpdateCallInfo(); |
|
1301 |
||
1302 |
// Update call state from ETel |
|
1303 |
UpdateCallState(); |
|
1304 |
||
1305 |
// Create call handlers for call related requests |
|
1306 |
// and for monitoring call related events |
|
1307 |
CreateCallHandlersL(); |
|
1308 |
||
37 | 1309 |
CSPLOGSTRING(CSPOBJECT, "CSPCall::ConstructL >"); |
1310 |
} |
|
1311 |
||
1312 |
// --------------------------------------------------------------------------- |
|
1313 |
// CSPCall::OpenCallHandleL |
|
65 | 1314 |
// Open call handle, calls either OpenNewCallL or OpenExistingCallL depending |
1315 |
// of the call direction and if the call is a client call |
|
37 | 1316 |
// --------------------------------------------------------------------------- |
65 | 1317 |
// |
37 | 1318 |
void CSPCall::OpenCallHandleL() |
1319 |
{ |
|
1320 |
CSPLOGSTRING(CSPINT, "CSPCall::OpenCallHandleL <"); |
|
65 | 1321 |
|
37 | 1322 |
if ( iMobileOriginated ) |
1323 |
{ |
|
65 | 1324 |
// There is no existing call on line, open new call |
37 | 1325 |
OpenNewCall(); |
1326 |
} |
|
1327 |
else |
|
1328 |
{ |
|
65 | 1329 |
// Mobile terminated call on line, open existing call |
1330 |
OpenExistingCallL( iName ); |
|
37 | 1331 |
} |
1332 |
||
1333 |
CSPLOGSTRING(CSPINT, "CSPCall::OpenCallHandleL >"); |
|
1334 |
} |
|
1335 |
||
1336 |
// --------------------------------------------------------------------------- |
|
1337 |
// CSPCall::UpdateCallInfoL |
|
65 | 1338 |
// Update call info including remote party name and number data |
37 | 1339 |
// --------------------------------------------------------------------------- |
65 | 1340 |
// |
37 | 1341 |
void CSPCall::UpdateCallInfo() |
1342 |
{ |
|
1343 |
CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfo <"); |
|
60 | 1344 |
RMobileCall::TMobileCallInfoV7Pckg pck( iEtelCallInfo ); |
1345 |
TInt err = GetMobileCallInfo( pck ); |
|
1346 |
UpdateCallInfoImpl( iEtelCallInfo ); |
|
37 | 1347 |
|
1348 |
CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfo >"); |
|
1349 |
} |
|
1350 |
||
1351 |
// --------------------------------------------------------------------------- |
|
1352 |
// CSPCall::UpdateCallInfoImpl |
|
1353 |
// Implementation for UpdateCallInfo(). |
|
1354 |
// --------------------------------------------------------------------------- |
|
65 | 1355 |
// |
60 | 1356 |
void CSPCall::UpdateCallInfoImpl( const RMobileCall::TMobileCallInfoV7& aCallInfo ) |
37 | 1357 |
{ |
1358 |
CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfoImpl <"); |
|
1359 |
||
1360 |
if ( iMobileOriginated ) |
|
1361 |
{ |
|
1362 |
// Call wasn't added by ETel monitor, update info accordingly |
|
65 | 1363 |
UpdateCallNameNumberInfo( aCallInfo, EFalse ); |
37 | 1364 |
} |
1365 |
else |
|
1366 |
{ |
|
1367 |
// Call was added by ETel monitor, update info accordingly |
|
1368 |
UpdateCallNameNumberInfo( aCallInfo, ETrue ); |
|
1369 |
} |
|
65 | 1370 |
|
37 | 1371 |
|
1372 |
CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfoImpl >"); |
|
1373 |
} |
|
1374 |
||
1375 |
// --------------------------------------------------------------------------- |
|
1376 |
// CSPCall::UpdateCallOrigin |
|
1377 |
// Set call origin to CCCECallParameters. |
|
1378 |
// --------------------------------------------------------------------------- |
|
65 | 1379 |
// |
60 | 1380 |
void CSPCall::UpdateCallOrigin( const RMobileCall::TMobileCallInfoV7& aCallInfo ) |
37 | 1381 |
{ |
1382 |
CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallOrigin <"); |
|
1383 |
||
1384 |
if ( RMobileCall::EOriginatorSIM == aCallInfo.iCallParamOrigin ) |
|
1385 |
{ |
|
1386 |
iParams->SetOrigin(CCCECallParameters::ECCECallOriginSAT); |
|
1387 |
iParams->SetAlphaId(aCallInfo.iAlphaId); |
|
1388 |
} |
|
1389 |
||
1390 |
CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallOrigin >"); |
|
1391 |
} |
|
1392 |
||
1393 |
||
1394 |
||
1395 |
// --------------------------------------------------------------------------- |
|
1396 |
// CSPCall::UpdateCallStateL |
|
65 | 1397 |
// |
37 | 1398 |
// --------------------------------------------------------------------------- |
65 | 1399 |
// |
37 | 1400 |
int CSPCall::UpdateCallState() |
1401 |
{ |
|
1402 |
CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallState <"); |
|
65 | 1403 |
TInt err( KErrNone ); |
1404 |
||
37 | 1405 |
// Update call state from ETel |
1406 |
RMobileCall::TMobileCallStatus etelState; |
|
1407 |
err = iCall.GetMobileCallStatus( etelState ); |
|
1408 |
if ( KErrNone == err ) |
|
1409 |
{ |
|
1410 |
iCallState = CCPStateFromETelState( etelState ); |
|
1411 |
} |
|
1412 |
CSPLOGSTRING2(CSPINT, "CSPCall::UpdateCallState > res %d", err); |
|
65 | 1413 |
|
1414 |
return err; |
|
37 | 1415 |
} |
1416 |
||
1417 |
// --------------------------------------------------------------------------- |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1418 |
// CSPCall::NotifyRemotePartyNumberChanged |
65 | 1419 |
// |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1420 |
// --------------------------------------------------------------------------- |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1421 |
// |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1422 |
void CSPCall::NotifyRemotePartyNumberChanged() |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1423 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1424 |
CSPLOGSTRING(CSPINT, "CSPCall::NotifyRemotePartyNumberChanged <"); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1425 |
// If COLP number is different from original dialled number |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1426 |
// it is available in connected state of a MO call. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1427 |
// TSY does not send notification so number must be fetched. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1428 |
if ( IsMobileOriginated() ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1429 |
{ |
60 | 1430 |
RMobileCall::TMobileCallInfoV7Pckg callInfoPckg( iEtelCallInfo ); |
50 | 1431 |
GetMobileCallInfo( callInfoPckg ); |
1432 |
if ( iEtelCallInfo.iRemoteParty.iRemoteNumber.iTelNumber.Length() ) |
|
1433 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1434 |
NotifyRemotePartyInfoChanged( KNullDesC(), |
50 | 1435 |
iEtelCallInfo.iRemoteParty.iRemoteNumber.iTelNumber); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1436 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1437 |
} |
50 | 1438 |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1439 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1440 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1441 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1442 |
// --------------------------------------------------------------------------- |
37 | 1443 |
// CSPCall::CreateCallHandlersL |
65 | 1444 |
// Create call handlers for call related requests and call monitoring |
37 | 1445 |
// --------------------------------------------------------------------------- |
65 | 1446 |
// |
37 | 1447 |
void CSPCall::CreateCallHandlersL() |
1448 |
{ |
|
1449 |
CSPLOGSTRING(CSPINT, "CSPCall::CreateCallHandlersL <"); |
|
1450 |
||
1451 |
iRequester = CSPEtelCallRequester::NewL( *this, iCall ); |
|
1452 |
||
1453 |
iCallEventMonitor = CSPEtelCallEventMonitor::NewL( *this, iCall ); |
|
1454 |
iCallEventMonitor->StartMonitoring(); |
|
1455 |
iCallStatusMonitor = CSPEtelCallStatusMonitor::NewL( *this, iCall ); |
|
1456 |
iCallStatusMonitor->StartMonitoring(); |
|
65 | 1457 |
|
37 | 1458 |
iCallCapsMonitor = CSPEtelCallCapsMonitor::NewL( *this, iCall ); |
1459 |
iCallCapsMonitor->StartMonitoring(); |
|
1460 |
iCapsFlags = iCallCapsMonitor->FetchCallControlCapsL(); |
|
65 | 1461 |
|
37 | 1462 |
iCallInfoMonitor = CSPCallInfoMonitor::NewL( *this, iCall ); |
1463 |
iCallInfoMonitor->StartMonitoring(); |
|
65 | 1464 |
|
1465 |
// Start UUI monitor and create message sender |
|
37 | 1466 |
iSkypeId = TCSPSkypeIdParser::CreateSkypeIdBufferL(); |
1467 |
iUUIMonitor = CSPUUIMonitor::NewL( iCall,*this ); |
|
1468 |
iUUIMonitor->StartMonitor(); |
|
1469 |
iUUIMessageSender = CSPUUIMessageSender::NewL( iCall ); |
|
1470 |
iUserToUserInformation = iParams->UUSId().AllocL(); |
|
65 | 1471 |
|
37 | 1472 |
// Transfer provider |
1473 |
iTransferProvider = CSPTransferProvider::NewL( iCall, *this, iCommonInfo ); |
|
1474 |
||
1475 |
// Forward provider |
|
1476 |
iForwardProvider = CSPForwardProvider::NewL(); |
|
65 | 1477 |
|
37 | 1478 |
CSPLOGSTRING(CSPINT, "CSPCall::CreateCallHandlersL >"); |
1479 |
} |
|
1480 |
||
1481 |
// --------------------------------------------------------------------------- |
|
1482 |
// CSPCall::NotifyRingingState |
|
1483 |
// Gets to ringing state |
|
1484 |
// --------------------------------------------------------------------------- |
|
65 | 1485 |
// |
37 | 1486 |
void CSPCall::NotifyRingingState( ) |
1487 |
{ |
|
1488 |
CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyRingingState"); |
|
1489 |
iCallState = MCCPCallObserver::ECCPStateRinging; |
|
1490 |
||
1491 |
TInt obsCount = iObservers.Count ( ); |
|
1492 |
for (TInt i = 0; i < obsCount; i++ ) |
|
1493 |
{ |
|
1494 |
MCCPCallObserver *obs = iObservers[i]; |
|
1495 |
if ( obs ) |
|
1496 |
{ |
|
1497 |
obs->CallStateChanged ( iCallState, this ); |
|
1498 |
} |
|
1499 |
} |
|
1500 |
} |
|
1501 |
||
1502 |
// --------------------------------------------------------------------------- |
|
1503 |
// CSPCall::CCPStateFromETelState |
|
1504 |
// Simple mapping between state enumerations. |
|
1505 |
// --------------------------------------------------------------------------- |
|
65 | 1506 |
// |
1507 |
MCCPCallObserver::TCCPCallState CSPCall::CCPStateFromETelState( |
|
1508 |
RMobileCall::TMobileCallStatus aEtelState ) |
|
37 | 1509 |
{ |
1510 |
MCCPCallObserver::TCCPCallState ret = MCCPCallObserver::ECCPStateIdle; |
|
1511 |
switch ( aEtelState ) |
|
1512 |
{ |
|
1513 |
case RMobileCall::EStatusUnknown: |
|
1514 |
{ |
|
65 | 1515 |
CSPLOGSTRING( CSPREQIN, |
37 | 1516 |
"CSPCall::State > RMobileCall::Unknown" ); |
1517 |
ret = MCCPCallObserver::ECCPStateIdle; |
|
1518 |
break; |
|
1519 |
} |
|
1520 |
case RMobileCall::EStatusIdle: |
|
1521 |
{ |
|
65 | 1522 |
CSPLOGSTRING( CSPREQIN, |
37 | 1523 |
"CSPCall::State > RMobileCall::EStatusIdle" ); |
1524 |
ret = MCCPCallObserver::ECCPStateIdle; |
|
1525 |
break; |
|
1526 |
} |
|
1527 |
case RMobileCall::EStatusRinging: |
|
1528 |
{ |
|
65 | 1529 |
CSPLOGSTRING( CSPREQIN, |
37 | 1530 |
"CSPCall::State > RMobileCall::EStatusRinging" ); |
1531 |
ret = MCCPCallObserver::ECCPStateRinging; |
|
1532 |
break; |
|
1533 |
} |
|
1534 |
// Map the following to connecting status |
|
65 | 1535 |
case RMobileCall::EStatusDialling: |
37 | 1536 |
{ |
1537 |
CSPLOGSTRING( CSPREQIN, "CSPCall::State > \ |
|
1538 |
RMobileCall::EStatusDialling" ); |
|
1539 |
ret = MCCPCallObserver::ECCPStateDialling; |
|
1540 |
break; |
|
1541 |
} |
|
1542 |
case RMobileCall::EStatusConnecting: |
|
1543 |
{ |
|
1544 |
CSPLOGSTRING( CSPREQIN, "CSPCall::State > \ |
|
1545 |
RMobileCall::Connecting" ); |
|
1546 |
ret = MCCPCallObserver::ECCPStateConnecting; |
|
1547 |
break; |
|
1548 |
} |
|
1549 |
case RMobileCall::EStatusAnswering: |
|
1550 |
{ |
|
1551 |
CSPLOGSTRING( CSPREQIN, "CSPCall::State > \ |
|
1552 |
RMobileCall::Answering" ); |
|
1553 |
ret = MCCPCallObserver::ECCPStateAnswering; |
|
65 | 1554 |
break; |
37 | 1555 |
} |
1556 |
// Call is connected and active. |
|
1557 |
case RMobileCall::EStatusConnected: |
|
1558 |
{ |
|
65 | 1559 |
CSPLOGSTRING( CSPREQIN, |
37 | 1560 |
"CSPCall::State > RMobileCall::EStatusConnected" ); |
1561 |
ret = MCCPCallObserver::ECCPStateConnected; |
|
1562 |
break; |
|
1563 |
} |
|
1564 |
case RMobileCall::EStatusDisconnectingWithInband: |
|
1565 |
case RMobileCall::EStatusDisconnecting: |
|
1566 |
{ |
|
65 | 1567 |
CSPLOGSTRING( CSPREQIN, |
37 | 1568 |
"CSPCall::State > RMobileCall::EStatusDisconnecting/Inband?"); |
1569 |
ret = MCCPCallObserver::ECCPStateDisconnecting; |
|
1570 |
break; |
|
1571 |
} |
|
1572 |
case RMobileCall::EStatusReconnectPending: |
|
1573 |
{ |
|
65 | 1574 |
CSPLOGSTRING( CSPREQIN, |
37 | 1575 |
"CSPCall::State > RMobileCall::EStatusHangingUp" ); |
1576 |
ret = MCCPCallObserver::ECCPStateDisconnecting; |
|
1577 |
break; |
|
1578 |
} |
|
1579 |
case RMobileCall::EStatusHold: |
|
1580 |
{ |
|
65 | 1581 |
CSPLOGSTRING( CSPREQIN, |
37 | 1582 |
"CSPCall::State > RMobileCall::EStatusHold" ); |
1583 |
ret = MCCPCallObserver::ECCPStateHold; |
|
1584 |
break; |
|
1585 |
} |
|
65 | 1586 |
case RMobileCall::EStatusWaitingAlternatingCallSwitch: |
37 | 1587 |
{ |
1588 |
// This state is not used in real life. |
|
65 | 1589 |
CSPLOGSTRING( CSPREQIN, |
37 | 1590 |
"CSPCall::State > RMobileCall::EStatusWaitingAlternatingCallSwitch" ); |
1591 |
ret = MCCPCallObserver::ECCPStateConnected; |
|
1592 |
break; |
|
1593 |
} |
|
65 | 1594 |
case RMobileCall::EStatusTransferring: |
37 | 1595 |
{ |
65 | 1596 |
CSPLOGSTRING( CSPREQIN, |
37 | 1597 |
"CSPCall::State > RMobileCall::EStatusHold" ); |
1598 |
ret = MCCPCallObserver::ECCPStateTransferring; |
|
1599 |
break; |
|
1600 |
} |
|
65 | 1601 |
case RMobileCall::EStatusTransferAlerting: |
37 | 1602 |
{ |
65 | 1603 |
CSPLOGSTRING( CSPREQIN, |
37 | 1604 |
"CSPCall::State > RMobileCall::EStatusHold" ); |
1605 |
ret = MCCPCallObserver::ECCPStateTransferring; |
|
1606 |
break; |
|
65 | 1607 |
} |
37 | 1608 |
default: |
1609 |
{ |
|
65 | 1610 |
CSPLOGSTRING( CSPREQIN, |
37 | 1611 |
"CSPCall::CCPStateFromETelState unhandled state "); |
1612 |
} |
|
1613 |
} |
|
1614 |
||
65 | 1615 |
CSPLOGSTRING3(CSPINT, |
37 | 1616 |
"CSPCall::CCPStateFromETelState ETel: %d CCP: %d", aEtelState, ret); |
1617 |
return ret; |
|
1618 |
} |
|
1619 |
||
1620 |
// --------------------------------------------------------------------------- |
|
1621 |
// CSPCall::NotifyCallStateChanged |
|
1622 |
// Notifies observers about state changes |
|
1623 |
// --------------------------------------------------------------------------- |
|
1624 |
// |
|
65 | 1625 |
void CSPCall::NotifyCallStateChanged( MCCPCallObserver::TCCPCallState aState ) |
37 | 1626 |
{ |
65 | 1627 |
CSPLOGSTRING3(CSPINT, |
1628 |
"CSPCall::NotifyCallStateChanged < state: %d this: %x", |
|
37 | 1629 |
aState, this ); |
65 | 1630 |
|
1631 |
iCallState = aState; |
|
1632 |
TBool notifyObservers( ETrue ); |
|
37 | 1633 |
|
1634 |
if ( !iMobileOriginated && MCCPCallObserver::ECCPStateRinging == aState ) |
|
1635 |
{ |
|
65 | 1636 |
CSPLOGSTRING2(CSPINT, "CSPCall::No notify on ringing MT", aState); |
1637 |
notifyObservers = EFalse; |
|
37 | 1638 |
} |
65 | 1639 |
|
37 | 1640 |
if ( notifyObservers ) |
1641 |
{ |
|
1642 |
TInt obsCount = iObservers.Count(); |
|
1643 |
for ( TInt i = 0; i < obsCount; i++ ) |
|
1644 |
{ |
|
1645 |
MCCPCallObserver *obs = iObservers[i]; |
|
1646 |
if ( obs ) |
|
65 | 1647 |
{ |
37 | 1648 |
obs->CallStateChanged( aState, this ); |
1649 |
} |
|
1650 |
} |
|
1651 |
} |
|
65 | 1652 |
|
1653 |
CSPLOGSTRING3(CSPINT, |
|
1654 |
"CSPCall::NotifyCallStateChanged > state: %d this: %x", |
|
37 | 1655 |
aState, this ); |
1656 |
} |
|
1657 |
||
1658 |
// --------------------------------------------------------------------------- |
|
1659 |
// CSPCall::NotifyCallStateChangedWithInband |
|
1660 |
// Notifies observers about state changes |
|
1661 |
// --------------------------------------------------------------------------- |
|
1662 |
// |
|
65 | 1663 |
void CSPCall::NotifyCallStateChangedWithInband( |
1664 |
MCCPCallObserver::TCCPCallState aState ) |
|
37 | 1665 |
{ |
65 | 1666 |
CSPLOGSTRING3(CSPINT, |
1667 |
"CSPCall::NotifyCallStateChangedWithInBand < state: %d this: %x", |
|
37 | 1668 |
aState, this ); |
65 | 1669 |
|
37 | 1670 |
iCallState = aState; |
65 | 1671 |
|
37 | 1672 |
if ( !iMobileOriginated && MCCPCallObserver::ECCPStateRinging == aState ) |
1673 |
{ |
|
1674 |
CSPLOGSTRING2(CSPINT, "CSPCall::No notify on ringing MT", aState); |
|
1675 |
} |
|
1676 |
else |
|
65 | 1677 |
{ |
37 | 1678 |
TInt obsCount = iObservers.Count(); |
1679 |
for ( TInt i = 0; i < obsCount; i++ ) |
|
65 | 1680 |
{ |
37 | 1681 |
MCCPCallObserver *obs = iObservers[i]; |
1682 |
if ( obs ) |
|
1683 |
{ |
|
1684 |
obs->CallStateChangedWithInband( aState, this ); |
|
1685 |
} |
|
1686 |
} |
|
1687 |
} |
|
65 | 1688 |
CSPLOGSTRING3(CSPINT, |
1689 |
"CSPCall::NotifyCallStateChangedWithInband > state: %d this: %x", |
|
37 | 1690 |
aState, this); |
1691 |
} |
|
1692 |
||
1693 |
// --------------------------------------------------------------------------- |
|
1694 |
// CSPCall::ReadRepositoryL |
|
1695 |
// Reads the given information from Central Repository. |
|
1696 |
// --------------------------------------------------------------------------- |
|
1697 |
// |
|
1698 |
void CSPCall::ReadRepositoryL( TUid aUid, TUint aKey, TInt& aVal) |
|
1699 |
{ |
|
1700 |
CSPLOGSTRING(CSPINT, "CSPCall::ReadRepositoryL"); |
|
65 | 1701 |
|
37 | 1702 |
CRepository* cr = CRepository::NewL( aUid ); |
1703 |
TInt err = cr->Get( aKey, aVal ); |
|
1704 |
delete cr; |
|
1705 |
User::LeaveIfError( err ); |
|
1706 |
} |
|
1707 |
||
1708 |
// --------------------------------------------------------------------------- |
|
1709 |
// CSPCall::CheckAndNotifyTerminationError |
|
1710 |
// Reads error code from ETel. |
|
1711 |
// --------------------------------------------------------------------------- |
|
1712 |
// |
|
1713 |
void CSPCall::CheckAndNotifyTerminationError() |
|
1714 |
{ |
|
65 | 1715 |
CSPLOGSTRING2(CSPINT, |
1716 |
"CSPCall::CheckAndNotifyTerminationError dial completion code: %d", |
|
37 | 1717 |
iDialCompletionCode); |
65 | 1718 |
|
37 | 1719 |
// Emergency error handling is separated into CSPEtelCallRequester |
1720 |
if ( !iIsEmergencyCall ) |
|
1721 |
{ |
|
1722 |
TInt termErr = ExitCodeError(); |
|
65 | 1723 |
CSPLOGSTRING2(CSPINT, |
1724 |
"CSPCall::CheckAndNotifyTerminationError exit code error: %d", |
|
37 | 1725 |
termErr); |
65 | 1726 |
|
37 | 1727 |
if ( termErr == KErrNone ) |
1728 |
{ |
|
1729 |
// Handle KErrGsmCCUnassignedNumber correctly |
|
1730 |
// because the value is not stored in exit code. |
|
1731 |
termErr = iDialCompletionCode; |
|
65 | 1732 |
CSPLOGSTRING(CSPINT, |
37 | 1733 |
"CSPCall::CheckAndNotifyTerminationError use dial completion code"); |
1734 |
} |
|
65 | 1735 |
|
37 | 1736 |
if ( termErr == KErrGsmRRPreEmptiveRelease ) |
1737 |
{ |
|
65 | 1738 |
// Error KErrGsmRRPreEmptiveRelease occurs when there is active call |
37 | 1739 |
// and user make emergency call, can be ignored. |
65 | 1740 |
CSPLOGSTRING3( |
1741 |
CSPERROR, |
|
37 | 1742 |
"CSPCall::CheckAndNotifyTerminationError preemptive release, ignore: %d", |
1743 |
termErr, |
|
1744 |
this ); |
|
1745 |
} |
|
65 | 1746 |
else if ( iDontReportTerm |
1747 |
&& ( termErr == KErrGsmCCNormalUnspecified |
|
37 | 1748 |
|| termErr == KErrGsmCCCallRejected ) ) |
1749 |
{ |
|
65 | 1750 |
// Not an error, since this happens on normal |
37 | 1751 |
// call termination situation after connected call. |
65 | 1752 |
CSPLOGSTRING3(CSPERROR, |
1753 |
"CSPCall::CheckAndNotifyTerminationError DISCARD this: %x err: %d", |
|
1754 |
this, |
|
1755 |
termErr); |
|
1756 |
} |
|
37 | 1757 |
else if ( termErr ) |
1758 |
{ |
|
1759 |
TCCPError ccpErr(ECCPErrorNone); |
|
1760 |
||
65 | 1761 |
// Only a couple of error codes can have diagnostic information. |
37 | 1762 |
// aDiagnostic ought to be undefined in other situatios, |
1763 |
// but at least in this way we can really guarantee it. |
|
1764 |
if ( termErr == KErrGsmCCFacilityRejected || |
|
1765 |
termErr == KErrGsmCCRequestedFacilityNotSubscribed || |
|
1766 |
termErr == KErrGsmCCIncomingCallsBarredInCug || |
|
1767 |
termErr == KErrGsmCCRequestedFacilityNotImplemented || |
|
1768 |
termErr == KErrGsmCCUserNotInCug ) |
|
1769 |
{ |
|
1770 |
TName name; |
|
65 | 1771 |
CallName( name ); |
37 | 1772 |
TInt diagErr = iCommonInfo.GetDiagnosticError( name ); |
1773 |
ccpErr = iRequester->MapError( diagErr ); |
|
65 | 1774 |
|
37 | 1775 |
// Finally use exit code if diagnostic did not contain |
1776 |
// any useful information. |
|
1777 |
if ( ccpErr == ECCPRequestFailure ) |
|
1778 |
{ |
|
1779 |
ccpErr = iRequester->MapError( termErr ); |
|
1780 |
} |
|
1781 |
} |
|
1782 |
else |
|
1783 |
{ |
|
1784 |
ccpErr = iRequester->MapError( termErr ); |
|
1785 |
} |
|
65 | 1786 |
|
37 | 1787 |
NotifyErrorOccurred( ccpErr ); |
1788 |
iTerminationErrorNotified = ETrue; |
|
1789 |
} |
|
65 | 1790 |
} |
37 | 1791 |
} |
1792 |
||
1793 |
// --------------------------------------------------------------------------- |
|
1794 |
// CSPCall::ExitCodeError |
|
1795 |
// Reads error code from ETel call info's iExitCode. |
|
1796 |
// --------------------------------------------------------------------------- |
|
1797 |
// |
|
1798 |
TInt CSPCall::ExitCodeError() const |
|
1799 |
{ |
|
65 | 1800 |
CSPLOGSTRING2(CSPINT, "CSPCall::ExitCodeError < this: %x", |
37 | 1801 |
this ); |
1802 |
TInt callError; |
|
60 | 1803 |
RMobileCall::TMobileCallInfoV7Pckg pck( iEtelCallInfo ); |
1804 |
TInt getErr = GetMobileCallInfo( pck ); |
|
37 | 1805 |
// Is there value in higher 16 bits |
50 | 1806 |
if ( KErrNone == getErr && (iEtelCallInfo.iExitCode & 0xFFFF0000) ) |
37 | 1807 |
{ |
1808 |
CSPLOGSTRING2(CSPINT, "CSPCall::ExitCodeError callInfo.iExitCode %d", |
|
50 | 1809 |
iEtelCallInfo.iExitCode ); |
1810 |
callError = ( iEtelCallInfo.iExitCode >> KTimesToSplitValue ); |
|
37 | 1811 |
|
1812 |
if ( callError > KErrEtelGsmBase ) |
|
1813 |
// Not in valid exteded range |
|
1814 |
{ |
|
1815 |
// Ignore invalid extented code |
|
50 | 1816 |
if ( ( iEtelCallInfo.iExitCode & 0x0000FFFF ) == KErrNone ) |
37 | 1817 |
// core error is zero |
1818 |
{ |
|
1819 |
callError = KErrNone; |
|
1820 |
} |
|
1821 |
else |
|
1822 |
{ |
|
50 | 1823 |
callError = ( ( iEtelCallInfo.iExitCode & 0x0000FFFF ) |
65 | 1824 |
| 0xFFFF0000 ); |
37 | 1825 |
} |
1826 |
} |
|
1827 |
} |
|
1828 |
// Higher and lower 16 bits are zero |
|
50 | 1829 |
else if ( !( iEtelCallInfo.iExitCode & 0xFFFFFFFF ) ) |
37 | 1830 |
{ |
1831 |
callError = KErrNone; |
|
1832 |
} |
|
65 | 1833 |
else |
37 | 1834 |
{ |
1835 |
// No extended error, expand value to full range |
|
50 | 1836 |
callError = ( iEtelCallInfo.iExitCode | 0xFFFF0000 ); |
37 | 1837 |
} |
65 | 1838 |
|
37 | 1839 |
CSPLOGSTRING2(CSPINT, "CSPCall::ExitCodeError > err: %d", callError); |
65 | 1840 |
|
37 | 1841 |
return callError; |
1842 |
} |
|
1843 |
||
1844 |
// --------------------------------------------------------------------------- |
|
1845 |
// CSPCall::UUSMessageReceived |
|
1846 |
// --------------------------------------------------------------------------- |
|
1847 |
// |
|
60 | 1848 |
void CSPCall::UUSMessageReceived( const TDesC& aMessage ) |
65 | 1849 |
{ |
37 | 1850 |
CSPLOGSTRING(CSPREQIN, "CSPCall::UUSMessageReceived"); |
1851 |
TCSPSkypeIdParser parser; |
|
65 | 1852 |
|
37 | 1853 |
TPtr ptr = iSkypeId->Des(); |
1854 |
ptr.Zero(); |
|
1855 |
const TInt error( parser.Parse( aMessage, ptr ) ); |
|
65 | 1856 |
|
1857 |
if ( !error ) |
|
37 | 1858 |
{ |
1859 |
iRemotePartyName = ptr; |
|
65 | 1860 |
NotifyCallEventOccurred( MCCPCallObserver::ECCPNotifyRemotePartyInfoChange ); |
37 | 1861 |
} |
65 | 1862 |
CSPLOGSTRING2(CSPINT, "CSPCall::UUSMessageReceived err: %d", error ); |
37 | 1863 |
} |
1864 |
||
1865 |
// --------------------------------------------------------------------------- |
|
1866 |
// CSPCall::NotifyRemotePartyInfoChanged |
|
1867 |
// --------------------------------------------------------------------------- |
|
1868 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1869 |
void CSPCall::NotifyRemotePartyInfoChanged( const TDesC& aRemotePartyName, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1870 |
const TDesC& aRemotePartyNumber ) |
37 | 1871 |
{ |
1872 |
CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyRemotePartyInfoChanged"); |
|
65 | 1873 |
if ( aRemotePartyName.Length() ) |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1874 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1875 |
iRemotePartyName = aRemotePartyName; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1876 |
} |
65 | 1877 |
|
1878 |
if ( aRemotePartyNumber.Length() ) |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1879 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1880 |
iRemotePartyNumber = aRemotePartyNumber; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1881 |
} |
65 | 1882 |
|
37 | 1883 |
NotifyCallEventOccurred( MCCPCallObserver::ECCPNotifyRemotePartyInfoChange ); |
1884 |
} |
|
1885 |
||
1886 |
// --------------------------------------------------------------------------- |
|
1887 |
// CSPCall::DontReportTerminationError |
|
1888 |
// --------------------------------------------------------------------------- |
|
1889 |
// |
|
65 | 1890 |
void CSPCall::DontReportTerminationError() |
37 | 1891 |
{ |
1892 |
CSPLOGSTRING(CSPREQIN, "CSPCall::DontReportTerminationError"); |
|
1893 |
iDontReportTerm = ETrue; |
|
1894 |
} |
|
1895 |
||
1896 |
// --------------------------------------------------------------------------- |
|
1897 |
// CSPCall::UpdateCallNameNumberInfo |
|
1898 |
// Update call info including remote party name and number data |
|
1899 |
// --------------------------------------------------------------------------- |
|
1900 |
// |
|
1901 |
void CSPCall::UpdateCallNameNumberInfo( |
|
60 | 1902 |
const RMobileCall::TMobileCallInfoV3& aCallInfo, |
37 | 1903 |
TBool aCallAddedByMonitor ) |
1904 |
{ |
|
1905 |
CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallNameNumberInfo <"); |
|
1906 |
||
1907 |
iCallName.Zero(); |
|
1908 |
iRemotePartyNumber.Zero(); |
|
1909 |
iRemotePartyName.Zero(); |
|
65 | 1910 |
|
1911 |
if ( aCallAddedByMonitor ) |
|
37 | 1912 |
{ |
65 | 1913 |
CSPLOGSTRING(CSPINT, |
37 | 1914 |
"CSPCall::UpdateCallNameNumberInfo call added by monitor"); |
1915 |
||
1916 |
// If call was created by ETel line status or incoming call monitor |
|
65 | 1917 |
// the call name is already known, only remote party info is fetched from |
1918 |
// call info |
|
37 | 1919 |
iCallName.Append( iName ); |
1920 |
iRemotePartyName.Append( aCallInfo.iRemoteParty.iCallingName ); |
|
1921 |
iRemotePartyNumber.Append( aCallInfo.iRemoteParty.iRemoteNumber.iTelNumber ); |
|
1922 |
} |
|
65 | 1923 |
else |
37 | 1924 |
{ |
65 | 1925 |
CSPLOGSTRING(CSPINT, |
37 | 1926 |
"CSPCall::UpdateCallNameNumberInfo call added by plugin owner"); |
65 | 1927 |
|
1928 |
// The call was not created by monitor and the remote number is already known, |
|
1929 |
// fetch only call name from call info |
|
37 | 1930 |
iCallName.Append( aCallInfo.iCallName ); |
65 | 1931 |
iRemotePartyNumber.Append( iName ); |
37 | 1932 |
} |
65 | 1933 |
|
1934 |
CSPLOGSTRING2(CSPINT, |
|
37 | 1935 |
"CSPCall::UpdateCallNameNumberInfo iCallName: %S", &iCallName ); |
65 | 1936 |
CSPLOGSTRING2(CSPINT, |
37 | 1937 |
"CSPCall::UpdateCallNameNumberInfo iRemotePartyNumber: %S", &iRemotePartyNumber ); |
65 | 1938 |
CSPLOGSTRING2(CSPINT, |
37 | 1939 |
"CSPCall::UpdateCallNameNumberInfo iRemotePartyName: %S", &iRemotePartyName ); |
1940 |
||
1941 |
CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallNameNumberInfo >"); |
|
1942 |
} |
|
1943 |
||
1944 |
// --------------------------------------------------------------------------- |
|
1945 |
// CSPCall::OpenNewCall |
|
65 | 1946 |
// Open new call |
37 | 1947 |
// --------------------------------------------------------------------------- |
65 | 1948 |
// |
37 | 1949 |
void CSPCall::OpenNewCall() |
1950 |
{ |
|
1951 |
CSPLOGSTRING(CSPINT, "CSPCall::OpenNewCall <"); |
|
1952 |
||
65 | 1953 |
// Open new call |
1954 |
__ASSERT_ALWAYS( iCall.OpenNewCall( iLine ) == KErrNone, |
|
37 | 1955 |
Panic( ECSPPanicNoEtel ) ); |
1956 |
||
1957 |
CSPLOGSTRING(CSPINT, "CSPCall::OpenNewCall >"); |
|
1958 |
} |
|
1959 |
||
1960 |
// --------------------------------------------------------------------------- |
|
1961 |
// CSPCall::OpenExistingCallL |
|
65 | 1962 |
// Open existing call |
37 | 1963 |
// --------------------------------------------------------------------------- |
65 | 1964 |
// |
37 | 1965 |
void CSPCall::OpenExistingCallL( const TDesC& aName ) |
1966 |
{ |
|
65 | 1967 |
CSPLOGSTRING2(CSPINT, |
37 | 1968 |
"CSPCall::OpenExistingCallL < aName: %S", &aName); |
65 | 1969 |
|
1970 |
// Open existing call with given name from current line |
|
1971 |
TInt err = iCall.OpenExistingCall( iLine, aName ); |
|
1972 |
||
37 | 1973 |
if ( KErrNone != err ) |
1974 |
{ |
|
1975 |
CSPLOGSTRING2(CSPERROR, |
|
65 | 1976 |
"CSPCall::OpenCallHandleL OpenExistingCall error: %d, leaving", err); |
37 | 1977 |
User::Leave( err ); |
1978 |
} |
|
1979 |
||
1980 |
CSPLOGSTRING(CSPINT, "CSPCall::OpenExistingCallL >"); |
|
1981 |
} |
|
1982 |
||
1983 |
// End of File |
|
1984 |