24
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include "cmmvoicecalltsy.h"
|
|
20 |
|
|
21 |
#include <featmgr/featurecontrol.h>
|
|
22 |
#include <featureuids.h>
|
|
23 |
#include "cmmvoicelinetsy.h"
|
|
24 |
#include "cmmphonetsy.h"
|
|
25 |
#include "cmmtsyreqhandlestore.h"
|
|
26 |
#include "cmmcalllist.h"
|
|
27 |
#include "CMmCommonStaticUtility.h"
|
|
28 |
#include "MmTsy_numberOfSlots.h"
|
|
29 |
#include "MmTsy_timeoutdefs.h"
|
|
30 |
#include "cmmmessagemanagerbase.h"
|
|
31 |
#include <ctsy/pluginapi/cmmdatapackage.h>
|
|
32 |
#include <ctsy/serviceapi/gsmerror.h>
|
|
33 |
#include "cmmcallgsmwcdmaext.h"
|
|
34 |
#include "cmmdtmftsy.h"
|
|
35 |
#include "cmmconferencecalltsy.h"
|
|
36 |
#include "CMmCustomTsy.h"
|
|
37 |
#include "cmmconferencecallgsmwcdmaext.h"
|
|
38 |
#include <etelmmerr.h>
|
|
39 |
#include <ctsy/pluginapi/mtelephonyaudiocontrol.h>
|
|
40 |
|
|
41 |
// ======== MEMBER FUNCTIONS ========
|
|
42 |
|
|
43 |
CMmVoiceCallTsy::CMmVoiceCallTsy()
|
|
44 |
{
|
|
45 |
}
|
|
46 |
|
|
47 |
CMmVoiceCallTsy* CMmVoiceCallTsy::NewL(
|
|
48 |
CMmPhoneTsy* aMmPhone, CMmVoiceLineTsy* aMmLine,
|
|
49 |
RMobilePhone::TMobileService aMode,
|
|
50 |
TDes& aName,
|
|
51 |
CMmMessageManagerBase* aMessageManager,
|
|
52 |
MTelephonyAudioControl* aTelephonyAudioControl )
|
|
53 |
{
|
|
54 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::NewL. Call name: %S", &aName);
|
|
55 |
|
|
56 |
CMmVoiceCallTsy* mmCall = NULL;
|
|
57 |
|
|
58 |
//check input parameters
|
|
59 |
if ( aMmPhone != NULL && aMmLine != NULL && (
|
|
60 |
aMode == RMobilePhone::EVoiceService ||
|
|
61 |
aMode == RMobilePhone::EAuxVoiceService ) )
|
|
62 |
{
|
|
63 |
mmCall = new( ELeave ) CMmVoiceCallTsy;
|
|
64 |
CleanupClosePushL( *mmCall );
|
|
65 |
mmCall->iMmPhone = aMmPhone;
|
|
66 |
mmCall->iMmLine = aMmLine;
|
|
67 |
mmCall->iCallName = aName;
|
|
68 |
mmCall->iCallMode = aMode;
|
|
69 |
mmCall->iMessageManager = aMessageManager;
|
|
70 |
mmCall->iTelephonyAudioControl = aTelephonyAudioControl;
|
|
71 |
mmCall->iTelephonyAudioControlSetup = EFalse;
|
|
72 |
|
|
73 |
mmCall->ConstructL( aMode );
|
|
74 |
CleanupStack::Pop();
|
|
75 |
}
|
|
76 |
return mmCall;
|
|
77 |
}
|
|
78 |
|
|
79 |
CMmVoiceCallTsy::~CMmVoiceCallTsy()
|
|
80 |
{
|
|
81 |
TFLOGSTRING3("TSY: CMmVoiceCallTsy::~CMmVoiceCallTsy. Call deleted iCallId:%d iCallName:%S", iCallId, &iCallName);
|
|
82 |
}
|
|
83 |
|
|
84 |
|
|
85 |
// ---------------------------------------------------------------------------
|
|
86 |
// CMmVoiceCallTsy::InitInternalAttributes
|
|
87 |
// Initialises miscellaneous internal attributes.
|
|
88 |
// (other items were commented in a header).
|
|
89 |
// ---------------------------------------------------------------------------
|
|
90 |
//
|
|
91 |
void CMmVoiceCallTsy::InitInternalAttributes()
|
|
92 |
{
|
|
93 |
//initialise internal attributes of base class
|
|
94 |
CMmCallTsy::InitInternalAttributes();
|
|
95 |
//set call capabilities
|
|
96 |
iCallCaps.iFlags = RCall::KCapsVoice | RCall::KCapsDial;
|
|
97 |
//not yet an emergency call
|
|
98 |
iEmergencyCall = EFalse;
|
|
99 |
|
|
100 |
i3rdPartyEmergencyNumberCheckDone = EFalse;
|
|
101 |
|
|
102 |
iISVCallParams = NULL;
|
|
103 |
|
|
104 |
iIsDialISV = EFalse;
|
|
105 |
|
|
106 |
}
|
|
107 |
|
|
108 |
// ---------------------------------------------------------------------------
|
|
109 |
// CMmVoiceCallTsy::DoExtFuncL
|
|
110 |
// DoExtFuncL is called by the Etel server when it has an "extended", i.e.
|
|
111 |
// non-core ETel request for the TSY. To process a request handle, request
|
|
112 |
// type and request data are passed to the TSY.
|
|
113 |
// (other items were commented in a header).
|
|
114 |
// ---------------------------------------------------------------------------
|
|
115 |
//
|
|
116 |
TInt CMmVoiceCallTsy::DoExtFuncL(
|
|
117 |
const TTsyReqHandle aTsyReqHandle,
|
|
118 |
const TInt aIpc,
|
|
119 |
const TDataPackage& aPackage )
|
|
120 |
{
|
|
121 |
TFLOGSTRING3("TSY: CMmVoiceCallTsy::DoExtFuncL. IPC:%d Handle:%d", aIpc, aTsyReqHandle);
|
|
122 |
|
|
123 |
TInt ret( KErrNone );
|
|
124 |
|
|
125 |
TAny* dataPtr = aPackage.Ptr1();
|
|
126 |
|
|
127 |
// The request data has to extracted from TDataPackage and the TAny*
|
|
128 |
// pointers have to be "cast" to the expected request data type
|
|
129 |
|
|
130 |
// NOTE! Do not put any Cancel methods here.
|
|
131 |
switch ( aIpc )
|
|
132 |
{
|
|
133 |
// Emergency Calls
|
|
134 |
// Dial Emergency Call
|
|
135 |
case EMobileCallDialEmergencyCall:
|
|
136 |
ret = DialEmergencyCall( aTsyReqHandle, aPackage );
|
|
137 |
break;
|
|
138 |
// Call Status
|
|
139 |
// Get Call Status
|
|
140 |
case EMobileCallGetMobileCallStatus:
|
|
141 |
ret = GetMobileCallStatus( aTsyReqHandle,
|
|
142 |
reinterpret_cast<RMobileCall::TMobileCallStatus*>( dataPtr ) );
|
|
143 |
break;
|
|
144 |
// Notify Call Status Change
|
|
145 |
case EMobileCallNotifyMobileCallStatusChange:
|
|
146 |
ret = NotifyMobileCallStatusChange(
|
|
147 |
reinterpret_cast<RMobileCall::TMobileCallStatus*>( dataPtr ) );
|
|
148 |
break;
|
|
149 |
// Place Call on Hold
|
|
150 |
case EMobileCallHold:
|
|
151 |
ret = HoldL( aTsyReqHandle );
|
|
152 |
break;
|
|
153 |
// Resume a Held Call
|
|
154 |
case EMobileCallResume:
|
|
155 |
ret = ResumeL( aTsyReqHandle );
|
|
156 |
break;
|
|
157 |
// Swap Between an On-going and an Held Call
|
|
158 |
case EMobileCallSwap:
|
|
159 |
ret = SwapL( aTsyReqHandle );
|
|
160 |
break;
|
|
161 |
// Transfer One Call to Remote Party of Another Call
|
|
162 |
case EMobileCallTransfer:
|
|
163 |
ret = TransferL( aTsyReqHandle );
|
|
164 |
break;
|
|
165 |
// Go "One-to-One" within a Conference Call
|
|
166 |
case EMobileCallGoOneToOne:
|
|
167 |
ret = GoOneToOneL( aTsyReqHandle );
|
|
168 |
break;
|
|
169 |
// Notify Call Event
|
|
170 |
case EMobileCallNotifyCallEvent:
|
|
171 |
ret = NotifyCallEvent(
|
|
172 |
reinterpret_cast<RMobileCall::TMobileCallEvent*>( dataPtr ) );
|
|
173 |
break;
|
|
174 |
// Call Control
|
|
175 |
// Get Call Capabilities
|
|
176 |
case EMobileCallGetMobileCallCaps:
|
|
177 |
ret = GetMobileCallCaps( aTsyReqHandle, aPackage.Des1n() );
|
|
178 |
break;
|
|
179 |
|
|
180 |
//Notify Call Capabilities Change
|
|
181 |
case EMobileCallNotifyMobileCallCapsChange:
|
|
182 |
ret = NotifyMobileCallCapsChange(aPackage.Des1n() );
|
|
183 |
break;
|
|
184 |
|
|
185 |
// Call Information
|
|
186 |
// Get Mobile Call Information
|
|
187 |
case EMobileCallGetMobileCallInfo:
|
|
188 |
ret = GetMobileCallInfo( aTsyReqHandle, aPackage.Des1n() );
|
|
189 |
break;
|
|
190 |
// Notify Change of Remote Party Information
|
|
191 |
case EMobileCallNotifyRemotePartyInfoChange:
|
|
192 |
ret = NotifyRemotePartyInfoChange(
|
|
193 |
reinterpret_cast<
|
|
194 |
RMobileCall::TMobileCallRemotePartyInfoV1Pckg*>(
|
|
195 |
aPackage.Des1n()) );
|
|
196 |
break;
|
|
197 |
// Order to notify if privacy is confirmed
|
|
198 |
case EMobileCallNotifyPrivacyConfirmation:
|
|
199 |
ret = NotifyPrivacyConfirmation(
|
|
200 |
reinterpret_cast<RMobilePhone::TMobilePhonePrivacy*>(
|
|
201 |
dataPtr ) );
|
|
202 |
break;
|
|
203 |
//AnswerIncomingCall ( by 3rd Party client )
|
|
204 |
case EMobileCallAnswerISV:
|
|
205 |
ret = AnswerIncomingCall( aTsyReqHandle, aPackage.Des1n() );
|
|
206 |
break;
|
|
207 |
//Dial a call ( by 3rd Party client )
|
|
208 |
case EMobileCallDialISV:
|
|
209 |
i3rdPartyEmergencyNumberCheckDone = EFalse;
|
|
210 |
iIsDialISV = ETrue;
|
|
211 |
ret = Dial( aTsyReqHandle, aPackage.Des1n(), aPackage.Des2u() );
|
|
212 |
break;
|
|
213 |
// Activate User-To-User Signalling service
|
|
214 |
case EMobileCallActivateUUS:
|
|
215 |
ret = ActivateUUS( aTsyReqHandle,
|
|
216 |
REINTERPRET_CAST( RMobileCall::TMobileCallUUSRequestV1Pckg*,
|
|
217 |
aPackage.Des1n()) );
|
|
218 |
break;
|
|
219 |
// Receive User-To-User Information, TDes16 descriptor pointer
|
|
220 |
case EMobileCallReceiveUUI:
|
|
221 |
ret = ReceiveUUI( aTsyReqHandle,
|
|
222 |
REINTERPRET_CAST( RMobileCall::TMobileCallUUI*,
|
|
223 |
aPackage.Des1u() ) );
|
|
224 |
break;
|
|
225 |
// Dial a call ( DialNoFdnCheck )
|
|
226 |
case EMobileCallDialNoFdnCheck:
|
|
227 |
ret = DialNoFdnCheck( aTsyReqHandle, aPackage.Des1n(),
|
|
228 |
aPackage.Des2u() );
|
|
229 |
break;
|
|
230 |
|
|
231 |
// Unsupported features
|
|
232 |
case EMobileCallGetMobileDataCallCaps:
|
|
233 |
case EMobileCallNotifyMobileDataCallCapsChange:
|
|
234 |
case EMobileCallGetMobileDataCallRLPRange:
|
|
235 |
case EMobileCallSetDynamicHscsdParams:
|
|
236 |
case EMobileCallGetCurrentHscsdInfo:
|
|
237 |
case EMobileCallNotifyHscsdInfoChange:
|
|
238 |
case EMobileCallSwitchAlternatingCall:
|
|
239 |
case EMobileCallNotifyAlternatingCallSwitch:
|
|
240 |
case EMobileCallSetPrivacy:
|
|
241 |
case EMobileCallSetTrafficChannel:
|
|
242 |
case EMobileCallNotifyTrafficChannelConfirmation:
|
|
243 |
case EMobileCallGetUUSCaps:
|
|
244 |
case EMobileCallNotifyUUSCapsChange:
|
|
245 |
case EMobileCallSendUUI:
|
|
246 |
case EMobileCallHangupWithUUI:
|
|
247 |
case EMobileCallAnswerWithUUI:
|
|
248 |
case EMobileCallNotifyVoiceFallback:
|
|
249 |
case EMobileCallDeflect:
|
|
250 |
case EMobileCallActivateCCBS:
|
|
251 |
case EMobileCallRejectCCBS:
|
|
252 |
default:
|
|
253 |
ret = KErrNotSupported;
|
|
254 |
break;
|
|
255 |
}
|
|
256 |
return ret;
|
|
257 |
}
|
|
258 |
|
|
259 |
// ---------------------------------------------------------------------------
|
|
260 |
// CMmVoiceCallTsy::ReqModeL
|
|
261 |
// ReqModeL is called from the ETel server's CTelObject::ReqAnalyserL in order
|
|
262 |
// to check the type of request it has.
|
|
263 |
// (other items were commented in a header).
|
|
264 |
// ---------------------------------------------------------------------------
|
|
265 |
//
|
|
266 |
CTelObject::TReqMode CMmVoiceCallTsy::ReqModeL(
|
|
267 |
const TInt aIpc )
|
|
268 |
{
|
|
269 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::ReqModeL. IPC:%d",aIpc);
|
|
270 |
|
|
271 |
CTelObject::TReqMode ret( 0 ); // default return value
|
|
272 |
|
|
273 |
switch ( aIpc )
|
|
274 |
{
|
|
275 |
// No Flow Control
|
|
276 |
// All disabled
|
|
277 |
// TSYs wishing to implement their own buffering algorithm will
|
|
278 |
// place all requests in this category.
|
|
279 |
|
|
280 |
// Get methods that do not use DOS and return immediately.
|
|
281 |
// Flow control not required.
|
|
282 |
case EEtelCallGetInfo:
|
|
283 |
case EEtelCallGetStatus:
|
|
284 |
case EEtelCallGetCaps:
|
|
285 |
case EEtelCallGetBearerServiceInfo:
|
|
286 |
case EEtelCallGetOwnershipStatus:
|
|
287 |
case EEtelCallGetCallParams:
|
|
288 |
case EEtelCallGetCallDuration:
|
|
289 |
case EEtelCallGetFaxSettings:
|
|
290 |
case EMobileCallGetMobileCallStatus:
|
|
291 |
case EMobileCallGetMobileCallInfo:
|
|
292 |
case EMobileCallGetMobileDataCallCaps:
|
|
293 |
case EMobileCallGetMobileCallCaps:
|
|
294 |
case EMobileCallGetCurrentHscsdInfo:
|
|
295 |
case EMobileCallGetMobileDataCallRLPRange:
|
|
296 |
case EMobileCallGetUUSCaps:
|
|
297 |
case EMobileCallSendUUI:
|
|
298 |
case EMobileCallHangupWithUUI:
|
|
299 |
case EMobileCallAnswerWithUUI:
|
|
300 |
//Other methods that do not use DOS and return immediately.
|
|
301 |
//Flow control not required.
|
|
302 |
case EEtelCallAcquireOwnership:
|
|
303 |
case EEtelCallTransferOwnership:
|
|
304 |
case EEtelCallSetFaxSettings:
|
|
305 |
//Methods that can propably take a long time and cannot therefore be
|
|
306 |
//flow controlled. Solution: All these methods must check req handle
|
|
307 |
//table before handling the request. In case that the request table
|
|
308 |
//indicates that same method has been called and has not been
|
|
309 |
//completed, the method should return KErrServerBusy.
|
|
310 |
case EMobileCallTransfer:
|
|
311 |
//This is also included here due to the fact that Emergency call
|
|
312 |
//should never be blocked by flow control. KErrServerBusy returned
|
|
313 |
//when already already dialing.
|
|
314 |
case EMobileCallDialEmergencyCall:
|
|
315 |
//HangUp cannot be flow controlled. Client should for example be able
|
|
316 |
//to terminate a call while another call is e.g. in Dialling state.
|
|
317 |
case EEtelCallHangUp:
|
|
318 |
//Answer was mixed with Hangup.
|
|
319 |
//Therefore this is also No flow control type.
|
|
320 |
case EEtelCallAnswer:
|
|
321 |
case EMobileCallAnswerISV:
|
|
322 |
// dial is not flow controlled as compeltion may take a while and that
|
|
323 |
// blocks for example PS data activation in 3G while dialing.
|
|
324 |
case EEtelCallDial:
|
|
325 |
break;
|
|
326 |
// Flow Controlled Services
|
|
327 |
// KReqModeFlowControlObeyed
|
|
328 |
// Commands that change the state of the phone, e.g. clearing the
|
|
329 |
// AoC counter; are commands that the TSY should only deal with
|
|
330 |
// one at a time.
|
|
331 |
|
|
332 |
//Voice call related methods that should be handled one at the time.
|
|
333 |
case EEtelCallConnect:
|
|
334 |
case EMobileCallHold:
|
|
335 |
case EMobileCallResume:
|
|
336 |
case EMobileCallSwap:
|
|
337 |
case EMobileCallDeflect:
|
|
338 |
case EMobileCallGoOneToOne:
|
|
339 |
case EMobileCallActivateUUS:
|
|
340 |
//Data call related methods that should be handled one at the time.
|
|
341 |
case EEtelCallLoanDataPort:
|
|
342 |
case EEtelCallRecoverDataPort:
|
|
343 |
case EMobileCallSwitchAlternatingCall:
|
|
344 |
case EMobileCallSetDynamicHscsdParams:
|
|
345 |
case EMobileCallSetPrivacy:
|
|
346 |
case EMobileCallSetTrafficChannel:
|
|
347 |
case EMobileCallDialISV:
|
|
348 |
case EMobileCallDialNoFdnCheck:
|
|
349 |
ret = KReqModeFlowControlObeyed;
|
|
350 |
break;
|
|
351 |
//ReqModePostImmediately
|
|
352 |
//Requests that notify a client about a change of state, where
|
|
353 |
//the TSY needs to distinguish between different clients.
|
|
354 |
//ret = KReqModeRePostImmediately;
|
|
355 |
|
|
356 |
//KReqModeMultipleCompletionEnabled
|
|
357 |
//(a) commands that may take some time, but which the TSY can
|
|
358 |
// handle more than one of concurrently, or
|
|
359 |
//(b) notifications that the TSY does not wish to be re-posted
|
|
360 |
// immediately, so the server does no buffering.
|
|
361 |
//ret = KReqModeMultipleCompletionEnabled;
|
|
362 |
|
|
363 |
//KReqModeMultipleCompletionEnabled | KReqModeFlowControlObeyed
|
|
364 |
//A command that may take some time and which the TSY can only
|
|
365 |
//deal with one at a time.
|
|
366 |
//ret = KReqModeMultipleCompletionEnabled |
|
|
367 |
// KReqModeFlowControlObeyed;
|
|
368 |
//break;
|
|
369 |
|
|
370 |
//Notifications
|
|
371 |
//KReqModeMultipleCompletionEnabled | ReqModePostImmediately
|
|
372 |
//Requests that notify a client about a change of state.
|
|
373 |
//Since these requests do not require the issuing of any modem
|
|
374 |
//commands, they do not have to obey flow control.
|
|
375 |
//The TSY never gets more than one of these outstanding per CTelObject
|
|
376 |
case EEtelCallNotifyHookChange:
|
|
377 |
case EEtelCallNotifyStatusChange:
|
|
378 |
case EEtelCallNotifyDurationChange:
|
|
379 |
case EEtelCallCapsChangeNotification:
|
|
380 |
case EMobileCallNotifyCallEvent:
|
|
381 |
case EMobileCallNotifyMobileCallStatusChange:
|
|
382 |
case EMobileCallNotifyRemotePartyInfoChange:
|
|
383 |
case EMobileCallNotifyPrivacyConfirmation:
|
|
384 |
case EMobileCallNotifyTrafficChannelConfirmation:
|
|
385 |
case EMobileCallNotifyHscsdInfoChange:
|
|
386 |
case EMobileCallNotifyMobileDataCallCapsChange:
|
|
387 |
case EMobileCallNotifyAlternatingCallSwitch:
|
|
388 |
case EMobileCallNotifyMobileCallCapsChange:
|
|
389 |
case EMobileCallNotifyVoiceFallback:
|
|
390 |
case EMobileCallNotifyUUSCapsChange:
|
|
391 |
case EMobileCallReceiveUUI:
|
|
392 |
ret = KReqModeMultipleCompletionEnabled |
|
|
393 |
KReqModeRePostImmediately;
|
|
394 |
break;
|
|
395 |
// Cancel Requests
|
|
396 |
// It is not necessary to include the Cancel methods in ReqModeL.
|
|
397 |
// The ETel server never calls ReqModeL with a Cancel IPC.
|
|
398 |
|
|
399 |
// Other variations of return values are unusable
|
|
400 |
|
|
401 |
// Default: Call CCallBase's ReqModeL.
|
|
402 |
default:
|
|
403 |
//Direct the request to the CCallBase
|
|
404 |
ret = CCallBase::ReqModeL( aIpc );
|
|
405 |
break;
|
|
406 |
}
|
|
407 |
return ret;
|
|
408 |
}
|
|
409 |
|
|
410 |
// ---------------------------------------------------------------------------
|
|
411 |
// CMmVoiceCallTsy::NumberOfSlotsL
|
|
412 |
// NumberOfSlotsL is called by the server when it is registering a new
|
|
413 |
// NOTIFICATION. It enables the TSY to tell the server how many buffer slots
|
|
414 |
// to allocate for "repost immediately" notifications that may trigger before
|
|
415 |
// clients collect them.
|
|
416 |
// (other items were commented in a header).
|
|
417 |
// ---------------------------------------------------------------------------
|
|
418 |
//
|
|
419 |
TInt CMmVoiceCallTsy::NumberOfSlotsL(
|
|
420 |
const TInt aIpc )
|
|
421 |
{
|
|
422 |
// There is a buffer in the ETel server for each type of NOTIFICATION and
|
|
423 |
// the size of the buffer is determined by the TSY. When the ETel server
|
|
424 |
// discovers that a request is "repost immediately" it will ask the TSY
|
|
425 |
// how big a buffer it wants by calling CTelObject::NumberOfSlotsL( ).
|
|
426 |
//
|
|
427 |
// It is up to the TSY developer's judgement how many buffer slots this
|
|
428 |
// method returns for each notification. If there is a danger that a
|
|
429 |
// particular notification could trigger frequently and in rapid
|
|
430 |
// succession (e.g. call group change notification) then at least 10 or
|
|
431 |
// 20 slots may be required. For a notification that triggers rarely,
|
|
432 |
// perhaps 1 or 2 slots is enough.
|
|
433 |
//
|
|
434 |
// So if the ETel server has stored a few occurrences of a particular
|
|
435 |
// notification, when a client subsequently calls that notification
|
|
436 |
// request, the ETel server will complete the client's request with
|
|
437 |
// the saved data.
|
|
438 |
|
|
439 |
TInt numberOfSlots( 1 );
|
|
440 |
|
|
441 |
switch ( aIpc )
|
|
442 |
{
|
|
443 |
case EEtelCallNotifyHookChange:
|
|
444 |
numberOfSlots = KMmCallHookChangeSlots;
|
|
445 |
break;
|
|
446 |
case EEtelCallNotifyStatusChange:
|
|
447 |
numberOfSlots = KMmCallStatusChangeSlots;
|
|
448 |
break;
|
|
449 |
case EEtelCallNotifyDurationChange:
|
|
450 |
numberOfSlots = KMmCallDurationChangeSlots;
|
|
451 |
break;
|
|
452 |
case EEtelCallCapsChangeNotification:
|
|
453 |
numberOfSlots = KMmCallCapsChangeSlots;
|
|
454 |
break;
|
|
455 |
case EMobileCallNotifyCallEvent:
|
|
456 |
numberOfSlots = KMmCallCallEventSlots;
|
|
457 |
break;
|
|
458 |
case EMobileCallNotifyMobileCallStatusChange:
|
|
459 |
numberOfSlots = KMmCallMobileCallStatusChangeSlots;
|
|
460 |
break;
|
|
461 |
case EMobileCallNotifyRemotePartyInfoChange:
|
|
462 |
numberOfSlots = KMmCallRemotePartyInfoChangeSlots;
|
|
463 |
break;
|
|
464 |
case EMobileCallNotifyPrivacyConfirmation:
|
|
465 |
numberOfSlots = KMmCallPrivacyConfirmationSlots;
|
|
466 |
break;
|
|
467 |
case EMobileCallNotifyTrafficChannelConfirmation:
|
|
468 |
numberOfSlots = KMmCallTrafficChannelConfirmationSlots;
|
|
469 |
break;
|
|
470 |
case EMobileCallNotifyHscsdInfoChange:
|
|
471 |
numberOfSlots = KMmCallHscsdInfoChangeSlots;
|
|
472 |
break;
|
|
473 |
case EMobileCallNotifyMobileDataCallCapsChange:
|
|
474 |
numberOfSlots = KMmCallMobileDataCallCapsChangeSlots;
|
|
475 |
break;
|
|
476 |
case EMobileCallNotifyAlternatingCallSwitch:
|
|
477 |
numberOfSlots = KMmCallAlternatingCallSwitchSlots;
|
|
478 |
break;
|
|
479 |
case EMobileCallNotifyMobileCallCapsChange:
|
|
480 |
numberOfSlots = KMmCallMobileCallCapsChangeSlots;
|
|
481 |
break;
|
|
482 |
case EMobileCallNotifyVoiceFallback:
|
|
483 |
numberOfSlots = KMmCallVoiceFallbackSlots;
|
|
484 |
break;
|
|
485 |
case EMobileCallNotifyUUSCapsChange:
|
|
486 |
numberOfSlots = KMmCallUUSCapsChangeSlots;
|
|
487 |
break;
|
|
488 |
case EMobileCallReceiveUUI:
|
|
489 |
numberOfSlots = KMmCallReceiveUUISlots;
|
|
490 |
break;
|
|
491 |
default:
|
|
492 |
// Unknown or invalid Call IPC
|
|
493 |
User::Leave( KErrNotSupported );
|
|
494 |
break;
|
|
495 |
}
|
|
496 |
return numberOfSlots;
|
|
497 |
}
|
|
498 |
|
|
499 |
// ---------------------------------------------------------------------------
|
|
500 |
// CMmVoiceCallTsy::CancelService
|
|
501 |
// CancelService is called by the ETel server when it is "cleaning-up" any
|
|
502 |
// still outstanding asynchronous requests before closing a client's
|
|
503 |
// sub-session. This will happen if a client closes its R-class handle without
|
|
504 |
// cancelling outstanding asynchronous requests. Only Mobile API requests are
|
|
505 |
// handled here.
|
|
506 |
// (other items were commented in a header).
|
|
507 |
// ---------------------------------------------------------------------------
|
|
508 |
//
|
|
509 |
TInt CMmVoiceCallTsy::CancelService(
|
|
510 |
const TInt aIpc,
|
|
511 |
const TTsyReqHandle aTsyReqHandle )
|
|
512 |
{
|
|
513 |
TFLOGSTRING3("TSY: CMmVoiceCallTsy::CancelService. IPC: %d, Req handle: %d", aIpc, aTsyReqHandle);
|
|
514 |
|
|
515 |
TInt ret( KErrNone );
|
|
516 |
|
|
517 |
//When the clients close their sub-sessions (eg. by calling RPhone::Close)
|
|
518 |
//they may not have cancelled all their outstanding asynchronous requests
|
|
519 |
//before closing. It is up to the ETel server to clean up in this
|
|
520 |
//situation, so the server will find the list of outstanding requests
|
|
521 |
//related to that sub-session object and pass these outstanding IPC
|
|
522 |
//request numbers,one at a time,to the CancelService function in the TSY.
|
|
523 |
switch ( aIpc )
|
|
524 |
{
|
|
525 |
//TSY has started a request and it is not possible to then cancel this
|
|
526 |
//request. The best thing for the TSY to do in this case is to proceed
|
|
527 |
//as though the Cancel never happened. The server's call to the TSY
|
|
528 |
//cancel function will return synchronously. The TSY then continues to
|
|
529 |
//wait for the original acknowledgement and when it receives it,
|
|
530 |
//the TSY will complete the original request.
|
|
531 |
case EMobileCallHold:
|
|
532 |
case EMobileCallResume:
|
|
533 |
case EMobileCallSwap:
|
|
534 |
case EMobileCallGoOneToOne:
|
|
535 |
case EMobileCallDeflect:
|
|
536 |
case EMobileCallTransfer:
|
|
537 |
case EMobileCallNotifyTrafficChannelConfirmation:
|
|
538 |
break;
|
|
539 |
//Cancel methods that are not supported
|
|
540 |
case EMobileCallSetDynamicHscsdParams:
|
|
541 |
case EMobileCallNotifyMobileDataCallCapsChange:
|
|
542 |
case EMobileCallNotifyHscsdInfoChange:
|
|
543 |
|
|
544 |
case EMobileCallSwitchAlternatingCall:
|
|
545 |
case EMobileCallNotifyAlternatingCallSwitch:
|
|
546 |
case EMobileCallGetMobileDataCallRLPRange:
|
|
547 |
case EMobileCallNotifyVoiceFallback:
|
|
548 |
case EMobileCallNotifyUUSCapsChange:
|
|
549 |
case EMobileCallActivateUUS:
|
|
550 |
case EMobileCallSendUUI:
|
|
551 |
case EMobileCallHangupWithUUI:
|
|
552 |
case EMobileCallAnswerWithUUI:
|
|
553 |
ret = KErrNotSupported;
|
|
554 |
break;
|
|
555 |
//Notification Cancels, no special requirements.
|
|
556 |
case EMobileCallNotifyMobileCallCapsChange:
|
|
557 |
ret = NotifyMobileCallCapsChangeCancel( aTsyReqHandle );
|
|
558 |
break;
|
|
559 |
case EMobileCallNotifyMobileCallStatusChange:
|
|
560 |
ret = NotifyMobileCallStatusChangeCancel( aTsyReqHandle );
|
|
561 |
break;
|
|
562 |
case EMobileCallNotifyCallEvent:
|
|
563 |
ret = NotifyCallEventCancel( aTsyReqHandle );
|
|
564 |
break;
|
|
565 |
case EMobileCallNotifyRemotePartyInfoChange:
|
|
566 |
ret = NotifyRemotePartyInfoChangeCancel( aTsyReqHandle );
|
|
567 |
break;
|
|
568 |
case EMobileCallNotifyPrivacyConfirmation:
|
|
569 |
ret = NotifyPrivacyConfirmationCancel( aTsyReqHandle );
|
|
570 |
break;
|
|
571 |
case EMobileCallReceiveUUI:
|
|
572 |
ret = ReceiveUUICancel( aTsyReqHandle );
|
|
573 |
break;
|
|
574 |
//Everything is taken care in the method implementation.
|
|
575 |
//Just direct the request to the method.
|
|
576 |
case EMobileCallDialEmergencyCall:
|
|
577 |
ret = DialEmergencyCallCancel( aTsyReqHandle );
|
|
578 |
break;
|
|
579 |
case EMobileCallDialISV:
|
|
580 |
iMmPhone->GetCustomTsy()->SetObjectForISVDialNumberCheck( NULL );
|
|
581 |
i3rdPartyEmergencyNumberCheckDone = EFalse;
|
|
582 |
ret = DialCancel( aTsyReqHandle );
|
|
583 |
break;
|
|
584 |
case EMobileCallDialNoFdnCheck:
|
|
585 |
ret = DialCancel( aTsyReqHandle );
|
|
586 |
break;
|
|
587 |
case EMobileCallAnswerISV:
|
|
588 |
ret = AnswerIncomingCallCancel( aTsyReqHandle );
|
|
589 |
break;
|
|
590 |
//Default case
|
|
591 |
default:
|
|
592 |
//call CCallBase
|
|
593 |
ret = CCallBase::CancelService( aIpc, aTsyReqHandle );
|
|
594 |
break;
|
|
595 |
}
|
|
596 |
return ret;
|
|
597 |
}
|
|
598 |
|
|
599 |
// ---------------------------------------------------------------------------
|
|
600 |
// CMmVoiceCallTsy::CompleteNotifyStatusChange
|
|
601 |
// Complete notification when status changes. If the new status requires,
|
|
602 |
// this method will ask call protocol extension to update it's status and
|
|
603 |
// capabilities and line owning this call to update it's status.
|
|
604 |
// (other items were commented in a header).
|
|
605 |
// ---------------------------------------------------------------------------
|
|
606 |
//
|
|
607 |
void CMmVoiceCallTsy::CompleteNotifyStatusChange(
|
|
608 |
TInt aResult,
|
|
609 |
CMmDataPackage* aDataPackage )
|
|
610 |
{
|
|
611 |
if ( iGhostCall )
|
|
612 |
{
|
|
613 |
HandleGhostCallStatusChange( aResult, aDataPackage );
|
|
614 |
}
|
|
615 |
else
|
|
616 |
{
|
|
617 |
TInt callId( -1 );
|
|
618 |
TInt callIndex( 0 );
|
|
619 |
TInt extendedError(
|
|
620 |
CMmCommonStaticUtility::ExtendedErrorCode( aResult) );
|
|
621 |
TInt ret( KErrNone );
|
|
622 |
TBool timerStarted( EFalse );
|
|
623 |
TBool statusChanged ( EFalse );
|
|
624 |
TBool mobileStatusChanged ( EFalse );
|
|
625 |
CMmVoiceCallTsy* mmCall = NULL;
|
|
626 |
RMobileCall::TMobileCallStatus callStatus( RMobileCall::EStatusIdle );
|
|
627 |
RMobilePhone::TMobileService callMode( RMobilePhone::EVoiceService );
|
|
628 |
CCallDataPackage* callDataPackage =
|
|
629 |
reinterpret_cast<CCallDataPackage*>(aDataPackage);
|
|
630 |
|
|
631 |
callDataPackage->GetCallIdAndMode( callId, callMode );
|
|
632 |
callDataPackage->UnPackData( callStatus );
|
|
633 |
|
|
634 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. aResult:%d", aResult );
|
|
635 |
TFLOGSTRING3("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. Call status:%d Call name:%S", callStatus, &iCallName);
|
|
636 |
|
|
637 |
TTsyReqHandle holdHandle =
|
|
638 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeMobileCallHold );
|
|
639 |
TTsyReqHandle resumeHandle =
|
|
640 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeMobileCallResume );
|
|
641 |
TTsyReqHandle swapHandle =
|
|
642 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeMobileCallSwap );
|
|
643 |
TBool localSwapRequested =
|
|
644 |
IsServiceLocallyRequested( EMultimodeMobileCallSwap );
|
|
645 |
|
|
646 |
switch( callStatus )
|
|
647 |
{
|
|
648 |
case RMobileCall::EStatusIdle:
|
|
649 |
{
|
|
650 |
RFeatureControl featureControl;
|
|
651 |
TInt err = featureControl.Open();
|
|
652 |
if ( (err == KErrNone) && (featureControl.FeatureSupported(NFeature::KEmergencyCallsEnabledInOfflineMode) == KFeatureSupported) && EEmergencyCallMade == iMmPhone->GetRfStatus())
|
|
653 |
{
|
|
654 |
CMmCallList* callList = iMmPhone->CallList();
|
|
655 |
|
|
656 |
TInt numberOfEmergencyCalls( 0 );
|
|
657 |
|
|
658 |
for( TInt i=0; i< callList->GetNumberOfObjects();i++)
|
|
659 |
{
|
|
660 |
CMmVoiceCallTsy* call =
|
|
661 |
reinterpret_cast<CMmVoiceCallTsy*>(
|
|
662 |
iMmPhone->CallList()->GetMmCallByIndex( i ) );
|
|
663 |
|
|
664 |
if( call->IsEmergencyCall() )
|
|
665 |
{
|
|
666 |
numberOfEmergencyCalls++;
|
|
667 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. numberOfEmergencyCalls:%d", numberOfEmergencyCalls );
|
|
668 |
}
|
|
669 |
}
|
|
670 |
|
|
671 |
// There might be another emergency call Dial started and
|
|
672 |
// iEmergencyCall flag is updated to false in
|
|
673 |
// CompleteHangUp, thus only if there is one emergency call
|
|
674 |
// flag indicating ETrue, RF's should be set off.
|
|
675 |
if( 1 == numberOfEmergencyCalls )
|
|
676 |
{
|
|
677 |
TCtsySsmCallbackData dummyData;
|
|
678 |
reinterpret_cast<CMmCallGsmWcdmaExt*>
|
|
679 |
( iMmCallExtInterface )->SetRfState(ERfsStateInfoInactive,
|
|
680 |
reinterpret_cast<CMmCallGsmWcdmaExt*>( iMmCallExtInterface ),
|
|
681 |
dummyData);
|
|
682 |
//set the rf status in phone
|
|
683 |
iMmPhone->SetRfStatus( ERfsInActive );
|
|
684 |
}
|
|
685 |
}
|
|
686 |
|
|
687 |
//reset caps.
|
|
688 |
iCallCaps.iFlags &= ~(
|
|
689 |
RCall::KCapsHangUp | RCall::KCapsAnswer );
|
|
690 |
iCallCaps.iFlags |= RCall::KCapsDial;
|
|
691 |
|
|
692 |
//stop the call duration timer
|
|
693 |
timerStarted = iCallTimer->Stop();
|
|
694 |
//Check air time timer only if call was in active state
|
|
695 |
//(call timer was started)
|
|
696 |
if ( timerStarted )
|
|
697 |
{
|
|
698 |
iMmPhone->AirTimeTimerCheckStop();
|
|
699 |
UpdateLifeTimer();
|
|
700 |
}
|
|
701 |
|
|
702 |
if ( iTelephonyAudioControl && iTelephonyAudioControlSetup )
|
|
703 |
{
|
|
704 |
//Inform call routing control if there were error or cancelling in dial
|
|
705 |
if ( RMobileCall::EStatusDialling == iMobileCallStatus )
|
|
706 |
{
|
|
707 |
iTelephonyAudioControl->CallStateChange(
|
|
708 |
iCallName, RMobileCall::EStatusDisconnecting );
|
|
709 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. Call routing state changed to EStatusDisconnecting: Call name:%S", &iCallName );
|
|
710 |
}
|
|
711 |
iTelephonyAudioControl->TeardownTelephonyAudio(
|
|
712 |
iCallName, aResult );
|
|
713 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. Call routing teared down: Call name:%S", &iCallName);
|
|
714 |
iTelephonyAudioControlSetup = EFalse;
|
|
715 |
}
|
|
716 |
|
|
717 |
iCallStatus = RCall::EStatusIdle;
|
|
718 |
iMobileCallStatus = RMobileCall::EStatusIdle;
|
|
719 |
|
|
720 |
ClearCallStatus();
|
|
721 |
statusChanged = ETrue;
|
|
722 |
|
|
723 |
if ( KErrNone != aResult )
|
|
724 |
{
|
|
725 |
if ( KErrGsmReleaseByUser == aResult ||
|
|
726 |
KErrGsmBusyUserRequest == aResult )
|
|
727 |
{
|
|
728 |
//aResult must be KErrNone to indicate the client that
|
|
729 |
//HangUp has successfully completed
|
|
730 |
CompleteHangUp( KErrNone );
|
|
731 |
CompleteAnswerIncomingCall( KErrGsmBusyUserRequest );
|
|
732 |
}
|
|
733 |
else
|
|
734 |
{
|
|
735 |
//set last exit code
|
|
736 |
iLastExitCode = aResult;
|
|
737 |
CompleteHangUp( aResult );
|
|
738 |
CompleteAnswerIncomingCall( aResult );
|
|
739 |
}
|
|
740 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. - CompleteDial's called");
|
|
741 |
CompleteDial( aResult );
|
|
742 |
CompleteDialNoFdn( aResult );
|
|
743 |
CompleteDialEmergencyCall( aResult );
|
|
744 |
}
|
|
745 |
// Try to complete Dial and HangUp; If completes happens from
|
|
746 |
// here, something has gone wrong. Done to prevent TSY from
|
|
747 |
// hanging.
|
|
748 |
else
|
|
749 |
{
|
|
750 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. - Try to complete Dial and HangUp");
|
|
751 |
iLastExitCode = KErrGeneral;
|
|
752 |
TInt errorValue = CMmCommonStaticUtility::EpocErrorCode(
|
|
753 |
KErrNotReady, KErrNotFound );
|
|
754 |
CompleteDial( errorValue );
|
|
755 |
CompleteDialNoFdn( errorValue );
|
|
756 |
CompleteDialEmergencyCall( errorValue );
|
|
757 |
CompleteHangUp( errorValue );
|
|
758 |
CompleteAnswerIncomingCall( errorValue );
|
|
759 |
}
|
|
760 |
//save last id. Required by Conference call implementation
|
|
761 |
SetPreviousCallId( iCallId );
|
|
762 |
//reset call id
|
|
763 |
iCallId = -1;
|
|
764 |
//update DTMF capabilities.
|
|
765 |
iMmPhone->GetDtmfTsy()->CompleteNotifyDTMFCaps();
|
|
766 |
|
|
767 |
//Check if call capability KCapsHangup still exists
|
|
768 |
//If it does, remove it and return the KCapsDial capability.
|
|
769 |
//If call mode is data, then return also KCapsConnect
|
|
770 |
//capability
|
|
771 |
if ( RCall::KCapsHangUp ==
|
|
772 |
( iCallCaps.iFlags & RCall::KCapsHangUp ) )
|
|
773 |
{
|
|
774 |
// Remove KCapsHangUp if it exists
|
|
775 |
iCallCaps.iFlags &= ~( RCall::KCapsHangUp );
|
|
776 |
// return the KCapsDial capability.
|
|
777 |
iCallCaps.iFlags |= RCall::KCapsDial;
|
|
778 |
|
|
779 |
CompleteNotifyCapsChange();
|
|
780 |
}
|
|
781 |
|
|
782 |
//Call Transfer handling
|
|
783 |
if ( ServiceRequested( EMultimodeCallTransfer ) )
|
|
784 |
{
|
|
785 |
//Complete Transfer
|
|
786 |
CompleteTransfer( KErrNone );
|
|
787 |
}
|
|
788 |
}
|
|
789 |
break;
|
|
790 |
//End of case KCallStatusIdle
|
|
791 |
case RMobileCall::EStatusDialling:
|
|
792 |
#ifdef REQHANDLE_TIMER
|
|
793 |
if ( KETelExt3rdPartyV1 != GetExtensionId() )
|
|
794 |
{
|
|
795 |
//non 3rd party client
|
|
796 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. - StopTimeOuts");
|
|
797 |
iTsyReqHandleStore->StopTimeout( EMultimodeCallDial );
|
|
798 |
iTsyReqHandleStore->StopTimeout(
|
|
799 |
EMultimodeMobileCallDialEmergencyCall );
|
|
800 |
iTsyReqHandleStore->StopTimeout(
|
|
801 |
EMultimodeCallDialNoFdnCheck );
|
|
802 |
}
|
|
803 |
else
|
|
804 |
{
|
|
805 |
//3rd party client
|
|
806 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. - StopTimeOut EMultimodeCallDialISV");
|
|
807 |
iTsyReqHandleStore->StopTimeout( EMultimodeCallDialISV );
|
|
808 |
}
|
|
809 |
#endif // REQHANDLE_TIMER
|
|
810 |
iCallStatus = RCall::EStatusDialling;
|
|
811 |
iMobileCallStatus = RMobileCall::EStatusDialling;
|
|
812 |
statusChanged = ETrue;
|
|
813 |
UpdateCallRoutingControl( iCallName, iMobileCallStatus );
|
|
814 |
|
|
815 |
if ( iDialCancelFlag != CMmCallTsy::EDialCancelNotCalled )
|
|
816 |
{
|
|
817 |
TTsyReqHandle dialCancelHandle =
|
|
818 |
iTsyReqHandleStore->GetTsyReqHandle(
|
|
819 |
EMultimodeCallDial );
|
|
820 |
|
|
821 |
TTsyReqHandle dialEmergCancelHandle =
|
|
822 |
iTsyReqHandleStore->GetTsyReqHandle(
|
|
823 |
EMultimodeMobileCallDialEmergencyCall );
|
|
824 |
|
|
825 |
// 3rd party client
|
|
826 |
TTsyReqHandle dialCancelHandleISV =
|
|
827 |
iTsyReqHandleStore->GetTsyReqHandle(
|
|
828 |
EMultimodeCallDialISV );
|
|
829 |
|
|
830 |
// DialNoFdnCheck
|
|
831 |
TTsyReqHandle dialCancelHandleNoFdn =
|
|
832 |
iTsyReqHandleStore->GetTsyReqHandle(
|
|
833 |
EMultimodeCallDialNoFdnCheck );
|
|
834 |
|
|
835 |
if ( 0 < dialCancelHandle )
|
|
836 |
{
|
|
837 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. - HangUp - EMultimodeCallDial");
|
|
838 |
HangUp( dialCancelHandle );
|
|
839 |
}
|
|
840 |
else if ( 0 < dialCancelHandleISV )
|
|
841 |
{
|
|
842 |
//3rd party client
|
|
843 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. - HangUp - EMultimodeCallDialISV");
|
|
844 |
HangUp( dialCancelHandleISV );
|
|
845 |
}
|
|
846 |
else if ( 0 < dialEmergCancelHandle )
|
|
847 |
{
|
|
848 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. - HangUp - EMultimodeMobileCallDialEmergencyCall");
|
|
849 |
HangUp( dialEmergCancelHandle );
|
|
850 |
}
|
|
851 |
else if ( 0 < dialCancelHandleNoFdn )
|
|
852 |
{
|
|
853 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. - HangUp - EMultimodeCallDialNoFdn");
|
|
854 |
HangUp( dialCancelHandleNoFdn );
|
|
855 |
}
|
|
856 |
else
|
|
857 |
{
|
|
858 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. - iDialCancelFlag = CMmCallTsy::EDialCancelNotCalled");
|
|
859 |
iDialCancelFlag = CMmCallTsy::EDialCancelNotCalled;
|
|
860 |
}
|
|
861 |
}
|
|
862 |
break;
|
|
863 |
case RMobileCall::EStatusConnecting:
|
|
864 |
iCallStatus = RCall::EStatusConnecting;
|
|
865 |
iMobileCallStatus = RMobileCall::EStatusConnecting;
|
|
866 |
statusChanged = ETrue;
|
|
867 |
UpdateCallRoutingControl( iCallName, iMobileCallStatus );
|
|
868 |
break;
|
|
869 |
case RMobileCall::EStatusRinging:
|
|
870 |
iCallStatus = RCall::EStatusRinging;
|
|
871 |
iMobileCallStatus = RMobileCall::EStatusRinging;
|
|
872 |
statusChanged = ETrue;
|
|
873 |
break;
|
|
874 |
case RMobileCall::EStatusAnswering:
|
|
875 |
iCallStatus = RCall::EStatusAnswering;
|
|
876 |
iMobileCallStatus = RMobileCall::EStatusAnswering;
|
|
877 |
statusChanged = ETrue;
|
|
878 |
UpdateCallRoutingControl( iCallName, iMobileCallStatus );
|
|
879 |
break;
|
|
880 |
case RMobileCall::EStatusConnected:
|
|
881 |
if ( KErrMMEtelCallForbidden == aResult )
|
|
882 |
{
|
|
883 |
CMmCallList* callList = iMmPhone->CallList();
|
|
884 |
for( TInt i=0; i< callList->GetNumberOfObjects();i++)
|
|
885 |
{
|
|
886 |
CMmVoiceCallTsy* call =
|
|
887 |
reinterpret_cast<CMmVoiceCallTsy*>(
|
|
888 |
iMmPhone->CallList()->GetMmCallByIndex( i ) );
|
|
889 |
// if there is call with status Answering, complete
|
|
890 |
// it with CALL_CAUSE_NOT_ALLOWED
|
|
891 |
if( RCall::EStatusAnswering == call->Status() )
|
|
892 |
{
|
|
893 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange Answering not allowed!");
|
|
894 |
TInt errorValue =
|
|
895 |
CMmCommonStaticUtility::EpocErrorCode(
|
|
896 |
KErrAccessDenied, KErrMMEtelCallForbidden );
|
|
897 |
call->CompleteAnswerIncomingCall( errorValue );
|
|
898 |
}
|
|
899 |
}
|
|
900 |
}
|
|
901 |
|
|
902 |
//check previous status. If status is answering
|
|
903 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. - EStatusConnected");
|
|
904 |
if ( RCall::EStatusAnswering == iCallStatus )
|
|
905 |
{
|
|
906 |
// don't start timers if error occurred
|
|
907 |
if ( KErrNone == aResult )
|
|
908 |
{
|
|
909 |
//Start call duration monitoring
|
|
910 |
iCallTimer->Start();
|
|
911 |
//Check if start the air time duration monitoring
|
|
912 |
iMmPhone->AirTimeTimerCheckStart();
|
|
913 |
}
|
|
914 |
//complete answer incoming call
|
|
915 |
CompleteAnswerIncomingCall( aResult );
|
|
916 |
}
|
|
917 |
//if it was connecting and dial cancel has not been activated
|
|
918 |
else if ( ( iCallStatus == RCall::EStatusConnecting ||
|
|
919 |
iCallStatus == RCall::EStatusDialling ) &&
|
|
920 |
CMmCallTsy::EDialCancelNotCalled == iDialCancelFlag )
|
|
921 |
{
|
|
922 |
//Start call duration monitoring
|
|
923 |
iCallTimer->Start();
|
|
924 |
//start air time duration monitoring
|
|
925 |
iMmPhone->AirTimeTimerCheckStart();
|
|
926 |
|
|
927 |
//if emergency call has been made, complete it
|
|
928 |
if ( iTsyReqHandleStore->GetTsyReqHandle(
|
|
929 |
EMultimodeMobileCallDialEmergencyCall ) )
|
|
930 |
{
|
|
931 |
//CompleteDialEmergencyCall
|
|
932 |
CompleteDialEmergencyCall( aResult );
|
|
933 |
}
|
|
934 |
//if normal call has been made (by 3rd party client or not
|
|
935 |
//complete it
|
|
936 |
if ( ( iTsyReqHandleStore->GetTsyReqHandle(
|
|
937 |
EMultimodeCallDial ) )
|
|
938 |
|| ( iTsyReqHandleStore->GetTsyReqHandle(
|
|
939 |
EMultimodeCallDialISV ) ) )
|
|
940 |
{
|
|
941 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange.EStatusConnected - Before CompleteDial");
|
|
942 |
CompleteDial( aResult );
|
|
943 |
}
|
|
944 |
if( iTsyReqHandleStore->GetTsyReqHandle(
|
|
945 |
EMultimodeCallDialNoFdnCheck ) )
|
|
946 |
{
|
|
947 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange.EStatusConnected - Before CompleteDialNoFdn");
|
|
948 |
CompleteDialNoFdn( aResult );
|
|
949 |
|
|
950 |
}
|
|
951 |
}
|
|
952 |
//if status was Hold (-> resume or swap has been asked)
|
|
953 |
else if ( iMobileCallStatus == RMobileCall::EStatusHold )
|
|
954 |
{
|
|
955 |
//local resume has been requested
|
|
956 |
CompleteNotifyCallEvent( RMobileCall::ELocalResume );
|
|
957 |
|
|
958 |
//complete resume but not if swap is going on
|
|
959 |
if ( swapHandle == 0 && resumeHandle != 0 )
|
|
960 |
{
|
|
961 |
//complete resume
|
|
962 |
CompleteResume( aResult );
|
|
963 |
}
|
|
964 |
else if ( localSwapRequested )
|
|
965 |
{
|
|
966 |
(reinterpret_cast<CMmVoiceLineTsy*>( iMmLine ))->
|
|
967 |
IsSwapReady( callStatus );
|
|
968 |
}
|
|
969 |
}
|
|
970 |
//Don't update status if it has not changed.
|
|
971 |
if ( RCall::EStatusConnected != iCallStatus ||
|
|
972 |
RMobileCall::EStatusConnected != iMobileCallStatus )
|
|
973 |
{
|
|
974 |
if(RMobileCall::EStatusConnecting != iMobileCallStatus)
|
|
975 |
{
|
|
976 |
// RMobileCall::EStatusConnected without RMobileCall::EStatusConnecting
|
|
977 |
if ( KErrNone == iMmCallExtInterface->
|
|
978 |
CompleteNotifyStatusChange( RMobileCall::EStatusConnecting ) )
|
|
979 |
{
|
|
980 |
CompleteNotifyMobileCallCapsChange( KErrNone );
|
|
981 |
}
|
|
982 |
|
|
983 |
}
|
|
984 |
UpdateCallRoutingControl( iCallName, RMobileCall::EStatusConnected );
|
|
985 |
iCallStatus = RCall::EStatusConnected;
|
|
986 |
iMobileCallStatus = RMobileCall::EStatusConnected;
|
|
987 |
statusChanged = ETrue;
|
|
988 |
}
|
|
989 |
|
|
990 |
//update DTMF capabilities.
|
|
991 |
iMmPhone->GetDtmfTsy()->CompleteNotifyDTMFCaps();
|
|
992 |
break;
|
|
993 |
case RMobileCall::EStatusDisconnecting:
|
|
994 |
//Core status
|
|
995 |
iCallStatus = RCall::EStatusHangingUp;
|
|
996 |
statusChanged = ETrue;
|
|
997 |
// Mobile status
|
|
998 |
iMobileCallStatus = RMobileCall::EStatusDisconnecting;
|
|
999 |
mobileStatusChanged = ETrue;
|
|
1000 |
//update DTMF capabilities.
|
|
1001 |
iMmPhone->GetDtmfTsy()->CompleteNotifyDTMFCaps();
|
|
1002 |
|
|
1003 |
if ( iCallDirection == RMobileCall::EMobileTerminated )
|
|
1004 |
{
|
|
1005 |
if( KMultimodeCallTypeIDNoFdnCheck == GetDialTypeId() )
|
|
1006 |
{
|
|
1007 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. RMobileCall::EStatusDisconnecting - Before CompleteDialNoFdn");
|
|
1008 |
//CompleteDialNoFdn in case remote user is busy
|
|
1009 |
CompleteDialNoFdn( aResult );
|
|
1010 |
}
|
|
1011 |
else
|
|
1012 |
{
|
|
1013 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. RMobileCall::EStatusDisconnecting - Before CompleteDial");
|
|
1014 |
//CompleteDial in case remote user is busy
|
|
1015 |
CompleteDial( aResult );
|
|
1016 |
}
|
|
1017 |
|
|
1018 |
}
|
|
1019 |
|
|
1020 |
//Set last exit code
|
|
1021 |
if ( KErrGsmReleaseByUser == aResult ||
|
|
1022 |
KErrGsmBusyUserRequest == aResult ||
|
|
1023 |
KErrNone == aResult )
|
|
1024 |
{
|
|
1025 |
iLastExitCode = KErrNone;
|
|
1026 |
}
|
|
1027 |
else
|
|
1028 |
{
|
|
1029 |
//set last exit code
|
|
1030 |
iLastExitCode = aResult;
|
|
1031 |
}
|
|
1032 |
|
|
1033 |
UpdateCallRoutingControl( iCallName, iMobileCallStatus );
|
|
1034 |
|
|
1035 |
break;
|
|
1036 |
case RMobileCall::EStatusDisconnectingWithInband:
|
|
1037 |
//Core status
|
|
1038 |
iCallStatus = RCall::EStatusHangingUp;
|
|
1039 |
statusChanged = ETrue;
|
|
1040 |
// Mobile status
|
|
1041 |
iMobileCallStatus =
|
|
1042 |
RMobileCall::EStatusDisconnectingWithInband;
|
|
1043 |
mobileStatusChanged = ETrue;
|
|
1044 |
|
|
1045 |
if( KMultimodeCallTypeIDNoFdnCheck == GetDialTypeId() )
|
|
1046 |
{
|
|
1047 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. RMobileCall::EStatusDisconnectingWithInband - Before CompleteDialNoFdn");
|
|
1048 |
//CompleteDialNoFdn in case remote user is busy
|
|
1049 |
CompleteDialNoFdn( aResult );
|
|
1050 |
}
|
|
1051 |
else
|
|
1052 |
{
|
|
1053 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::CompleteNotifyStatusChange. RMobileCall::EStatusDisconnectingWithInband - Before CompleteDial");
|
|
1054 |
//CompleteDial in case remote user is busy
|
|
1055 |
CompleteDial( aResult );
|
|
1056 |
}
|
|
1057 |
|
|
1058 |
//update DTMF capabilities.
|
|
1059 |
iMmPhone->GetDtmfTsy()->CompleteNotifyDTMFCaps();
|
|
1060 |
|
|
1061 |
//Set last exit code
|
|
1062 |
if ( KErrGsmReleaseByUser == aResult ||
|
|
1063 |
KErrGsmBusyUserRequest == aResult ||
|
|
1064 |
KErrGsmCCNormalUnspecified == extendedError ||
|
|
1065 |
KErrNone == aResult )
|
|
1066 |
{
|
|
1067 |
iLastExitCode = KErrNone;
|
|
1068 |
}
|
|
1069 |
else
|
|
1070 |
{
|
|
1071 |
//set last exit code
|
|
1072 |
iLastExitCode = aResult;
|
|
1073 |
}
|
|
1074 |
|
|
1075 |
UpdateCallRoutingControl( iCallName, iMobileCallStatus );
|
|
1076 |
|
|
1077 |
break;
|
|
1078 |
case RMobileCall::EStatusHold:
|
|
1079 |
if ( iMobileCallStatus != RMobileCall::EStatusHold )
|
|
1080 |
{
|
|
1081 |
UpdateCallRoutingControl( iCallName, RMobileCall::EStatusHold );
|
|
1082 |
|
|
1083 |
//remote party requested this
|
|
1084 |
CompleteNotifyCallEvent( RMobileCall::ELocalHold );
|
|
1085 |
}
|
|
1086 |
|
|
1087 |
//complete hold but not if swap is going on
|
|
1088 |
if ( swapHandle == 0 && holdHandle != 0 )
|
|
1089 |
{
|
|
1090 |
CompleteHold ( aResult );
|
|
1091 |
}
|
|
1092 |
else if ( localSwapRequested )
|
|
1093 |
{
|
|
1094 |
(reinterpret_cast<CMmVoiceLineTsy*>( iMmLine ) )->
|
|
1095 |
IsSwapReady( callStatus );
|
|
1096 |
}
|
|
1097 |
|
|
1098 |
// Mobile API state
|
|
1099 |
iMobileCallStatus = RMobileCall::EStatusHold;
|
|
1100 |
mobileStatusChanged = ETrue;
|
|
1101 |
|
|
1102 |
//update DTMF capabilities.
|
|
1103 |
iMmPhone->GetDtmfTsy()->CompleteNotifyDTMFCaps();
|
|
1104 |
break;
|
|
1105 |
case RMobileCall::EStatusUnknown:
|
|
1106 |
case RMobileCall::EStatusReconnectPending:
|
|
1107 |
case RMobileCall::EStatusWaitingAlternatingCallSwitch:
|
|
1108 |
case RMobileCall::EStatusTransferring:
|
|
1109 |
case RMobileCall::EStatusTransferAlerting:
|
|
1110 |
default:
|
|
1111 |
//nothing to do
|
|
1112 |
break;
|
|
1113 |
}
|
|
1114 |
|
|
1115 |
//reset req handle. Returns the deleted req handle
|
|
1116 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
1117 |
EMultimodeCallNotifyStatusChange );
|
|
1118 |
|
|
1119 |
if ( ( EMultimodeCallReqHandleUnknown != reqHandle ) && statusChanged )
|
|
1120 |
{
|
|
1121 |
*iRetStatus = iCallStatus;
|
|
1122 |
//reset req handle.
|
|
1123 |
iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1124 |
EMultimodeCallNotifyStatusChange );
|
|
1125 |
|
|
1126 |
ReqCompleted( reqHandle, ret );
|
|
1127 |
}
|
|
1128 |
|
|
1129 |
//reset req handle. Returns the deleted req handle
|
|
1130 |
reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
1131 |
EMultimodeCallNotifyMobileCallStatusChange );
|
|
1132 |
|
|
1133 |
if ( ( EMultimodeCallReqHandleUnknown != reqHandle ) &&
|
|
1134 |
(statusChanged || mobileStatusChanged) )
|
|
1135 |
{
|
|
1136 |
*iRetMobileCallStatus = iMobileCallStatus;
|
|
1137 |
//reset req handle.
|
|
1138 |
iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1139 |
EMultimodeCallNotifyMobileCallStatusChange );
|
|
1140 |
ReqCompleted( reqHandle, ret );
|
|
1141 |
}
|
|
1142 |
|
|
1143 |
//Update also line's status
|
|
1144 |
if ( statusChanged || mobileStatusChanged )
|
|
1145 |
{
|
|
1146 |
iMmLine->CompleteNotifyStatusChange();
|
|
1147 |
}
|
|
1148 |
|
|
1149 |
//Inform extension dll about the current status. Enables dynamic
|
|
1150 |
//capability updates. Must be done before Notifying caps change
|
|
1151 |
if ( KErrNone == iMmCallExtInterface->
|
|
1152 |
CompleteNotifyStatusChange( iMobileCallStatus ) )
|
|
1153 |
{
|
|
1154 |
CompleteNotifyMobileCallCapsChange( KErrNone );
|
|
1155 |
}
|
|
1156 |
|
|
1157 |
mmCall = reinterpret_cast<CMmVoiceCallTsy*>(
|
|
1158 |
iMmPhone->CallList()->GetMmCallByIndex( callIndex ) );
|
|
1159 |
|
|
1160 |
while ( mmCall )
|
|
1161 |
{
|
|
1162 |
if ( RMobileCall::EStatusIdle != mmCall->MobileCallStatus() &&
|
|
1163 |
this != mmCall )
|
|
1164 |
{
|
|
1165 |
if ( KErrNone == mmCall->ActiveCallExtension()->
|
|
1166 |
CompleteNotifyStatusChange( mmCall->MobileCallStatus() ) )
|
|
1167 |
{
|
|
1168 |
mmCall->CompleteNotifyMobileCallCapsChange( KErrNone );
|
|
1169 |
}
|
|
1170 |
}
|
|
1171 |
callIndex++;
|
|
1172 |
mmCall = reinterpret_cast<CMmVoiceCallTsy*>(
|
|
1173 |
iMmPhone->CallList()->GetMmCallByIndex( callIndex ) );
|
|
1174 |
}
|
|
1175 |
|
|
1176 |
// Inform Conference Call Tsy about status indication of
|
|
1177 |
// a single call, might cause change of conference status
|
|
1178 |
CMmConferenceCallTsy* confCall = iMmPhone->ConferenceCall();
|
|
1179 |
if ( confCall )
|
|
1180 |
{
|
|
1181 |
if ( RMobileCall::EStatusIdle == callStatus )
|
|
1182 |
{
|
|
1183 |
// if the call has gone to idle state, iPreviousCallId must
|
|
1184 |
// be used instead of iCallId, because iCallId has already
|
|
1185 |
// been reset
|
|
1186 |
confCall->CallStatusChanged( callStatus, iPreviousCallId );
|
|
1187 |
}
|
|
1188 |
else
|
|
1189 |
{
|
|
1190 |
confCall->CallStatusChanged( callStatus, iCallId );
|
|
1191 |
}
|
|
1192 |
}
|
|
1193 |
}
|
|
1194 |
}
|
|
1195 |
|
|
1196 |
// ---------------------------------------------------------------------------
|
|
1197 |
// CMmVoiceCallTsy::Dial
|
|
1198 |
// This CORE API method dials to the given number.
|
|
1199 |
// (other items were commented in a header).
|
|
1200 |
// ---------------------------------------------------------------------------
|
|
1201 |
//
|
|
1202 |
TInt CMmVoiceCallTsy::Dial(
|
|
1203 |
const TTsyReqHandle aTsyReqHandle,
|
|
1204 |
const TDesC8* aCallParams,
|
|
1205 |
TDesC* aTelNumber )
|
|
1206 |
{
|
|
1207 |
TFLOGSTRING3("TSY: CMmVoiceCallTsy::Dial. Req handle: %d, Call name: %S", aTsyReqHandle, &iCallName);
|
|
1208 |
|
|
1209 |
TBool isDialISV = iIsDialISV;
|
|
1210 |
iIsDialISV = EFalse;
|
|
1211 |
|
|
1212 |
if ( aCallParams->Length()!= 0 )
|
|
1213 |
{
|
|
1214 |
if ( sizeof( RMobileCall::TCallParams ) > aCallParams->Length() )
|
|
1215 |
{
|
|
1216 |
TFLOGSTRING ("TSY: CMmVoiceCallTsy::Dial bad size argument");
|
|
1217 |
// Complete the request with appropiate error
|
|
1218 |
return KErrArgument;
|
|
1219 |
}
|
|
1220 |
}
|
|
1221 |
CMmCallList* callList = iMmPhone->CallList();
|
|
1222 |
|
|
1223 |
TBool dialFlag( EFalse );
|
|
1224 |
|
|
1225 |
for ( TInt i = 0; i < callList->GetNumberOfObjects(); i++ )
|
|
1226 |
{
|
|
1227 |
CMmCallTsy* call = callList->GetMmCallByIndex( i );
|
|
1228 |
|
|
1229 |
if ( call->GetDialFlag() )
|
|
1230 |
{
|
|
1231 |
dialFlag = ETrue;
|
|
1232 |
i = callList->GetNumberOfObjects();
|
|
1233 |
}
|
|
1234 |
}
|
|
1235 |
|
|
1236 |
if ( !dialFlag )
|
|
1237 |
{
|
|
1238 |
TInt ret( KErrNone );
|
|
1239 |
SetDialFlag( ETrue );
|
|
1240 |
TInt trapError( KErrNone );
|
|
1241 |
//Default value
|
|
1242 |
TInt extensionId ( -1 );
|
|
1243 |
|
|
1244 |
TTsyReqHandle dialHandle =
|
|
1245 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeCallDial );
|
|
1246 |
|
|
1247 |
TTsyReqHandle dialHandleISV =
|
|
1248 |
iTsyReqHandleStore->GetTsyReqHandle( EMultimodeCallDialISV );
|
|
1249 |
|
|
1250 |
|
|
1251 |
RMobileCall::TMobileCallParamsV1Pckg* paramsPckgV1 = NULL;
|
|
1252 |
|
|
1253 |
if ( 0 < aCallParams->Length() )
|
|
1254 |
{
|
|
1255 |
paramsPckgV1 =
|
|
1256 |
reinterpret_cast<RMobileCall::TMobileCallParamsV1Pckg*>(
|
|
1257 |
const_cast<TDesC8*>( aCallParams ) );
|
|
1258 |
}
|
|
1259 |
else
|
|
1260 |
{
|
|
1261 |
iCallParams.iSpeakerControl =
|
|
1262 |
RCall::EMonitorSpeakerControlOnUntilCarrier;
|
|
1263 |
iCallParams.iSpeakerVolume = RCall::EMonitorSpeakerVolumeLow;
|
|
1264 |
iCallParams.iInterval = 0;
|
|
1265 |
iCallParams.iWaitForDialTone = RCall::EDialToneWait;
|
|
1266 |
iCallParams.iIdRestrict = RMobileCall::EIdRestrictDefault;
|
|
1267 |
iCallParams.iCug.iExplicitInvoke = EFalse;
|
|
1268 |
iCallParams.iCug.iCugIndex = 0xFFFF;
|
|
1269 |
iCallParams.iCug.iSuppressPrefCug = EFalse;
|
|
1270 |
iCallParams.iCug.iSuppressOA = EFalse;
|
|
1271 |
iCallParams.iAutoRedial = EFalse;
|
|
1272 |
|
|
1273 |
|
|
1274 |
paramsPckgV1 = &iCallParamsPckg;
|
|
1275 |
}
|
|
1276 |
|
|
1277 |
RMobileCall::TMobileCallParamsV1& paramsV1 = ( *paramsPckgV1 )();
|
|
1278 |
|
|
1279 |
//Retrieve the extensionId of the call
|
|
1280 |
extensionId = paramsV1.ExtensionId();
|
|
1281 |
|
|
1282 |
//Set the private member variable iExtensionId
|
|
1283 |
SetExtensionId( extensionId );
|
|
1284 |
|
|
1285 |
//Check if there is already an active call
|
|
1286 |
CMmCallTsy* activeCall = iMmPhone->CallList()->
|
|
1287 |
GetMmCallByStatus( RMobileCall::EStatusConnected );
|
|
1288 |
|
|
1289 |
//reset exit code
|
|
1290 |
iLastExitCode = KErrNone;
|
|
1291 |
|
|
1292 |
if ( KETelExt3rdPartyV1 == extensionId && !isDialISV )
|
|
1293 |
{
|
|
1294 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::Dial - KErrArgument");
|
|
1295 |
//Complete the request with appropiate error
|
|
1296 |
ReqCompleted ( aTsyReqHandle, KErrArgument );
|
|
1297 |
SetDialFlag( EFalse );
|
|
1298 |
}
|
|
1299 |
|
|
1300 |
else if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() )
|
|
1301 |
{
|
|
1302 |
TFLOGSTRING("TSY: Offline mode ON, Dial request is not allowed" );
|
|
1303 |
ret = CMmCommonStaticUtility::EpocErrorCode(
|
|
1304 |
KErrGeneral, KErrGsmOfflineOpNotAllowed );
|
|
1305 |
|
|
1306 |
//Complete the request with appropiate error
|
|
1307 |
ReqCompleted ( aTsyReqHandle, ret );
|
|
1308 |
SetDialFlag( EFalse );
|
|
1309 |
}
|
|
1310 |
|
|
1311 |
//check that status is Idle
|
|
1312 |
else if ( RMobileCall::EStatusIdle != iMobileCallStatus )
|
|
1313 |
{
|
|
1314 |
//The request cannot be forwarded since this call object
|
|
1315 |
//is still in use.
|
|
1316 |
//Complete request with status value informing the client about
|
|
1317 |
//the situation.
|
|
1318 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::Dial - KErrNotReady");
|
|
1319 |
ReqCompleted( aTsyReqHandle, KErrNotReady );
|
|
1320 |
SetDialFlag( EFalse );
|
|
1321 |
}
|
|
1322 |
|
|
1323 |
else if ( ( 0 < dialHandle ) || ( ( KETelExt3rdPartyV1 == extensionId )
|
|
1324 |
&& ( 0 < dialHandleISV ) && !i3rdPartyEmergencyNumberCheckDone ) )
|
|
1325 |
{
|
|
1326 |
//The request is already processing because of previous request
|
|
1327 |
//Complete request with status value informing the client about
|
|
1328 |
//the situation.
|
|
1329 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::Dial - KErrServerBusy");
|
|
1330 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
1331 |
SetDialFlag( EFalse );
|
|
1332 |
}
|
|
1333 |
|
|
1334 |
else if ( ( activeCall ) && ( KETelExt3rdPartyV1 == extensionId )
|
|
1335 |
&& ( KETelExt3rdPartyV1 != activeCall->GetExtensionId() ) )
|
|
1336 |
{
|
|
1337 |
//a 3rd party client call cannot put on Hold a "normal" call
|
|
1338 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::Dial - KErrServerBusy");
|
|
1339 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
1340 |
SetDialFlag( EFalse );
|
|
1341 |
}
|
|
1342 |
//3rd party client is not allowed to call to a emergency call number
|
|
1343 |
//Number check for 3rd clients must be done always
|
|
1344 |
|
|
1345 |
else if ( extensionId == KETelExt3rdPartyV1 &&
|
|
1346 |
!i3rdPartyEmergencyNumberCheckDone )
|
|
1347 |
{
|
|
1348 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::Dial - For 3rd party client number check must be done every time ");
|
|
1349 |
|
|
1350 |
TInt ret( KErrGeneral );
|
|
1351 |
|
|
1352 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::Dial - 3rd party client number check iNumberCheckMode.iCheckMode = RMmCustomAPI::EEmerNumberCheckNormal ");
|
|
1353 |
iNumberCheckMode.iCheckMode = RMmCustomAPI::EEmerNumberCheckNormal;
|
|
1354 |
iNumberCheckMode.iNumber.Copy( *aTelNumber );
|
|
1355 |
|
|
1356 |
//Save parameter for Dial req after number check
|
|
1357 |
iISVCallParams = aCallParams;
|
|
1358 |
|
|
1359 |
CMmDataPackage package;
|
|
1360 |
package.PackData( &iNumberCheckMode );
|
|
1361 |
|
|
1362 |
CMmCustomTsy* mmCustom = iMmPhone->GetCustomTsy();
|
|
1363 |
|
|
1364 |
if ( NULL == mmCustom )
|
|
1365 |
{
|
|
1366 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::Dial - CustomTSY is not yet created!");
|
|
1367 |
ReqCompleted( aTsyReqHandle, KErrNotReady );
|
|
1368 |
SetDialFlag( EFalse );
|
|
1369 |
}
|
|
1370 |
|
|
1371 |
else
|
|
1372 |
{
|
|
1373 |
//Save call object pointer to Customtsy for completion
|
|
1374 |
mmCustom->SetObjectForISVDialNumberCheck( this );
|
|
1375 |
|
|
1376 |
TRAP( trapError, ret = mmCustom->CheckEmergencyNumberL( 0,
|
|
1377 |
&iNumberCheckMode, &i3rdPartyEmergencyNumberCheckDone );
|
|
1378 |
);
|
|
1379 |
|
|
1380 |
if ( KErrNone == ret )
|
|
1381 |
{
|
|
1382 |
//Set dial flag to false because of ISV dial waits
|
|
1383 |
//number check to be completed
|
|
1384 |
SetDialFlag( EFalse );
|
|
1385 |
|
|
1386 |
#ifdef REQHANDLE_TIMER
|
|
1387 |
//Set timer for the request if 3rd party client
|
|
1388 |
SetTypeOfResponse( EMultimodeCallDialISV, aTsyReqHandle );
|
|
1389 |
#else
|
|
1390 |
//Set timer if 3rd party client
|
|
1391 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
1392 |
EMultimodeCallDialISV, aTsyReqHandle );
|
|
1393 |
#endif
|
|
1394 |
}
|
|
1395 |
|
|
1396 |
else
|
|
1397 |
{
|
|
1398 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
1399 |
}
|
|
1400 |
}
|
|
1401 |
}
|
|
1402 |
|
|
1403 |
else
|
|
1404 |
{
|
|
1405 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::Dial - UUS services: %u", iUUSRequest.iServiceReq );
|
|
1406 |
|
|
1407 |
// UUS1 will be embedded within the call set-up message
|
|
1408 |
if ( iUUSRequest.iServiceReq & RMobileCall::KUUS1Implicit )
|
|
1409 |
{
|
|
1410 |
// Create package
|
|
1411 |
CCallDataPackage package;
|
|
1412 |
// Set call id and call mode
|
|
1413 |
package.SetCallIdAndMode( CallId(), CallMode() );
|
|
1414 |
package.PackData( &iUUSRequest );
|
|
1415 |
// Send UUS request to the Domestic OS layer.
|
|
1416 |
TRAPD(err, ret = iMessageManager->HandleRequestL(
|
|
1417 |
EMobileCallActivateUUS, &package ));
|
|
1418 |
|
|
1419 |
// clear/empty the UUS request buffer
|
|
1420 |
iUUSRequest.iServiceReq = 0;
|
|
1421 |
iUUSRequest.iUUI.Zero();
|
|
1422 |
|
|
1423 |
if( err != KErrNone)
|
|
1424 |
{
|
|
1425 |
ret = err;
|
|
1426 |
}
|
|
1427 |
// in case the LTSY does not support required UUS,
|
|
1428 |
// complete the dial with error value
|
|
1429 |
if ( KErrNone != ret )
|
|
1430 |
{
|
|
1431 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::Dial - UUS ERROR:%d", ret );
|
|
1432 |
// Complete the request with appropiate error
|
|
1433 |
ReqCompleted ( aTsyReqHandle, KErrGsmCCResourceNotAvailable );
|
|
1434 |
ClearCallStatus();
|
|
1435 |
return KErrNone;
|
|
1436 |
}
|
|
1437 |
}
|
|
1438 |
|
|
1439 |
//save call params
|
|
1440 |
iCallParams.iSpeakerControl = paramsV1.iSpeakerControl;
|
|
1441 |
iCallParams.iSpeakerVolume = paramsV1.iSpeakerVolume;
|
|
1442 |
iCallParams.iInterval = paramsV1.iInterval;
|
|
1443 |
iCallParams.iWaitForDialTone = paramsV1.iWaitForDialTone;
|
|
1444 |
|
|
1445 |
//set call direction
|
|
1446 |
iCallDirection = RMobileCall::EMobileOriginated;
|
|
1447 |
// Dial
|
|
1448 |
TRAP( trapError,
|
|
1449 |
ret = iMmCallExtInterface->DialL(
|
|
1450 |
iCallMode, paramsPckgV1, aTelNumber, extensionId );
|
|
1451 |
);
|
|
1452 |
|
|
1453 |
|
|
1454 |
if ( KErrNone == ret && KErrNone == trapError )
|
|
1455 |
{
|
|
1456 |
UpdateCallRoutingControl( iCallName, iMobileCallStatus );
|
|
1457 |
|
|
1458 |
//update core status
|
|
1459 |
iCallCaps.iFlags &= ~( RCall::KCapsDial );
|
|
1460 |
iCallCaps.iFlags |= RCall::KCapsHangUp;
|
|
1461 |
//complete core caps change
|
|
1462 |
CompleteNotifyCapsChange();
|
|
1463 |
|
|
1464 |
#ifdef REQHANDLE_TIMER
|
|
1465 |
if ( KETelExt3rdPartyV1 != extensionId )
|
|
1466 |
{
|
|
1467 |
//set timer for the request if 3rd party client
|
|
1468 |
SetTypeOfResponse( EMultimodeCallDial, aTsyReqHandle );
|
|
1469 |
}
|
|
1470 |
|
|
1471 |
#else
|
|
1472 |
if ( KETelExt3rdPartyV1 != extensionId )
|
|
1473 |
{
|
|
1474 |
//set timer if 3rd party client
|
|
1475 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
1476 |
EMultimodeCallDial, aTsyReqHandle );
|
|
1477 |
}
|
|
1478 |
#endif
|
|
1479 |
}
|
|
1480 |
else
|
|
1481 |
{
|
|
1482 |
if ( KErrNone != trapError )
|
|
1483 |
{
|
|
1484 |
//Error Handling.DialL() leaves
|
|
1485 |
ret = trapError;
|
|
1486 |
}
|
|
1487 |
ReqCompleted( aTsyReqHandle, ret );
|
|
1488 |
ClearCallStatus();
|
|
1489 |
}
|
|
1490 |
}
|
|
1491 |
|
|
1492 |
return KErrNone;
|
|
1493 |
}
|
|
1494 |
|
|
1495 |
else // if dialFlag set
|
|
1496 |
{
|
|
1497 |
return KErrServerBusy;
|
|
1498 |
}
|
|
1499 |
|
|
1500 |
}
|
|
1501 |
|
|
1502 |
// ---------------------------------------------------------------------------
|
|
1503 |
// CMmVoiceCallTsy::AnswerIncomingCall
|
|
1504 |
// This CORE API method is used for answering to an incoming call.
|
|
1505 |
// (other items were commented in a header).
|
|
1506 |
// ---------------------------------------------------------------------------
|
|
1507 |
//
|
|
1508 |
TInt CMmVoiceCallTsy::AnswerIncomingCall(
|
|
1509 |
const TTsyReqHandle aTsyReqHandle,
|
|
1510 |
const TDesC8* aCallParams )
|
|
1511 |
{
|
|
1512 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::AnswerIncomingCall. \n\t\t\t Handle:%d", aTsyReqHandle);
|
|
1513 |
|
|
1514 |
TInt trapError( KErrNone );
|
|
1515 |
|
|
1516 |
//ExtensionId unknown.Set to -1
|
|
1517 |
TInt extensionId ( -1 );
|
|
1518 |
|
|
1519 |
TTsyReqHandle answerCallHandle( iTsyReqHandleStore->
|
|
1520 |
GetTsyReqHandle( EMultimodeCallAnswer ) );
|
|
1521 |
|
|
1522 |
//3rd party client
|
|
1523 |
TTsyReqHandle answerCallHandleISV( iTsyReqHandleStore->
|
|
1524 |
GetTsyReqHandle( EMultimodeCallAnswerISV ) );
|
|
1525 |
|
|
1526 |
if (NULL != aCallParams )
|
|
1527 |
{
|
|
1528 |
RMobileCall::TMobileCallParamsV1Pckg* mmParamsPckgV1 =
|
|
1529 |
reinterpret_cast<RMobileCall::TMobileCallParamsV1Pckg*>(
|
|
1530 |
const_cast<TDesC8*> ( aCallParams ) );
|
|
1531 |
RMobileCall::TMobileCallParamsV1& callParams =
|
|
1532 |
(*mmParamsPckgV1)();
|
|
1533 |
|
|
1534 |
//Retrieve information about the extensionId
|
|
1535 |
extensionId = callParams.ExtensionId();
|
|
1536 |
|
|
1537 |
//Set the private member variable iExtensionId
|
|
1538 |
SetExtensionId( extensionId );
|
|
1539 |
}
|
|
1540 |
/*no else*/
|
|
1541 |
|
|
1542 |
// check if there is an active and a held call already
|
|
1543 |
CMmCallTsy* activeCall = iMmPhone->CallList()->
|
|
1544 |
GetMmCallByStatus( RMobileCall::EStatusConnected );
|
|
1545 |
CMmCallTsy* heldCall = iMmPhone->CallList()->
|
|
1546 |
GetMmCallByStatus( RMobileCall::EStatusHold );
|
|
1547 |
|
|
1548 |
if ( 0 < answerCallHandle )
|
|
1549 |
{
|
|
1550 |
//The request is already in processing because of previous request
|
|
1551 |
//Complete request with status value informing the client about
|
|
1552 |
//the situation.
|
|
1553 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
1554 |
}
|
|
1555 |
//if 3rd party client
|
|
1556 |
else if ( 0 < answerCallHandleISV )
|
|
1557 |
{
|
|
1558 |
//The request is already in processing because of previous request
|
|
1559 |
//Complete request with status value informing the client about
|
|
1560 |
//the situation.
|
|
1561 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
1562 |
}
|
|
1563 |
else if ( activeCall && heldCall )
|
|
1564 |
{
|
|
1565 |
// if there is an active and a held call, we cannot answer
|
|
1566 |
// yet another one
|
|
1567 |
ReqCompleted( aTsyReqHandle, KErrGsmNotAllowed );
|
|
1568 |
}
|
|
1569 |
else if( activeCall &&
|
|
1570 |
( !( KETelExt3rdPartyV1 == activeCall->GetExtensionId() ) &&
|
|
1571 |
( KETelExt3rdPartyV1 == extensionId ) ) )
|
|
1572 |
{
|
|
1573 |
//if the active call is handled by a non 3rd party client and that this
|
|
1574 |
//AnswerIncomingCall is handled by a 3rd party client
|
|
1575 |
//=> a 3rd party call cannot put on hold a non 3rd party one.
|
|
1576 |
ReqCompleted( aTsyReqHandle, KErrGsmNotAllowed );
|
|
1577 |
}
|
|
1578 |
else
|
|
1579 |
{
|
|
1580 |
TInt ret( KErrNone );
|
|
1581 |
|
|
1582 |
//reset exit code
|
|
1583 |
iLastExitCode = KErrNone;
|
|
1584 |
|
|
1585 |
// Check that call object is same as object created for last
|
|
1586 |
// incoming call
|
|
1587 |
if ( RMobileCall::EMobileTerminated == iCallDirection &&
|
|
1588 |
RMobileCall::EStatusRinging == iMobileCallStatus )
|
|
1589 |
{
|
|
1590 |
//Answer incoming call
|
|
1591 |
TRAP( trapError,
|
|
1592 |
ret = iMmCallExtInterface->
|
|
1593 |
AnswerIncomingCallL( iCallId, extensionId );
|
|
1594 |
);
|
|
1595 |
|
|
1596 |
if ( KErrNone != trapError )
|
|
1597 |
{
|
|
1598 |
//Object cannot be created.
|
|
1599 |
ret = trapError;
|
|
1600 |
}
|
|
1601 |
|
|
1602 |
if ( KErrNone == ret )
|
|
1603 |
{
|
|
1604 |
UpdateCallRoutingControl( iCallName, iMobileCallStatus );
|
|
1605 |
|
|
1606 |
iCallCaps.iFlags |= RCall::KCapsHangUp;
|
|
1607 |
iCallCaps.iFlags &= ~(
|
|
1608 |
RCall::KCapsAnswer | RCall::KCapsDial );
|
|
1609 |
CompleteNotifyCapsChange();
|
|
1610 |
}
|
|
1611 |
}
|
|
1612 |
else
|
|
1613 |
{
|
|
1614 |
ret = KErrNotSupported;
|
|
1615 |
}
|
|
1616 |
|
|
1617 |
//error handling
|
|
1618 |
if ( KErrNone != ret )
|
|
1619 |
{
|
|
1620 |
ReqCompleted( aTsyReqHandle, ret );
|
|
1621 |
ClearCallStatus();
|
|
1622 |
}
|
|
1623 |
else
|
|
1624 |
{
|
|
1625 |
#ifdef REQHANDLE_TIMER
|
|
1626 |
//set timer for the request
|
|
1627 |
if ( KETelExt3rdPartyV1 == extensionId )
|
|
1628 |
{
|
|
1629 |
//3rd party client
|
|
1630 |
SetTypeOfResponse( EMultimodeCallAnswerISV, aTsyReqHandle );
|
|
1631 |
}
|
|
1632 |
else
|
|
1633 |
{
|
|
1634 |
SetTypeOfResponse( EMultimodeCallAnswer, aTsyReqHandle );
|
|
1635 |
}
|
|
1636 |
#else
|
|
1637 |
//timer set
|
|
1638 |
if ( KETelExt3rdPartyV1 == extensionId )
|
|
1639 |
{
|
|
1640 |
//3rd party client
|
|
1641 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
1642 |
EMultimodeCallAnswerISV, aTsyReqHandle );
|
|
1643 |
}
|
|
1644 |
else
|
|
1645 |
{
|
|
1646 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
1647 |
EMultimodeCallAnswer, aTsyReqHandle );
|
|
1648 |
}
|
|
1649 |
#endif
|
|
1650 |
}
|
|
1651 |
}
|
|
1652 |
return KErrNone;
|
|
1653 |
}
|
|
1654 |
|
|
1655 |
// ---------------------------------------------------------------------------
|
|
1656 |
// CMmVoiceCallTsy::HangUp
|
|
1657 |
// This CORE API method disconnects the call. Used with normal voice calls,
|
|
1658 |
// emergency calls as well as data calls. DialCancel also uses this method.
|
|
1659 |
// (other items were commented in a header).
|
|
1660 |
// ---------------------------------------------------------------------------
|
|
1661 |
//
|
|
1662 |
TInt CMmVoiceCallTsy::HangUp(
|
|
1663 |
const TTsyReqHandle aTsyReqHandle )
|
|
1664 |
{
|
|
1665 |
TFLOGSTRING3("TSY: CMmVoiceCallTsy::HangUp. Req handle: %d, Call name: %S", aTsyReqHandle, &iCallName);
|
|
1666 |
|
|
1667 |
TInt ret( KErrNone );
|
|
1668 |
TInt trapError( KErrNone );
|
|
1669 |
TInt hangUpCause( KErrNone );
|
|
1670 |
|
|
1671 |
TTsyReqHandle hangUpHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
1672 |
EMultimodeCallHangUp );
|
|
1673 |
TTsyReqHandle dialHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
1674 |
EMultimodeCallDial );
|
|
1675 |
TTsyReqHandle dialEmergencyHandle = iTsyReqHandleStore->GetTsyReqHandle(
|
|
1676 |
EMultimodeMobileCallDialEmergencyCall );
|
|
1677 |
|
|
1678 |
// 3rd party client
|
|
1679 |
TTsyReqHandle dialHandleISV = iTsyReqHandleStore->GetTsyReqHandle(
|
|
1680 |
EMultimodeCallDialISV );
|
|
1681 |
|
|
1682 |
// Dial NoFdnCheck
|
|
1683 |
TTsyReqHandle dialHandleNoFdnCheck = iTsyReqHandleStore->GetTsyReqHandle(
|
|
1684 |
EMultimodeCallDialNoFdnCheck );
|
|
1685 |
|
|
1686 |
if ( 0 < hangUpHandle || iHangUpFlag )
|
|
1687 |
{
|
|
1688 |
//The request is already in processing because of previous request
|
|
1689 |
//Complete request with status value informing the client about
|
|
1690 |
//the situation.
|
|
1691 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
1692 |
}
|
|
1693 |
else if ( RCall::EStatusIdle == iCallStatus &&
|
|
1694 |
( EMultimodeCallReqHandleUnknown == dialHandle ||
|
|
1695 |
EMultimodeCallReqHandleUnknown == dialEmergencyHandle
|
|
1696 |
|| EMultimodeCallReqHandleUnknown == dialHandleISV
|
|
1697 |
|| EMultimodeCallReqHandleUnknown == dialHandleNoFdnCheck ) )
|
|
1698 |
{
|
|
1699 |
//Call object is already in idle state.
|
|
1700 |
//Complete HangUp request with error.
|
|
1701 |
ReqCompleted( aTsyReqHandle, KErrNotReady );
|
|
1702 |
}
|
|
1703 |
else
|
|
1704 |
{
|
|
1705 |
// If this was not called by DialCancel or AnswerIncomingCallCancel
|
|
1706 |
if ( CMmCallTsy::EDialCancelNotCalled == iDialCancelFlag &&
|
|
1707 |
!iAnswerCancelFlag )
|
|
1708 |
{
|
|
1709 |
#ifdef REQHANDLE_TIMER
|
|
1710 |
//set timer for the request
|
|
1711 |
SetTypeOfResponse( EMultimodeCallHangUp, aTsyReqHandle );
|
|
1712 |
#else
|
|
1713 |
//save HangUp request handle, set timer
|
|
1714 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
1715 |
EMultimodeCallHangUp, aTsyReqHandle );
|
|
1716 |
#endif
|
|
1717 |
}
|
|
1718 |
//decide the hangup cause
|
|
1719 |
if ( RCall::EStatusRinging == iCallStatus )
|
|
1720 |
{
|
|
1721 |
iLastExitCode = KErrGsmCallRejected;
|
|
1722 |
hangUpCause = KErrGsmBusyUserRequest;
|
|
1723 |
}
|
|
1724 |
else
|
|
1725 |
{
|
|
1726 |
hangUpCause = KErrGsmReleaseByUser;
|
|
1727 |
}
|
|
1728 |
|
|
1729 |
// Avoid held call from automatically becoming active call
|
|
1730 |
TBool autoStChangeDisable = ETrue;
|
|
1731 |
|
|
1732 |
//Create package
|
|
1733 |
CCallDataPackage package;
|
|
1734 |
//Set call id and call mode
|
|
1735 |
package.SetCallIdAndMode( iCallId, RMobilePhone::EVoiceService );
|
|
1736 |
//Pack call parameters and mobile call info
|
|
1737 |
package.PackData( &hangUpCause, &autoStChangeDisable );
|
|
1738 |
//Send request to the Domestic OS layer.
|
|
1739 |
TRAP( trapError,
|
|
1740 |
ret = iMessageManager->HandleRequestL(
|
|
1741 |
EEtelCallHangUp, &package );
|
|
1742 |
);
|
|
1743 |
|
|
1744 |
//send failure
|
|
1745 |
if ( KErrNone != ret || KErrNone != trapError )
|
|
1746 |
{
|
|
1747 |
iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeCallHangUp );
|
|
1748 |
|
|
1749 |
//in case of memory error
|
|
1750 |
if ( KErrNone != trapError )
|
|
1751 |
{
|
|
1752 |
// Object cannot be created.
|
|
1753 |
ret = trapError;
|
|
1754 |
}
|
|
1755 |
|
|
1756 |
ReqCompleted( aTsyReqHandle, ret );
|
|
1757 |
}
|
|
1758 |
else
|
|
1759 |
{
|
|
1760 |
//update core status - hangup not possible now.
|
|
1761 |
//remove also dataport caps
|
|
1762 |
iCallCaps.iFlags &= ~(
|
|
1763 |
RCall::KCapsHangUp |
|
|
1764 |
RCall::KCapsLoanDataPort |
|
|
1765 |
RCall::KCapsRecoverDataPort );
|
|
1766 |
//complete core caps change
|
|
1767 |
CompleteNotifyCapsChange();
|
|
1768 |
// set hangup flag to ongoing
|
|
1769 |
iHangUpFlag = ETrue;
|
|
1770 |
}
|
|
1771 |
}
|
|
1772 |
return KErrNone;
|
|
1773 |
}
|
|
1774 |
|
|
1775 |
// ---------------------------------------------------------------------------
|
|
1776 |
// CMmVoiceCallTsy::CompleteHangUp
|
|
1777 |
// Completes call hangup (both normal and emergency calls). If the cause value
|
|
1778 |
// is different than the sent one, the call release requset has failed. In
|
|
1779 |
// this case the causeValue describes the fail cause. Otherwise the call
|
|
1780 |
// releasing has succeeded.
|
|
1781 |
// (other items were commented in a header).
|
|
1782 |
// ---------------------------------------------------------------------------
|
|
1783 |
//
|
|
1784 |
void CMmVoiceCallTsy::CompleteHangUp(
|
|
1785 |
TInt aResult )
|
|
1786 |
{
|
|
1787 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::CompleteHangUp.\n \t\t\t Result:%d", aResult );
|
|
1788 |
TFLOGSTRING3("TSY: CMmVoiceCallTsy::CompleteHangUp. Call Id:%d Call name:%S", iCallId, &iCallName);
|
|
1789 |
|
|
1790 |
TInt ret( KErrNone );
|
|
1791 |
|
|
1792 |
// Complete for HangUp request
|
|
1793 |
// (not to DialCancel or AnswerIncomingCallCancel )
|
|
1794 |
if ( CMmCallTsy::EDialCancelNotCalled == iDialCancelFlag &&
|
|
1795 |
!iAnswerCancelFlag )
|
|
1796 |
{
|
|
1797 |
//reset req handle. Returns the deleted req handle
|
|
1798 |
TTsyReqHandle reqHandle =
|
|
1799 |
iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeCallHangUp );
|
|
1800 |
|
|
1801 |
if ( EMultimodeCallReqHandleUnknown != reqHandle )
|
|
1802 |
{
|
|
1803 |
//if hangup request failed
|
|
1804 |
if ( KErrNone != aResult )
|
|
1805 |
{
|
|
1806 |
//Hangup failed, it should be still possible to carry out
|
|
1807 |
iCallCaps.iFlags |= RCall::KCapsHangUp;
|
|
1808 |
|
|
1809 |
//Call status is not idle. HangUp request failed, complete
|
|
1810 |
//HangUp request with error.
|
|
1811 |
if ( RCall::EStatusIdle != iCallStatus )
|
|
1812 |
{
|
|
1813 |
// ignore KErrGsmReleaseByUser, which means that the call ended
|
|
1814 |
// because the local user released the call, and must be treated
|
|
1815 |
// as a normal return code from the LTSY
|
|
1816 |
ret = ( (aResult == KErrGsmReleaseByUser) ? KErrNone : aResult );
|
|
1817 |
}
|
|
1818 |
}
|
|
1819 |
else
|
|
1820 |
{
|
|
1821 |
//Dial hangup has succeeded, update core status -
|
|
1822 |
//dial possible again
|
|
1823 |
iCallCaps.iFlags |= RCall::KCapsDial;
|
|
1824 |
|
|
1825 |
if ( KErrGsmCallRejected != iLastExitCode )
|
|
1826 |
{
|
|
1827 |
iLastExitCode = KErrNone;
|
|
1828 |
}
|
|
1829 |
|
|
1830 |
//If client refuses to answer, remove the answering capability
|
|
1831 |
iCallCaps.iFlags &= ~( RCall::KCapsAnswer );
|
|
1832 |
}
|
|
1833 |
ReqCompleted( reqHandle, ret );
|
|
1834 |
|
|
1835 |
//complete caps change notification
|
|
1836 |
CompleteNotifyCapsChange();
|
|
1837 |
|
|
1838 |
iEmergencyCall = EFalse;
|
|
1839 |
}
|
|
1840 |
}
|
|
1841 |
// Complete for DialCancel or AnswerIncomingCallCancel, success
|
|
1842 |
else if ( KErrNone == aResult )
|
|
1843 |
{
|
|
1844 |
// Find out if this is cancelling of Dial or DialEmergencyCall
|
|
1845 |
TTsyReqHandle cancelHandle = iTsyReqHandleStore->
|
|
1846 |
ResetTsyReqHandle( EMultimodeCallDial );
|
|
1847 |
TTsyReqHandle dialEmergCancelHandle = iTsyReqHandleStore->
|
|
1848 |
ResetTsyReqHandle( EMultimodeMobileCallDialEmergencyCall );
|
|
1849 |
|
|
1850 |
if ( ( NULL == cancelHandle ) && ( NULL == dialEmergCancelHandle ) )
|
|
1851 |
{
|
|
1852 |
// Find out if this is cancelling of AnswerIncomingCall
|
|
1853 |
cancelHandle = iTsyReqHandleStore->
|
|
1854 |
ResetTsyReqHandle( EMultimodeCallAnswer );
|
|
1855 |
|
|
1856 |
if ( NULL == cancelHandle )
|
|
1857 |
{
|
|
1858 |
// Find out if this is cancelling of DialISV
|
|
1859 |
cancelHandle = iTsyReqHandleStore->
|
|
1860 |
ResetTsyReqHandle( EMultimodeCallDialISV );
|
|
1861 |
|
|
1862 |
if ( NULL == cancelHandle )
|
|
1863 |
{
|
|
1864 |
// Find out if this is cancelling of AnswerIncomingCallISV
|
|
1865 |
cancelHandle = iTsyReqHandleStore->
|
|
1866 |
ResetTsyReqHandle( EMultimodeCallAnswerISV );
|
|
1867 |
|
|
1868 |
// Find out if this is cancelling DialNoFdnCheck
|
|
1869 |
if ( NULL == cancelHandle )
|
|
1870 |
{
|
|
1871 |
cancelHandle = iTsyReqHandleStore->
|
|
1872 |
ResetTsyReqHandle( EMultimodeCallDialNoFdnCheck );
|
|
1873 |
}
|
|
1874 |
}
|
|
1875 |
}
|
|
1876 |
}
|
|
1877 |
if ( 0 < cancelHandle )
|
|
1878 |
{
|
|
1879 |
// Complete with error value KErrCancel
|
|
1880 |
ReqCompleted( cancelHandle, KErrCancel );
|
|
1881 |
|
|
1882 |
// Cancel has succeeded, update core status -
|
|
1883 |
// dial possible again
|
|
1884 |
iCallCaps.iFlags |= RCall::KCapsDial;
|
|
1885 |
// If client refuses to answer, remove the answering capability
|
|
1886 |
iCallCaps.iFlags &= ~( RCall::KCapsAnswer );
|
|
1887 |
// Complete caps change notification
|
|
1888 |
CompleteNotifyCapsChange();
|
|
1889 |
}
|
|
1890 |
// Cancel to DialEmergencyCall
|
|
1891 |
else if ( 0 < dialEmergCancelHandle )
|
|
1892 |
{
|
|
1893 |
// Complete DialEmergencyCall with error value KErrCancel
|
|
1894 |
ReqCompleted( dialEmergCancelHandle, KErrCancel );
|
|
1895 |
|
|
1896 |
// Update last exit code
|
|
1897 |
iLastExitCode = KErrCancel;
|
|
1898 |
|
|
1899 |
// Dial cancel has succeeded,
|
|
1900 |
// update core status - dial possible again
|
|
1901 |
iCallCaps.iFlags |= RCall::KCapsDial;
|
|
1902 |
// Complete caps change notification
|
|
1903 |
CompleteNotifyCapsChange();
|
|
1904 |
|
|
1905 |
iEmergencyCall = EFalse;
|
|
1906 |
}
|
|
1907 |
}
|
|
1908 |
// Cancel failed and the request succeeded (connected)
|
|
1909 |
else if ( RCall::EStatusConnected == iCallStatus )
|
|
1910 |
{
|
|
1911 |
// Find out if this is cancelling of Dial
|
|
1912 |
TTsyReqHandle cancelHandle = iTsyReqHandleStore->
|
|
1913 |
ResetTsyReqHandle( EMultimodeCallDial );
|
|
1914 |
|
|
1915 |
// Find out if this is cancelling of DialEmergencyCall
|
|
1916 |
TTsyReqHandle dialEmergCancelHandle = iTsyReqHandleStore->
|
|
1917 |
ResetTsyReqHandle( EMultimodeMobileCallDialEmergencyCall );
|
|
1918 |
|
|
1919 |
if ( ( NULL == cancelHandle ) && ( NULL == dialEmergCancelHandle ) )
|
|
1920 |
{
|
|
1921 |
// Find out if this is cancelling of AnswerIncomingCall
|
|
1922 |
cancelHandle = iTsyReqHandleStore->
|
|
1923 |
ResetTsyReqHandle( EMultimodeCallAnswer );
|
|
1924 |
|
|
1925 |
if ( NULL == cancelHandle )
|
|
1926 |
{
|
|
1927 |
// Find out if this is cancelling of DialISV
|
|
1928 |
cancelHandle = iTsyReqHandleStore->
|
|
1929 |
ResetTsyReqHandle( EMultimodeCallDialISV );
|
|
1930 |
|
|
1931 |
if ( NULL == cancelHandle )
|
|
1932 |
{
|
|
1933 |
// Find out if this is cancelling of AnswerIncomingCallISV
|
|
1934 |
cancelHandle = iTsyReqHandleStore->
|
|
1935 |
ResetTsyReqHandle( EMultimodeCallAnswerISV );
|
|
1936 |
|
|
1937 |
if (NULL == cancelHandle )
|
|
1938 |
{
|
|
1939 |
// Find out if this is cancelling DialNoFdnCheck
|
|
1940 |
cancelHandle = iTsyReqHandleStore->
|
|
1941 |
ResetTsyReqHandle( EMultimodeCallDialNoFdnCheck );
|
|
1942 |
}
|
|
1943 |
}
|
|
1944 |
}
|
|
1945 |
}
|
|
1946 |
// Cancel to Dial(ISV) or AnswerIncomingCall(ISV)
|
|
1947 |
if ( 0 < cancelHandle )
|
|
1948 |
{
|
|
1949 |
// Complete Dial or AnswerIncomingCall with success (KErrNone)
|
|
1950 |
ReqCompleted( cancelHandle, KErrNone );
|
|
1951 |
|
|
1952 |
// Succeeded, update core status - hangup possible again
|
|
1953 |
iCallCaps.iFlags |= RCall::KCapsHangUp;
|
|
1954 |
// Complete caps change notification
|
|
1955 |
CompleteNotifyCapsChange();
|
|
1956 |
}
|
|
1957 |
// Cancel to DialEmergencyCall
|
|
1958 |
else if ( 0 < dialEmergCancelHandle )
|
|
1959 |
{
|
|
1960 |
// Complete DialEmergencyCall with success (KErrNone)
|
|
1961 |
ReqCompleted( dialEmergCancelHandle, KErrNone );
|
|
1962 |
|
|
1963 |
// Dial has succeeded, update core status - hangup possible again
|
|
1964 |
iCallCaps.iFlags |= RCall::KCapsHangUp;
|
|
1965 |
// Complete caps change notification
|
|
1966 |
CompleteNotifyCapsChange();
|
|
1967 |
}
|
|
1968 |
}
|
|
1969 |
|
|
1970 |
// Reset cancel flags
|
|
1971 |
iDialCancelFlag = CMmCallTsy::EDialCancelNotCalled;
|
|
1972 |
iAnswerCancelFlag = EFalse;
|
|
1973 |
// reset hangup flag
|
|
1974 |
iHangUpFlag = EFalse;
|
|
1975 |
}
|
|
1976 |
|
|
1977 |
// ---------------------------------------------------------------------------
|
|
1978 |
// CMmVoiceCallTsy::RegisterNotification
|
|
1979 |
// RegisterNotification is called when the server recognises that this
|
|
1980 |
// notification is being posted for the first time on this sub-session object.
|
|
1981 |
// It enables the TSY to "turn on" any regular notification messages that it
|
|
1982 |
// may receive from DOS. Currently does not really do anything but returns
|
|
1983 |
// KErrNone to ETel server in case of known notification request type.
|
|
1984 |
// (other items were commented in a header).
|
|
1985 |
// ---------------------------------------------------------------------------
|
|
1986 |
//
|
|
1987 |
TInt CMmVoiceCallTsy::RegisterNotification(
|
|
1988 |
const TInt aIpc )
|
|
1989 |
{
|
|
1990 |
TInt ret( KErrNone );
|
|
1991 |
|
|
1992 |
switch ( aIpc )
|
|
1993 |
{
|
|
1994 |
case EEtelCallNotifyHookChange:
|
|
1995 |
case EEtelCallNotifyStatusChange:
|
|
1996 |
case EEtelCallNotifyDurationChange:
|
|
1997 |
case EEtelCallCapsChangeNotification:
|
|
1998 |
case EMobileCallNotifyCallEvent:
|
|
1999 |
case EMobileCallNotifyMobileCallStatusChange:
|
|
2000 |
case EMobileCallNotifyRemotePartyInfoChange:
|
|
2001 |
case EMobileCallNotifyPrivacyConfirmation:
|
|
2002 |
case EMobileCallNotifyTrafficChannelConfirmation:
|
|
2003 |
case EMobileCallNotifyHscsdInfoChange:
|
|
2004 |
case EMobileCallNotifyMobileDataCallCapsChange:
|
|
2005 |
case EMobileCallNotifyAlternatingCallSwitch:
|
|
2006 |
case EMobileCallNotifyMobileCallCapsChange:
|
|
2007 |
case EMobileCallNotifyVoiceFallback:
|
|
2008 |
case EMobileCallNotifyUUSCapsChange:
|
|
2009 |
case EMobileCallReceiveUUI:
|
|
2010 |
ret = KErrNone;
|
|
2011 |
break;
|
|
2012 |
default:
|
|
2013 |
// Unknown or invalid IPC
|
|
2014 |
ret = KErrNotSupported;
|
|
2015 |
break;
|
|
2016 |
}
|
|
2017 |
return ret;
|
|
2018 |
}
|
|
2019 |
|
|
2020 |
// ---------------------------------------------------------------------------
|
|
2021 |
// CMmVoiceCallTsy::DeregisterNotification
|
|
2022 |
// DeregisterNotification is called when the server recognises that this
|
|
2023 |
// notification will not be posted again because the last client to have a
|
|
2024 |
// handle on this sub-session object has just closed the handle. It enables
|
|
2025 |
// the TSY to "turn off" any regular notification messages that it may receive
|
|
2026 |
// from DOS. Currently does not really do anything but returns KErrNone to
|
|
2027 |
// ETel server in case of known notification request type.
|
|
2028 |
// (other items were commented in a header).
|
|
2029 |
// ---------------------------------------------------------------------------
|
|
2030 |
//
|
|
2031 |
TInt CMmVoiceCallTsy::DeregisterNotification(
|
|
2032 |
const TInt aIpc )
|
|
2033 |
{
|
|
2034 |
TInt ret ( KErrNone );
|
|
2035 |
|
|
2036 |
switch ( aIpc )
|
|
2037 |
{
|
|
2038 |
case EEtelCallNotifyHookChange:
|
|
2039 |
case EEtelCallNotifyStatusChange:
|
|
2040 |
case EEtelCallNotifyDurationChange:
|
|
2041 |
case EEtelCallCapsChangeNotification:
|
|
2042 |
case EMobileCallNotifyCallEvent:
|
|
2043 |
case EMobileCallNotifyMobileCallStatusChange:
|
|
2044 |
case EMobileCallNotifyRemotePartyInfoChange:
|
|
2045 |
case EMobileCallNotifyPrivacyConfirmation:
|
|
2046 |
case EMobileCallNotifyTrafficChannelConfirmation:
|
|
2047 |
case EMobileCallNotifyHscsdInfoChange:
|
|
2048 |
case EMobileCallNotifyMobileDataCallCapsChange:
|
|
2049 |
case EMobileCallNotifyAlternatingCallSwitch:
|
|
2050 |
case EMobileCallNotifyMobileCallCapsChange:
|
|
2051 |
case EMobileCallNotifyVoiceFallback:
|
|
2052 |
case EMobileCallNotifyUUSCapsChange:
|
|
2053 |
case EMobileCallReceiveUUI:
|
|
2054 |
ret = KErrNone;
|
|
2055 |
break;
|
|
2056 |
default:
|
|
2057 |
// Unknown or invalid IPC
|
|
2058 |
ret = KErrNotSupported;
|
|
2059 |
break;
|
|
2060 |
}
|
|
2061 |
return ret;
|
|
2062 |
}
|
|
2063 |
|
|
2064 |
// ---------------------------------------------------------------------------
|
|
2065 |
// CMmVoiceCallTsy::HoldL
|
|
2066 |
// This method can be used to hold an active call.
|
|
2067 |
// (other items were commented in a header).
|
|
2068 |
// ---------------------------------------------------------------------------
|
|
2069 |
//
|
|
2070 |
TInt CMmVoiceCallTsy::HoldL(
|
|
2071 |
const TTsyReqHandle aTsyReqHandle )
|
|
2072 |
{
|
|
2073 |
//Call hold from extension
|
|
2074 |
TInt ret = iMmCallExtInterface->HoldL( iCallId );
|
|
2075 |
|
|
2076 |
//request failed
|
|
2077 |
if ( ret != KErrNone )
|
|
2078 |
{
|
|
2079 |
ReqCompleted( aTsyReqHandle, ret );
|
|
2080 |
}
|
|
2081 |
else //success in sending to Phonet
|
|
2082 |
{
|
|
2083 |
// Store the request handle
|
|
2084 |
iReqHandleType = EMultimodeMobileCallHold;
|
|
2085 |
}
|
|
2086 |
return KErrNone;
|
|
2087 |
}
|
|
2088 |
|
|
2089 |
// ---------------------------------------------------------------------------
|
|
2090 |
// CMmVoiceCallTsy::ResumeL
|
|
2091 |
// Resumes a held call.
|
|
2092 |
// (other items were commented in a header).
|
|
2093 |
// ---------------------------------------------------------------------------
|
|
2094 |
//
|
|
2095 |
TInt CMmVoiceCallTsy::ResumeL(
|
|
2096 |
const TTsyReqHandle aTsyReqHandle )
|
|
2097 |
{
|
|
2098 |
//Call resume from extension
|
|
2099 |
TInt ret = iMmCallExtInterface->ResumeL( iCallId );
|
|
2100 |
|
|
2101 |
//if failed
|
|
2102 |
if ( ret != KErrNone )
|
|
2103 |
{
|
|
2104 |
ReqCompleted( aTsyReqHandle, ret );
|
|
2105 |
}
|
|
2106 |
else //success in sending to Phonet
|
|
2107 |
{
|
|
2108 |
// Store the request handle
|
|
2109 |
iReqHandleType = EMultimodeMobileCallResume;
|
|
2110 |
}
|
|
2111 |
return KErrNone;
|
|
2112 |
}
|
|
2113 |
|
|
2114 |
// ---------------------------------------------------------------------------
|
|
2115 |
// CMmVoiceCallTsy::SwapL
|
|
2116 |
// Swaps between active and held call.
|
|
2117 |
// (other items were commented in a header).
|
|
2118 |
// ---------------------------------------------------------------------------
|
|
2119 |
//
|
|
2120 |
TInt CMmVoiceCallTsy::SwapL(
|
|
2121 |
const TTsyReqHandle aTsyReqHandle )
|
|
2122 |
{
|
|
2123 |
//direct request to extension
|
|
2124 |
TInt ret = iMmCallExtInterface->SwapL( iCallId );
|
|
2125 |
|
|
2126 |
//request failed
|
|
2127 |
if ( ret != KErrNone )
|
|
2128 |
{
|
|
2129 |
ReqCompleted( aTsyReqHandle, ret );
|
|
2130 |
}
|
|
2131 |
else //success in sending to Phonet
|
|
2132 |
{
|
|
2133 |
// Store the request handle
|
|
2134 |
iReqHandleType = EMultimodeMobileCallSwap;
|
|
2135 |
//inform Line that swap handling has started
|
|
2136 |
(reinterpret_cast<CMmVoiceLineTsy*>( iMmLine ))->
|
|
2137 |
SetSwapStatus( CMmVoiceLineTsy::EWaitingHoldAndResumeOk );
|
|
2138 |
}
|
|
2139 |
return KErrNone;
|
|
2140 |
}
|
|
2141 |
|
|
2142 |
// ---------------------------------------------------------------------------
|
|
2143 |
// CMmVoiceCallTsy::DialEmergencyCallL
|
|
2144 |
// Dials an emergency call.
|
|
2145 |
// (other items were commented in a header).
|
|
2146 |
// ---------------------------------------------------------------------------
|
|
2147 |
//
|
|
2148 |
TInt CMmVoiceCallTsy::DialEmergencyCall(
|
|
2149 |
const TTsyReqHandle aTsyReqHandle,
|
|
2150 |
const TDataPackage& aNumber )
|
|
2151 |
{
|
|
2152 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::DialEmergencyCall number %S", aNumber.Des1u());
|
|
2153 |
|
|
2154 |
if(aNumber.Des1u()->MaxLength() > RMobileENStore::KEmergencyNumberSize)
|
|
2155 |
{
|
|
2156 |
// The emergency call number is too big
|
|
2157 |
ReqCompleted( aTsyReqHandle, KErrArgument);
|
|
2158 |
}
|
|
2159 |
else
|
|
2160 |
{
|
|
2161 |
SetDialFlag(ETrue);
|
|
2162 |
//check that status is Idle
|
|
2163 |
if ( iMobileCallStatus != RMobileCall::EStatusIdle )
|
|
2164 |
{
|
|
2165 |
//The request cannot be forwarded since this call object
|
|
2166 |
//is still in use.
|
|
2167 |
//Complete request with status value informing the client
|
|
2168 |
//about the situation.
|
|
2169 |
ReqCompleted( aTsyReqHandle, KErrNotReady );
|
|
2170 |
SetDialFlag(EFalse);
|
|
2171 |
}
|
|
2172 |
// If dial already proceeding,
|
|
2173 |
else if ( NULL != iTsyReqHandleStore->GetTsyReqHandle(EMultimodeCallDial) ||
|
|
2174 |
NULL != iTsyReqHandleStore->GetTsyReqHandle(EMultimodeMobileCallDialEmergencyCall ) )
|
|
2175 |
{
|
|
2176 |
ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
2177 |
SetDialFlag(EFalse);
|
|
2178 |
}
|
|
2179 |
|
|
2180 |
// Because the Phone Application is the first client that is started,
|
|
2181 |
// it will always be the priority client. 3rd party applications are
|
|
2182 |
// now allowed to make emergency calls too.
|
|
2183 |
else
|
|
2184 |
{
|
|
2185 |
iLastExitCode = KErrNone;
|
|
2186 |
iCallDirection = RMobileCall::EMobileOriginated;
|
|
2187 |
|
|
2188 |
// Prepare data to pass throught all loop
|
|
2189 |
TCtsySsmCallbackData callbackData;
|
|
2190 |
callbackData.iNumberPackage.SetPacketData(&aNumber);
|
|
2191 |
callbackData.iReqHandle = aTsyReqHandle;
|
|
2192 |
|
|
2193 |
iMmCallExtInterface->DialEmergencyCall(callbackData );
|
|
2194 |
}
|
|
2195 |
}
|
|
2196 |
return KErrNone;
|
|
2197 |
}
|
|
2198 |
|
|
2199 |
// ---------------------------------------------------------------------------
|
|
2200 |
// CMmVoiceCallTsy::CompleteDialEmergencyCall
|
|
2201 |
// Completes emergency call dialling.
|
|
2202 |
// (other items were commented in a header).
|
|
2203 |
// ---------------------------------------------------------------------------
|
|
2204 |
//
|
|
2205 |
void CMmVoiceCallTsy::CompleteDialEmergencyCall(
|
|
2206 |
TInt aResult )
|
|
2207 |
{
|
|
2208 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::CompleteDialEmergencyCall. Result:%d", aResult );
|
|
2209 |
TFLOGSTRING3("TSY: CMmVoiceCallTsy::CompleteDialEmergencyCall. Call Id:%d Call name:%S", iCallId, &iCallName);
|
|
2210 |
|
|
2211 |
//reset req handle. Returns the deleted req handle
|
|
2212 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->
|
|
2213 |
ResetTsyReqHandle( EMultimodeMobileCallDialEmergencyCall );
|
|
2214 |
|
|
2215 |
if ( EMultimodeCallReqHandleUnknown != reqHandle )
|
|
2216 |
{
|
|
2217 |
if ( aResult != KErrNone )
|
|
2218 |
{
|
|
2219 |
iLastExitCode = aResult;
|
|
2220 |
|
|
2221 |
//clear flag indicating that this is a emergency call
|
|
2222 |
iEmergencyCall = EFalse;
|
|
2223 |
ClearCallStatus();
|
|
2224 |
}
|
|
2225 |
ReqCompleted( reqHandle, aResult );
|
|
2226 |
}
|
|
2227 |
}
|
|
2228 |
|
|
2229 |
// ---------------------------------------------------------------------------
|
|
2230 |
// CMmVoiceCallTsy::DialEmergencyCallCancel
|
|
2231 |
// Cancels DialEmergencyCall request.
|
|
2232 |
// (other items were commented in a header).
|
|
2233 |
// ---------------------------------------------------------------------------
|
|
2234 |
//
|
|
2235 |
TInt CMmVoiceCallTsy::DialEmergencyCallCancel(
|
|
2236 |
const TTsyReqHandle aTsyReqHandle )
|
|
2237 |
{
|
|
2238 |
// Let callback to handle canceling
|
|
2239 |
TCtsySsmCallbackData callbackData;
|
|
2240 |
callbackData.iReqHandle = aTsyReqHandle;
|
|
2241 |
SsmPluginCallback(KErrCancel,callbackData);
|
|
2242 |
|
|
2243 |
return KErrNone;
|
|
2244 |
}
|
|
2245 |
|
|
2246 |
// ---------------------------------------------------------------------------
|
|
2247 |
// CMmVoiceCallTsy::FillMobileCallInfo
|
|
2248 |
// The method fills a current snapshot of the call information described in
|
|
2249 |
// the TMobileCallInfoVx class to the aInfo. The mode specific fields will be
|
|
2250 |
// filled by the extension.
|
|
2251 |
// (other items were commented in a header).
|
|
2252 |
// ---------------------------------------------------------------------------
|
|
2253 |
//
|
|
2254 |
TInt CMmVoiceCallTsy::FillMobileCallInfo(
|
|
2255 |
TDes8* aInfo )
|
|
2256 |
{
|
|
2257 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::FillMobileCallInfo");
|
|
2258 |
|
|
2259 |
TInt ret = KErrArgument;
|
|
2260 |
TInt extensionId = 0;
|
|
2261 |
|
|
2262 |
if ( sizeof ( RMobilePhone::TMultimodeType ) <= aInfo->MaxLength() )
|
|
2263 |
{
|
|
2264 |
RMobilePhone::TMultimodeTypePckg* infoParamsPckg =
|
|
2265 |
reinterpret_cast<RMobilePhone::TMultimodeTypePckg*>(
|
|
2266 |
aInfo );
|
|
2267 |
RMobilePhone::TMultimodeType& callInfo = ( *infoParamsPckg )();
|
|
2268 |
|
|
2269 |
// get extensionid from the recieved data
|
|
2270 |
extensionId = callInfo.ExtensionId();
|
|
2271 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::FillMobileCallInfo - extensionid=%d",callInfo.ExtensionId());
|
|
2272 |
}
|
|
2273 |
|
|
2274 |
//TMobileCallInfoV1
|
|
2275 |
if ( KETelExtMultimodeV1 == extensionId ||
|
|
2276 |
KETelExtMultimodeV3 == extensionId ||
|
|
2277 |
KEtelExtMultimodeV7 == extensionId ||
|
|
2278 |
KEtelExtMultimodeV8 == extensionId )
|
|
2279 |
{
|
|
2280 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::FillMobileCallInfo - V1");
|
|
2281 |
// Set ret to KErrNone. We can fill this parameter class.
|
|
2282 |
ret = KErrNone;
|
|
2283 |
|
|
2284 |
RMobileCall::TMobileCallInfoV1Pckg* paramsPckgV1 =
|
|
2285 |
reinterpret_cast<RMobileCall::TMobileCallInfoV1Pckg*>( aInfo );
|
|
2286 |
RMobileCall::TMobileCallInfoV1& info = ( *paramsPckgV1 )();
|
|
2287 |
|
|
2288 |
// set mobilecallinfo default values
|
|
2289 |
FillMobileCallInfoDefaults( &info );
|
|
2290 |
|
|
2291 |
// fill specific data
|
|
2292 |
iMmCallExtInterface->FillMobileCallInfo( &info );
|
|
2293 |
}
|
|
2294 |
|
|
2295 |
// TMobileCallInfoV3
|
|
2296 |
if ( KETelExtMultimodeV3 == extensionId ||
|
|
2297 |
KEtelExtMultimodeV7 == extensionId ||
|
|
2298 |
KEtelExtMultimodeV8 == extensionId )
|
|
2299 |
{
|
|
2300 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::FillMobileCallInfo - V3");
|
|
2301 |
|
|
2302 |
RMobileCall::TMobileCallInfoV3Pckg* paramsPckgV3 =
|
|
2303 |
reinterpret_cast<RMobileCall::TMobileCallInfoV3Pckg*>( aInfo );
|
|
2304 |
RMobileCall::TMobileCallInfoV3& info = ( *paramsPckgV3 )();
|
|
2305 |
|
|
2306 |
// fill specific data
|
|
2307 |
iMmCallExtInterface->FillMobileCallInfoV3( &info );
|
|
2308 |
}
|
|
2309 |
|
|
2310 |
// TMobileCallInfoV7
|
|
2311 |
if ( KEtelExtMultimodeV7 == extensionId ||
|
|
2312 |
KEtelExtMultimodeV8 == extensionId )
|
|
2313 |
{
|
|
2314 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::FillMobileCallInfo - V7");
|
|
2315 |
|
|
2316 |
RMobileCall::TMobileCallInfoV7Pckg* paramsPckgV7 =
|
|
2317 |
reinterpret_cast<RMobileCall::TMobileCallInfoV7Pckg*>( aInfo );
|
|
2318 |
RMobileCall::TMobileCallInfoV7& info = ( *paramsPckgV7 )();
|
|
2319 |
|
|
2320 |
// fill specific data
|
|
2321 |
iMmCallExtInterface->FillMobileCallInfoV7( &info );
|
|
2322 |
}
|
|
2323 |
|
|
2324 |
// TMobileCallInfoV8
|
|
2325 |
if ( KEtelExtMultimodeV8 == extensionId )
|
|
2326 |
{
|
|
2327 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::FillMobileCallInfo - V8");
|
|
2328 |
|
|
2329 |
RMobileCall::TMobileCallInfoV8Pckg* paramsPckgV8 =
|
|
2330 |
reinterpret_cast<RMobileCall::TMobileCallInfoV8Pckg*>( aInfo );
|
|
2331 |
RMobileCall::TMobileCallInfoV8& info = ( *paramsPckgV8 )();
|
|
2332 |
|
|
2333 |
// fill specific data
|
|
2334 |
iMmCallExtInterface->FillMobileCallInfoV8( &info );
|
|
2335 |
}
|
|
2336 |
|
|
2337 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::FillMobileCallInfo end. ret=%d",ret);
|
|
2338 |
|
|
2339 |
return ret;
|
|
2340 |
}
|
|
2341 |
|
|
2342 |
// ---------------------------------------------------------------------------
|
|
2343 |
// CMmVoiceCallTsy::GoOneToOneL
|
|
2344 |
// This method requests a private communication to the remote party of one
|
|
2345 |
// call within a conference call.
|
|
2346 |
// (other items were commented in a header).
|
|
2347 |
// ---------------------------------------------------------------------------
|
|
2348 |
//
|
|
2349 |
TInt CMmVoiceCallTsy::GoOneToOneL(
|
|
2350 |
const TTsyReqHandle aTsyReqHandle )
|
|
2351 |
{
|
|
2352 |
//direct request to the extension
|
|
2353 |
TInt ret( iMmCallExtInterface->GoOneToOneL( iCallId ) );
|
|
2354 |
|
|
2355 |
if ( ret != KErrNone )
|
|
2356 |
{
|
|
2357 |
ReqCompleted( aTsyReqHandle, ret );
|
|
2358 |
}
|
|
2359 |
else
|
|
2360 |
{
|
|
2361 |
//save tsy req handle type
|
|
2362 |
iReqHandleType = EMultimodeCallGoOneToOne;
|
|
2363 |
}
|
|
2364 |
return KErrNone;
|
|
2365 |
}
|
|
2366 |
|
|
2367 |
// ---------------------------------------------------------------------------
|
|
2368 |
// CMmVoiceCallTsy::CompleteGoOneToOne
|
|
2369 |
// This method completes an outstanding asynchronous GoOneToOne request.
|
|
2370 |
// (other items were commented in a header).
|
|
2371 |
// ---------------------------------------------------------------------------
|
|
2372 |
//
|
|
2373 |
void CMmVoiceCallTsy::CompleteGoOneToOne(
|
|
2374 |
TInt aErrorCode )
|
|
2375 |
{
|
|
2376 |
//reset req handle. Returns the deleted req handle
|
|
2377 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->
|
|
2378 |
ResetTsyReqHandle( EMultimodeCallGoOneToOne );
|
|
2379 |
|
|
2380 |
if (KErrNone != aErrorCode)
|
|
2381 |
{
|
|
2382 |
CMmConferenceCallTsy* mmConference = iMmPhone->ConferenceCall();
|
|
2383 |
CMmConferenceCallExtInterface* confCallExt =
|
|
2384 |
mmConference->GetActiveConferenceCallExtension();
|
|
2385 |
if ( confCallExt )
|
|
2386 |
{
|
|
2387 |
// This cast is safe: As we are here in GSM/WCDMA Call
|
|
2388 |
// extension, we know that the active Conference Call
|
|
2389 |
// extension is also GSM/WCDMA
|
|
2390 |
static_cast<CMmConferenceCallGsmWcdmaExt*>( confCallExt )->
|
|
2391 |
SetGoOneToOneHandlingStarted( EFalse, iCallId );
|
|
2392 |
}
|
|
2393 |
}
|
|
2394 |
|
|
2395 |
if ( EMultimodeCallReqHandleUnknown != reqHandle )
|
|
2396 |
{
|
|
2397 |
ReqCompleted( reqHandle, aErrorCode );
|
|
2398 |
}
|
|
2399 |
}
|
|
2400 |
|
|
2401 |
// ---------------------------------------------------------------------------
|
|
2402 |
// CMmVoiceCallTsy::CompleteHold
|
|
2403 |
// Complete the ongoing hold request.
|
|
2404 |
// (other items were commented in a header).
|
|
2405 |
// ---------------------------------------------------------------------------
|
|
2406 |
//
|
|
2407 |
void CMmVoiceCallTsy::CompleteHold(
|
|
2408 |
TInt aResult )
|
|
2409 |
{
|
|
2410 |
//reset req handle. Returns the deleted req handle
|
|
2411 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->
|
|
2412 |
ResetTsyReqHandle( EMultimodeMobileCallHold );
|
|
2413 |
|
|
2414 |
if ( EMultimodeCallReqHandleUnknown != reqHandle )
|
|
2415 |
{
|
|
2416 |
ReqCompleted( reqHandle, aResult );
|
|
2417 |
}
|
|
2418 |
}
|
|
2419 |
|
|
2420 |
// ---------------------------------------------------------------------------
|
|
2421 |
// CMmVoiceCallTsy::CompleteResume
|
|
2422 |
// Complete the ongoing resume request.
|
|
2423 |
// (other items were commented in a header).
|
|
2424 |
// ---------------------------------------------------------------------------
|
|
2425 |
//
|
|
2426 |
void CMmVoiceCallTsy::CompleteResume(
|
|
2427 |
TInt aResult )
|
|
2428 |
{
|
|
2429 |
//reset req handle. Returns the deleted req handle
|
|
2430 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->
|
|
2431 |
ResetTsyReqHandle( EMultimodeMobileCallResume );
|
|
2432 |
|
|
2433 |
if ( EMultimodeCallReqHandleUnknown != reqHandle )
|
|
2434 |
{
|
|
2435 |
// The Call Server has rejected the retrieve request
|
|
2436 |
ReqCompleted( reqHandle, aResult );
|
|
2437 |
}
|
|
2438 |
}
|
|
2439 |
|
|
2440 |
// ---------------------------------------------------------------------------
|
|
2441 |
// CMmVoiceCallTsy::CompleteResume
|
|
2442 |
// Complete the ongoing swap request.
|
|
2443 |
// (other items were commented in a header).
|
|
2444 |
// ---------------------------------------------------------------------------
|
|
2445 |
//
|
|
2446 |
void CMmVoiceCallTsy::CompleteSwap(
|
|
2447 |
TInt aResult )
|
|
2448 |
{
|
|
2449 |
//reset req handle. Returns the deleted req handle
|
|
2450 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->
|
|
2451 |
ResetTsyReqHandle( EMultimodeMobileCallSwap );
|
|
2452 |
|
|
2453 |
if ( EMultimodeCallReqHandleUnknown != reqHandle )
|
|
2454 |
{
|
|
2455 |
TFLOGSTRING2("TSY: Swap complete, Call ID: %d", iCallId );
|
|
2456 |
ReqCompleted( reqHandle, aResult );
|
|
2457 |
}
|
|
2458 |
(reinterpret_cast<CMmVoiceLineTsy*>( iMmLine ))->
|
|
2459 |
SetSwapStatus( CMmVoiceLineTsy::EStatusSwapNotRequested );
|
|
2460 |
}
|
|
2461 |
|
|
2462 |
// ---------------------------------------------------------------------------
|
|
2463 |
// CMmVoiceCallTsy::SetEmergencyMode
|
|
2464 |
// Call mode may change during call creation.
|
|
2465 |
// (other items were commented in a header).
|
|
2466 |
// ---------------------------------------------------------------------------
|
|
2467 |
//
|
|
2468 |
void CMmVoiceCallTsy::SetEmergencyMode(
|
|
2469 |
TBool aIsEmergency )
|
|
2470 |
{
|
|
2471 |
//Call mode may change during call creation.
|
|
2472 |
iEmergencyCall = aIsEmergency;
|
|
2473 |
}
|
|
2474 |
|
|
2475 |
// ---------------------------------------------------------------------------
|
|
2476 |
// CMmVoiceCallTsy::IsEmergencyCall
|
|
2477 |
// Is this call an emergency call.
|
|
2478 |
// (other items were commented in a header).
|
|
2479 |
// ---------------------------------------------------------------------------
|
|
2480 |
//
|
|
2481 |
TBool CMmVoiceCallTsy::IsEmergencyCall() const
|
|
2482 |
{
|
|
2483 |
//TRUE if emergency call, otherwise FALSE
|
|
2484 |
return iEmergencyCall;
|
|
2485 |
}
|
|
2486 |
|
|
2487 |
#ifdef REQHANDLE_TIMER
|
|
2488 |
// ---------------------------------------------------------------------------
|
|
2489 |
// CMmVoiceCallTsy::SetTypeOfResponse
|
|
2490 |
// Sets the type of response for a given Handle. Automatic mode includes an
|
|
2491 |
// automatic response in case of non response from the Domestic OS Layer in a
|
|
2492 |
// specified time.
|
|
2493 |
// (other items were commented in a header).
|
|
2494 |
// ---------------------------------------------------------------------------
|
|
2495 |
//
|
|
2496 |
void CMmVoiceCallTsy::SetTypeOfResponse(
|
|
2497 |
const TInt aReqHandleType,
|
|
2498 |
const TTsyReqHandle aTsyReqHandle )
|
|
2499 |
{
|
|
2500 |
//Sets the type of response for a given Handle. Automatic mode includes an
|
|
2501 |
//automatic response in case of non response from the DOS in a specified
|
|
2502 |
//time.
|
|
2503 |
TInt timeOut( 0 );
|
|
2504 |
|
|
2505 |
//example switch
|
|
2506 |
switch ( aReqHandleType )
|
|
2507 |
{
|
|
2508 |
case EMultimodeCallDial:
|
|
2509 |
case EMultimodeCallDialISV:
|
|
2510 |
case EMultimodeCallDialNoFdnCheck:
|
|
2511 |
timeOut = KMmCallDialTimeOut;
|
|
2512 |
break;
|
|
2513 |
case EMultimodeCallAnswer:
|
|
2514 |
case EMultimodeCallAnswerISV:
|
|
2515 |
timeOut = KMmCallAnswerTimeOut;
|
|
2516 |
break;
|
|
2517 |
case EMultimodeCallHangUp:
|
|
2518 |
timeOut = KMmCallHangUpTimeOut;
|
|
2519 |
break;
|
|
2520 |
case EMultimodeMobileCallHold:
|
|
2521 |
timeOut = KMmCallHoldTimeOut;
|
|
2522 |
break;
|
|
2523 |
case EMultimodeMobileCallResume:
|
|
2524 |
timeOut = KMmCallResumeTimeOut;
|
|
2525 |
break;
|
|
2526 |
case EMultimodeMobileCallSwap:
|
|
2527 |
timeOut = KMmCallSwapTimeOut;
|
|
2528 |
break;
|
|
2529 |
case EMultimodeMobileCallDeflectCall:
|
|
2530 |
timeOut = KMmCallSwapTimeOut;
|
|
2531 |
break;
|
|
2532 |
case EMultimodeMobileCallDialEmergencyCall:
|
|
2533 |
timeOut = KMmCallDialEmergencyCallTimeOut;
|
|
2534 |
break;
|
|
2535 |
case EMultimodeCallTransfer:
|
|
2536 |
timeOut = KMmCallTransferTimeOut;
|
|
2537 |
break;
|
|
2538 |
case EMultimodeCallGoOneToOne:
|
|
2539 |
timeOut = KMmCallGoOneToOneTimeOut;
|
|
2540 |
break;
|
|
2541 |
//Can't use timer:
|
|
2542 |
// - all notifications
|
|
2543 |
//case EMultimodeCallNotifyStatusChange:
|
|
2544 |
//case EMultimodeCallNotifyDurationChange:
|
|
2545 |
//case EMultimodeCallCapsChangeNotification:
|
|
2546 |
//case EMultimodeCallNotifyMobileCallStatusChange:
|
|
2547 |
//case EMultimodeCallNotifyCallEvent:
|
|
2548 |
//case EMultimodeCallNotifyRemotePartyInfoChange:
|
|
2549 |
//case EMultimodeCallNotifyMobileCallCapsChange:
|
|
2550 |
//case EMultimodeCallNotifyDataCallCapsChange:
|
|
2551 |
//case EMultimodeCallNotifyHscsdInfoChange:
|
|
2552 |
//case EMultimodeCallNotifyPrivacyConfirmation:
|
|
2553 |
//case EMobileCallReceiveUUI:
|
|
2554 |
|
|
2555 |
case EMultimodeCallSetDynamicHscsdParams:
|
|
2556 |
default:
|
|
2557 |
//does not use timer
|
|
2558 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
2559 |
aReqHandleType, aTsyReqHandle );
|
|
2560 |
break;
|
|
2561 |
}
|
|
2562 |
|
|
2563 |
if ( timeOut > 0 )
|
|
2564 |
{
|
|
2565 |
//the timeout parameter is given in seconds.
|
|
2566 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
2567 |
aReqHandleType, aTsyReqHandle, timeOut );
|
|
2568 |
}
|
|
2569 |
|
|
2570 |
}
|
|
2571 |
|
|
2572 |
// ---------------------------------------------------------------------------
|
|
2573 |
// CMmVoiceCallTsy::Complete
|
|
2574 |
// Completes the request due timer expiration
|
|
2575 |
// (other items were commented in a header).
|
|
2576 |
// ---------------------------------------------------------------------------
|
|
2577 |
//
|
|
2578 |
void CMmVoiceCallTsy::Complete(
|
|
2579 |
TInt aReqHandleType,
|
|
2580 |
TInt aError )
|
|
2581 |
{
|
|
2582 |
//All possible TSY req handle types are listed in the
|
|
2583 |
//switch case below.
|
|
2584 |
switch( aReqHandleType )
|
|
2585 |
{
|
|
2586 |
//cases handled with automatic completion
|
|
2587 |
case EMultimodeMobileCallHold:
|
|
2588 |
CompleteHold( aError );
|
|
2589 |
break;
|
|
2590 |
case EMultimodeMobileCallResume:
|
|
2591 |
CompleteResume( aError );
|
|
2592 |
break;
|
|
2593 |
case EMultimodeMobileCallSwap:
|
|
2594 |
CompleteSwap( aError );
|
|
2595 |
break;
|
|
2596 |
case EMultimodeMobileCallDialEmergencyCall:
|
|
2597 |
CompleteDialEmergencyCall( aError );
|
|
2598 |
break;
|
|
2599 |
case EMultimodeCallGoOneToOne:
|
|
2600 |
CompleteGoOneToOne( aError );
|
|
2601 |
break;
|
|
2602 |
|
|
2603 |
//Can't use timer:
|
|
2604 |
// - all notifications
|
|
2605 |
//case EMultimodeCallNotifyStatusChange:
|
|
2606 |
//case EMultimodeCallNotifyDurationChange:
|
|
2607 |
//case EMultimodeCallCapsChangeNotification:
|
|
2608 |
//case EMultimodeCallNotifyMobileCallStatusChange:
|
|
2609 |
//case EMultimodeCallNotifyCallEvent:
|
|
2610 |
//case EMultimodeCallNotifyRemotePartyInfoChange:
|
|
2611 |
//case EMultimodeCallNotifyMobileCallCapsChange:
|
|
2612 |
//case EMultimodeCallNotifyDataCallCapsChange:
|
|
2613 |
//case EMultimodeCallNotifyHscsdInfoChange:
|
|
2614 |
//case EMultimodeCallNotifyPrivacyConfirmation:
|
|
2615 |
//case EMobileCallReceiveUUI:
|
|
2616 |
|
|
2617 |
case EMultimodeCallDial:
|
|
2618 |
case EMultimodeCallDialNoFdnCheck:
|
|
2619 |
case EMultimodeCallDialISV:
|
|
2620 |
case EMultimodeCallAnswer:
|
|
2621 |
case EMultimodeCallAnswerISV:
|
|
2622 |
case EMultimodeCallHangUp:
|
|
2623 |
case EMultimodeMobileCallDeflectCall:
|
|
2624 |
case EMultimodeCallTransfer:
|
|
2625 |
case EMultimodeCallSetDynamicHscsdParams:
|
|
2626 |
default:
|
|
2627 |
{
|
|
2628 |
CMmCallTsy::Complete( aReqHandleType, aError );
|
|
2629 |
break;
|
|
2630 |
}
|
|
2631 |
}
|
|
2632 |
}
|
|
2633 |
#endif
|
|
2634 |
|
|
2635 |
// ---------------------------------------------------------------------------
|
|
2636 |
// CMmVoiceCallTsy::GetBearerServiceInfo
|
|
2637 |
// Get bearer service info.
|
|
2638 |
// (other items were commented in a header).
|
|
2639 |
// ---------------------------------------------------------------------------
|
|
2640 |
//
|
|
2641 |
TInt CMmVoiceCallTsy::GetBearerServiceInfo(
|
|
2642 |
const TTsyReqHandle,
|
|
2643 |
RCall::TBearerService* )
|
|
2644 |
{
|
|
2645 |
return KErrNotSupported;
|
|
2646 |
}
|
|
2647 |
|
|
2648 |
// ---------------------------------------------------------------------------
|
|
2649 |
// CMmVoiceCallTsy::Connect
|
|
2650 |
// Set correct data call attributes, depending on parameter extension.
|
|
2651 |
// (other items were commented in a header).
|
|
2652 |
// ---------------------------------------------------------------------------
|
|
2653 |
//
|
|
2654 |
TInt CMmVoiceCallTsy::Connect(
|
|
2655 |
const TTsyReqHandle,
|
|
2656 |
const TDesC8* )
|
|
2657 |
{
|
|
2658 |
return KErrNotSupported;
|
|
2659 |
}
|
|
2660 |
|
|
2661 |
// ---------------------------------------------------------------------------
|
|
2662 |
// CMmVoiceCallTsy::ConnectChancel
|
|
2663 |
// Cancels connecting of a (data) call (Not Supported).
|
|
2664 |
// (other items were commented in a header).
|
|
2665 |
// ---------------------------------------------------------------------------
|
|
2666 |
//
|
|
2667 |
TInt CMmVoiceCallTsy::ConnectCancel(
|
|
2668 |
const TTsyReqHandle )
|
|
2669 |
{
|
|
2670 |
return KErrNotSupported;
|
|
2671 |
}
|
|
2672 |
|
|
2673 |
// ---------------------------------------------------------------------------
|
|
2674 |
// CMmVoiceCallTsy::LoanDataPort
|
|
2675 |
// This CORE API method loans dataport to client.
|
|
2676 |
// (other items were commented in a header).
|
|
2677 |
// ---------------------------------------------------------------------------
|
|
2678 |
//
|
|
2679 |
TInt CMmVoiceCallTsy::LoanDataPort(
|
|
2680 |
const TTsyReqHandle,
|
|
2681 |
RCall::TCommPort* )
|
|
2682 |
{
|
|
2683 |
return KErrNotSupported;
|
|
2684 |
}
|
|
2685 |
|
|
2686 |
// ---------------------------------------------------------------------------
|
|
2687 |
// CMmVoiceCallTsy::LoanDataPortCancel
|
|
2688 |
// Cancels dataport loaning to client. LoanDataPort always
|
|
2689 |
// completes immediately, this is never used.
|
|
2690 |
// (other items were commented in a header).
|
|
2691 |
// ---------------------------------------------------------------------------
|
|
2692 |
//
|
|
2693 |
TInt CMmVoiceCallTsy::LoanDataPortCancel(
|
|
2694 |
const TTsyReqHandle )
|
|
2695 |
{
|
|
2696 |
return KErrNotSupported;
|
|
2697 |
}
|
|
2698 |
|
|
2699 |
// ---------------------------------------------------------------------------
|
|
2700 |
// CMmVoiceCallTsy::RecoverDataPort
|
|
2701 |
// This CORE API method recovers dataport from client.
|
|
2702 |
// (other items were commented in a header).
|
|
2703 |
// ---------------------------------------------------------------------------
|
|
2704 |
//
|
|
2705 |
TInt CMmVoiceCallTsy::RecoverDataPort(
|
|
2706 |
const TTsyReqHandle )
|
|
2707 |
{
|
|
2708 |
return KErrNotSupported;
|
|
2709 |
}
|
|
2710 |
|
|
2711 |
// ---------------------------------------------------------------------------
|
|
2712 |
// CMmVoiceCallTsy::RecoverDataPortAndRelinquishOwnership
|
|
2713 |
// Recovers dataport from client and relinquishes ownership.
|
|
2714 |
// (other items were commented in a header).
|
|
2715 |
// ---------------------------------------------------------------------------
|
|
2716 |
//
|
|
2717 |
TInt CMmVoiceCallTsy::RecoverDataPortAndRelinquishOwnership()
|
|
2718 |
{
|
|
2719 |
return KErrNotSupported;
|
|
2720 |
}
|
|
2721 |
|
|
2722 |
// ---------------------------------------------------------------------------
|
|
2723 |
// CMmVoiceCallTsy::Complete3rdPartyCallNbrCheck
|
|
2724 |
// Completes emergency number check for 3rd party clients
|
|
2725 |
// Decides if dial can be done
|
|
2726 |
// (other items were commented in a header).
|
|
2727 |
// ---------------------------------------------------------------------------
|
|
2728 |
//
|
|
2729 |
void CMmVoiceCallTsy::Complete3rdPartyCallNbrCheck( TBool aIsEmergencyNbr )
|
|
2730 |
{
|
|
2731 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::Complete3rdPartyCallNbrCheck " );
|
|
2732 |
|
|
2733 |
if( i3rdPartyEmergencyNumberCheckDone )
|
|
2734 |
{
|
|
2735 |
if( aIsEmergencyNbr )
|
|
2736 |
{
|
|
2737 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::Complete3rdPartyCallNbrCheck - Emergency number" );
|
|
2738 |
CompleteDial( KErrNotSupported );
|
|
2739 |
i3rdPartyEmergencyNumberCheckDone = EFalse;
|
|
2740 |
}
|
|
2741 |
else
|
|
2742 |
{
|
|
2743 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::Complete3rdPartyCallNbrCheck - NOT Emergency nbr - DIAL" );
|
|
2744 |
i3rdPartyEmergencyNumberCheckDone = ETrue;
|
|
2745 |
iIsDialISV = ETrue;
|
|
2746 |
|
|
2747 |
TTsyReqHandle reqHandle = iTsyReqHandleStore->
|
|
2748 |
GetTsyReqHandle( EMultimodeCallDialISV );
|
|
2749 |
|
|
2750 |
TInt ret = Dial( reqHandle, iISVCallParams,
|
|
2751 |
&iNumberCheckMode.iNumber );
|
|
2752 |
|
|
2753 |
if( KErrNone == ret )
|
|
2754 |
{
|
|
2755 |
//Dial is made reset
|
|
2756 |
i3rdPartyEmergencyNumberCheckDone = EFalse;
|
|
2757 |
iISVCallParams = NULL;
|
|
2758 |
}
|
|
2759 |
}
|
|
2760 |
|
|
2761 |
}
|
|
2762 |
else
|
|
2763 |
{
|
|
2764 |
CompleteDial( KErrGeneral );
|
|
2765 |
}
|
|
2766 |
|
|
2767 |
}
|
|
2768 |
|
|
2769 |
// ---------------------------------------------------------------------------
|
|
2770 |
// CMmVoiceCallTsy::DialNoFdnCheck
|
|
2771 |
// This method makes a call without fdn check
|
|
2772 |
// (other items were commented in a header).
|
|
2773 |
// ---------------------------------------------------------------------------
|
|
2774 |
//
|
|
2775 |
TInt CMmVoiceCallTsy::DialNoFdnCheck(
|
|
2776 |
const TTsyReqHandle aTsyReqHandle,
|
|
2777 |
const TDesC8* aCallParams,
|
|
2778 |
TDesC* aTelNumber )
|
|
2779 |
{
|
|
2780 |
TFLOGSTRING3("TSY: CMmVoiceCallTsy::DialNoFdnCheck. Req handle: %d, Call name: %S", aTsyReqHandle, &iCallName );
|
|
2781 |
TInt ret( KErrGeneral );
|
|
2782 |
|
|
2783 |
// Check that there is no dial on going for another call
|
|
2784 |
CMmCallList* callList = iMmPhone->CallList();
|
|
2785 |
|
|
2786 |
TBool dialFlag( EFalse );
|
|
2787 |
|
|
2788 |
for ( TInt i=0; i< callList->GetNumberOfObjects();i++ )
|
|
2789 |
{
|
|
2790 |
CMmCallTsy* call = callList->GetMmCallByIndex( i );
|
|
2791 |
|
|
2792 |
if( call->GetDialFlag() )
|
|
2793 |
{
|
|
2794 |
dialFlag = ETrue;
|
|
2795 |
i = callList->GetNumberOfObjects();
|
|
2796 |
}
|
|
2797 |
}
|
|
2798 |
|
|
2799 |
if( !dialFlag )
|
|
2800 |
{
|
|
2801 |
ret = KErrNone;
|
|
2802 |
SetDialFlag( ETrue );
|
|
2803 |
|
|
2804 |
RMobileCall::TMobileCallParamsV1Pckg* paramsPckgV1 = NULL;
|
|
2805 |
|
|
2806 |
if ( 0 < aCallParams->Length() )
|
|
2807 |
{
|
|
2808 |
paramsPckgV1 =
|
|
2809 |
reinterpret_cast<RMobileCall::TMobileCallParamsV1Pckg*>(
|
|
2810 |
const_cast<TDesC8*>( aCallParams ) );
|
|
2811 |
}
|
|
2812 |
else
|
|
2813 |
{
|
|
2814 |
iCallParams.iSpeakerControl =
|
|
2815 |
RCall::EMonitorSpeakerControlOnUntilCarrier;
|
|
2816 |
iCallParams.iSpeakerVolume = RCall::EMonitorSpeakerVolumeLow;
|
|
2817 |
iCallParams.iInterval = 0;
|
|
2818 |
iCallParams.iWaitForDialTone = RCall::EDialToneWait;
|
|
2819 |
iCallParams.iIdRestrict = RMobileCall::EIdRestrictDefault;
|
|
2820 |
iCallParams.iCug.iExplicitInvoke = EFalse;
|
|
2821 |
iCallParams.iCug.iCugIndex = 0xFFFF;
|
|
2822 |
iCallParams.iCug.iSuppressPrefCug = EFalse;
|
|
2823 |
iCallParams.iCug.iSuppressOA = EFalse;
|
|
2824 |
iCallParams.iAutoRedial = EFalse;
|
|
2825 |
|
|
2826 |
paramsPckgV1 = &iCallParamsPckg;
|
|
2827 |
}
|
|
2828 |
|
|
2829 |
RMobileCall::TMobileCallParamsV1& paramsV1 = ( *paramsPckgV1 )();
|
|
2830 |
|
|
2831 |
SetDialTypeId( KMultimodeCallTypeIDNoFdnCheck );
|
|
2832 |
|
|
2833 |
if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() )
|
|
2834 |
{
|
|
2835 |
TFLOGSTRING("TSY: Offline mode ON, DialNoFdnCheck request is not allowed" );
|
|
2836 |
ret = CMmCommonStaticUtility::EpocErrorCode(
|
|
2837 |
KErrGeneral, KErrGsmOfflineOpNotAllowed );
|
|
2838 |
|
|
2839 |
// Complete the request with appropiate error
|
|
2840 |
ReqCompleted ( aTsyReqHandle, ret );
|
|
2841 |
SetDialFlag(EFalse);
|
|
2842 |
}
|
|
2843 |
// Check that status is Idle
|
|
2844 |
else if ( RMobileCall::EStatusIdle != iMobileCallStatus )
|
|
2845 |
{
|
|
2846 |
//The request cannot be forwarded since this call object
|
|
2847 |
//is still in use.
|
|
2848 |
//Complete request with status value informing the client about
|
|
2849 |
//the situation.
|
|
2850 |
TFLOGSTRING("TSY: CMmVoiceCallTsy::DialNoFdnCheck - KErrNotReady");
|
|
2851 |
ReqCompleted( aTsyReqHandle, KErrNotReady );
|
|
2852 |
SetDialFlag(EFalse);
|
|
2853 |
}
|
|
2854 |
else
|
|
2855 |
{
|
|
2856 |
// Save call params
|
|
2857 |
iCallParams.iSpeakerControl = paramsV1.iSpeakerControl;
|
|
2858 |
iCallParams.iSpeakerVolume = paramsV1.iSpeakerVolume;
|
|
2859 |
iCallParams.iInterval = paramsV1.iInterval;
|
|
2860 |
iCallParams.iWaitForDialTone = paramsV1.iWaitForDialTone;
|
|
2861 |
|
|
2862 |
// Set call direction
|
|
2863 |
iCallDirection = RMobileCall::EMobileOriginated;
|
|
2864 |
// Dial
|
|
2865 |
TRAPD(err, ret = iMmCallExtInterface->DialL(
|
|
2866 |
iCallMode, paramsPckgV1, aTelNumber,
|
|
2867 |
KMultimodeCallTypeIDNoFdnCheck ));
|
|
2868 |
|
|
2869 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::DialNoFdnCheck ret = %d", ret);
|
|
2870 |
if(err != KErrNone)
|
|
2871 |
{
|
|
2872 |
ret = err;
|
|
2873 |
}
|
|
2874 |
|
|
2875 |
if ( KErrNone == ret )
|
|
2876 |
{
|
|
2877 |
UpdateCallRoutingControl( iCallName, iMobileCallStatus );
|
|
2878 |
|
|
2879 |
// Update core status
|
|
2880 |
iCallCaps.iFlags &= ~( RCall::KCapsDial );
|
|
2881 |
iCallCaps.iFlags |= RCall::KCapsHangUp;
|
|
2882 |
// Complete core caps change
|
|
2883 |
CompleteNotifyCapsChange();
|
|
2884 |
|
|
2885 |
#ifdef REQHANDLE_TIMER
|
|
2886 |
// Set timer for the dialnofdncheck request
|
|
2887 |
SetTypeOfResponse( EMultimodeCallDialNoFdnCheck,
|
|
2888 |
aTsyReqHandle );
|
|
2889 |
#else
|
|
2890 |
|
|
2891 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
2892 |
EMultimodeCallDialNoFdnCheck, aTsyReqHandle );
|
|
2893 |
#endif
|
|
2894 |
}
|
|
2895 |
else
|
|
2896 |
{
|
|
2897 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::DialNoFdnCheck Before ReqCompleted ret = %d", ret);
|
|
2898 |
ReqCompleted( aTsyReqHandle, ret );
|
|
2899 |
ClearCallStatus();
|
|
2900 |
SetDialFlag(EFalse);
|
|
2901 |
}
|
|
2902 |
}
|
|
2903 |
|
|
2904 |
}
|
|
2905 |
else
|
|
2906 |
return KErrServerBusy;
|
|
2907 |
|
|
2908 |
return KErrNone;
|
|
2909 |
}
|
|
2910 |
|
|
2911 |
|
|
2912 |
// ---------------------------------------------------------------------------
|
|
2913 |
// CMmVoiceCallTsy::SsmPluginCallback
|
|
2914 |
// This is callback
|
|
2915 |
// This method is called from CMmCallGsmWcdmaExt, after
|
|
2916 |
// sendinig request to LTSY
|
|
2917 |
// ---------------------------------------------------------------------------
|
|
2918 |
//
|
|
2919 |
void CMmVoiceCallTsy::SsmPluginCallback(TInt aResult, TCtsySsmCallbackData& aCallbackData)
|
|
2920 |
{
|
|
2921 |
if ( KErrNone != aResult )
|
|
2922 |
{
|
|
2923 |
// first of all cancel
|
|
2924 |
// possible request to SSM. It will do nothing if there is no request to SSM
|
|
2925 |
|
|
2926 |
TRfStateInfo stateInfo = Phone()->GetRfStateInfo();
|
|
2927 |
if (ERfsStateInfoNormal != stateInfo)
|
|
2928 |
{
|
|
2929 |
TCtsySsmCallbackData dummyData;
|
|
2930 |
reinterpret_cast<CMmCallGsmWcdmaExt*>
|
|
2931 |
( iMmCallExtInterface )->SetRfState(ERfsStateInfoInactive,
|
|
2932 |
reinterpret_cast<CMmCallGsmWcdmaExt*>( iMmCallExtInterface ),
|
|
2933 |
dummyData);
|
|
2934 |
}
|
|
2935 |
|
|
2936 |
// Then we should check if iReqHandleType was sent
|
|
2937 |
TTsyReqHandle tsyReqHandle = iTsyReqHandleStore->GetTsyReqHandle( EMultimodeMobileCallDialEmergencyCall );
|
|
2938 |
if (EMultimodeCallReqHandleUnknown != tsyReqHandle)
|
|
2939 |
{
|
|
2940 |
//here it means that there do was successful request to LTSY
|
|
2941 |
// and we have to cancel request to LTSY (following code is from DialEmergencyCallCancel)
|
|
2942 |
|
|
2943 |
// it means that we have to cancel request to LTSY
|
|
2944 |
iDialCancelFlag = CMmCallTsy::EDialCancelCallCalled;
|
|
2945 |
// ??? 3 what about tsyReqHandle?
|
|
2946 |
if ( iCallId > 0 || (GetDialFlag()&& iCallStatus!=RMobileCall::EStatusIdle) )
|
|
2947 |
{
|
|
2948 |
HangUp(tsyReqHandle);
|
|
2949 |
}
|
|
2950 |
}
|
|
2951 |
else
|
|
2952 |
{
|
|
2953 |
// we here. It means that there was no successful request to LTSY
|
|
2954 |
iEmergencyCall = EFalse;
|
|
2955 |
|
|
2956 |
// It looks like some error occurs in synchronous branch
|
|
2957 |
|
|
2958 |
// complete request, using regHandle from aCallbackData
|
|
2959 |
if (EMultimodeCallReqHandleUnknown != aCallbackData.iReqHandle)
|
|
2960 |
{
|
|
2961 |
ReqCompleted( aCallbackData.iReqHandle, aResult );
|
|
2962 |
}
|
|
2963 |
aCallbackData.iReqHandle = EMultimodeCallReqHandleUnknown;
|
|
2964 |
ClearCallStatus();
|
|
2965 |
}
|
|
2966 |
}
|
|
2967 |
else
|
|
2968 |
{
|
|
2969 |
// if we here it means that request to LTSY was sent successfully
|
|
2970 |
iEmergencyCall = ETrue;
|
|
2971 |
UpdateCallRoutingControl( iCallName, iMobileCallStatus );
|
|
2972 |
|
|
2973 |
//update core status
|
|
2974 |
iCallCaps.iFlags &= ~( RCall::KCapsDial );
|
|
2975 |
iCallCaps.iFlags |= RCall::KCapsHangUp;
|
|
2976 |
//complete core caps change
|
|
2977 |
CompleteNotifyCapsChange();
|
|
2978 |
|
|
2979 |
// store reqHandle here, just in case of successful sending request to LTSY
|
|
2980 |
#ifdef REQHANDLE_TIMER
|
|
2981 |
SetTypeOfResponse( EMultimodeMobileCallDialEmergencyCall, aCallbackData.iReqHandle );
|
|
2982 |
#else
|
|
2983 |
iTsyReqHandleStore->SetTsyReqHandle(
|
|
2984 |
EMultimodeMobileCallDialEmergencyCall, aCallbackData.iReqHandle );
|
|
2985 |
#endif
|
|
2986 |
|
|
2987 |
}
|
|
2988 |
}
|
|
2989 |
|
|
2990 |
|
|
2991 |
// ---------------------------------------------------------------------------
|
|
2992 |
// CMmVoiceCallTsy::UpdateCallRoutingControl
|
|
2993 |
// Establishes call routing control and updates its state
|
|
2994 |
// (other items were commented in a header).
|
|
2995 |
// ---------------------------------------------------------------------------
|
|
2996 |
//
|
|
2997 |
void CMmVoiceCallTsy::UpdateCallRoutingControl(
|
|
2998 |
const TName& aCallName,
|
|
2999 |
RMobileCall::TMobileCallStatus aMobileCallStatus )
|
|
3000 |
{
|
|
3001 |
if ( iTelephonyAudioControl )
|
|
3002 |
{
|
|
3003 |
if ( iTelephonyAudioControlSetup )
|
|
3004 |
{
|
|
3005 |
iTelephonyAudioControl->CallStateChange( aCallName,
|
|
3006 |
aMobileCallStatus );
|
|
3007 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::UpdateCallRoutingControl. Call routing state changed to EStatusDialling: Call name:%S", &iCallName );
|
|
3008 |
}
|
|
3009 |
else
|
|
3010 |
{
|
|
3011 |
iTelephonyAudioControl->SetupTelephonyAudio(
|
|
3012 |
aCallName,
|
|
3013 |
MTelephonyAudioControl::ECallTypeVoice,
|
|
3014 |
iEmergencyCall,
|
|
3015 |
iCallDirection );
|
|
3016 |
TFLOGSTRING2("TSY: CMmVoiceCallTsy::CMmVoiceCallTsy::UpdateCallRoutingControl. Call routing setup: Call name:%S", &iCallName );
|
|
3017 |
iTelephonyAudioControlSetup = ETrue;
|
|
3018 |
}
|
|
3019 |
}
|
|
3020 |
}
|
|
3021 |
|
|
3022 |
// End of File
|
|
3023 |
|