|
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 "cmmfaxcalltsy.h" |
|
20 #include "cmmfaxlinetsy.h" |
|
21 #include "cmmphonetsy.h" |
|
22 #include "cmmtsyreqhandlestore.h" |
|
23 #include "cmmcalllist.h" |
|
24 #include "CMmCommonStaticUtility.h" |
|
25 #include "MmTsy_numberOfSlots.h" |
|
26 #include "cmmlinelist.h" |
|
27 #include "cmmmessagemanagerbase.h" |
|
28 #include <ctsy/pluginapi/cmmdatapackage.h> |
|
29 #include <ctsy/serviceapi/gsmerror.h> |
|
30 #include "CMmFaxExtInterface.h" |
|
31 #include "cmmcallgsmwcdmaext.h" |
|
32 |
|
33 // ======== MEMBER FUNCTIONS ======== |
|
34 |
|
35 CMmFaxCallTsy::CMmFaxCallTsy() |
|
36 { |
|
37 } |
|
38 |
|
39 CMmFaxCallTsy* CMmFaxCallTsy::NewL( |
|
40 CMmPhoneTsy* aMmPhone, CMmFaxLineTsy* aMmLine, |
|
41 RMobilePhone::TMobileService aMode, |
|
42 TDes& aName, |
|
43 CMmMessageManagerBase* aMessageManager ) |
|
44 { |
|
45 TFLOGSTRING2("TSY: CMmFaxCallTsy::NewL. Call name: %S", &aName); |
|
46 |
|
47 CMmFaxCallTsy* mmCall = NULL; |
|
48 |
|
49 //check input parameters |
|
50 if ( aMmPhone != NULL && aMmLine != NULL && |
|
51 aMode == RMobilePhone::EFaxService ) |
|
52 { |
|
53 mmCall = new( ELeave ) CMmFaxCallTsy; |
|
54 CleanupClosePushL( *mmCall ); |
|
55 mmCall->iMmPhone = aMmPhone; |
|
56 mmCall->iMmLine = aMmLine; |
|
57 mmCall->iCallName = aName; |
|
58 mmCall->iCallMode = aMode; |
|
59 mmCall->iMessageManager = aMessageManager; |
|
60 mmCall->ConstructL( aMode ); |
|
61 CleanupStack::Pop(); |
|
62 } |
|
63 |
|
64 return mmCall; |
|
65 } |
|
66 |
|
67 CMmFaxCallTsy::~CMmFaxCallTsy() |
|
68 { |
|
69 TFLOGSTRING3("TSY: CMmFaxCallTsy::~CMmFaxCallTsy. Call deleted \ |
|
70 iCallId:%d iCallName:%S", iCallId, &iCallName); |
|
71 |
|
72 // If Dial fails, Symbian CSD agent will close the call immediately. |
|
73 // This means that TSY has not yet received call status indications, |
|
74 // where call status changes to idle. Thus responses from modem are |
|
75 // passed to call object. |
|
76 // Here we need to assert that call object recovers dataport |
|
77 // if it is loaned. |
|
78 CCallBase::SetUnowned(); |
|
79 |
|
80 // delete Internal Fax call extension object. |
|
81 if ( iMmFaxExt ) |
|
82 { |
|
83 delete iMmFaxExt; |
|
84 } |
|
85 iMmFaxExt = NULL; |
|
86 |
|
87 // Check if dataport is loaned! |
|
88 if ( iLoanedCommPort.iPort.Compare( KNullDesC) != 0 ) |
|
89 { |
|
90 //Create package |
|
91 CCallDataPackage package; |
|
92 //Set call id and call mode |
|
93 package.SetCallIdAndMode( iCallId, iCallMode ); |
|
94 //Pack commport |
|
95 package.PackData( &iLoanedCommPort ); |
|
96 |
|
97 //Send request to the Domestic OS layer. |
|
98 if( iMessageManager ) |
|
99 { |
|
100 TRAP_IGNORE( |
|
101 iMessageManager->HandleRequestL( |
|
102 EEtelCallRecoverDataPort, &package ); |
|
103 ); |
|
104 } |
|
105 iLoanedCommPort.iCsy.Zero(); |
|
106 iLoanedCommPort.iPort.Zero();; |
|
107 } |
|
108 |
|
109 // If this is iLastIncomingFaxCall, set iLastIncomingFaxCall |
|
110 // of CMmFaxLineTsy to NULL |
|
111 if ( this == (reinterpret_cast<CMmFaxLineTsy*>(iMmLine))->iLastIncomingFaxCall ) |
|
112 { |
|
113 reinterpret_cast<CMmFaxLineTsy*>(iMmLine)->ResetLastIncomingCall(); |
|
114 } |
|
115 } |
|
116 |
|
117 |
|
118 // --------------------------------------------------------------------------- |
|
119 // CMmFaxCallTsy::InitExtensionModulesL |
|
120 // Initialises extension modules for CMmFaxCallTsy |
|
121 // (other items were commented in a header). |
|
122 // --------------------------------------------------------------------------- |
|
123 // |
|
124 void CMmFaxCallTsy::InitExtensionModulesL( |
|
125 RMobilePhone::TMobileService aMode ) |
|
126 { |
|
127 CMmCallTsy::InitExtensionModulesL( aMode ); |
|
128 |
|
129 // Create internal fax call object if this is fax call |
|
130 // TODO: what to do when this is faxmodem fax call?? |
|
131 if ( aMode == RMobilePhone::EFaxService ) |
|
132 { |
|
133 // Internal Fax call extension object creation. |
|
134 iMmFaxExt = CMmFaxExtInterface::NewL( this ); |
|
135 } |
|
136 else |
|
137 { |
|
138 iMmFaxExt = NULL; |
|
139 } |
|
140 } |
|
141 |
|
142 // --------------------------------------------------------------------------- |
|
143 // CMmFaxCallTsy::InitInternalAttributes |
|
144 // Initialises miscellaneous internal attributes. |
|
145 // (other items were commented in a header). |
|
146 // --------------------------------------------------------------------------- |
|
147 // |
|
148 void CMmFaxCallTsy::InitInternalAttributes() |
|
149 { |
|
150 CMmCallTsy::InitInternalAttributes(); |
|
151 |
|
152 iCallCaps.iFlags = RCall::KCapsFax | RCall::KCapsConnect; |
|
153 |
|
154 // Boolean that indicates if this call object is finished data call. |
|
155 // Required as Symbian CSD agent in situation where first data call |
|
156 // fails due wrong number and it then opens second data call, which |
|
157 // dials correct number. Call status notifications go to wrong call |
|
158 // object (the first one) and causes problems for clients. |
|
159 iIsFinishedDataCall = EFalse; |
|
160 |
|
161 //dataport params |
|
162 iLoanedCommPort.iCsy.Zero(); |
|
163 iLoanedCommPort.iPort.Zero();; |
|
164 } |
|
165 |
|
166 // --------------------------------------------------------------------------- |
|
167 // CMmFaxCallTsy::OpenNewObjectByNameL |
|
168 // Creates new Fax object and returns a pointer to it. |
|
169 // (other items were commented in a header). |
|
170 // --------------------------------------------------------------------------- |
|
171 // |
|
172 CTelObject* CMmFaxCallTsy::OpenNewObjectByNameL( |
|
173 const TDesC& aName ) |
|
174 { |
|
175 CTelObject* telObject = NULL; |
|
176 |
|
177 // iMmFaxExt is non null if fax calls are supported |
|
178 if ( iMmFaxExt ) |
|
179 { |
|
180 telObject = iMmFaxExt->OpenNewObjectByNameL(aName); |
|
181 } |
|
182 else |
|
183 { |
|
184 //Not supported |
|
185 User::Leave( KErrNotSupported ); |
|
186 } |
|
187 |
|
188 return telObject; |
|
189 } |
|
190 |
|
191 // --------------------------------------------------------------------------- |
|
192 // CMmFaxCallTsy::DoExtFuncL |
|
193 // DoExtFuncL is called by the Etel server when it has an "extended", i.e. |
|
194 // non-core ETel request for the TSY. To process a request handle, request |
|
195 // type and request data are passed to the TSY. |
|
196 // (other items were commented in a header). |
|
197 // --------------------------------------------------------------------------- |
|
198 // |
|
199 TInt CMmFaxCallTsy::DoExtFuncL( |
|
200 const TTsyReqHandle aTsyReqHandle, |
|
201 const TInt aIpc, |
|
202 const TDataPackage& aPackage ) |
|
203 { |
|
204 TFLOGSTRING3("TSY: CMmFaxCallTsy::DoExtFuncL. IPC:%d Handle:%d", aIpc, |
|
205 aTsyReqHandle); |
|
206 |
|
207 TInt ret( KErrNone ); |
|
208 |
|
209 TAny* dataPtr = aPackage.Ptr1(); |
|
210 |
|
211 // The request data has to extracted from TDataPackage and the TAny* |
|
212 // pointers have to be "cast" to the expected request data type |
|
213 |
|
214 // NOTE! Do not put any Cancel methods here. |
|
215 switch ( aIpc ) |
|
216 { |
|
217 // Call Status |
|
218 // Get Call Status |
|
219 case EMobileCallGetMobileCallStatus: |
|
220 ret = GetMobileCallStatus( aTsyReqHandle, |
|
221 reinterpret_cast<RMobileCall::TMobileCallStatus*> |
|
222 ( dataPtr ) ); |
|
223 break; |
|
224 // Notify Call Status Change |
|
225 case EMobileCallNotifyMobileCallStatusChange: |
|
226 ret = NotifyMobileCallStatusChange( |
|
227 reinterpret_cast<RMobileCall::TMobileCallStatus*> |
|
228 ( dataPtr ) ); |
|
229 break; |
|
230 // Notify Call Event |
|
231 case EMobileCallNotifyCallEvent: |
|
232 ret = NotifyCallEvent( |
|
233 reinterpret_cast<RMobileCall::TMobileCallEvent*>( dataPtr ) ); |
|
234 break; |
|
235 // Call Control |
|
236 // Get Call Capabilities |
|
237 case EMobileCallGetMobileCallCaps: |
|
238 ret = GetMobileCallCaps( aTsyReqHandle, aPackage.Des1n() ); |
|
239 break; |
|
240 |
|
241 //Notify Call Capabilities Change |
|
242 case EMobileCallNotifyMobileCallCapsChange: |
|
243 ret = NotifyMobileCallCapsChange(aPackage.Des1n() ); |
|
244 break; |
|
245 |
|
246 // Call Information |
|
247 // Get Mobile Call Information |
|
248 case EMobileCallGetMobileCallInfo: |
|
249 ret = GetMobileCallInfo( aTsyReqHandle, aPackage.Des1n() ); |
|
250 break; |
|
251 // Notify Change of Remote Party Information |
|
252 case EMobileCallNotifyRemotePartyInfoChange: |
|
253 ret = NotifyRemotePartyInfoChange( |
|
254 reinterpret_cast<RMobileCall::TMobileCallRemotePartyInfoV1Pckg*>( |
|
255 aPackage.Des1n()) ); |
|
256 break; |
|
257 // Order to notify if privacy is confirmed |
|
258 case EMobileCallNotifyPrivacyConfirmation: |
|
259 ret = NotifyPrivacyConfirmation( |
|
260 reinterpret_cast<RMobilePhone::TMobilePhonePrivacy*>( |
|
261 dataPtr ) ); |
|
262 break; |
|
263 // Unsupported features |
|
264 case EMobileCallDialEmergencyCall: |
|
265 case EMobileCallHold: |
|
266 case EMobileCallResume: |
|
267 case EMobileCallSwap: |
|
268 case EMobileCallGoOneToOne: |
|
269 case EMobileCallGetMobileDataCallCaps: |
|
270 case EMobileCallNotifyMobileDataCallCapsChange: |
|
271 case EMobileCallGetMobileDataCallRLPRange: |
|
272 case EMobileCallSetDynamicHscsdParams: |
|
273 case EMobileCallGetCurrentHscsdInfo: |
|
274 case EMobileCallNotifyHscsdInfoChange: |
|
275 case EMobileCallSwitchAlternatingCall: |
|
276 case EMobileCallNotifyAlternatingCallSwitch: |
|
277 case EMobileCallSetPrivacy: |
|
278 case EMobileCallSetTrafficChannel: |
|
279 case EMobileCallNotifyTrafficChannelConfirmation: |
|
280 case EMobileCallGetUUSCaps: |
|
281 case EMobileCallNotifyUUSCapsChange: |
|
282 case EMobileCallActivateUUS: |
|
283 case EMobileCallSendUUI: |
|
284 case EMobileCallReceiveUUI: |
|
285 case EMobileCallHangupWithUUI: |
|
286 case EMobileCallAnswerWithUUI: |
|
287 case EMobileCallNotifyVoiceFallback: |
|
288 case EMobileCallDeflect: |
|
289 case EMobileCallActivateCCBS: |
|
290 case EMobileCallRejectCCBS: |
|
291 default: |
|
292 ret = KErrNotSupported; |
|
293 break; |
|
294 } |
|
295 |
|
296 return ret; |
|
297 } |
|
298 |
|
299 // --------------------------------------------------------------------------- |
|
300 // CMmFaxCallTsy::ReqModeL |
|
301 // ReqModeL is called from the ETel server's CTelObject::ReqAnalyserL in |
|
302 // order to check the type of request it has. |
|
303 // (other items were commented in a header). |
|
304 // --------------------------------------------------------------------------- |
|
305 // |
|
306 CTelObject::TReqMode CMmFaxCallTsy::ReqModeL( |
|
307 const TInt aIpc ) |
|
308 { |
|
309 TFLOGSTRING2("TSY: CMmFaxCallTsy::ReqModeL. IPC:%d",aIpc); |
|
310 |
|
311 CTelObject::TReqMode ret( 0 ); // default return value |
|
312 |
|
313 switch ( aIpc ) |
|
314 { |
|
315 //No Flow Control |
|
316 //All disabled |
|
317 //TSYs wishing to implement their own buffering algorithm will place |
|
318 //all requests in this category. |
|
319 //This category will also be used by the RecoverDataPort request that |
|
320 //must be passed to the TSY to indicate that it may use the |
|
321 //communications port after a loan. |
|
322 |
|
323 //Get methods that do not use DOS and return immediately. |
|
324 //Flow control not required. |
|
325 case EEtelCallGetInfo: |
|
326 case EEtelCallGetStatus: |
|
327 case EEtelCallGetCaps: |
|
328 case EEtelCallGetBearerServiceInfo: |
|
329 case EEtelCallGetOwnershipStatus: |
|
330 case EEtelCallGetCallParams: |
|
331 case EEtelCallGetCallDuration: |
|
332 case EEtelCallGetFaxSettings: |
|
333 case EMobileCallGetMobileCallStatus: |
|
334 case EMobileCallGetMobileCallInfo: |
|
335 case EMobileCallGetMobileDataCallCaps: |
|
336 case EMobileCallGetMobileCallCaps: |
|
337 case EMobileCallGetCurrentHscsdInfo: |
|
338 case EMobileCallGetMobileDataCallRLPRange: |
|
339 case EMobileCallGetUUSCaps: |
|
340 case EMobileCallActivateUUS: |
|
341 case EMobileCallSendUUI: |
|
342 case EMobileCallReceiveUUI: |
|
343 case EMobileCallHangupWithUUI: |
|
344 case EMobileCallAnswerWithUUI: |
|
345 //Other methods that do not use DOS and return immediately. |
|
346 //Flow control not required. |
|
347 case EEtelCallAcquireOwnership: |
|
348 case EEtelCallTransferOwnership: |
|
349 case EEtelCallSetFaxSettings: |
|
350 //Methods that can propably take a long time and cannot therefore be |
|
351 //flow controlled. Solution: All these methods must check req handle |
|
352 //table before handling the request. In case that the request table |
|
353 //indicates that same method has been called and has not been |
|
354 //completed, the method should return KErrServerBusy. |
|
355 case EMobileCallTransfer: |
|
356 //This is also included here due to the fact that Emergency call |
|
357 //should never be blocked by flow control. KErrServerBusy returned |
|
358 //when already already dialing. |
|
359 case EMobileCallDialEmergencyCall: |
|
360 //HangUp cannot be flow controlled. Client should for example be able |
|
361 //to terminate a call while another call is e.g. in Dialling state. |
|
362 case EEtelCallHangUp: |
|
363 //Answer was mixed with Hangup. |
|
364 //Therefore this is also No flow control type. |
|
365 case EEtelCallAnswer: |
|
366 // dial is not flow controlled as compeltion may take a while and that |
|
367 // blocks for example PS data activation in 3G while dialing. |
|
368 case EEtelCallDial: |
|
369 break; |
|
370 //Flow Controlled Services |
|
371 //KReqModeFlowControlObeyed |
|
372 //Commands that change the state of the phone, e.g. clearing the |
|
373 //AoC counter; are commands that the TSY should only deal with |
|
374 //one at a time. |
|
375 |
|
376 //Voice call related methods that should be handled one at the time. |
|
377 case EEtelCallConnect: |
|
378 case EMobileCallHold: |
|
379 case EMobileCallResume: |
|
380 case EMobileCallSwap: |
|
381 case EMobileCallDeflect: |
|
382 case EMobileCallGoOneToOne: |
|
383 //Data call related methods that should be handled one at the time. |
|
384 case EEtelCallLoanDataPort: |
|
385 case EEtelCallRecoverDataPort: |
|
386 case EMobileCallSwitchAlternatingCall: |
|
387 case EMobileCallSetDynamicHscsdParams: |
|
388 case EMobileCallSetPrivacy: |
|
389 case EMobileCallSetTrafficChannel: |
|
390 ret = KReqModeFlowControlObeyed; |
|
391 break; |
|
392 //ReqModePostImmediately |
|
393 //Requests that notify a client about a change of state, where the |
|
394 //TSY needs to distinguish between different clients. |
|
395 //ret = KReqModeRePostImmediately; |
|
396 |
|
397 //KReqModeMultipleCompletionEnabled |
|
398 //(a) commands that may take some time, but which the TSY can handle |
|
399 // more than one of concurrently, or |
|
400 //(b) notifications that the TSY does not wish to be re-posted |
|
401 //immediately, so the server does no buffering. |
|
402 //ret = KReqModeMultipleCompletionEnabled; |
|
403 |
|
404 //KReqModeMultipleCompletionEnabled | KReqModeFlowControlObeyed |
|
405 //A command that may take some time and which the TSY can only deal |
|
406 //with one at a time. |
|
407 //ret = KReqModeMultipleCompletionEnabled | |
|
408 // KReqModeFlowControlObeyed; |
|
409 //break; |
|
410 |
|
411 //Notifications |
|
412 //KReqModeMultipleCompletionEnabled | ReqModePostImmediately |
|
413 //Requests that notify a client about a change of state. |
|
414 //Since these requests do not require the issuing of any modem |
|
415 //commands, they do not have to obey flow control. |
|
416 //The TSY never gets more than one of these outstanding per |
|
417 // CTelObject. |
|
418 case EEtelCallNotifyHookChange: |
|
419 case EEtelCallNotifyStatusChange: |
|
420 case EEtelCallNotifyDurationChange: |
|
421 case EEtelCallCapsChangeNotification: |
|
422 case EMobileCallNotifyCallEvent: |
|
423 case EMobileCallNotifyMobileCallStatusChange: |
|
424 case EMobileCallNotifyRemotePartyInfoChange: |
|
425 case EMobileCallNotifyPrivacyConfirmation: |
|
426 case EMobileCallNotifyTrafficChannelConfirmation: |
|
427 case EMobileCallNotifyHscsdInfoChange: |
|
428 case EMobileCallNotifyMobileDataCallCapsChange: |
|
429 case EMobileCallNotifyAlternatingCallSwitch: |
|
430 case EMobileCallNotifyMobileCallCapsChange: |
|
431 case EMobileCallNotifyVoiceFallback: |
|
432 case EMobileCallNotifyUUSCapsChange: |
|
433 ret = KReqModeMultipleCompletionEnabled | |
|
434 KReqModeRePostImmediately; |
|
435 break; |
|
436 //Cancel Requests |
|
437 //It is not necessary to include the Cancel methods in ReqModeL at all |
|
438 //The ETel server never calls ReqModeL with a Cancel IPC. |
|
439 |
|
440 //Other variations of return values are unusable |
|
441 |
|
442 //Default: Call CCallBase's ReqModeL. |
|
443 default: |
|
444 //Direct the request to the CCallBase |
|
445 ret = CCallBase::ReqModeL( aIpc ); |
|
446 break; |
|
447 } |
|
448 |
|
449 return ret; |
|
450 } |
|
451 |
|
452 // --------------------------------------------------------------------------- |
|
453 // CMmFaxCallTsy::NumberOfSlotsL |
|
454 // NumberOfSlotsL is called by the server when it is registering a new |
|
455 // NOTIFICATION. It enables the TSY to tell the server how many buffer slots |
|
456 // to allocate for "repost immediately" notifications that may trigger before |
|
457 // clients collect them. |
|
458 // (other items were commented in a header). |
|
459 // --------------------------------------------------------------------------- |
|
460 // |
|
461 TInt CMmFaxCallTsy::NumberOfSlotsL( |
|
462 const TInt aIpc ) |
|
463 { |
|
464 //There is a buffer in the ETel server for each type of NOTIFICATION and |
|
465 //the size of the buffer is determined by the TSY. When the ETel server |
|
466 //discovers that a request is "repost immediately" it will ask the TSY |
|
467 //how big a buffer it wants by calling CTelObject::NumberOfSlotsL( ). |
|
468 // |
|
469 //It is up to the TSY developer's judgement how many buffer slots this |
|
470 //method returns for each notification. If there is a danger that |
|
471 //a particular notification could trigger frequently and in rapid |
|
472 //succession (e.g. call group change notification) then at least 10 or |
|
473 //20 slots may be required. For a notification that triggers rarely, |
|
474 //perhaps 1 or 2 slots is enough. |
|
475 // |
|
476 //So if the ETel server has stored a few occurrences of a particular |
|
477 //notification, when a client subsequently calls that notification request |
|
478 //the ETel server will complete the client's request with the saved data. |
|
479 |
|
480 TInt numberOfSlots( 1 ); |
|
481 |
|
482 switch ( aIpc ) |
|
483 { |
|
484 case EEtelCallNotifyHookChange: |
|
485 numberOfSlots = KMmCallHookChangeSlots; |
|
486 break; |
|
487 case EEtelCallNotifyStatusChange: |
|
488 numberOfSlots = KMmCallStatusChangeSlots; |
|
489 break; |
|
490 case EEtelCallNotifyDurationChange: |
|
491 numberOfSlots = KMmCallDurationChangeSlots; |
|
492 break; |
|
493 case EEtelCallCapsChangeNotification: |
|
494 numberOfSlots = KMmCallCapsChangeSlots; |
|
495 break; |
|
496 case EMobileCallNotifyCallEvent: |
|
497 numberOfSlots = KMmCallCallEventSlots; |
|
498 break; |
|
499 case EMobileCallNotifyMobileCallStatusChange: |
|
500 numberOfSlots = KMmCallMobileCallStatusChangeSlots; |
|
501 break; |
|
502 case EMobileCallNotifyRemotePartyInfoChange: |
|
503 numberOfSlots = KMmCallRemotePartyInfoChangeSlots; |
|
504 break; |
|
505 case EMobileCallNotifyPrivacyConfirmation: |
|
506 numberOfSlots = KMmCallPrivacyConfirmationSlots; |
|
507 break; |
|
508 case EMobileCallNotifyTrafficChannelConfirmation: |
|
509 numberOfSlots = KMmCallTrafficChannelConfirmationSlots; |
|
510 break; |
|
511 case EMobileCallNotifyHscsdInfoChange: |
|
512 numberOfSlots = KMmCallHscsdInfoChangeSlots; |
|
513 break; |
|
514 case EMobileCallNotifyMobileDataCallCapsChange: |
|
515 numberOfSlots = KMmCallMobileDataCallCapsChangeSlots; |
|
516 break; |
|
517 case EMobileCallNotifyAlternatingCallSwitch: |
|
518 numberOfSlots = KMmCallAlternatingCallSwitchSlots; |
|
519 break; |
|
520 case EMobileCallNotifyMobileCallCapsChange: |
|
521 numberOfSlots = KMmCallMobileCallCapsChangeSlots; |
|
522 break; |
|
523 case EMobileCallNotifyVoiceFallback: |
|
524 numberOfSlots = KMmCallVoiceFallbackSlots; |
|
525 break; |
|
526 case EMobileCallNotifyUUSCapsChange: |
|
527 numberOfSlots = KMmCallUUSCapsChangeSlots; |
|
528 break; |
|
529 default: |
|
530 // Unknown or invalid Call IPC |
|
531 User::Leave( KErrNotSupported ); |
|
532 break; |
|
533 } |
|
534 |
|
535 return numberOfSlots; |
|
536 } |
|
537 |
|
538 // --------------------------------------------------------------------------- |
|
539 // CMmFaxCallTsy::CancelService |
|
540 // CancelService is called by the ETel server when it is "cleaning-up" any |
|
541 // still outstanding asynchronous requests before closing a client's |
|
542 // sub-session. This will happen if a client closes its R-class handle without |
|
543 // cancelling outstanding asynchronous requests. Only Mobile API requests are |
|
544 // handled here. |
|
545 // (other items were commented in a header). |
|
546 // --------------------------------------------------------------------------- |
|
547 // |
|
548 TInt CMmFaxCallTsy::CancelService( |
|
549 const TInt aIpc, |
|
550 const TTsyReqHandle aTsyReqHandle ) |
|
551 { |
|
552 TFLOGSTRING3("TSY: CMmFaxCallTsy::CancelService. IPC: %d, Req handle: %d", |
|
553 aIpc, aTsyReqHandle); |
|
554 |
|
555 TInt ret( KErrNone ); |
|
556 |
|
557 //When the clients close their sub-sessions (eg. by calling RPhone::Close) |
|
558 //they may not have cancelled all their outstanding asynchronous requests |
|
559 //before closing. It is up to the ETel server to clean up in this |
|
560 //situation, so the server will find the list of outstanding requests |
|
561 //related to that sub-session object and pass these outstanding IPC req. |
|
562 //numbers, one at a time, to the CancelService function in the TSY. |
|
563 |
|
564 switch ( aIpc ) |
|
565 { |
|
566 //TSY has started a request and it is not possible to then |
|
567 //cancel this request. The best thing for the TSY to do in this case |
|
568 //is to proceed as though the Cancel never happened. The server's call |
|
569 //to the TSY cancel function will return synchronously. The TSY then |
|
570 //continues to wait for the original acknowledgement and when it |
|
571 //receives it, the TSY will complete the original request. |
|
572 case EMobileCallHold: |
|
573 case EMobileCallResume: |
|
574 case EMobileCallSwap: |
|
575 case EMobileCallGoOneToOne: |
|
576 case EMobileCallDeflect: |
|
577 case EMobileCallTransfer: |
|
578 case EMobileCallNotifyTrafficChannelConfirmation: |
|
579 break; |
|
580 //Cancel methods that are not supported |
|
581 case EMobileCallDialEmergencyCall: |
|
582 |
|
583 case EMobileCallSetDynamicHscsdParams: |
|
584 case EMobileCallNotifyMobileDataCallCapsChange: |
|
585 case EMobileCallNotifyHscsdInfoChange: |
|
586 |
|
587 case EMobileCallSwitchAlternatingCall: |
|
588 case EMobileCallNotifyAlternatingCallSwitch: |
|
589 case EMobileCallGetMobileDataCallRLPRange: |
|
590 case EMobileCallNotifyVoiceFallback: |
|
591 case EMobileCallNotifyUUSCapsChange: |
|
592 case EMobileCallActivateUUS: |
|
593 case EMobileCallSendUUI: |
|
594 case EMobileCallReceiveUUI: |
|
595 case EMobileCallHangupWithUUI: |
|
596 case EMobileCallAnswerWithUUI: |
|
597 ret = KErrNotSupported; |
|
598 break; |
|
599 //Notification Cancels, no special requirements. |
|
600 case EMobileCallNotifyMobileCallCapsChange: |
|
601 ret = NotifyMobileCallCapsChangeCancel( aTsyReqHandle ); |
|
602 break; |
|
603 case EMobileCallNotifyMobileCallStatusChange: |
|
604 ret = NotifyMobileCallStatusChangeCancel( aTsyReqHandle ); |
|
605 break; |
|
606 case EMobileCallNotifyCallEvent: |
|
607 ret = NotifyCallEventCancel( aTsyReqHandle ); |
|
608 break; |
|
609 case EMobileCallNotifyRemotePartyInfoChange: |
|
610 ret = NotifyRemotePartyInfoChangeCancel( aTsyReqHandle ); |
|
611 break; |
|
612 case EMobileCallNotifyPrivacyConfirmation: |
|
613 ret = NotifyPrivacyConfirmationCancel( aTsyReqHandle ); |
|
614 break; |
|
615 //Default case |
|
616 default: |
|
617 //call CCallBase |
|
618 ret = CCallBase::CancelService( aIpc, aTsyReqHandle ); |
|
619 break; |
|
620 } |
|
621 |
|
622 return ret; |
|
623 } |
|
624 |
|
625 // --------------------------------------------------------------------------- |
|
626 // CMmFaxCallTsy::CompleteNotifyStatusChange |
|
627 // Complete notification when status changes. If the new status requires, |
|
628 // this method will ask call protocol extension to update it's status and |
|
629 // capabilities and line owning this call to update it's status. |
|
630 // (other items were commented in a header). |
|
631 // --------------------------------------------------------------------------- |
|
632 // |
|
633 void CMmFaxCallTsy::CompleteNotifyStatusChange( |
|
634 TInt aResult, |
|
635 CMmDataPackage* aDataPackage ) |
|
636 { |
|
637 if ( iGhostCall ) |
|
638 { |
|
639 HandleGhostCallStatusChange( aResult, aDataPackage ); |
|
640 } |
|
641 else |
|
642 { |
|
643 TInt callIndex( 0 ); |
|
644 TInt extendedError( |
|
645 CMmCommonStaticUtility::ExtendedErrorCode( aResult) ); |
|
646 TInt ret( KErrNone ); |
|
647 TBool timerStarted( EFalse ); |
|
648 TBool statusChanged ( EFalse ); |
|
649 TBool mobileStatusChanged ( EFalse ); |
|
650 CMmFaxCallTsy* mmCall = NULL; |
|
651 RMobileCall::TMobileCallStatus callStatus( RMobileCall::EStatusIdle ); |
|
652 CCallDataPackage* callDataPackage = |
|
653 reinterpret_cast<CCallDataPackage*>(aDataPackage); |
|
654 |
|
655 callDataPackage->UnPackData( callStatus ); |
|
656 |
|
657 TFLOGSTRING2("TSY: CMmFaxCallTsy::CompleteNotifyStatusChange. aResult:%d", |
|
658 aResult ); |
|
659 TFLOGSTRING3("TSY: CMmFaxCallTsy::CompleteNotifyStatusChange. \ |
|
660 Call status:%d Call name:%S", callStatus, &iCallName); |
|
661 |
|
662 switch( callStatus ) |
|
663 { |
|
664 case RMobileCall::EStatusIdle: |
|
665 //reset caps. |
|
666 iCallCaps.iFlags &= ~( |
|
667 RCall::KCapsHangUp | RCall::KCapsAnswer ); |
|
668 iCallCaps.iFlags |= RCall::KCapsDial; |
|
669 |
|
670 //stop the call duration timer |
|
671 timerStarted = iCallTimer->Stop(); |
|
672 //Check air time timer only if call was in active state |
|
673 //(call timer was started) |
|
674 if ( timerStarted ) |
|
675 { |
|
676 iMmPhone->AirTimeTimerCheckStop(); |
|
677 UpdateLifeTimer(); |
|
678 } |
|
679 |
|
680 iCallStatus = RCall::EStatusIdle; |
|
681 iMobileCallStatus = RMobileCall::EStatusIdle; |
|
682 |
|
683 SetUnowned(); |
|
684 |
|
685 ClearCallStatus(); |
|
686 statusChanged = ETrue; |
|
687 |
|
688 if ( KErrNone != aResult ) |
|
689 { |
|
690 if ( KErrGsmReleaseByUser == aResult || |
|
691 KErrGsmBusyUserRequest == aResult ) |
|
692 { |
|
693 // aResult must be KErrNone to indicate the client |
|
694 // that HangUp has successfully completed |
|
695 CompleteHangUp( KErrNone ); |
|
696 if ( this != iMmPhone->WaitingCallForData() ) |
|
697 { |
|
698 CompleteAnswerIncomingCall( |
|
699 KErrGsmBusyUserRequest ); |
|
700 } |
|
701 } |
|
702 else |
|
703 { |
|
704 //set last exit code |
|
705 iLastExitCode = aResult; |
|
706 CompleteHangUp( aResult ); |
|
707 if ( this != iMmPhone->WaitingCallForData() ) |
|
708 { |
|
709 CompleteAnswerIncomingCall( aResult ); |
|
710 } |
|
711 } |
|
712 CompleteDial( aResult ); |
|
713 } |
|
714 // Try to complete Dial and HangUp; If completes happens from |
|
715 // here, something has gone wrong. Done to prevent TSY from |
|
716 // hanging. |
|
717 else |
|
718 { |
|
719 iLastExitCode = KErrGeneral; |
|
720 TInt errorValue = CMmCommonStaticUtility::EpocErrorCode( |
|
721 KErrNotReady, KErrNotFound ); |
|
722 CompleteDial( errorValue ); |
|
723 CompleteHangUp( errorValue ); |
|
724 if ( this != iMmPhone->WaitingCallForData() ) |
|
725 { |
|
726 CompleteAnswerIncomingCall( errorValue ); |
|
727 } |
|
728 } |
|
729 //save last id. Required by Conference call implementation |
|
730 SetPreviousCallId( iCallId ); |
|
731 //reset call id |
|
732 iCallId = -1; |
|
733 |
|
734 //Check if call capability KCapsHangup still exists |
|
735 //If it does, remove it and return the KCapsDial capability. |
|
736 //If call mode is data, then return also KCapsConnect |
|
737 //capability |
|
738 if ( RCall::KCapsHangUp == |
|
739 ( iCallCaps.iFlags & RCall::KCapsHangUp ) ) |
|
740 { |
|
741 // Remove KCapsHangUp if it exists |
|
742 iCallCaps.iFlags &= ~( RCall::KCapsHangUp ); |
|
743 // return the KCapsDial capability. |
|
744 iCallCaps.iFlags |= RCall::KCapsDial; |
|
745 |
|
746 CompleteNotifyCapsChange(); |
|
747 } |
|
748 |
|
749 //Call Transfer handling |
|
750 if ( ServiceRequested( EMultimodeCallTransfer ) ) |
|
751 { |
|
752 //Complete Transfer |
|
753 CompleteTransfer( KErrNone ); |
|
754 } |
|
755 break; |
|
756 //End of case KCallStatusIdle |
|
757 case RMobileCall::EStatusDialling: |
|
758 #ifdef REQHANDLE_TIMER |
|
759 iTsyReqHandleStore->StopTimeout( EMultimodeCallDial ); |
|
760 #endif |
|
761 iCallStatus = RCall::EStatusDialling; |
|
762 iMobileCallStatus = RMobileCall::EStatusDialling; |
|
763 statusChanged = ETrue; |
|
764 if ( iDialCancelFlag != CMmCallTsy::EDialCancelNotCalled ) |
|
765 { |
|
766 TTsyReqHandle dialCancelHandle = iTsyReqHandleStore-> |
|
767 GetTsyReqHandle( EMultimodeCallDial ); |
|
768 |
|
769 if ( 0 < dialCancelHandle ) |
|
770 { |
|
771 HangUp( dialCancelHandle ); |
|
772 } |
|
773 else |
|
774 { |
|
775 iDialCancelFlag = CMmCallTsy::EDialCancelNotCalled; |
|
776 } |
|
777 } |
|
778 break; |
|
779 case RMobileCall::EStatusConnecting: |
|
780 iCallStatus = RCall::EStatusConnecting; |
|
781 iMobileCallStatus = RMobileCall::EStatusConnecting; |
|
782 statusChanged = ETrue; |
|
783 break; |
|
784 case RMobileCall::EStatusRinging: |
|
785 // If mode is fax call, there is a chance that call mode is |
|
786 //already ringing |
|
787 if (RCall::EStatusRinging != iCallStatus || |
|
788 RMobileCall::EStatusRinging != iMobileCallStatus) |
|
789 { |
|
790 iCallStatus = RCall::EStatusRinging; |
|
791 iMobileCallStatus = RMobileCall::EStatusRinging; |
|
792 statusChanged = ETrue; |
|
793 } |
|
794 break; |
|
795 case RMobileCall::EStatusAnswering: |
|
796 iCallStatus = RCall::EStatusAnswering; |
|
797 iMobileCallStatus = RMobileCall::EStatusAnswering; |
|
798 statusChanged = ETrue; |
|
799 |
|
800 CompleteAnswerIncomingCall( aResult ); |
|
801 break; |
|
802 case RMobileCall::EStatusConnected: |
|
803 //check previous status. If status is answering |
|
804 if ( RCall::EStatusAnswering == iCallStatus ) |
|
805 { |
|
806 //Start call duration monitoring |
|
807 iCallTimer->Start(); |
|
808 //Check if start the air time duration monitoring |
|
809 iMmPhone->AirTimeTimerCheckStart(); |
|
810 } |
|
811 //if it was connecting and dial cancel has not been activated |
|
812 else if ( ( iCallStatus == RCall::EStatusConnecting || |
|
813 iCallStatus == RCall::EStatusDialling ) && |
|
814 CMmCallTsy::EDialCancelNotCalled == iDialCancelFlag ) |
|
815 { |
|
816 //Start call duration monitoring |
|
817 iCallTimer->Start(); |
|
818 //start air time duration monitoring |
|
819 iMmPhone->AirTimeTimerCheckStart(); |
|
820 } |
|
821 |
|
822 //Don't update status if it has not changed. |
|
823 if ( RCall::EStatusConnected != iCallStatus || |
|
824 RMobileCall::EStatusConnected != iMobileCallStatus ) |
|
825 { |
|
826 iCallStatus = RCall::EStatusConnected; |
|
827 iMobileCallStatus = RMobileCall::EStatusConnected; |
|
828 statusChanged = ETrue; |
|
829 } |
|
830 break; |
|
831 case RMobileCall::EStatusDisconnecting: |
|
832 // When call is released, this call object becomes "used". |
|
833 // Thus set iIsFinishedDataCall to ETrue. |
|
834 iIsFinishedDataCall = ETrue; |
|
835 //Core status |
|
836 iCallStatus = RCall::EStatusHangingUp; |
|
837 statusChanged = ETrue; |
|
838 // Mobile status |
|
839 iMobileCallStatus = RMobileCall::EStatusDisconnecting; |
|
840 mobileStatusChanged = ETrue; |
|
841 |
|
842 if ( iCallDirection == RMobileCall::EMobileTerminated ) |
|
843 { |
|
844 //CompleteDial in case remote user is busy |
|
845 CompleteDial( aResult ); |
|
846 |
|
847 //Set last exit code |
|
848 if ( KErrGsmReleaseByUser == aResult || |
|
849 KErrGsmBusyUserRequest == aResult || |
|
850 KErrGsmCCNormalUnspecified == extendedError || |
|
851 KErrNone == aResult ) |
|
852 { |
|
853 iLastExitCode = KErrNone; |
|
854 } |
|
855 else |
|
856 { |
|
857 //set last exit code |
|
858 iLastExitCode = aResult; |
|
859 } |
|
860 } |
|
861 break; |
|
862 case RMobileCall::EStatusDisconnectingWithInband: |
|
863 // When call is released, this call object becomes "used". |
|
864 // Thus set iIsFinishedDataCall to ETrue. |
|
865 iIsFinishedDataCall = ETrue; |
|
866 //Core status |
|
867 iCallStatus = RCall::EStatusHangingUp; |
|
868 statusChanged = ETrue; |
|
869 // Mobile status |
|
870 iMobileCallStatus = |
|
871 RMobileCall::EStatusDisconnectingWithInband; |
|
872 mobileStatusChanged = ETrue; |
|
873 //CompleteDial in case remote user is busy |
|
874 CompleteDial( aResult ); |
|
875 |
|
876 //Set last exit code |
|
877 if ( KErrGsmReleaseByUser == aResult || |
|
878 KErrGsmBusyUserRequest == aResult || |
|
879 KErrGsmCCNormalUnspecified == extendedError || |
|
880 KErrNone == aResult ) |
|
881 { |
|
882 iLastExitCode = KErrNone; |
|
883 } |
|
884 else |
|
885 { |
|
886 //set last exit code |
|
887 iLastExitCode = aResult; |
|
888 } |
|
889 break; |
|
890 case RMobileCall::EStatusHold: |
|
891 case RMobileCall::EStatusUnknown: |
|
892 case RMobileCall::EStatusReconnectPending: |
|
893 case RMobileCall::EStatusWaitingAlternatingCallSwitch: |
|
894 case RMobileCall::EStatusTransferring: |
|
895 case RMobileCall::EStatusTransferAlerting: |
|
896 default: |
|
897 //nothing to do |
|
898 break; |
|
899 } |
|
900 |
|
901 //reset req handle. Returns the deleted req handle |
|
902 TTsyReqHandle reqHandle = iTsyReqHandleStore-> |
|
903 GetTsyReqHandle( EMultimodeCallNotifyStatusChange ); |
|
904 |
|
905 if ( ( EMultimodeCallReqHandleUnknown != reqHandle ) |
|
906 && statusChanged ) |
|
907 { |
|
908 *iRetStatus = iCallStatus; |
|
909 //reset req handle. |
|
910 iTsyReqHandleStore->ResetTsyReqHandle( |
|
911 EMultimodeCallNotifyStatusChange ); |
|
912 |
|
913 ReqCompleted( reqHandle, ret ); |
|
914 } |
|
915 |
|
916 //reset req handle. Returns the deleted req handle |
|
917 reqHandle = iTsyReqHandleStore->GetTsyReqHandle( |
|
918 EMultimodeCallNotifyMobileCallStatusChange ); |
|
919 |
|
920 if ( ( EMultimodeCallReqHandleUnknown != reqHandle ) && |
|
921 ( statusChanged || mobileStatusChanged ) ) |
|
922 { |
|
923 *iRetMobileCallStatus = iMobileCallStatus; |
|
924 //reset req handle. |
|
925 iTsyReqHandleStore->ResetTsyReqHandle( |
|
926 EMultimodeCallNotifyMobileCallStatusChange ); |
|
927 ReqCompleted( reqHandle, ret ); |
|
928 } |
|
929 |
|
930 //Update also line's status |
|
931 if ( statusChanged || mobileStatusChanged ) |
|
932 { |
|
933 iMmLine->CompleteNotifyStatusChange(); |
|
934 } |
|
935 |
|
936 //Inform extension dll about the current status. Enables dynamic |
|
937 //capability updates. Must be done before Notifying caps change |
|
938 if ( KErrNone == iMmCallExtInterface-> |
|
939 CompleteNotifyStatusChange( iMobileCallStatus ) ) |
|
940 { |
|
941 CompleteNotifyMobileCallCapsChange( KErrNone ); |
|
942 } |
|
943 |
|
944 mmCall = reinterpret_cast<CMmFaxCallTsy*>( |
|
945 iMmPhone->CallList()->GetMmCallByIndex( callIndex ) ); |
|
946 while ( mmCall ) |
|
947 { |
|
948 if ( RMobileCall::EStatusIdle != mmCall->MobileCallStatus() && |
|
949 this != mmCall ) |
|
950 { |
|
951 if ( KErrNone == |
|
952 mmCall->ActiveCallExtension()-> |
|
953 CompleteNotifyStatusChange( mmCall->MobileCallStatus() ) ) |
|
954 { |
|
955 mmCall->CompleteNotifyMobileCallCapsChange( KErrNone ); |
|
956 } |
|
957 } |
|
958 callIndex++; |
|
959 mmCall = reinterpret_cast<CMmFaxCallTsy*>( |
|
960 iMmPhone->CallList()->GetMmCallByIndex( callIndex ) ); |
|
961 } |
|
962 } |
|
963 } |
|
964 |
|
965 // --------------------------------------------------------------------------- |
|
966 // CMmFaxCallTsy::Dial |
|
967 // This CORE API method dials to the given number. |
|
968 // (other items were commented in a header). |
|
969 // --------------------------------------------------------------------------- |
|
970 // |
|
971 TInt CMmFaxCallTsy::Dial( |
|
972 const TTsyReqHandle aTsyReqHandle, |
|
973 const TDesC8* aCallParams, |
|
974 TDesC* aTelNumber ) |
|
975 { |
|
976 TFLOGSTRING3("TSY: CMmFaxCallTsy::Dial. Req handle: %d, Call name: %S", |
|
977 aTsyReqHandle, &iCallName); |
|
978 |
|
979 CMmCallList* callList = iMmPhone->CallList(); |
|
980 TBool dialFlag( EFalse ); |
|
981 |
|
982 for(TInt i=0; i< callList->GetNumberOfObjects();i++) |
|
983 { |
|
984 CMmCallTsy* call = callList->GetMmCallByIndex( i ); |
|
985 if( call->GetDialFlag() ) |
|
986 { |
|
987 dialFlag = ETrue; |
|
988 i= callList->GetNumberOfObjects(); |
|
989 } |
|
990 } |
|
991 |
|
992 if(!dialFlag ) |
|
993 { |
|
994 SetDialFlag( ETrue ); |
|
995 TTsyReqHandle dialHandle = iTsyReqHandleStore-> |
|
996 GetTsyReqHandle( EMultimodeCallDial ); |
|
997 |
|
998 //reset exit code |
|
999 iLastExitCode = KErrNone; |
|
1000 |
|
1001 //reset finished data call flag |
|
1002 iIsFinishedDataCall = EFalse; |
|
1003 |
|
1004 if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() ) |
|
1005 { |
|
1006 TFLOGSTRING("TSY: Offline mode ON, Dial request is not allowed" ); |
|
1007 TInt ret = CMmCommonStaticUtility::EpocErrorCode( |
|
1008 KErrGeneral, KErrGsmOfflineOpNotAllowed ); |
|
1009 |
|
1010 //Complete the request with appropiate error |
|
1011 ReqCompleted ( aTsyReqHandle, ret ); |
|
1012 } |
|
1013 |
|
1014 //check that status is Idle |
|
1015 else if ( RMobileCall::EStatusIdle != iMobileCallStatus ) |
|
1016 { |
|
1017 //The request cannot be forwarded since this call object |
|
1018 //is still in use. |
|
1019 //Complete request with status value informing the client |
|
1020 //about the situation. |
|
1021 TFLOGSTRING("TSY: CMmFaxCallTsy::Dial - KErrNotReady"); |
|
1022 ReqCompleted( aTsyReqHandle, KErrNotReady ); |
|
1023 } |
|
1024 else if ( 0 < dialHandle ) |
|
1025 { |
|
1026 //The request is already in processing because of previous request |
|
1027 //Complete request with status value informing the client about |
|
1028 //the situation. |
|
1029 TFLOGSTRING("TSY: CMmFaxCallTsy::Dial - KErrServerBusy"); |
|
1030 ReqCompleted( aTsyReqHandle, KErrServerBusy ); |
|
1031 } |
|
1032 else |
|
1033 { |
|
1034 TInt ret( KErrNone ); |
|
1035 |
|
1036 RMobileCall::TMobileCallParamsV1Pckg* paramsPckgV1 = |
|
1037 reinterpret_cast<RMobileCall::TMobileCallParamsV1Pckg*>( |
|
1038 const_cast<TDesC8*>( aCallParams ) ); |
|
1039 RMobileCall::TMobileCallParamsV1& paramsV1 = ( *paramsPckgV1 )(); |
|
1040 |
|
1041 //save call params |
|
1042 iCallParams.iSpeakerControl = paramsV1.iSpeakerControl; |
|
1043 iCallParams.iSpeakerVolume = paramsV1.iSpeakerVolume; |
|
1044 iCallParams.iInterval = paramsV1.iInterval; |
|
1045 iCallParams.iWaitForDialTone = paramsV1.iWaitForDialTone; |
|
1046 |
|
1047 //set call direction |
|
1048 iCallDirection = RMobileCall::EMobileOriginated; |
|
1049 |
|
1050 // if fax extension is loaded do a fax call, otherwise return not supported |
|
1051 if (iMmFaxExt) |
|
1052 { |
|
1053 // Check if there already is an active or connecting call |
|
1054 TInt numberOfObjects = iMmPhone->CallList()-> |
|
1055 GetNumberOfObjects(); |
|
1056 for ( TInt i = 0; i < numberOfObjects; i++ ) |
|
1057 { |
|
1058 CMmCallTsy* mmCall = iMmPhone->CallList()-> |
|
1059 GetMmCallByIndex( i ); |
|
1060 if ( !( RMobileCall::EStatusUnknown == |
|
1061 mmCall->MobileCallStatus() || |
|
1062 RMobileCall::EStatusIdle == |
|
1063 mmCall->MobileCallStatus() || |
|
1064 RMobileCall::EStatusDisconnecting == |
|
1065 mmCall->MobileCallStatus() || |
|
1066 RMobileCall::EStatusDisconnectingWithInband == |
|
1067 mmCall->MobileCallStatus() ) ) |
|
1068 { |
|
1069 ret = KErrEtelCallAlreadyActive; |
|
1070 break; |
|
1071 } |
|
1072 } |
|
1073 |
|
1074 if ( KErrNone == ret ) |
|
1075 { |
|
1076 ret = iMmFaxExt->Dial(aTsyReqHandle, aTelNumber); |
|
1077 } |
|
1078 } |
|
1079 else |
|
1080 { |
|
1081 ret = KErrNotSupported; |
|
1082 } |
|
1083 |
|
1084 if ( KErrNone != ret ) |
|
1085 { |
|
1086 ReqCompleted( aTsyReqHandle, ret ); |
|
1087 ClearCallStatus(); |
|
1088 } |
|
1089 else |
|
1090 { |
|
1091 #ifdef REQHANDLE_TIMER |
|
1092 //set timer for the request |
|
1093 SetTypeOfResponse( EMultimodeCallDial, aTsyReqHandle ); |
|
1094 #else |
|
1095 //set timer |
|
1096 iTsyReqHandleStore->SetTsyReqHandle( |
|
1097 EMultimodeCallDial, aTsyReqHandle ); |
|
1098 #endif |
|
1099 } |
|
1100 } |
|
1101 |
|
1102 return KErrNone; |
|
1103 } |
|
1104 else |
|
1105 return KErrServerBusy; |
|
1106 } |
|
1107 |
|
1108 |
|
1109 // --------------------------------------------------------------------------- |
|
1110 // CMmFaxCallTsy::DialCancel |
|
1111 // This CORE API method cancels an outstanding dial request.Calls HangUp |
|
1112 // method to do this and set a flag so that we can know that DialCancel |
|
1113 // handling is going on. |
|
1114 // (other items were commented in a header). |
|
1115 // --------------------------------------------------------------------------- |
|
1116 // |
|
1117 TInt CMmFaxCallTsy::DialCancel( |
|
1118 const TTsyReqHandle aTsyReqHandle ) |
|
1119 { |
|
1120 TFLOGSTRING3("TSY: CMmFaxCallTsy::DialCancel. Req handle: %d, Call name: %S", |
|
1121 aTsyReqHandle, &iCallName); |
|
1122 |
|
1123 TInt ret( KErrGeneral ); |
|
1124 |
|
1125 if (iMmFaxExt) |
|
1126 { |
|
1127 iMmFaxExt->DialCancel(); |
|
1128 // ingnore dialcancel for internal fax call |
|
1129 return KErrNone; |
|
1130 } |
|
1131 |
|
1132 ret = CMmCallTsy::DialCancel( aTsyReqHandle ); |
|
1133 |
|
1134 return ret; |
|
1135 } |
|
1136 |
|
1137 // --------------------------------------------------------------------------- |
|
1138 // CMmFaxCallTsy::AnswerIncomingCall |
|
1139 // This CORE API method is used for answering to an incoming call. |
|
1140 // (other items were commented in a header). |
|
1141 // --------------------------------------------------------------------------- |
|
1142 // |
|
1143 TInt CMmFaxCallTsy::AnswerIncomingCall( |
|
1144 const TTsyReqHandle aTsyReqHandle, |
|
1145 const TDesC8* /*aCallParams*/ ) |
|
1146 { |
|
1147 TFLOGSTRING2("TSY: CMmFaxCallTsy::AnswerIncomingCall. \n\t\t\t Handle:%d", |
|
1148 aTsyReqHandle); |
|
1149 |
|
1150 TTsyReqHandle iAnswerCallHandle = iTsyReqHandleStore-> |
|
1151 GetTsyReqHandle( EMultimodeCallAnswer ); |
|
1152 |
|
1153 if ( 0 < iAnswerCallHandle ) |
|
1154 { |
|
1155 //The request is already in processing because of previous request |
|
1156 //Complete request with status value informing the client about |
|
1157 //the situation. |
|
1158 ReqCompleted( aTsyReqHandle, KErrServerBusy ); |
|
1159 } |
|
1160 else |
|
1161 { |
|
1162 TInt ret( KErrNone ); |
|
1163 //call object is under use again |
|
1164 iIsFinishedDataCall = EFalse; |
|
1165 //reset exit code |
|
1166 iLastExitCode = KErrNone; |
|
1167 |
|
1168 if ( iMmFaxExt ) |
|
1169 { |
|
1170 // internal fax call... |
|
1171 ret = iMmFaxExt->AnswerIncomingCall( aTsyReqHandle ); |
|
1172 } |
|
1173 else |
|
1174 { |
|
1175 // FaxModemMode should send the ATA command itself, |
|
1176 // not call answer from TSY! |
|
1177 // fax receive case comes here... |
|
1178 ret = KErrNotSupported; |
|
1179 } |
|
1180 |
|
1181 //error handling |
|
1182 if ( KErrNone != ret ) |
|
1183 { |
|
1184 ReqCompleted( aTsyReqHandle, ret ); |
|
1185 ClearCallStatus(); |
|
1186 } |
|
1187 else |
|
1188 { |
|
1189 #ifdef REQHANDLE_TIMER |
|
1190 //set timer for the request |
|
1191 SetTypeOfResponse( EMultimodeCallAnswer, aTsyReqHandle ); |
|
1192 #else |
|
1193 //timer set |
|
1194 iTsyReqHandleStore->SetTsyReqHandle( |
|
1195 EMultimodeCallAnswer, aTsyReqHandle ); |
|
1196 #endif |
|
1197 } |
|
1198 } |
|
1199 |
|
1200 return KErrNone; |
|
1201 } |
|
1202 |
|
1203 // --------------------------------------------------------------------------- |
|
1204 // CMmFaxCallTsy::AnswerIncomingCallCancel |
|
1205 // TSY has started a request and it is not possible to then cancel this |
|
1206 // request. The best thing for the TSY to do in this case is to proceed as |
|
1207 // though the Cancel never happened. The server's call to the TSY cancel |
|
1208 // function will return synchronously. The TSY then continues to wait for the |
|
1209 // AnswerIncomingCall() acknowledgemnt and when it receives it, the TSY will |
|
1210 // complete the original AnswerIncomingCall request. |
|
1211 // (other items were commented in a header). |
|
1212 // --------------------------------------------------------------------------- |
|
1213 // |
|
1214 TInt CMmFaxCallTsy::AnswerIncomingCallCancel( |
|
1215 const TTsyReqHandle ) |
|
1216 { |
|
1217 return KErrNone; |
|
1218 } |
|
1219 |
|
1220 // --------------------------------------------------------------------------- |
|
1221 // CMmFaxCallTsy::HangUp |
|
1222 // This CORE API method disconnects the call. Used with normal voice calls, |
|
1223 // emergency calls as well as data calls. DialCancel also uses this method. |
|
1224 // (other items were commented in a header). |
|
1225 // --------------------------------------------------------------------------- |
|
1226 // |
|
1227 TInt CMmFaxCallTsy::HangUp( |
|
1228 const TTsyReqHandle aTsyReqHandle ) |
|
1229 { |
|
1230 TFLOGSTRING3("TSY: CMmFaxCallTsy::HangUp. Req handle: %d, Call name: %S", |
|
1231 aTsyReqHandle, &iCallName); |
|
1232 |
|
1233 TInt hangUpCause( KErrNone ); |
|
1234 TInt ret( KErrNone ); |
|
1235 TInt trapError ( KErrNone ); |
|
1236 |
|
1237 TTsyReqHandle hangUpHandle = iTsyReqHandleStore-> |
|
1238 GetTsyReqHandle( EMultimodeCallHangUp ); |
|
1239 TTsyReqHandle dialHandle = iTsyReqHandleStore-> |
|
1240 GetTsyReqHandle( EMultimodeCallDial ); |
|
1241 |
|
1242 if ( 0 < hangUpHandle ) |
|
1243 { |
|
1244 //The request is already in processing because of previous request |
|
1245 //Complete request with status value informing the client about |
|
1246 //the situation. |
|
1247 ReqCompleted( aTsyReqHandle, KErrServerBusy ); |
|
1248 } |
|
1249 else if ( RCall::EStatusIdle == iCallStatus && |
|
1250 EMultimodeCallReqHandleUnknown == dialHandle ) |
|
1251 { |
|
1252 //Call object is already in idle state. |
|
1253 //Complete HangUp request with error. |
|
1254 ReqCompleted( aTsyReqHandle, KErrNotReady ); |
|
1255 } |
|
1256 else |
|
1257 { |
|
1258 //if this was not called by DialCancel |
|
1259 if ( CMmCallTsy::EDialCancelNotCalled == iDialCancelFlag ) |
|
1260 { |
|
1261 #ifdef REQHANDLE_TIMER |
|
1262 //set timer for the request |
|
1263 SetTypeOfResponse( EMultimodeCallHangUp, aTsyReqHandle ); |
|
1264 #else |
|
1265 //save HangUp request handle, set timer |
|
1266 iTsyReqHandleStore->SetTsyReqHandle( |
|
1267 EMultimodeCallHangUp, aTsyReqHandle ); |
|
1268 #endif |
|
1269 } |
|
1270 //decide the hangup cause |
|
1271 if ( RCall::EStatusRinging == iCallStatus ) |
|
1272 { |
|
1273 iLastExitCode = KErrGsmCallRejected; |
|
1274 hangUpCause = KErrGsmBusyUserRequest; |
|
1275 } |
|
1276 else |
|
1277 { |
|
1278 hangUpCause = KErrGsmReleaseByUser; |
|
1279 } |
|
1280 |
|
1281 // Call handling |
|
1282 //If the call is ringing e.g. MT call, we do not have ownership |
|
1283 //yet. So let the client reject the call without checking |
|
1284 //ownership. |
|
1285 if ( RCall::EStatusRinging == iCallStatus ) |
|
1286 { |
|
1287 TFLOGSTRING("TSY: CMmFaxCallTsy::HangUp - Reject incoming call"); |
|
1288 } |
|
1289 //Phone Application is the first client that is started, it |
|
1290 //will always be the priority client and thus able to hangup calls |
|
1291 //Owner of the call is also able to hangup the call. |
|
1292 else if ( CCallBase::CheckPriorityClient( aTsyReqHandle ) || |
|
1293 ( CheckOwnership( aTsyReqHandle ) != EOwnedFalse ) ) |
|
1294 { |
|
1295 if ( iMmFaxExt != NULL ) |
|
1296 { |
|
1297 // internal fax hangup handling |
|
1298 iMmFaxExt->HangUp(); |
|
1299 } |
|
1300 } |
|
1301 // If call is not owned, complete with error |
|
1302 else if ( CCallBase::EOwnedTrue != |
|
1303 CheckOwnership( aTsyReqHandle ) ) |
|
1304 { |
|
1305 iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeCallHangUp ); |
|
1306 ret = KErrEtelNotCallOwner; |
|
1307 ReqCompleted( aTsyReqHandle, KErrEtelNotCallOwner ); |
|
1308 } |
|
1309 |
|
1310 if ( KErrNone == ret ) |
|
1311 { |
|
1312 //in case of memory error |
|
1313 if ( KErrNone != trapError ) |
|
1314 { |
|
1315 // Object cannot be created. |
|
1316 ret = trapError; |
|
1317 } |
|
1318 else |
|
1319 { |
|
1320 //Create package |
|
1321 CCallDataPackage package; |
|
1322 //Set call id and call mode |
|
1323 package.SetCallIdAndMode( iCallId, iCallMode ); |
|
1324 |
|
1325 TBool autoStChangeDisable = EFalse; |
|
1326 //Pack call parameters and mobile call info |
|
1327 package.PackData( &hangUpCause, &autoStChangeDisable ); |
|
1328 //Send request to the Domestic OS layer. |
|
1329 TRAP(trapError, |
|
1330 ret = iMessageManager->HandleRequestL( |
|
1331 EEtelCallHangUp, &package ); |
|
1332 ); |
|
1333 } |
|
1334 |
|
1335 //send failure |
|
1336 if ( KErrNone != ret || KErrNone != trapError ) |
|
1337 { |
|
1338 iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeCallHangUp ); |
|
1339 |
|
1340 //in case of memory error |
|
1341 if ( KErrNone != trapError ) |
|
1342 { |
|
1343 // Object cannot be created. |
|
1344 ret = trapError; |
|
1345 } |
|
1346 |
|
1347 ReqCompleted( aTsyReqHandle, ret ); |
|
1348 } |
|
1349 else |
|
1350 { |
|
1351 //update core status - hangup not possible now. |
|
1352 //remove also dataport caps |
|
1353 iCallCaps.iFlags &= ~( |
|
1354 RCall::KCapsHangUp | |
|
1355 RCall::KCapsLoanDataPort | |
|
1356 RCall::KCapsRecoverDataPort ); |
|
1357 //complete core caps change |
|
1358 CompleteNotifyCapsChange(); |
|
1359 } |
|
1360 } |
|
1361 } |
|
1362 |
|
1363 return KErrNone; |
|
1364 } |
|
1365 |
|
1366 // --------------------------------------------------------------------------- |
|
1367 // CMmFaxCallTsy::GetOwnershipStatus |
|
1368 // Get call ownership status. |
|
1369 // (other items were commented in a header). |
|
1370 // --------------------------------------------------------------------------- |
|
1371 // |
|
1372 TInt CMmFaxCallTsy::GetOwnershipStatus( |
|
1373 const TTsyReqHandle aTsyReqHandle, |
|
1374 RCall::TOwnershipStatus* aOwnershipStatus ) |
|
1375 { |
|
1376 TCallOwnership ownerShip = CheckOwnership( aTsyReqHandle ); |
|
1377 |
|
1378 switch ( ownerShip ) |
|
1379 { |
|
1380 case EOwnedUnowned: |
|
1381 *aOwnershipStatus = RCall::EOwnershipUnowned; |
|
1382 break; |
|
1383 case EOwnedTrue: |
|
1384 *aOwnershipStatus = RCall::EOwnershipOwnedByThisClient; |
|
1385 break; |
|
1386 case EOwnedFalse: |
|
1387 *aOwnershipStatus = RCall::EOwnershipOwnedByAnotherClient; |
|
1388 break; |
|
1389 case EOwnedPriorityClient: |
|
1390 if ( CCallBase::CheckPriorityClient( aTsyReqHandle ) ) |
|
1391 { |
|
1392 *aOwnershipStatus = RCall::EOwnershipOwnedByThisClient; |
|
1393 } |
|
1394 else |
|
1395 { |
|
1396 *aOwnershipStatus = RCall::EOwnershipOwnedByAnotherClient; |
|
1397 } |
|
1398 break; |
|
1399 default: |
|
1400 //all possible values are switched, nothing to do here... |
|
1401 break; |
|
1402 } |
|
1403 |
|
1404 ReqCompleted( aTsyReqHandle, KErrNone ); |
|
1405 |
|
1406 return KErrNone; |
|
1407 } |
|
1408 |
|
1409 // --------------------------------------------------------------------------- |
|
1410 // CMmFaxCallTsy::TransferOwnership |
|
1411 // Transfers the call ownership. |
|
1412 // (other items were commented in a header). |
|
1413 // --------------------------------------------------------------------------- |
|
1414 // |
|
1415 TInt CMmFaxCallTsy::TransferOwnership( |
|
1416 const TTsyReqHandle aTsyReqHandle ) |
|
1417 { |
|
1418 // If call is not owned, complete with error |
|
1419 if ( CCallBase::EOwnedTrue != CheckOwnership( aTsyReqHandle ) ) |
|
1420 { |
|
1421 ReqCompleted( aTsyReqHandle, KErrEtelNotCallOwner ); |
|
1422 } |
|
1423 // If list is empty, complete with error |
|
1424 else if ( iList->iAcquireList.IsEmpty() ) |
|
1425 { |
|
1426 ReqCompleted( aTsyReqHandle, KErrEtelNoClientInterestedInThisCall ); |
|
1427 } |
|
1428 else |
|
1429 { |
|
1430 CAcquireEntry* entry = iList->iAcquireList.First(); |
|
1431 if ( entry ) |
|
1432 { |
|
1433 SetOwnership( entry->iTsyReqHandle ); |
|
1434 ReqCompleted( entry->iTsyReqHandle, KErrNone ); |
|
1435 iList->Remove( entry ); |
|
1436 ReqCompleted( aTsyReqHandle, KErrNone ); |
|
1437 } |
|
1438 else |
|
1439 { |
|
1440 ReqCompleted( aTsyReqHandle, KErrGeneral ); |
|
1441 } |
|
1442 } |
|
1443 |
|
1444 return KErrNone; |
|
1445 } |
|
1446 |
|
1447 // --------------------------------------------------------------------------- |
|
1448 // CMmFaxCallTsy::AcquireOwnership |
|
1449 // Acquire the call ownership. |
|
1450 // (other items were commented in a header). |
|
1451 // --------------------------------------------------------------------------- |
|
1452 // |
|
1453 TInt CMmFaxCallTsy::AcquireOwnership( |
|
1454 const TTsyReqHandle aTsyReqHandle ) |
|
1455 { |
|
1456 TInt trapError; |
|
1457 // Check if the call is unowned? |
|
1458 if ( CheckOwnership( aTsyReqHandle ) == CCallBase::EOwnedUnowned ) |
|
1459 { |
|
1460 // It is, return with error |
|
1461 ReqCompleted( aTsyReqHandle, KErrEtelCallNotActive ); |
|
1462 } |
|
1463 else |
|
1464 { |
|
1465 CAcquireEntry* entry = NULL; |
|
1466 // Call is owned, add this req handle to acquire list |
|
1467 // coverity [resource_leak] |
|
1468 // TRAP macro releases memory while exception caught and trapError != KErrNone |
|
1469 TRAP( trapError, |
|
1470 entry = CAcquireEntry::NewL( aTsyReqHandle ); |
|
1471 ); |
|
1472 if ( trapError != KErrNone ) |
|
1473 { |
|
1474 // Object cannot be created. |
|
1475 ReqCompleted( aTsyReqHandle, trapError ); |
|
1476 } |
|
1477 else if ( NULL != entry ) |
|
1478 { |
|
1479 iList->iAcquireList.AddLast( *entry ); |
|
1480 } |
|
1481 } |
|
1482 |
|
1483 return KErrNone; |
|
1484 } |
|
1485 |
|
1486 // --------------------------------------------------------------------------- |
|
1487 // CMmFaxCallTsy::AcquireOwnershipCancel |
|
1488 // Cancel the call ownership acquire. |
|
1489 // (other items were commented in a header). |
|
1490 // --------------------------------------------------------------------------- |
|
1491 // |
|
1492 TInt CMmFaxCallTsy::AcquireOwnershipCancel( |
|
1493 const TTsyReqHandle aTsyReqHandle ) |
|
1494 { |
|
1495 CAcquireEntry* entry = iList->FindByTsyReqHandle( aTsyReqHandle ); |
|
1496 if ( NULL != entry ) |
|
1497 { |
|
1498 iList->Remove( entry ); |
|
1499 ReqCompleted( aTsyReqHandle, KErrCancel ); |
|
1500 } |
|
1501 else |
|
1502 { |
|
1503 ReqCompleted( aTsyReqHandle, KErrNotFound ); |
|
1504 } |
|
1505 |
|
1506 return KErrNone; |
|
1507 } |
|
1508 |
|
1509 // --------------------------------------------------------------------------- |
|
1510 // CMmFaxCallTsy::RelinquishOwnership |
|
1511 // Relinquish the call ownership. |
|
1512 // (other items were commented in a header). |
|
1513 // --------------------------------------------------------------------------- |
|
1514 // |
|
1515 TInt CMmFaxCallTsy::RelinquishOwnership() |
|
1516 { |
|
1517 if ( iList->iAcquireList.IsEmpty() ) |
|
1518 { |
|
1519 SetUnowned(); |
|
1520 if ( RCall::EStatusConnected != iCallStatus ) |
|
1521 { |
|
1522 RelinquishOwnershipCompleted( KErrNone ); |
|
1523 } |
|
1524 } |
|
1525 else |
|
1526 { |
|
1527 CAcquireEntry* entry = iList->iAcquireList.First(); |
|
1528 if ( entry ) |
|
1529 { |
|
1530 SetOwnership( entry->iTsyReqHandle ); |
|
1531 ReqCompleted( entry->iTsyReqHandle, KErrNone ); |
|
1532 iList->Remove( entry ); |
|
1533 } |
|
1534 RelinquishOwnershipCompleted( KErrNone ); |
|
1535 } |
|
1536 |
|
1537 return KErrNone; |
|
1538 } |
|
1539 |
|
1540 // --------------------------------------------------------------------------- |
|
1541 // CMmFaxCallTsy::RegisterNotification |
|
1542 // RegisterNotification is called when the server recognises that this |
|
1543 // notification is being posted for the first time on this sub-session object. |
|
1544 // It enables the TSY to "turn on" any regular notification messages that it |
|
1545 // may receive from DOS. Currently does not really do anything but returns |
|
1546 // KErrNone to ETel server in case of known notification request type. |
|
1547 // (other items were commented in a header). |
|
1548 // --------------------------------------------------------------------------- |
|
1549 // |
|
1550 TInt CMmFaxCallTsy::RegisterNotification( |
|
1551 const TInt aIpc ) |
|
1552 { |
|
1553 TInt ret( KErrNone ); |
|
1554 |
|
1555 switch ( aIpc ) |
|
1556 { |
|
1557 case EEtelCallNotifyHookChange: |
|
1558 case EEtelCallNotifyStatusChange: |
|
1559 case EEtelCallNotifyDurationChange: |
|
1560 case EEtelCallCapsChangeNotification: |
|
1561 case EMobileCallNotifyCallEvent: |
|
1562 case EMobileCallNotifyMobileCallStatusChange: |
|
1563 case EMobileCallNotifyRemotePartyInfoChange: |
|
1564 case EMobileCallNotifyPrivacyConfirmation: |
|
1565 case EMobileCallNotifyTrafficChannelConfirmation: |
|
1566 case EMobileCallNotifyHscsdInfoChange: |
|
1567 case EMobileCallNotifyMobileDataCallCapsChange: |
|
1568 case EMobileCallNotifyAlternatingCallSwitch: |
|
1569 case EMobileCallNotifyMobileCallCapsChange: |
|
1570 case EMobileCallNotifyVoiceFallback: |
|
1571 case EMobileCallNotifyUUSCapsChange: |
|
1572 ret = KErrNone; |
|
1573 break; |
|
1574 default: |
|
1575 // Unknown or invalid IPC |
|
1576 ret = KErrNotSupported; |
|
1577 break; |
|
1578 } |
|
1579 |
|
1580 return ret; |
|
1581 } |
|
1582 |
|
1583 // --------------------------------------------------------------------------- |
|
1584 // CMmFaxCallTsy::DeregisterNotification |
|
1585 // DeregisterNotification is called when the server recognises that this |
|
1586 // notification will not be posted again because the last client to have a |
|
1587 // handle on this sub-session object has just closed the handle. It enables |
|
1588 // the TSY to "turn off" any regular notification messages that it may receive |
|
1589 // from DOS. Currently does not really do anything but returns KErrNone to |
|
1590 // ETel server in case of known notification request type. |
|
1591 // (other items were commented in a header). |
|
1592 // --------------------------------------------------------------------------- |
|
1593 // |
|
1594 TInt CMmFaxCallTsy::DeregisterNotification( |
|
1595 const TInt aIpc ) |
|
1596 { |
|
1597 TInt ret ( KErrNone ); |
|
1598 |
|
1599 switch ( aIpc ) |
|
1600 { |
|
1601 case EEtelCallNotifyHookChange: |
|
1602 case EEtelCallNotifyStatusChange: |
|
1603 case EEtelCallNotifyDurationChange: |
|
1604 case EEtelCallCapsChangeNotification: |
|
1605 case EMobileCallNotifyCallEvent: |
|
1606 case EMobileCallNotifyMobileCallStatusChange: |
|
1607 case EMobileCallNotifyRemotePartyInfoChange: |
|
1608 case EMobileCallNotifyPrivacyConfirmation: |
|
1609 case EMobileCallNotifyTrafficChannelConfirmation: |
|
1610 case EMobileCallNotifyHscsdInfoChange: |
|
1611 case EMobileCallNotifyMobileDataCallCapsChange: |
|
1612 case EMobileCallNotifyAlternatingCallSwitch: |
|
1613 case EMobileCallNotifyMobileCallCapsChange: |
|
1614 case EMobileCallNotifyVoiceFallback: |
|
1615 case EMobileCallNotifyUUSCapsChange: |
|
1616 ret = KErrNone; |
|
1617 break; |
|
1618 default: |
|
1619 // Unknown or invalid IPC |
|
1620 ret = KErrNotSupported; |
|
1621 break; |
|
1622 } |
|
1623 |
|
1624 return ret; |
|
1625 } |
|
1626 |
|
1627 // --------------------------------------------------------------------------- |
|
1628 // CMmFaxCallTsy::ClearCallStatus |
|
1629 // Clears internal call status. |
|
1630 // (other items were commented in a header). |
|
1631 // --------------------------------------------------------------------------- |
|
1632 // |
|
1633 void CMmFaxCallTsy::ClearCallStatus() |
|
1634 { |
|
1635 SetUnowned(); |
|
1636 CMmCallTsy::ClearCallStatus(); |
|
1637 } |
|
1638 |
|
1639 #ifdef REQHANDLE_TIMER |
|
1640 // --------------------------------------------------------------------------- |
|
1641 // CMmFaxCallTsy::SetTypeOfResponse |
|
1642 // Sets the type of response for a given Handle. Automatic mode includes an |
|
1643 // automatic response in case of non response from the Domestic OS Layer in |
|
1644 // a specified time. |
|
1645 // (other items were commented in a header). |
|
1646 // --------------------------------------------------------------------------- |
|
1647 // |
|
1648 void CMmFaxCallTsy::SetTypeOfResponse( |
|
1649 const TInt aReqHandleType, |
|
1650 const TTsyReqHandle aTsyReqHandle ) |
|
1651 { |
|
1652 //Sets the type of response for a given Handle. |
|
1653 //Automatic mode includes an automatic response in case of |
|
1654 //non response from the DOS in a specified time. |
|
1655 TInt timeOut( 0 ); |
|
1656 |
|
1657 //example switch |
|
1658 switch ( aReqHandleType ) |
|
1659 { |
|
1660 case EMultimodeCallDial: |
|
1661 timeOut = KMmCallDialTimeOut; |
|
1662 break; |
|
1663 case EMultimodeCallAnswer: |
|
1664 timeOut = KMmCallAnswerTimeOut; |
|
1665 break; |
|
1666 case EMultimodeCallHangUp: |
|
1667 timeOut = KMmCallHangUpTimeOut; |
|
1668 break; |
|
1669 case EMultimodeCallTransfer: |
|
1670 timeOut = KMmCallTransferTimeOut; |
|
1671 break; |
|
1672 //Can't use timer: |
|
1673 // - all notifications |
|
1674 //case EMultimodeCallNotifyStatusChange: |
|
1675 //case EMultimodeCallNotifyDurationChange: |
|
1676 //case EMultimodeCallCapsChangeNotification: |
|
1677 //case EMultimodeCallNotifyMobileCallStatusChange: |
|
1678 //case EMultimodeCallNotifyCallEvent: |
|
1679 //case EMultimodeCallNotifyRemotePartyInfoChange: |
|
1680 //case EMultimodeCallNotifyMobileCallCapsChange: |
|
1681 //case EMultimodeCallNotifyDataCallCapsChange: |
|
1682 //case EMultimodeCallNotifyHscsdInfoChange: |
|
1683 //case EMultimodeCallNotifyPrivacyConfirmation: |
|
1684 |
|
1685 case EMultimodeMobileCallHold: |
|
1686 case EMultimodeMobileCallResume: |
|
1687 case EMultimodeMobileCallSwap: |
|
1688 case EMultimodeMobileCallDeflectCall: |
|
1689 case EMultimodeMobileCallDialEmergencyCall: |
|
1690 case EMultimodeCallGoOneToOne: |
|
1691 |
|
1692 case EMultimodeCallSetDynamicHscsdParams: |
|
1693 |
|
1694 default: |
|
1695 //does not use timer |
|
1696 iTsyReqHandleStore->SetTsyReqHandle( |
|
1697 aReqHandleType, aTsyReqHandle ); |
|
1698 break; |
|
1699 } |
|
1700 |
|
1701 if ( timeOut > 0 ) |
|
1702 { |
|
1703 //the timeout parameter is given in seconds. |
|
1704 iTsyReqHandleStore->SetTsyReqHandle( |
|
1705 aReqHandleType, |
|
1706 aTsyReqHandle, |
|
1707 timeOut ); |
|
1708 } |
|
1709 } |
|
1710 #endif |
|
1711 |
|
1712 // --------------------------------------------------------------------------- |
|
1713 // CMmFaxCallTsy::IsFinishedData |
|
1714 // Returns boolean that indicates if call object is already been used in |
|
1715 // fax calls. This means that call has been already released or disconnected. |
|
1716 // (other items were commented in a header). |
|
1717 // --------------------------------------------------------------------------- |
|
1718 // |
|
1719 TBool CMmFaxCallTsy::IsFinishedData() const |
|
1720 { |
|
1721 return iIsFinishedDataCall; |
|
1722 } |
|
1723 |
|
1724 // --------------------------------------------------------------------------- |
|
1725 // CMmFaxCallTsy::LoanDataPort |
|
1726 // This CORE API method loans dataport to client. |
|
1727 // (other items were commented in a header). |
|
1728 // --------------------------------------------------------------------------- |
|
1729 // |
|
1730 TInt CMmFaxCallTsy::LoanDataPort( |
|
1731 const TTsyReqHandle aTsyReqHandle, |
|
1732 RCall::TCommPort* aCommPort ) |
|
1733 { |
|
1734 TFLOGSTRING2("TSY: CMmFaxCallTsy::LoanDataPort - Client taking control: %S", |
|
1735 &iCallName ); |
|
1736 |
|
1737 TInt ret( KErrNone ); |
|
1738 |
|
1739 // Check if the port is loaned! |
|
1740 if ( iLoanedCommPort.iPort.Compare( KNullDesC) == 0 ) |
|
1741 { |
|
1742 // Check ownership |
|
1743 TCallOwnership ownerShip = CheckOwnership( aTsyReqHandle ); |
|
1744 // If not yet owned, take ownership. |
|
1745 if ( EOwnedUnowned == ownerShip || EOwnedPriorityClient == ownerShip ) |
|
1746 { |
|
1747 SetOwnership( aTsyReqHandle ); |
|
1748 } |
|
1749 // Else check if this req handle already owns the call. |
|
1750 else if ( CCallBase::EOwnedTrue != ownerShip ) |
|
1751 { |
|
1752 ret = KErrEtelNotCallOwner; |
|
1753 } |
|
1754 |
|
1755 // If port can be loaned, request access to dataport |
|
1756 if ( ret == KErrNone ) |
|
1757 { |
|
1758 //Create package |
|
1759 CCallDataPackage package; |
|
1760 //Set call id and call mode |
|
1761 package.SetCallIdAndMode( iCallId, iCallMode ); |
|
1762 //Pack commport |
|
1763 package.PackData( aCommPort ); |
|
1764 |
|
1765 //Send request to the Domestic OS layer. |
|
1766 TRAPD( trapError, |
|
1767 ret = iMessageManager->HandleRequestL( |
|
1768 EEtelCallLoanDataPort, &package ); |
|
1769 ); |
|
1770 |
|
1771 if ( KErrNone != trapError ) |
|
1772 { |
|
1773 //error handling, leaved. |
|
1774 ret = trapError; |
|
1775 } |
|
1776 |
|
1777 if ( KErrNone == ret ) |
|
1778 { |
|
1779 iLoanedCommPort.iCsy.Copy( aCommPort->iCsy ); |
|
1780 iLoanedCommPort.iPort.Copy( aCommPort->iPort ); |
|
1781 |
|
1782 // If dataport was available, changed new call caps and |
|
1783 // complete notification! |
|
1784 iCallCaps.iFlags |= |
|
1785 RCall::KCapsData | |
|
1786 RCall::KCapsHangUp | |
|
1787 RCall::KCapsRecoverDataPort; |
|
1788 iCallCaps.iFlags &= ~( RCall::KCapsLoanDataPort ); |
|
1789 |
|
1790 iMmCallExtInterface->AddGSMCallCaps( |
|
1791 RCall::KCapsRecoverDataPort ); |
|
1792 iMmCallExtInterface->RemoveGSMCallCaps( |
|
1793 RCall::KCapsLoanDataPort ); |
|
1794 |
|
1795 CompleteNotifyCapsChange(); |
|
1796 CompleteNotifyMobileCallCapsChange( KErrNone ); |
|
1797 } |
|
1798 } |
|
1799 } |
|
1800 else |
|
1801 { |
|
1802 ret = KErrEtelPortAlreadyLoaned; |
|
1803 } |
|
1804 |
|
1805 // Complete request if result is KErrNone. |
|
1806 // Return possible error to CCallBase base class because it sets |
|
1807 // iLoanDataport to TRUE if KErrNone is returned. This may cause |
|
1808 // serious problems when the data call object is closed and data port |
|
1809 // is not really loaned. ETel completes request in case where error is |
|
1810 // returned. |
|
1811 if ( KErrNone == ret ) |
|
1812 { |
|
1813 ReqCompleted( aTsyReqHandle, KErrNone ); |
|
1814 } |
|
1815 |
|
1816 return ret; |
|
1817 } |
|
1818 |
|
1819 // --------------------------------------------------------------------------- |
|
1820 // CMmFaxCallTsy::LoanDataPortCancel |
|
1821 // Cancels dataport loaning to client. LoanDataPort always |
|
1822 // completes immediately, this is never used. |
|
1823 // (other items were commented in a header). |
|
1824 // --------------------------------------------------------------------------- |
|
1825 // |
|
1826 TInt CMmFaxCallTsy::LoanDataPortCancel( |
|
1827 const TTsyReqHandle ) |
|
1828 { |
|
1829 return KErrNone; |
|
1830 } |
|
1831 |
|
1832 // --------------------------------------------------------------------------- |
|
1833 // CMmFaxCallTsy::RecoverDataPort |
|
1834 // This CORE API method recovers dataport from client. |
|
1835 // (other items were commented in a header). |
|
1836 // --------------------------------------------------------------------------- |
|
1837 // |
|
1838 TInt CMmFaxCallTsy::RecoverDataPort( |
|
1839 const TTsyReqHandle aTsyReqHandle ) |
|
1840 { |
|
1841 TFLOGSTRING2("TSY: CMmFaxCallTsy::RecoverDataPort - Client returning control: %S", |
|
1842 &iCallName ); |
|
1843 |
|
1844 TInt ret( KErrNone ); |
|
1845 |
|
1846 // Check if the port is loaned! |
|
1847 if ( iLoanedCommPort.iPort.Compare( KNullDesC) != 0 ) |
|
1848 { |
|
1849 //Create package |
|
1850 CCallDataPackage package; |
|
1851 //Set call id and call mode |
|
1852 package.SetCallIdAndMode( iCallId, iCallMode ); |
|
1853 //Pack commport |
|
1854 package.PackData( &iLoanedCommPort ); |
|
1855 |
|
1856 //Send request to the Domestic OS layer. |
|
1857 TRAPD( trapError, |
|
1858 ret = iMessageManager->HandleRequestL( |
|
1859 EEtelCallRecoverDataPort, &package ); |
|
1860 ); |
|
1861 |
|
1862 if ( KErrNone != trapError ) |
|
1863 { |
|
1864 //error handling, leaved. |
|
1865 ret = trapError; |
|
1866 } |
|
1867 |
|
1868 iLoanedCommPort.iCsy.Zero(); |
|
1869 iLoanedCommPort.iPort.Zero();; |
|
1870 |
|
1871 // Set new call caps! |
|
1872 iCallCaps.iFlags |= RCall::KCapsLoanDataPort; |
|
1873 iCallCaps.iFlags &= ~( RCall::KCapsRecoverDataPort ); |
|
1874 iMmCallExtInterface->AddGSMCallCaps( |
|
1875 RCall::KCapsLoanDataPort ); |
|
1876 iMmCallExtInterface->RemoveGSMCallCaps( |
|
1877 RCall::KCapsRecoverDataPort ); |
|
1878 } |
|
1879 else |
|
1880 { |
|
1881 ret = KErrEtelPortNotLoanedToClient; |
|
1882 } |
|
1883 |
|
1884 ReqCompleted( aTsyReqHandle, ret ); |
|
1885 |
|
1886 return KErrNone; |
|
1887 } |
|
1888 |
|
1889 // --------------------------------------------------------------------------- |
|
1890 // CMmFaxCallTsy::RecoverDataPortAndRelinquishOwnership |
|
1891 // Recovers dataport from client and relinquishes ownership. |
|
1892 // (other items were commented in a header). |
|
1893 // --------------------------------------------------------------------------- |
|
1894 // |
|
1895 TInt CMmFaxCallTsy::RecoverDataPortAndRelinquishOwnership() |
|
1896 { |
|
1897 TFLOGSTRING2("TSY: CMmFaxCallTsy::RecoverDataPortAndRelinquishOwnership - \ |
|
1898 Client returning control: %S", &iCallName ); |
|
1899 |
|
1900 TInt ret( KErrNone ); |
|
1901 |
|
1902 // Check if the port is loaned! |
|
1903 if ( iLoanedCommPort.iPort.Compare( KNullDesC) != 0 ) |
|
1904 { |
|
1905 //Create package |
|
1906 CCallDataPackage package; |
|
1907 //Set call id and call mode |
|
1908 package.SetCallIdAndMode( iCallId, iCallMode ); |
|
1909 //Pack commport |
|
1910 package.PackData( &iLoanedCommPort ); |
|
1911 |
|
1912 //Send request to the Domestic OS layer. |
|
1913 TRAPD( trapError, |
|
1914 ret = iMessageManager->HandleRequestL( |
|
1915 EEtelCallRecoverDataPort, &package ); |
|
1916 ); |
|
1917 |
|
1918 if ( KErrNone != trapError ) |
|
1919 { |
|
1920 //error handling, leaved. |
|
1921 ret = trapError; |
|
1922 } |
|
1923 |
|
1924 iLoanedCommPort.iCsy.Zero(); |
|
1925 iLoanedCommPort.iPort.Zero();; |
|
1926 |
|
1927 if ( iList->iAcquireList.IsEmpty() ) |
|
1928 { |
|
1929 SetUnowned(); |
|
1930 |
|
1931 if ( KErrNone == ret ) |
|
1932 { |
|
1933 // Call owner is closing fax call handle. Call |
|
1934 // RecoverDataPortAndRelinquishOwnershipCompleted method. |
|
1935 RecoverDataPortAndRelinquishOwnershipCompleted( KErrNone ); |
|
1936 } |
|
1937 } |
|
1938 else |
|
1939 { |
|
1940 CAcquireEntry* entry = iList->iAcquireList.First(); |
|
1941 if ( entry ) |
|
1942 { |
|
1943 SetOwnership( entry->iTsyReqHandle ); |
|
1944 ReqCompleted( entry->iTsyReqHandle, KErrNone ); |
|
1945 iList->Remove( entry ); |
|
1946 } |
|
1947 // Set new call caps! |
|
1948 iCallCaps.iFlags |= RCall::KCapsLoanDataPort; |
|
1949 iCallCaps.iFlags &= ~( RCall::KCapsRecoverDataPort ); |
|
1950 |
|
1951 iMmCallExtInterface->AddGSMCallCaps( |
|
1952 RCall::KCapsLoanDataPort ); |
|
1953 iMmCallExtInterface->RemoveGSMCallCaps( |
|
1954 RCall::KCapsRecoverDataPort ); |
|
1955 } |
|
1956 } |
|
1957 else |
|
1958 { |
|
1959 ret = KErrEtelPortNotLoanedToClient; |
|
1960 } |
|
1961 |
|
1962 return ret; |
|
1963 } |
|
1964 |
|
1965 // --------------------------------------------------------------------------- |
|
1966 // CMmFaxCallTsy::Connect |
|
1967 // Set correct data call attributes, depending on parameter extension. |
|
1968 // (other items were commented in a header). |
|
1969 // --------------------------------------------------------------------------- |
|
1970 // |
|
1971 TInt CMmFaxCallTsy::Connect( |
|
1972 const TTsyReqHandle aTsyReqHandle, |
|
1973 const TDesC8* aCallParams ) |
|
1974 { |
|
1975 TInt ret(KErrArgument); |
|
1976 |
|
1977 if(sizeof(RMobileCall::TMobileCallParamsV1) <= aCallParams->Length()) |
|
1978 { |
|
1979 ret = KErrNone; |
|
1980 |
|
1981 if ( CheckOwnership( aTsyReqHandle ) == CCallBase::EOwnedUnowned ) |
|
1982 { |
|
1983 SetOwnership( aTsyReqHandle ); |
|
1984 } |
|
1985 |
|
1986 RMobileCall::TMobileCallParamsV1Pckg* paramsPckgV1 = |
|
1987 reinterpret_cast<RMobileCall::TMobileCallParamsV1Pckg*>( |
|
1988 const_cast<TDesC8*>( aCallParams ) ); |
|
1989 RMobileCall::TMobileCallParamsV1& paramsV1 = ( *paramsPckgV1 )(); |
|
1990 |
|
1991 iCallParams.iSpeakerControl = paramsV1.iSpeakerControl; |
|
1992 iCallParams.iSpeakerVolume = paramsV1.iSpeakerVolume; |
|
1993 iCallParams.iInterval = paramsV1.iInterval; |
|
1994 iCallParams.iWaitForDialTone = paramsV1.iWaitForDialTone; |
|
1995 |
|
1996 if ( paramsV1.ExtensionId() == KETelExtMultimodeV1 || |
|
1997 paramsV1.ExtensionId() == RMobileCall::KETelMobileDataCallParamsV1 || |
|
1998 paramsV1.ExtensionId() == RMobileCall::KETelMobileDataCallParamsV2 || |
|
1999 paramsV1.ExtensionId() == RMobileCall::KETelMobileDataCallParamsV8 || |
|
2000 paramsV1.ExtensionId() == RMobileCall::KETelMobileHscsdCallParamsV1 || |
|
2001 paramsV1.ExtensionId() == RMobileCall::KETelMobileHscsdCallParamsV2 || |
|
2002 paramsV1.ExtensionId() == RMobileCall::KETelMobileHscsdCallParamsV7 || |
|
2003 paramsV1.ExtensionId() == RMobileCall::KETelMobileHscsdCallParamsV8 ) |
|
2004 { |
|
2005 iCallParams.iIdRestrict = paramsV1.iIdRestrict; |
|
2006 iCallParams.iCug = paramsV1.iCug; |
|
2007 iCallParams.iAutoRedial = paramsV1.iAutoRedial; |
|
2008 } |
|
2009 if ( paramsV1.ExtensionId() == RMobileCall::KETelMobileDataCallParamsV1 || |
|
2010 paramsV1.ExtensionId() == RMobileCall::KETelMobileDataCallParamsV2 || |
|
2011 paramsV1.ExtensionId() == RMobileCall::KETelMobileDataCallParamsV8 || |
|
2012 paramsV1.ExtensionId() == RMobileCall::KETelMobileHscsdCallParamsV1 || |
|
2013 paramsV1.ExtensionId() == RMobileCall::KETelMobileHscsdCallParamsV2 || |
|
2014 paramsV1.ExtensionId() == RMobileCall::KETelMobileHscsdCallParamsV7 || |
|
2015 paramsV1.ExtensionId() == RMobileCall::KETelMobileHscsdCallParamsV8 ) |
|
2016 { |
|
2017 iMmCallExtInterface->Connect( aCallParams ); |
|
2018 } |
|
2019 |
|
2020 ReqCompleted( aTsyReqHandle, KErrNone ); |
|
2021 |
|
2022 } |
|
2023 |
|
2024 return ret; |
|
2025 } |
|
2026 |
|
2027 // --------------------------------------------------------------------------- |
|
2028 // CMmFaxCallTsy::ConnectChancel |
|
2029 // Cancels connecting of a (fax) call (Not Supported). |
|
2030 // (other items were commented in a header). |
|
2031 // --------------------------------------------------------------------------- |
|
2032 // |
|
2033 TInt CMmFaxCallTsy::ConnectCancel( |
|
2034 const TTsyReqHandle ) |
|
2035 { |
|
2036 return KErrNone; |
|
2037 } |
|
2038 |
|
2039 // --------------------------------------------------------------------------- |
|
2040 // CMmFaxCallTsy::GetBearerServiceInfo |
|
2041 // Get bearer service info. |
|
2042 // (other items were commented in a header). |
|
2043 // --------------------------------------------------------------------------- |
|
2044 // |
|
2045 TInt CMmFaxCallTsy::GetBearerServiceInfo( |
|
2046 const TTsyReqHandle aTsyReqHandle, |
|
2047 RCall::TBearerService* aBearerService ) |
|
2048 { |
|
2049 // If the call is not connected, the request will return KErrNotFound. |
|
2050 TInt ret( KErrNotFound ); |
|
2051 |
|
2052 // Reset info variables. Info is also unknown for voice call. |
|
2053 aBearerService->iBearerCaps = |
|
2054 RCall::KBearerCapsCompressionNone | RCall::KBearerCapsProtocolUnknown; |
|
2055 aBearerService->iBearerSpeed = RCall::EBearerDataUnknown; |
|
2056 |
|
2057 if ( RCall::EStatusConnected == iCallStatus ) |
|
2058 { |
|
2059 ret = iMmCallExtInterface->GetBearerServiceInfo( aBearerService ); |
|
2060 } |
|
2061 |
|
2062 ReqCompleted( aTsyReqHandle, ret ); |
|
2063 |
|
2064 return KErrNone; |
|
2065 } |
|
2066 |
|
2067 // --------------------------------------------------------------------------- |
|
2068 // CMmFaxCallTsy::GetFaxSettings |
|
2069 // This CORE API method is used for getting fax settings. |
|
2070 // (other items were commented in a header). |
|
2071 // --------------------------------------------------------------------------- |
|
2072 // |
|
2073 TInt CMmFaxCallTsy::GetFaxSettings( |
|
2074 const TTsyReqHandle aTsyReqHandle, |
|
2075 RCall::TFaxSessionSettings* aSettings ) |
|
2076 { |
|
2077 TInt errorCode ( KErrNotSupported ); |
|
2078 |
|
2079 if ( iMmFaxExt ) |
|
2080 { |
|
2081 // if fax is supported, handle this request |
|
2082 errorCode = iMmFaxExt->GetFaxSettings( aSettings ); |
|
2083 } |
|
2084 |
|
2085 ReqCompleted( aTsyReqHandle, errorCode ); |
|
2086 return KErrNone; |
|
2087 } |
|
2088 |
|
2089 // --------------------------------------------------------------------------- |
|
2090 // CMmFaxCallTsy::SetFaxSettings |
|
2091 // This CORE API method is used for set fax settings. |
|
2092 // (other items were commented in a header). |
|
2093 // --------------------------------------------------------------------------- |
|
2094 // |
|
2095 TInt CMmFaxCallTsy::SetFaxSettings( |
|
2096 const TTsyReqHandle aTsyReqHandle, |
|
2097 const RCall::TFaxSessionSettings* aSettings ) |
|
2098 { |
|
2099 TInt errorCode(KErrNotSupported); |
|
2100 |
|
2101 if ( iMmFaxExt ) |
|
2102 { |
|
2103 // if fax is supported, handle this request |
|
2104 errorCode = iMmFaxExt->SetFaxSettings( aSettings ); |
|
2105 } |
|
2106 |
|
2107 ReqCompleted( aTsyReqHandle, errorCode ); |
|
2108 |
|
2109 return KErrNone; |
|
2110 } |
|
2111 |
|
2112 // --------------------------------------------------------------------------- |
|
2113 // CMmFaxCallTsy::GetMobileDataCallRLPRange |
|
2114 // Get Data Call RLP Range. |
|
2115 // (other items were commented in a header). |
|
2116 // --------------------------------------------------------------------------- |
|
2117 // |
|
2118 TInt CMmFaxCallTsy::GetMobileDataCallRLPRange( |
|
2119 const TTsyReqHandle aTsyReqHandle, |
|
2120 TInt*, |
|
2121 TDes8* ) |
|
2122 { |
|
2123 ReqCompleted( aTsyReqHandle, KErrNotSupported ); |
|
2124 |
|
2125 return KErrNone; |
|
2126 } |
|
2127 |
|
2128 |
|
2129 // End of File |