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