24
|
1 |
// Copyright (c) 1997-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 |
#include <commsdattypesv1_1.h>
|
|
17 |
#include "CALL.H" // Header file for this source file
|
|
18 |
#include "NOTIFY.H"
|
|
19 |
#include "ATDIAL.H"
|
|
20 |
#include "ATANSWER.H"
|
|
21 |
#include "ATCONNCT.H"
|
|
22 |
#include "ATHANGUP.H"
|
|
23 |
#include "ATO.H"
|
|
24 |
#include "ATNOCARR.H"
|
|
25 |
#include "LINE.H"
|
|
26 |
#include "ATINIT.H"
|
|
27 |
#include "mSLOGGER.H" // for LOGTEXT untilities
|
|
28 |
#include "ATIO.H" // For CATIO class
|
|
29 |
#include "PHONE.H"
|
|
30 |
#include <et_clsvr.h>
|
|
31 |
#include "ATBASE.H"
|
|
32 |
#include "Matstd.h" // For AT command string constants
|
|
33 |
#include "set_cbst.h" // for CATSetCBST class
|
|
34 |
#include "et_struct.h"
|
|
35 |
|
|
36 |
|
|
37 |
//
|
|
38 |
// CAcquireEntry class
|
|
39 |
//
|
|
40 |
CAcquireEntry* CAcquireEntry::NewL(const TTsyReqHandle aTsyReqHandle)
|
|
41 |
//
|
|
42 |
// Create new request entry
|
|
43 |
//
|
|
44 |
{
|
|
45 |
return new(ELeave) CAcquireEntry(aTsyReqHandle);
|
|
46 |
}
|
|
47 |
|
|
48 |
CAcquireEntry::CAcquireEntry(const TTsyReqHandle aTsyReqHandle)
|
|
49 |
//
|
|
50 |
// Constructor
|
|
51 |
//
|
|
52 |
{
|
|
53 |
iTsyReqHandle=aTsyReqHandle;
|
|
54 |
}
|
|
55 |
|
|
56 |
CAcquireEntry::~CAcquireEntry()
|
|
57 |
//
|
|
58 |
// Destructor
|
|
59 |
//
|
|
60 |
{}
|
|
61 |
|
|
62 |
void CAcquireEntry::Deque()
|
|
63 |
//
|
|
64 |
// Deque List
|
|
65 |
//
|
|
66 |
{
|
|
67 |
iLink.Deque();
|
|
68 |
iLink.iPrev=iLink.iNext=NULL;
|
|
69 |
}
|
|
70 |
|
|
71 |
CAcquireOwnerList::CAcquireOwnerList()
|
|
72 |
{}
|
|
73 |
|
|
74 |
CAcquireOwnerList::~CAcquireOwnerList()
|
|
75 |
{}
|
|
76 |
|
|
77 |
CAcquireOwnerList* CAcquireOwnerList::NewL()
|
|
78 |
//
|
|
79 |
// Static function to create new acquire owner list
|
|
80 |
//
|
|
81 |
{
|
|
82 |
CAcquireOwnerList* self=new(ELeave) CAcquireOwnerList();
|
|
83 |
CleanupStack::PushL(self);
|
|
84 |
self->ConstructL();
|
|
85 |
CleanupStack::Pop(self);
|
|
86 |
return self;
|
|
87 |
}
|
|
88 |
|
|
89 |
void CAcquireOwnerList::ConstructL()
|
|
90 |
{
|
|
91 |
iAcquireList.SetOffset(_FOFF(CAcquireEntry,iLink));
|
|
92 |
}
|
|
93 |
|
|
94 |
CAcquireEntry* CAcquireOwnerList::FindByTsyReqHandle(const TTsyReqHandle aTsyReqHandle)
|
|
95 |
//
|
|
96 |
// Searches for client interested in taking ownership of call, by its TsyReqHandle
|
|
97 |
//
|
|
98 |
{
|
|
99 |
CAcquireEntry* entry;
|
|
100 |
TDblQueIter<CAcquireEntry> iter(iAcquireList);
|
|
101 |
while(entry = iter++, entry!=NULL)
|
|
102 |
{
|
|
103 |
if(entry->iTsyReqHandle==aTsyReqHandle)
|
|
104 |
return entry;
|
|
105 |
}
|
|
106 |
return NULL;
|
|
107 |
}
|
|
108 |
|
|
109 |
void CAcquireOwnerList::Remove(CAcquireEntry* aEntry)
|
|
110 |
{
|
|
111 |
aEntry->Deque();
|
|
112 |
delete aEntry;
|
|
113 |
}
|
|
114 |
|
|
115 |
//
|
|
116 |
// CHeartbeatRunner - periodic class to count seconds from beginning of call
|
|
117 |
//
|
|
118 |
CHeartbeatRunner* CHeartbeatRunner::NewL(CCallHayes* aCallHayes,CNotifications* aNotificationStore)
|
|
119 |
{
|
|
120 |
CHeartbeatRunner* self=new (ELeave) CHeartbeatRunner(aCallHayes,aNotificationStore);
|
|
121 |
CleanupStack::PushL(self);
|
|
122 |
self->ConstructL();
|
|
123 |
CleanupStack::Pop();
|
|
124 |
return self;
|
|
125 |
}
|
|
126 |
|
|
127 |
CHeartbeatRunner::CHeartbeatRunner(CCallHayes* aCallHayes,CNotifications* aNotificationStore)
|
|
128 |
:iCallHayes(aCallHayes), iNotificationStore(aNotificationStore)
|
|
129 |
{}
|
|
130 |
|
|
131 |
void CHeartbeatRunner::ConstructL()
|
|
132 |
{
|
|
133 |
iHeartbeat=CHeartbeat::NewL(0); // neutral priority
|
|
134 |
}
|
|
135 |
|
|
136 |
CHeartbeatRunner::~CHeartbeatRunner()
|
|
137 |
{
|
|
138 |
if (iHeartbeat != NULL)
|
|
139 |
iHeartbeat->Cancel();
|
|
140 |
delete iHeartbeat;
|
|
141 |
}
|
|
142 |
|
|
143 |
void CHeartbeatRunner::Start()
|
|
144 |
{
|
|
145 |
iStartTime.UniversalTime();
|
|
146 |
iHeartbeat->Start(ETwelveOClock,this);
|
|
147 |
}
|
|
148 |
|
|
149 |
void CHeartbeatRunner::Stop()
|
|
150 |
{
|
|
151 |
iHeartbeat->Cancel();
|
|
152 |
iTicks=0;
|
|
153 |
}
|
|
154 |
|
|
155 |
TTimeIntervalSeconds CHeartbeatRunner::CallDuration() const
|
|
156 |
{
|
|
157 |
TTimeIntervalSeconds duration(iTicks);
|
|
158 |
return duration;
|
|
159 |
}
|
|
160 |
|
|
161 |
// private functions
|
|
162 |
|
|
163 |
void CHeartbeatRunner::Beat()
|
|
164 |
{
|
|
165 |
iTicks++;
|
|
166 |
iNotificationStore->CheckNotification(iCallHayes,ETimePeriodElapsed);
|
|
167 |
}
|
|
168 |
|
|
169 |
void CHeartbeatRunner::Synchronize()
|
|
170 |
{
|
|
171 |
TInt ticksMissed = 0;
|
|
172 |
TTime desiredTime = iStartTime + TTimeIntervalMicroSeconds(iTicks * KCallTimerInterval);
|
|
173 |
TTime currentTime; // set current time to now
|
|
174 |
currentTime.UniversalTime();
|
|
175 |
TTimeIntervalMicroSeconds missedTime = currentTime.MicroSecondsFrom(desiredTime);
|
|
176 |
// Calculate the ticks missed (quickly!)
|
|
177 |
TInt64 missedTimeInt = missedTime.Int64(); // convert the missed time interval to an Int64
|
|
178 |
ticksMissed = I64INT(missedTimeInt / KCallTimerInterval);
|
|
179 |
// The following loop increments the ticks missed by the same amount, but takes much longer
|
|
180 |
// while (desiredTime < currentTime)
|
|
181 |
// {
|
|
182 |
// desiredTime = desiredTime - TTimeIntervalMicroSeconds(iTickInterval);
|
|
183 |
// ticksMissed++;
|
|
184 |
// }
|
|
185 |
iTicks = iTicks + ticksMissed;
|
|
186 |
LOGTEXT3(_L8("Heartbeat function synchronising - from %d to %d"),iTicks-ticksMissed,iTicks);
|
|
187 |
if (ticksMissed!=0)
|
|
188 |
iNotificationStore->CheckNotification(iCallHayes,ETimePeriodElapsed);
|
|
189 |
}
|
|
190 |
|
|
191 |
//
|
|
192 |
// CCallHayes - General Call Functionality
|
|
193 |
//
|
|
194 |
void CCallHayes::CloseCall(TAny* aObj)
|
|
195 |
//
|
|
196 |
// Utility func for cleanup stack
|
|
197 |
//
|
|
198 |
{
|
|
199 |
((CObject*)aObj)->Close();
|
|
200 |
}
|
|
201 |
|
|
202 |
CCallHayes::CCallHayes(CATIO* aIo,CATInit* aInit,CPhoneGlobals* aPhoneGlobals)
|
|
203 |
: iPhoneGlobals(aPhoneGlobals),iIo(aIo),iInit(aInit)
|
|
204 |
{}
|
|
205 |
|
|
206 |
void CCallHayes::ConstructL(const TName& aName)
|
|
207 |
//
|
|
208 |
// Initialise Call Information
|
|
209 |
//
|
|
210 |
{
|
|
211 |
LOGTEXT(_L8("Entered CCallHayes::ConstructL()"));
|
|
212 |
iCallInfo.iCallName = aName;
|
|
213 |
iCallInfo.iBearerService.iBearerCaps = RCall::KBearerCapsCompressionUnknown | RCall::KBearerCapsProtocolUnknown;
|
|
214 |
iCallInfo.iBearerService.iBearerSpeed = RCall::EBearerDataUnknown;
|
|
215 |
iCallInfo.iHookStatus = RCall::EHookStatusOn;
|
|
216 |
iCallInfo.iClientPanicOccurred = ENoPanicOccurred;
|
|
217 |
// Read default call preferences from database
|
|
218 |
GetDefaultCallParams();
|
|
219 |
iCallInfo.iLoanedToClient = EFalse;
|
|
220 |
if (iPhoneGlobals->iPhoneStatus.iLineStatus == RCall::EStatusRinging)
|
|
221 |
{
|
|
222 |
iCallInfo.iMobileStatus = RMobileCall::EStatusRinging;
|
|
223 |
}
|
|
224 |
else
|
|
225 |
{
|
|
226 |
iCallInfo.iMobileStatus = RMobileCall::EStatusIdle;
|
|
227 |
}
|
|
228 |
|
|
229 |
iQuickInit=CATQuickInit::NewL(iIo,this,iPhoneGlobals);
|
|
230 |
iWaitForNoCarrier=CATWaitForNoCarrier::NewL(iIo,this,iPhoneGlobals);
|
|
231 |
iList=CAcquireOwnerList::NewL();
|
|
232 |
iCallTimer = CHeartbeatRunner::NewL(this,iPhoneGlobals->iNotificationStore);
|
|
233 |
LOGTEXT2(_L8("iCallTimer = %x"),iCallTimer);
|
|
234 |
}
|
|
235 |
|
|
236 |
CCallHayes::~CCallHayes()
|
|
237 |
{
|
|
238 |
LOGTEXT(_L8("Entered CCallHayes destructor"));
|
|
239 |
if (Owner())
|
|
240 |
REINTERPRET_CAST(CLineHayes*,Owner())->RemoveCall(this);
|
|
241 |
iPhoneGlobals->iNotificationStore->RemoveClientFromLastEvents(this);
|
|
242 |
delete iWaitForNoCarrier;
|
|
243 |
delete iList;
|
|
244 |
delete iQuickInit;
|
|
245 |
delete iCallTimer;
|
|
246 |
}
|
|
247 |
|
|
248 |
CTelObject::TReqMode CCallHayes::ReqModeL(const TInt aIpc)
|
|
249 |
{
|
|
250 |
TReqMode reqMode = CCallBase::ReqModeL(aIpc);
|
|
251 |
if ((reqMode & KReqModeFlowControlObeyed || aIpc==EEtelCallAnswer) && iPhoneGlobals->iPhoneStatus.iDataPortLoaned)
|
|
252 |
{
|
|
253 |
LOGTEXT2(_L8("ReqModeL Leaving with KErrInUse as data port is loaned (aIpc=%d)"),aIpc);
|
|
254 |
User::Leave(KErrInUse);
|
|
255 |
}
|
|
256 |
return reqMode;
|
|
257 |
}
|
|
258 |
|
|
259 |
TInt CCallHayes::RegisterNotification(const TInt /*aIpc*/)
|
|
260 |
{
|
|
261 |
return KErrNone;
|
|
262 |
}
|
|
263 |
TInt CCallHayes::DeregisterNotification(const TInt /*aIpc*/)
|
|
264 |
{
|
|
265 |
return KErrNone;
|
|
266 |
}
|
|
267 |
|
|
268 |
|
|
269 |
void CCallHayes::Init()
|
|
270 |
//
|
|
271 |
// Only CPhoneHayes::Init() is implemented as that is called first
|
|
272 |
//
|
|
273 |
{}
|
|
274 |
|
|
275 |
|
|
276 |
TInt CCallHayes::NotifyCapsChange(const TTsyReqHandle aTsyReqHandle, RCall::TCaps* aCaps)
|
|
277 |
{
|
|
278 |
LOGTEXT(_L8("Call:\tCaps Change Notification lodged"));
|
|
279 |
iPhoneGlobals->iNotificationStore->RegisterNotification(ECallCaps,aTsyReqHandle,this,aCaps);
|
|
280 |
return KErrNone;
|
|
281 |
}
|
|
282 |
|
|
283 |
TInt CCallHayes::NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
284 |
{
|
|
285 |
LOGTEXT(_L8("Call:\tCaps Change Notification cancelled"));
|
|
286 |
iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
|
|
287 |
return KErrNone;
|
|
288 |
}
|
|
289 |
|
|
290 |
TInt CCallHayes::NotifyHookChange(const TTsyReqHandle aTsyReqHandle, RCall::THookStatus* aHookStatus)
|
|
291 |
{
|
|
292 |
LOGTEXT(_L8("Call:\tHook Change Notification lodged"));
|
|
293 |
iPhoneGlobals->iNotificationStore->RegisterNotification(ECallHookChange,aTsyReqHandle,this,aHookStatus);
|
|
294 |
return KErrNone;
|
|
295 |
}
|
|
296 |
|
|
297 |
TInt CCallHayes::NotifyHookChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
298 |
{
|
|
299 |
LOGTEXT(_L8("Call:\tHook Change Notification cancelled"));
|
|
300 |
iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
|
|
301 |
return KErrNone;
|
|
302 |
}
|
|
303 |
|
|
304 |
TInt CCallHayes::NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus)
|
|
305 |
{
|
|
306 |
LOGTEXT(_L8("Call:\tStatus Change Notification lodged"));
|
|
307 |
iPhoneGlobals->iNotificationStore->RegisterNotification(ECallStatusChange,aTsyReqHandle,this,aStatus);
|
|
308 |
return KErrNone;
|
|
309 |
}
|
|
310 |
|
|
311 |
TInt CCallHayes::NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
312 |
{
|
|
313 |
LOGTEXT(_L8("Call:\tStatus Change Notification cancelled"));
|
|
314 |
iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
|
|
315 |
return KErrNone;
|
|
316 |
}
|
|
317 |
|
|
318 |
TInt CCallHayes::NotifyDurationChange(const TTsyReqHandle aTsyReqHandle,TTimeIntervalSeconds* aTime)
|
|
319 |
{
|
|
320 |
LOGTEXT(_L8("Call:\tDuration Change Notification lodged"));
|
|
321 |
iPhoneGlobals->iNotificationStore->RegisterNotification(ECallDurationChange,aTsyReqHandle,this,aTime);
|
|
322 |
return KErrNone;
|
|
323 |
}
|
|
324 |
|
|
325 |
TInt CCallHayes::NotifyDurationChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
326 |
{
|
|
327 |
LOGTEXT(_L8("Call:\tDuration Change Notification cancelled"));
|
|
328 |
iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
|
|
329 |
return KErrNone;
|
|
330 |
}
|
|
331 |
|
|
332 |
TInt CCallHayes::GetInfo(const TTsyReqHandle aTsyReqHandle, RCall::TCallInfo* aCallInfo)
|
|
333 |
{
|
|
334 |
aCallInfo->iCallName = iCallInfo.iCallName;
|
|
335 |
aCallInfo->iStatus = GetCoreCallStatus();
|
|
336 |
aCallInfo->iHookStatus = iCallInfo.iHookStatus;
|
|
337 |
aCallInfo->iLineName = Owner()->Name();
|
|
338 |
GetCallDuration(aCallInfo->iDuration);
|
|
339 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
340 |
return KErrNone;
|
|
341 |
}
|
|
342 |
|
|
343 |
TInt CCallHayes::GetStatus(const TTsyReqHandle aTsyReqHandle, RCall::TStatus* aCallStatus)
|
|
344 |
{
|
|
345 |
LOGTEXT(_L8("Call:\tGetStatus() called"));
|
|
346 |
*aCallStatus = GetCoreCallStatus();
|
|
347 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
348 |
return KErrNone;
|
|
349 |
}
|
|
350 |
|
|
351 |
TInt CCallHayes::TransferOwnership(const TTsyReqHandle aTsyReqHandle)
|
|
352 |
//
|
|
353 |
// Transfer call ownership
|
|
354 |
//
|
|
355 |
{
|
|
356 |
LOGTEXT(_L8("Call:\tTransferOwnership called"));
|
|
357 |
if (CheckOwnership(aTsyReqHandle)!=CCallBase::EOwnedTrue)
|
|
358 |
{
|
|
359 |
ReqCompleted(aTsyReqHandle,KErrEtelNotCallOwner);
|
|
360 |
return KErrNone;
|
|
361 |
}
|
|
362 |
|
|
363 |
if(iList->iAcquireList.IsEmpty()) // no one interested in this call !
|
|
364 |
{
|
|
365 |
ReqCompleted(aTsyReqHandle,KErrEtelNoClientInterestedInThisCall);
|
|
366 |
return KErrNone;
|
|
367 |
}
|
|
368 |
|
|
369 |
CAcquireEntry* entry=iList->iAcquireList.First();
|
|
370 |
if (entry) // someone interested in this call
|
|
371 |
{
|
|
372 |
LOGTEXT(_L8("Call:\tTransferOwnership successful"));
|
|
373 |
(void)SetOwnership(entry->iTsyReqHandle);
|
|
374 |
ReqCompleted(entry->iTsyReqHandle,KErrNone);
|
|
375 |
iList->Remove(entry);
|
|
376 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
377 |
}
|
|
378 |
return KErrNone;
|
|
379 |
}
|
|
380 |
|
|
381 |
TInt CCallHayes::AcquireOwnership(const TTsyReqHandle aTsyReqHandle)
|
|
382 |
//
|
|
383 |
// Acquire call Ownership (server has already checked client does not own it)
|
|
384 |
// If call is unowned and idle, this request is completed with CallNotActive.
|
|
385 |
// A call must never be owned and idle concurrently.
|
|
386 |
//
|
|
387 |
{
|
|
388 |
LOGTEXT(_L8("Call:\tAcquireOwnership called"));
|
|
389 |
if (CheckOwnership(aTsyReqHandle)==CCallBase::EOwnedUnowned)
|
|
390 |
{
|
|
391 |
LOGTEXT(_L8("Call:\tAcquireOwnership unsuccessful as call is not owned already"));
|
|
392 |
ReqCompleted(aTsyReqHandle,KErrEtelCallNotActive);
|
|
393 |
}
|
|
394 |
else
|
|
395 |
{
|
|
396 |
if(iList->iAcquireList.IsEmpty())
|
|
397 |
// List is empty. Client is the first one to request ownership of the call.
|
|
398 |
{
|
|
399 |
CAcquireEntry* entry=NULL;
|
|
400 |
TRAPD(err,entry=CAcquireEntry::NewL(aTsyReqHandle));
|
|
401 |
if(err==KErrNone)
|
|
402 |
iList->iAcquireList.AddLast(*entry);
|
|
403 |
else
|
|
404 |
return err;
|
|
405 |
}
|
|
406 |
else
|
|
407 |
// List is not empty. Another client has already requested to acquire ownership of the call.
|
|
408 |
// Only one client can be waiting to acquire ownership at any one time.
|
|
409 |
return KErrInUse;
|
|
410 |
}
|
|
411 |
return KErrNone;
|
|
412 |
}
|
|
413 |
|
|
414 |
TInt CCallHayes::AcquireOwnershipCancel(const TTsyReqHandle aTsyReqHandle)
|
|
415 |
//
|
|
416 |
// Cancel Acquire call Ownership
|
|
417 |
//
|
|
418 |
{
|
|
419 |
CAcquireEntry* entry=iList->FindByTsyReqHandle(aTsyReqHandle);
|
|
420 |
__ASSERT_ALWAYS(entry!=NULL,Panic(EAcquirerNotFound));
|
|
421 |
if (entry != NULL)
|
|
422 |
{
|
|
423 |
iList->Remove(entry);
|
|
424 |
ReqCompleted(aTsyReqHandle, KErrCancel);
|
|
425 |
}
|
|
426 |
else
|
|
427 |
{
|
|
428 |
ReqCompleted(aTsyReqHandle, KErrNotFound);
|
|
429 |
}
|
|
430 |
return KErrNone;
|
|
431 |
}
|
|
432 |
|
|
433 |
TInt CCallHayes::GetBearerServiceInfo(const TTsyReqHandle aTsyReqHandle,RCall::TBearerService* aBearerService)
|
|
434 |
{
|
|
435 |
*aBearerService = iCallInfo.iBearerService;
|
|
436 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
437 |
return KErrNone;
|
|
438 |
}
|
|
439 |
|
|
440 |
TInt CCallHayes::GetCallParams(const TTsyReqHandle aTsyReqHandle, TDes8* aParams)
|
|
441 |
//
|
|
442 |
// Call parameters are only set when connecting a call, so there have no meaning when a
|
|
443 |
// call is not in progress.
|
|
444 |
//
|
|
445 |
{
|
|
446 |
if (RMobileCall::EStatusIdle != iCallInfo.iMobileStatus &&
|
|
447 |
RMobileCall::EStatusUnknown != iCallInfo.iMobileStatus )
|
|
448 |
{
|
|
449 |
TPckg<RCall::TCallParams>* paramsPckg = (TPckg<RCall::TCallParams>*)aParams;
|
|
450 |
RCall::TCallParams& callparams = (*paramsPckg)();
|
|
451 |
|
|
452 |
//
|
|
453 |
// Configure basic TCallParams parameters
|
|
454 |
callparams.iSpeakerControl = iCallInfo.iSpeakerControl;
|
|
455 |
callparams.iSpeakerVolume = iCallInfo.iSpeakerVolume;
|
|
456 |
callparams.iInterval = iCallInfo.iInterval;
|
|
457 |
callparams.iWaitForDialTone = iCallInfo.iWaitForDialTone;
|
|
458 |
|
|
459 |
//
|
|
460 |
// Configure additional params as required
|
|
461 |
if(callparams.ExtensionId()==RMobileCall::KETelMobileCallParamsV1)
|
|
462 |
{
|
|
463 |
//
|
|
464 |
// Configure RMobileCall::TMobileCallParamsV1 parameters
|
|
465 |
RMobileCall::TMobileCallParamsV1Pckg* pckg = (RMobileCall::TMobileCallParamsV1Pckg*)aParams;
|
|
466 |
RMobileCall::TMobileCallParamsV1& params = (*pckg)();
|
|
467 |
params.iIdRestrict=iCallInfo.iCallParams.iIdRestrict;
|
|
468 |
params.iCug=iCallInfo.iCallParams.iCug;
|
|
469 |
params.iAutoRedial=iCallInfo.iCallParams.iAutoRedial;
|
|
470 |
}
|
|
471 |
else if(callparams.ExtensionId()==RMobileCall::KETelMobileDataCallParamsV1)
|
|
472 |
{
|
|
473 |
//
|
|
474 |
// Configure RMobileCall::TMobileDataCallParamsV1 parameters
|
|
475 |
RMobileCall::TMobileDataCallParamsV1Pckg* pckg = (RMobileCall::TMobileDataCallParamsV1Pckg*)aParams;
|
|
476 |
RMobileCall::TMobileDataCallParamsV1& params = (*pckg)();
|
|
477 |
params.iService=iCallInfo.iCallParams.iService;
|
|
478 |
params.iSpeed=iCallInfo.iCallParams.iSpeed;
|
|
479 |
params.iProtocol=iCallInfo.iCallParams.iProtocol;
|
|
480 |
params.iQoS=iCallInfo.iCallParams.iQoS;
|
|
481 |
params.iRLPVersion=iCallInfo.iCallParams.iRLPVersion;
|
|
482 |
params.iModemToMSWindowSize=iCallInfo.iCallParams.iModemToMSWindowSize;
|
|
483 |
params.iMSToModemWindowSize=iCallInfo.iCallParams.iMSToModemWindowSize;
|
|
484 |
params.iAckTimer=iCallInfo.iCallParams.iAckTimer;
|
|
485 |
params.iRetransmissionAttempts=iCallInfo.iCallParams.iRetransmissionAttempts;
|
|
486 |
params.iResequencingPeriod=iCallInfo.iCallParams.iResequencingPeriod;
|
|
487 |
params.iV42bisReq=iCallInfo.iCallParams.iV42bisReq;
|
|
488 |
params.iV42bisCodewordsNum=iCallInfo.iCallParams.iV42bisCodewordsNum;
|
|
489 |
params.iV42bisMaxStringLength=iCallInfo.iCallParams.iV42bisMaxStringLength;
|
|
490 |
}
|
|
491 |
else if(callparams.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV1)
|
|
492 |
{
|
|
493 |
//
|
|
494 |
// Configure RMobileCall::TMobileHscsdCallParamsV1 parameters
|
|
495 |
RMobileCall::TMobileHscsdCallParamsV1Pckg* pckg = (RMobileCall::TMobileHscsdCallParamsV1Pckg*)aParams;
|
|
496 |
RMobileCall::TMobileHscsdCallParamsV1& params = (*pckg)();
|
|
497 |
params.iWantedAiur=iCallInfo.iCallParams.iWantedAiur;
|
|
498 |
params.iWantedRxTimeSlots=iCallInfo.iCallParams.iWantedRxTimeSlots;
|
|
499 |
params.iMaxTimeSlots=iCallInfo.iCallParams.iMaxTimeSlots;
|
|
500 |
params.iCodings=iCallInfo.iCallParams.iCodings;
|
|
501 |
params.iAsymmetry=iCallInfo.iCallParams.iAsymmetry;
|
|
502 |
params.iUserInitUpgrade=iCallInfo.iCallParams.iUserInitUpgrade;
|
|
503 |
}
|
|
504 |
|
|
505 |
//
|
|
506 |
// Complete the clients request
|
|
507 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
508 |
}
|
|
509 |
else
|
|
510 |
{
|
|
511 |
ReqCompleted(aTsyReqHandle,KErrUnknown);
|
|
512 |
}
|
|
513 |
return KErrNone;
|
|
514 |
}
|
|
515 |
|
|
516 |
TInt CCallHayes::GetCallDuration(const TTsyReqHandle aTsyReqHandle, TTimeIntervalSeconds* aTime)
|
|
517 |
{
|
|
518 |
if ( RMobileCall::EStatusConnected != iCallInfo.iMobileStatus &&
|
|
519 |
RMobileCall::EStatusDisconnecting != iCallInfo.iMobileStatus)
|
|
520 |
{
|
|
521 |
ReqCompleted(aTsyReqHandle,KErrEtelCallNotActive);
|
|
522 |
return KErrNone;
|
|
523 |
}
|
|
524 |
*aTime = iCallTimer->CallDuration();
|
|
525 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
526 |
return KErrNone;
|
|
527 |
}
|
|
528 |
|
|
529 |
void CCallHayes::GetCallDuration(TTimeIntervalSeconds& aTime) const
|
|
530 |
{
|
|
531 |
aTime = iCallTimer->CallDuration();
|
|
532 |
}
|
|
533 |
|
|
534 |
void CCallHayes::GetDefaultCallParams()
|
|
535 |
{
|
|
536 |
iPhoneGlobals->iConfiguration->GetIntervalPref(iCallInfo.iInterval);
|
|
537 |
iPhoneGlobals->iConfiguration->GetSpeakerSettingPref(iCallInfo.iSpeakerControl);
|
|
538 |
iPhoneGlobals->iConfiguration->GetSpeakerVolumePref(iCallInfo.iSpeakerVolume);
|
|
539 |
iPhoneGlobals->iConfiguration->GetWaitForDialTonePref(iCallInfo.iWaitForDialTone);
|
|
540 |
}
|
|
541 |
|
|
542 |
void CCallHayes::SetCallParams(const TDesC8* aParams)
|
|
543 |
{
|
|
544 |
if ((*aParams).Length()==0)
|
|
545 |
// Always returns KErrNone
|
|
546 |
GetDefaultCallParams();
|
|
547 |
else
|
|
548 |
{
|
|
549 |
TPckg<RCall::TCallParams>* paramsPckg = (TPckg<RCall::TCallParams>*)aParams;
|
|
550 |
RCall::TCallParams& callparams = (*paramsPckg)();
|
|
551 |
iCallInfo.iSpeakerControl = callparams.iSpeakerControl;
|
|
552 |
iCallInfo.iSpeakerVolume = callparams.iSpeakerVolume;
|
|
553 |
iCallInfo.iInterval = callparams.iInterval;
|
|
554 |
iCallInfo.iWaitForDialTone = callparams.iWaitForDialTone;
|
|
555 |
}
|
|
556 |
}
|
|
557 |
|
|
558 |
TInt CCallHayes::ValidateRequest(const TTsyReqHandle aTsyReqHandle, RCall::TStatus aLineStatus)
|
|
559 |
//
|
|
560 |
// Validating a request
|
|
561 |
//
|
|
562 |
{
|
|
563 |
CCallBase::TCallOwnership owned = CheckOwnership(aTsyReqHandle);
|
|
564 |
if (owned==CCallBase::EOwnedFalse) // call owned by another client
|
|
565 |
{
|
|
566 |
return KErrEtelNotCallOwner;
|
|
567 |
}
|
|
568 |
if (iPhoneGlobals->iPhoneStatus.iLineStatus != aLineStatus)
|
|
569 |
{
|
|
570 |
if (aLineStatus==RCall::EStatusIdle)
|
|
571 |
// implies that this call is already active (assuming an owned call is
|
|
572 |
// an active call) or ringing or unknown
|
|
573 |
{
|
|
574 |
return KErrInUse;
|
|
575 |
}
|
|
576 |
else if (aLineStatus==RCall::EStatusRinging)
|
|
577 |
{
|
|
578 |
return KErrNotReady;
|
|
579 |
}
|
|
580 |
}
|
|
581 |
return KErrNone;
|
|
582 |
}
|
|
583 |
|
|
584 |
|
|
585 |
RCall::TStatus CCallHayes::GetCoreCallStatus()
|
|
586 |
{
|
|
587 |
RCall::TStatus coreStatus;
|
|
588 |
if (iCallInfo.iMobileStatus <= RMobileCall::EStatusDisconnecting)
|
|
589 |
//coreStatus = static_cast<RCall::TStatus>(iCallInfo.iMobileStatus);
|
|
590 |
coreStatus = (RCall::TStatus)iCallInfo.iMobileStatus;
|
|
591 |
else
|
|
592 |
switch (iCallInfo.iMobileStatus)
|
|
593 |
{
|
|
594 |
case RMobileCall::EStatusReconnectPending:
|
|
595 |
case RMobileCall::EStatusHold:
|
|
596 |
coreStatus = RCall::EStatusConnected;
|
|
597 |
break;
|
|
598 |
case RMobileCall::EStatusWaitingAlternatingCallSwitch:
|
|
599 |
coreStatus = RCall::EStatusIdle;
|
|
600 |
break;
|
|
601 |
default:
|
|
602 |
coreStatus = RCall::EStatusUnknown;
|
|
603 |
break;
|
|
604 |
}
|
|
605 |
return coreStatus;
|
|
606 |
}
|
|
607 |
|
|
608 |
TInt CCallHayes::ChangeCallStatus(RMobileCall::TMobileCallStatus aCallStatus)
|
|
609 |
{
|
|
610 |
if (iCallInfo.iMobileStatus != aCallStatus)
|
|
611 |
{
|
|
612 |
iCallInfo.iMobileStatus = aCallStatus;
|
|
613 |
|
|
614 |
if (aCallStatus == RMobileCall::EStatusIdle)
|
|
615 |
{
|
|
616 |
iCallInfo.iHookStatus = RCall::EHookStatusOn;
|
|
617 |
iPhoneGlobals->iNotificationStore->CheckNotification(this,EBecomeIdle);
|
|
618 |
}
|
|
619 |
else if (aCallStatus != RMobileCall::EStatusUnknown && aCallStatus != RMobileCall::EStatusRinging)
|
|
620 |
{
|
|
621 |
iCallInfo.iHookStatus = RCall::EHookStatusOff;
|
|
622 |
}
|
|
623 |
if (aCallStatus == RMobileCall::EStatusConnected)
|
|
624 |
{
|
|
625 |
iPhoneGlobals->iNotificationStore->CheckNotification(this,EConnected);
|
|
626 |
iIo->Cancel();
|
|
627 |
TCommConfig aConfigPckg;
|
|
628 |
TInt ret = iPhoneGlobals->iConfiguration->PortConfig(aConfigPckg,EConfigTypeConnect);
|
|
629 |
if (ret==KErrNone)
|
|
630 |
ret = iIo->ConfigurePort(aConfigPckg);
|
|
631 |
// if (!(iIo->ReadPending()))
|
|
632 |
// iIo->Read();
|
|
633 |
iCallInfo.iTimeCallBegan.UniversalTime();
|
|
634 |
return ret;
|
|
635 |
}
|
|
636 |
}
|
|
637 |
return KErrNone;
|
|
638 |
}
|
|
639 |
|
|
640 |
void CCallHayes::ChangeLineStatus(RCall::TStatus aLineStatus)
|
|
641 |
{
|
|
642 |
iPhoneGlobals->iPhoneStatus.iLineStatus = aLineStatus;
|
|
643 |
}
|
|
644 |
|
|
645 |
void CCallHayes::SetToIdle()
|
|
646 |
{
|
|
647 |
iWaitForNoCarrier->StopWait();
|
|
648 |
// Always returns KErrNone
|
|
649 |
(void)SetUnowned();
|
|
650 |
iPhoneGlobals->iPhoneStatus.iMode = RPhone::EModeIdle;
|
|
651 |
ChangeLineStatus(RCall::EStatusIdle); // line status should be changed first because
|
|
652 |
// ChangeCallStatus is the function which sends
|
|
653 |
// the new event to the Notification Handler,
|
|
654 |
// and this will complete both line and call status
|
|
655 |
// notifications, taking the new statuses from the
|
|
656 |
// CLineHayes and CCallHayes objects.
|
|
657 |
// EStatusIdle always results in KErrNone return value
|
|
658 |
(void)ChangeCallStatus(RMobileCall::EStatusIdle);
|
|
659 |
StopCallTicker();
|
|
660 |
}
|
|
661 |
|
|
662 |
void CCallHayes::SetToIdleAndCompleteReq(TTsyReqHandle aTsyReqHandle,TInt aStatus)
|
|
663 |
{
|
|
664 |
SetToIdle();
|
|
665 |
ReqCompleted(aTsyReqHandle, aStatus);
|
|
666 |
}
|
|
667 |
|
|
668 |
void CCallHayes::GetCallInfo(TCallInfoIndex* aCallInfoIndex)
|
|
669 |
//
|
|
670 |
// Copied field by field since TCallInfoTSY is different to TCallInfoIndex
|
|
671 |
//
|
|
672 |
{
|
|
673 |
aCallInfoIndex->iInfo.iCallName = iCallInfo.iCallName;
|
|
674 |
aCallInfoIndex->iInfo.iStatus = GetCoreCallStatus();
|
|
675 |
aCallInfoIndex->iInfo.iCallCapsFlags = 0;
|
|
676 |
}
|
|
677 |
|
|
678 |
TBool CCallHayes::CheckName(const TDesC& aName) const
|
|
679 |
//
|
|
680 |
// Return TRUE if name is the same as the name of this call
|
|
681 |
{
|
|
682 |
if (iCallInfo.iCallName.CompareF(aName))
|
|
683 |
return EFalse;
|
|
684 |
else
|
|
685 |
return ETrue;
|
|
686 |
}
|
|
687 |
|
|
688 |
TCallInfoTSY* CCallHayes::CallInfo()
|
|
689 |
{
|
|
690 |
return &iCallInfo;
|
|
691 |
}
|
|
692 |
|
|
693 |
void CCallHayes::StartCallTicker() const
|
|
694 |
{
|
|
695 |
iCallTimer->Start();
|
|
696 |
}
|
|
697 |
|
|
698 |
void CCallHayes::StopCallTicker() const
|
|
699 |
{
|
|
700 |
iCallTimer->Stop();
|
|
701 |
}
|
|
702 |
|
|
703 |
void CCallHayes::ResetIsForIncomingCall()
|
|
704 |
{
|
|
705 |
iIsForIncomingCall=EFalse;
|
|
706 |
}
|
|
707 |
|
|
708 |
TBool CCallHayes::IsForIncomingCall() const
|
|
709 |
{
|
|
710 |
return iIsForIncomingCall;
|
|
711 |
}
|
|
712 |
|
|
713 |
void CCallHayes::SetOwnedByTSY()
|
|
714 |
{
|
|
715 |
iIsOwnedByTSY=ETrue;
|
|
716 |
}
|
|
717 |
|
|
718 |
void CCallHayes::SetUnownedByTSY()
|
|
719 |
{
|
|
720 |
iIsOwnedByTSY=EFalse;
|
|
721 |
}
|
|
722 |
|
|
723 |
TBool CCallHayes::IsOwnedByTSY() const
|
|
724 |
{
|
|
725 |
return iIsOwnedByTSY;
|
|
726 |
}
|
|
727 |
|
|
728 |
|
|
729 |
//
|
|
730 |
// Functions which are supported in one line but not the other
|
|
731 |
//
|
|
732 |
TInt CCallHayes::LoanDataPort(const TTsyReqHandle,RCall::TCommPort*)
|
|
733 |
{
|
|
734 |
return KErrNotSupported;
|
|
735 |
}
|
|
736 |
|
|
737 |
TInt CCallHayes::LoanDataPortCancel(const TTsyReqHandle)
|
|
738 |
{
|
|
739 |
return KErrNotSupported;
|
|
740 |
}
|
|
741 |
|
|
742 |
TInt CCallHayes::RecoverDataPort(const TTsyReqHandle)
|
|
743 |
{
|
|
744 |
return KErrNotSupported;
|
|
745 |
}
|
|
746 |
|
|
747 |
TInt CCallHayes::RecoverDataPortAndRelinquishOwnership()
|
|
748 |
{
|
|
749 |
return KErrNotSupported;
|
|
750 |
}
|
|
751 |
|
|
752 |
TInt CCallHayes::GetFaxSettings(const TTsyReqHandle,RCall::TFaxSessionSettings*)
|
|
753 |
{
|
|
754 |
return KErrNotSupported;
|
|
755 |
}
|
|
756 |
|
|
757 |
TInt CCallHayes::SetFaxSettings(const TTsyReqHandle,const RCall::TFaxSessionSettings*)
|
|
758 |
{
|
|
759 |
return KErrNotSupported;
|
|
760 |
}
|
|
761 |
|
|
762 |
CTelObject* CCallHayes::OpenNewObjectByNameL(const TDesC& /*aName*/)
|
|
763 |
{
|
|
764 |
User::Leave(KErrNotSupported);
|
|
765 |
return NULL;
|
|
766 |
}
|
|
767 |
|
|
768 |
CTelObject* CCallHayes::OpenNewObjectL(TDes& /*aNewName*/)
|
|
769 |
{
|
|
770 |
User::Leave(KErrNotSupported);
|
|
771 |
return NULL;
|
|
772 |
}
|
|
773 |
|
|
774 |
TInt CCallHayes::CheckAndSetRegistrationParams(const TInt /*aIpc*/,const TDes8* /*aDes1*/,const TDes8* /*aDes2*/)
|
|
775 |
{
|
|
776 |
return KErrNone;
|
|
777 |
}
|
|
778 |
|
|
779 |
TInt CCallHayes::ExtFunc(const TTsyReqHandle,const TInt, const TDataPackage&)
|
|
780 |
//
|
|
781 |
// Unsupported in this TSY
|
|
782 |
//
|
|
783 |
{
|
|
784 |
return KErrNotSupported;
|
|
785 |
}
|
|
786 |
|
|
787 |
/*
|
|
788 |
* CCallMobile class that implements Multimode ETel Mobile Call requests
|
|
789 |
*/
|
|
790 |
|
|
791 |
CCallMobile::CCallMobile(CATIO* aIo,CATInit* aInit,CPhoneGlobals* aPhoneGlobals)
|
|
792 |
: CCallHayes(aIo, aInit, aPhoneGlobals)
|
|
793 |
{
|
|
794 |
}
|
|
795 |
|
|
796 |
CCallMobile::~CCallMobile()
|
|
797 |
{
|
|
798 |
}
|
|
799 |
|
|
800 |
CTelObject::TReqMode CCallMobile::ReqModeL(const TInt aIpc)
|
|
801 |
{
|
|
802 |
// ReqModeL is called from the server's CTelObject::ReqAnalyserL
|
|
803 |
// in order to check the type of request it has
|
|
804 |
|
|
805 |
CTelObject::TReqMode ret=0;
|
|
806 |
switch (aIpc)
|
|
807 |
{
|
|
808 |
//
|
|
809 |
// No Flow Control NOR Multiple Completion
|
|
810 |
//
|
|
811 |
case EMobileCallGetMobileCallCaps:
|
|
812 |
case EMobileCallGetMobileCallStatus:
|
|
813 |
break;
|
|
814 |
|
|
815 |
case EMobileCallGetMobileDataCallCaps:
|
|
816 |
break;
|
|
817 |
//
|
|
818 |
// Multiple Completion Services with Immediate Server Repost
|
|
819 |
// (Usually Notifications)
|
|
820 |
//
|
|
821 |
case EMobileCallNotifyMobileCallStatusChange:
|
|
822 |
case EMobileCallNotifyMobileCallCapsChange:
|
|
823 |
|
|
824 |
ret=KReqModeMultipleCompletionEnabled | KReqModeRePostImmediately;
|
|
825 |
break;
|
|
826 |
//
|
|
827 |
//
|
|
828 |
//
|
|
829 |
default:
|
|
830 |
ret=CCallHayes::ReqModeL(aIpc);
|
|
831 |
break;
|
|
832 |
}
|
|
833 |
|
|
834 |
return ret;
|
|
835 |
}
|
|
836 |
|
|
837 |
|
|
838 |
TInt CCallMobile::NumberOfSlotsL(const TInt aIpc)
|
|
839 |
{
|
|
840 |
// NumberOfSlotsL is called by the server when it is registering a new notification
|
|
841 |
// It enables the TSY to tell the server how many buffer slots to allocate for
|
|
842 |
// "repost immediately" notifications that may trigger before clients collect them
|
|
843 |
|
|
844 |
TInt numberOfSlots=1;
|
|
845 |
switch (aIpc)
|
|
846 |
{
|
|
847 |
case EMobileCallNotifyMobileCallStatusChange:
|
|
848 |
case EMobileCallNotifyMobileCallCapsChange:
|
|
849 |
LOGTEXT(_L8("CCallMobile: Registered with 5 slots"));
|
|
850 |
numberOfSlots=5;
|
|
851 |
break;
|
|
852 |
default:
|
|
853 |
numberOfSlots = CCallBase::NumberOfSlotsL(aIpc);
|
|
854 |
break;
|
|
855 |
}
|
|
856 |
return numberOfSlots;
|
|
857 |
}
|
|
858 |
|
|
859 |
|
|
860 |
TInt CCallMobile::ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,
|
|
861 |
const TDataPackage& aPackage)
|
|
862 |
{
|
|
863 |
// ExtFunc is called by the server when it has a "extended", i.e. non-core ETel request
|
|
864 |
// for the TSY to process
|
|
865 |
// A request handle, request type and request data are passed to the TSY
|
|
866 |
|
|
867 |
TAny* dataPtr=aPackage.Ptr1();
|
|
868 |
|
|
869 |
// The request data has to extracted from TDataPackage and the TAny* pointers have to
|
|
870 |
// be "cast" to the expected request data type
|
|
871 |
|
|
872 |
switch (aIpc)
|
|
873 |
{
|
|
874 |
//
|
|
875 |
// No Flow Control NOR Multiple Completion
|
|
876 |
//
|
|
877 |
case EMobileCallGetMobileCallCaps:
|
|
878 |
return GetMobileCallCaps(aTsyReqHandle, aPackage.Des1n());
|
|
879 |
|
|
880 |
case EMobileCallGetMobileCallStatus:
|
|
881 |
return GetMobileCallStatus(aTsyReqHandle,
|
|
882 |
REINTERPRET_CAST(RMobileCall::TMobileCallStatus*,dataPtr));
|
|
883 |
//
|
|
884 |
// Multiple Completion Services with Immediate Server Repost
|
|
885 |
// (Usually Notifications)
|
|
886 |
//
|
|
887 |
case EMobileCallNotifyMobileCallStatusChange:
|
|
888 |
return NotifyMobileCallStatusChange(aTsyReqHandle,
|
|
889 |
REINTERPRET_CAST(RMobileCall::TMobileCallStatus*, dataPtr));
|
|
890 |
|
|
891 |
case EMobileCallNotifyMobileCallCapsChange:
|
|
892 |
return NotifyMobileCallCapsChange(aTsyReqHandle, aPackage.Des1n());
|
|
893 |
|
|
894 |
//
|
|
895 |
// Cancels
|
|
896 |
//
|
|
897 |
case EMobileCallNotifyMobileCallStatusChangeCancel:
|
|
898 |
return NotifyMobileCallStatusChangeCancel(aTsyReqHandle);
|
|
899 |
|
|
900 |
case EMobileCallNotifyMobileCallCapsChangeCancel:
|
|
901 |
return NotifyMobileCallCapsChangeCancel(aTsyReqHandle);
|
|
902 |
|
|
903 |
default:
|
|
904 |
return KErrNotSupported;
|
|
905 |
}
|
|
906 |
}
|
|
907 |
|
|
908 |
TInt CCallMobile::CancelService(const TInt aIpc, const TTsyReqHandle aTsyReqHandle)
|
|
909 |
{
|
|
910 |
// CancelService is called by the server when it is "cleaning-up" any still outstanding
|
|
911 |
// asynchronous requests before closing a client's sub-session.
|
|
912 |
// This will happen if a client closes its R-class handle without cancelling outstanding
|
|
913 |
// asynchronous requests.
|
|
914 |
|
|
915 |
switch (aIpc)
|
|
916 |
{
|
|
917 |
case EMobileCallNotifyMobileCallStatusChange:
|
|
918 |
return NotifyMobileCallStatusChangeCancel(aTsyReqHandle);
|
|
919 |
case EMobileCallNotifyMobileCallCapsChange:
|
|
920 |
return NotifyMobileCallCapsChangeCancel(aTsyReqHandle);
|
|
921 |
default:
|
|
922 |
return CCallBase::CancelService(aIpc,aTsyReqHandle);
|
|
923 |
}
|
|
924 |
}
|
|
925 |
|
|
926 |
TInt CCallMobile::GetMobileCallCaps(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps)
|
|
927 |
{
|
|
928 |
LOGTEXT(_L8("CCallMobile: :GetMobileCallCaps called"));
|
|
929 |
|
|
930 |
RMobileCall::TMobileCallCapsV1Pckg *capsPckg = REINTERPRET_CAST(RMobileCall::TMobileCallCapsV1Pckg *,aCaps);
|
|
931 |
RMobileCall::TMobileCallCapsV1& caps = (*capsPckg)();
|
|
932 |
// Always returns KErrNone
|
|
933 |
(void)CollateCurrentMobileCaps(aTsyReqHandle, &caps.iCallControlCaps);
|
|
934 |
caps.iCallEventCaps=0; // no call events are supported
|
|
935 |
|
|
936 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
937 |
return KErrNone;
|
|
938 |
}
|
|
939 |
|
|
940 |
TInt CCallMobile::GetCaps(const TTsyReqHandle aTsyReqHandle,RCall::TCaps* aCallCaps)
|
|
941 |
{
|
|
942 |
(void)CollateCurrentCoreCaps(aTsyReqHandle, reinterpret_cast<TUint32*>(&aCallCaps->iFlags));
|
|
943 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
944 |
return KErrNone;
|
|
945 |
}
|
|
946 |
|
|
947 |
TBool CCallMobile::CollateCurrentMobileCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps)
|
|
948 |
{
|
|
949 |
CollateCoreCaps(aTsyReqHandle, aCallCaps);
|
|
950 |
if (iMobileCaps.iCallControlCaps != *aCallCaps)
|
|
951 |
{
|
|
952 |
iMobileCaps.iCallControlCaps = *aCallCaps;
|
|
953 |
return ETrue;
|
|
954 |
}
|
|
955 |
return EFalse;
|
|
956 |
}
|
|
957 |
|
|
958 |
TBool CCallMobile::CollateCurrentCoreCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps)
|
|
959 |
{
|
|
960 |
CollateCoreCaps(aTsyReqHandle, aCallCaps);
|
|
961 |
if (iCaps.iFlags != *aCallCaps)
|
|
962 |
{
|
|
963 |
iCaps.iFlags = *aCallCaps;
|
|
964 |
return ETrue;
|
|
965 |
}
|
|
966 |
return EFalse;
|
|
967 |
}
|
|
968 |
|
|
969 |
TInt CCallMobile::NotifyMobileCallCapsChange(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps)
|
|
970 |
{
|
|
971 |
LOGTEXT(_L8("CCallMobile::NotifyMobileCallCapsChange lodged"));
|
|
972 |
iPhoneGlobals->iNotificationStore->RegisterNotification(ECallMobileCaps,aTsyReqHandle,this,aCaps);
|
|
973 |
return KErrNone;
|
|
974 |
}
|
|
975 |
|
|
976 |
TInt CCallMobile::NotifyMobileCallCapsChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
977 |
{
|
|
978 |
LOGTEXT(_L8("CCallMobile::NotifyMobileCallCapsChangeCancel called"));
|
|
979 |
iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
|
|
980 |
return KErrNone;
|
|
981 |
}
|
|
982 |
|
|
983 |
TInt CCallMobile::GetMobileCallStatus(const TTsyReqHandle aTsyReqHandle,RMobileCall::TMobileCallStatus* aStatus)
|
|
984 |
{
|
|
985 |
LOGTEXT(_L8("CCallMobile::GetMobileCallStatus called"));
|
|
986 |
*aStatus=iCallInfo.iMobileStatus;
|
|
987 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
988 |
return KErrNone;
|
|
989 |
}
|
|
990 |
|
|
991 |
TInt CCallMobile::NotifyMobileCallStatusChange(const TTsyReqHandle aTsyReqHandle,RMobileCall::TMobileCallStatus* aStatus)
|
|
992 |
{
|
|
993 |
LOGTEXT(_L8("CCallMobile::NotifyMobileCallStatusChange lodged"));
|
|
994 |
iPhoneGlobals->iNotificationStore->RegisterNotification(EMobileCallStatusChange,aTsyReqHandle,this,aStatus);
|
|
995 |
return KErrNone;
|
|
996 |
}
|
|
997 |
|
|
998 |
TInt CCallMobile::NotifyMobileCallStatusChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
999 |
{
|
|
1000 |
LOGTEXT(_L8("CCallMobile::NotifyMobileCallStatusChangeCancel called"));
|
|
1001 |
iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
|
|
1002 |
return KErrNone;
|
|
1003 |
}
|
|
1004 |
|
|
1005 |
//
|
|
1006 |
// CCallMobileVoice - Voice Specific Call Functionality
|
|
1007 |
//
|
|
1008 |
|
|
1009 |
CCallMobileVoice* CCallMobileVoice::NewL(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals,const TName& aName)
|
|
1010 |
{
|
|
1011 |
CCallMobileVoice* voiceCall=new(ELeave) CCallMobileVoice(aATIO,aInit,aPhoneGlobals);
|
|
1012 |
TCleanupItem newCallVoiceHayesClose(CloseCall,voiceCall);
|
|
1013 |
CleanupStack::PushL(newCallVoiceHayesClose);
|
|
1014 |
voiceCall->ConstructL(aName);
|
|
1015 |
CleanupStack::Pop();
|
|
1016 |
return voiceCall;
|
|
1017 |
}
|
|
1018 |
|
|
1019 |
CCallMobileVoice::CCallMobileVoice(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals)
|
|
1020 |
: CCallMobile(aATIO,aInit,aPhoneGlobals)
|
|
1021 |
{}
|
|
1022 |
|
|
1023 |
void CCallMobileVoice::ConstructL(const TName& aName)
|
|
1024 |
{
|
|
1025 |
CCallHayes::ConstructL(aName);
|
|
1026 |
iCallInfo.iLineOwnerName = KVoiceLineName;
|
|
1027 |
iDialVoice=CATDialVoice::NewL(iIo,this,iInit,iPhoneGlobals);
|
|
1028 |
iAnswerVoice=CATAnswerVoice::NewL(iIo,this,iInit,iPhoneGlobals);
|
|
1029 |
iHangUpVoice=CATHangUpVoice::NewL(iIo,this,iInit,iPhoneGlobals);
|
|
1030 |
}
|
|
1031 |
|
|
1032 |
CCallMobileVoice::~CCallMobileVoice()
|
|
1033 |
//
|
|
1034 |
// Removes itself from array of calls in CLineMobileVoice
|
|
1035 |
//
|
|
1036 |
{
|
|
1037 |
delete iDialVoice;
|
|
1038 |
delete iAnswerVoice;
|
|
1039 |
delete iHangUpVoice;
|
|
1040 |
}
|
|
1041 |
|
|
1042 |
void CCallMobileVoice::CollateCoreCaps(const TTsyReqHandle /*aTsyReqHandle*/, TUint32* aCallCaps)
|
|
1043 |
{
|
|
1044 |
*aCallCaps = RCall::KCapsVoice;
|
|
1045 |
|
|
1046 |
// Voice calls can be manipulated by any client, not just owner so set as many caps as possible
|
|
1047 |
if (iPhoneGlobals->iPhoneStatus.iModemDetected==RPhone::EDetectedPresent)
|
|
1048 |
{
|
|
1049 |
*aCallCaps |= (RCall::KCapsDial | RCall::KCapsConnect);
|
|
1050 |
|
|
1051 |
TInt ret=KErrNone;
|
|
1052 |
if (!iIsForIncomingCall)
|
|
1053 |
{
|
|
1054 |
if (REINTERPRET_CAST(CPhoneHayes*,Owner()->Owner())->CheckForOutstandingAnswer())
|
|
1055 |
ret=KErrEtelAnswerAlreadyOutstanding;
|
|
1056 |
}
|
|
1057 |
else
|
|
1058 |
ret=KErrEtelAnswerAlreadyOutstanding;
|
|
1059 |
|
|
1060 |
if (ret==KErrNone && (iCallInfo.iMobileStatus==RMobileCall::EStatusIdle || iCallInfo.iMobileStatus==RMobileCall::EStatusRinging))
|
|
1061 |
*aCallCaps |= RCall::KCapsAnswer;
|
|
1062 |
|
|
1063 |
if (iCallInfo.iMobileStatus==RMobileCall::EStatusConnected)
|
|
1064 |
*aCallCaps |= RCall::KCapsHangUp;
|
|
1065 |
}
|
|
1066 |
}
|
|
1067 |
|
|
1068 |
TInt CCallMobileVoice::Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams,TDesC* aTelNumber)
|
|
1069 |
//
|
|
1070 |
// Dial a voice call
|
|
1071 |
//
|
|
1072 |
{
|
|
1073 |
SetCallParams(aCallParams);
|
|
1074 |
LOGTEXT(_L8("VoiceCall:\tSubmitting Dial command for Voice call"));
|
|
1075 |
if (iPhoneGlobals->iPhoneStatus.iLineStatus == RCall::EStatusIdle)
|
|
1076 |
{
|
|
1077 |
(void)SetOwnership(aTsyReqHandle);
|
|
1078 |
iDialVoice->ExecuteCommand(aTsyReqHandle,aTelNumber,&iCallInfo);
|
|
1079 |
return KErrNone;
|
|
1080 |
}
|
|
1081 |
else
|
|
1082 |
{
|
|
1083 |
return KErrInUse;
|
|
1084 |
}
|
|
1085 |
}
|
|
1086 |
|
|
1087 |
TInt CCallMobileVoice::DialCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1088 |
/**
|
|
1089 |
* Cancel the dial request if possible
|
|
1090 |
*/
|
|
1091 |
{
|
|
1092 |
LOGTEXT(_L8("VoiceCall:\tSubmitting Cancel Dial command for Voice call"));
|
|
1093 |
iDialVoice->CancelCommand(aTsyReqHandle);
|
|
1094 |
return KErrNone;
|
|
1095 |
}
|
|
1096 |
|
|
1097 |
TInt CCallMobileVoice::AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams)
|
|
1098 |
/**
|
|
1099 |
* If there is no waiting call, will wait for one and then answer it. If there is, it will
|
|
1100 |
* answer immediately.
|
|
1101 |
*/
|
|
1102 |
{
|
|
1103 |
CCallBase::TCallOwnership owned = CheckOwnership(aTsyReqHandle);
|
|
1104 |
TInt ret=KErrNone;
|
|
1105 |
if (owned==CCallBase::EOwnedFalse) // call owned by another client
|
|
1106 |
{
|
|
1107 |
ret=KErrEtelNotCallOwner;
|
|
1108 |
}
|
|
1109 |
else
|
|
1110 |
{
|
|
1111 |
if (!iIsForIncomingCall)
|
|
1112 |
{
|
|
1113 |
if (REINTERPRET_CAST(CPhoneHayes*,Owner()->Owner())->CheckForOutstandingAnswer())
|
|
1114 |
ret=KErrEtelAnswerAlreadyOutstanding;
|
|
1115 |
}
|
|
1116 |
else
|
|
1117 |
ret=KErrEtelAnswerAlreadyOutstanding;
|
|
1118 |
}
|
|
1119 |
if (ret==KErrNone)
|
|
1120 |
{
|
|
1121 |
CLineHayes* line = STATIC_CAST(CLineHayes*,Owner());
|
|
1122 |
STATIC_CAST(CPhoneHayes*,line->Owner())->CancelOtherRingingCall(line);
|
|
1123 |
line->FreePreAllocCallIfNecessary();
|
|
1124 |
SetCallParams(aCallParams);
|
|
1125 |
if (iCallInfo.iMobileStatus==RMobileCall::EStatusRinging)
|
|
1126 |
{
|
|
1127 |
(void)SetOwnership(aTsyReqHandle);
|
|
1128 |
LOGTEXT(_L8("VoiceCall:\tSubmitting Answer command"));
|
|
1129 |
iAnswerVoice->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
|
|
1130 |
}
|
|
1131 |
else // This call is now a client-designated Incoming Call object.
|
|
1132 |
{
|
|
1133 |
iIsForIncomingCall=ETrue;
|
|
1134 |
iAnswerTsyReqHandle = aTsyReqHandle;
|
|
1135 |
}
|
|
1136 |
return KErrNone;
|
|
1137 |
}
|
|
1138 |
ReqCompleted(aTsyReqHandle,ret);
|
|
1139 |
return KErrNone;
|
|
1140 |
}
|
|
1141 |
|
|
1142 |
|
|
1143 |
TInt CCallMobileVoice::AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1144 |
{
|
|
1145 |
LOGTEXT(_L8("VoiceCall:\tSubmitting Cancel Answer command"));
|
|
1146 |
if (iIsForIncomingCall)
|
|
1147 |
{
|
|
1148 |
iIsForIncomingCall=EFalse;
|
|
1149 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1150 |
}
|
|
1151 |
else
|
|
1152 |
iAnswerVoice->CancelCommand(aTsyReqHandle);
|
|
1153 |
return KErrNone;
|
|
1154 |
}
|
|
1155 |
|
|
1156 |
void CCallMobileVoice::AnswerImmediately()
|
|
1157 |
{
|
|
1158 |
(void)SetOwnership(iAnswerTsyReqHandle);
|
|
1159 |
// EStatusRinging always results in KErrNone return value
|
|
1160 |
(void) ChangeCallStatus(RMobileCall::EStatusRinging);
|
|
1161 |
iPhoneGlobals->iNotificationStore->CheckNotification(this,ERingOccurred);
|
|
1162 |
iIsForIncomingCall=EFalse;
|
|
1163 |
// this must be after the check notification as CNotifications
|
|
1164 |
// asks line for info about the call which Is For Incoming Call
|
|
1165 |
LOGTEXT(_L8("VoiceCall:\tSubmitting Answer command"));
|
|
1166 |
iAnswerVoice->ExecuteCommand(iAnswerTsyReqHandle,NULL,&iCallInfo);
|
|
1167 |
}
|
|
1168 |
|
|
1169 |
TInt CCallMobileVoice::Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8* /*aCallParams*/)
|
|
1170 |
{
|
|
1171 |
ReqCompleted(aTsyReqHandle,KErrNotSupported);
|
|
1172 |
return KErrNone;
|
|
1173 |
}
|
|
1174 |
|
|
1175 |
TInt CCallMobileVoice::ConnectCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1176 |
{
|
|
1177 |
ReqCompleted(aTsyReqHandle,KErrNotSupported);
|
|
1178 |
return KErrNone;
|
|
1179 |
}
|
|
1180 |
|
|
1181 |
TInt CCallMobileVoice::HangUp(const TTsyReqHandle aTsyReqHandle)
|
|
1182 |
{
|
|
1183 |
if (CheckOwnership(aTsyReqHandle)==CCallBase::EOwnedFalse)
|
|
1184 |
{
|
|
1185 |
ReqCompleted(aTsyReqHandle,KErrEtelNotCallOwner);
|
|
1186 |
return KErrNone;
|
|
1187 |
}
|
|
1188 |
if ((iCallInfo.iMobileStatus!=RMobileCall::EStatusIdle) &&
|
|
1189 |
(iCallInfo.iMobileStatus!=RMobileCall::EStatusDisconnecting))
|
|
1190 |
{
|
|
1191 |
LOGTEXT(_L8("VoiceCall:\tSubmitting Hang Up command"));
|
|
1192 |
iHangUpVoice->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
|
|
1193 |
return KErrNone;
|
|
1194 |
}
|
|
1195 |
else
|
|
1196 |
{
|
|
1197 |
// Call not in a state to be terminated - but return KErrNone
|
|
1198 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1199 |
return KErrNone;
|
|
1200 |
}
|
|
1201 |
}
|
|
1202 |
|
|
1203 |
TInt CCallMobileVoice::HangUpCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1204 |
//
|
|
1205 |
// Cancel the hang up command.
|
|
1206 |
//
|
|
1207 |
{
|
|
1208 |
LOGTEXT(_L8("VoiceCall:\tSubmitting Cancel Hang Up command"));
|
|
1209 |
iHangUpVoice->Stop(aTsyReqHandle);
|
|
1210 |
return KErrNone;
|
|
1211 |
}
|
|
1212 |
|
|
1213 |
TInt CCallMobileVoice::RelinquishOwnership()
|
|
1214 |
{
|
|
1215 |
//
|
|
1216 |
// Called by server to tell TSY to either pass ownership on to another interested client
|
|
1217 |
// or hang up immediately. If call is currently connecting, RelinquishOwnershipComplete
|
|
1218 |
// will be called once cancelling has finished.
|
|
1219 |
//
|
|
1220 |
LOGTEXT(_L8("VoiceCall:\tRelinquish Ownership"));
|
|
1221 |
if(iList->iAcquireList.IsEmpty())
|
|
1222 |
{
|
|
1223 |
if (iDialVoice->IsPreConnectInProgress())
|
|
1224 |
{
|
|
1225 |
iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
|
|
1226 |
return KErrNone;
|
|
1227 |
}
|
|
1228 |
switch(iCallInfo.iMobileStatus)
|
|
1229 |
{
|
|
1230 |
case RMobileCall::EStatusConnected:
|
|
1231 |
iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
|
|
1232 |
iHangUpVoice->ExecuteCommand(0, NULL, &iCallInfo);
|
|
1233 |
break;
|
|
1234 |
case RMobileCall::EStatusDialling:
|
|
1235 |
case RMobileCall::EStatusConnecting:
|
|
1236 |
case RMobileCall::EStatusAnswering:
|
|
1237 |
case RMobileCall::EStatusDisconnecting:
|
|
1238 |
iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
|
|
1239 |
break;
|
|
1240 |
default:
|
|
1241 |
if (iPhoneGlobals->iPhoneStatus.iInitStatus==EPhoneInitialising)
|
|
1242 |
iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
|
|
1243 |
else
|
|
1244 |
RelinquishOwnershipCompleted(KErrNone);
|
|
1245 |
break;
|
|
1246 |
}
|
|
1247 |
return KErrNone;
|
|
1248 |
}
|
|
1249 |
CAcquireEntry* entry=iList->iAcquireList.First();
|
|
1250 |
if (entry)
|
|
1251 |
{
|
|
1252 |
(void)SetOwnership(entry->iTsyReqHandle);
|
|
1253 |
ReqCompleted(entry->iTsyReqHandle,KErrNone);
|
|
1254 |
iList->Remove(entry);
|
|
1255 |
}
|
|
1256 |
RelinquishOwnershipCompleted(KErrNone);
|
|
1257 |
return KErrNone;
|
|
1258 |
}
|
|
1259 |
|
|
1260 |
TInt CCallMobileVoice::RecoverDataPortAndRelinquishOwnership()
|
|
1261 |
{
|
|
1262 |
RecoverDataPortAndRelinquishOwnershipCompleted(KErrNotSupported);
|
|
1263 |
return KErrNone;
|
|
1264 |
}
|
|
1265 |
|
|
1266 |
TInt CCallMobileVoice::LoanDataPort(const TTsyReqHandle aTsyReqHandle, RCall::TCommPort* /* aCommPort*/)
|
|
1267 |
{
|
|
1268 |
ReqCompleted(aTsyReqHandle,KErrNotSupported);
|
|
1269 |
return KErrNone;
|
|
1270 |
}
|
|
1271 |
|
|
1272 |
TInt CCallMobileVoice::LoanDataPortCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1273 |
{
|
|
1274 |
ReqCompleted(aTsyReqHandle,KErrNotSupported);
|
|
1275 |
return KErrNone;
|
|
1276 |
}
|
|
1277 |
|
|
1278 |
TInt CCallMobileVoice::RecoverDataPort(const TTsyReqHandle aTsyReqHandle)
|
|
1279 |
{
|
|
1280 |
ReqCompleted(aTsyReqHandle,KErrNotSupported);
|
|
1281 |
return KErrNone;
|
|
1282 |
}
|
|
1283 |
|
|
1284 |
|
|
1285 |
//
|
|
1286 |
//
|
|
1287 |
// CCallMobileData - Data Specific Call Functionality
|
|
1288 |
//
|
|
1289 |
//
|
|
1290 |
|
|
1291 |
CCallMobileData* CCallMobileData::NewL(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals,const TName& aName)
|
|
1292 |
{
|
|
1293 |
CCallMobileData* dataCall=new(ELeave) CCallMobileData(aATIO,aInit,aPhoneGlobals);
|
|
1294 |
TCleanupItem newCallDataHayesClose(CloseCall,dataCall);
|
|
1295 |
CleanupStack::PushL(newCallDataHayesClose);
|
|
1296 |
dataCall->ConstructL(aName);
|
|
1297 |
CleanupStack::Pop();
|
|
1298 |
return dataCall;
|
|
1299 |
}
|
|
1300 |
|
|
1301 |
CCallMobileData::CCallMobileData(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals)
|
|
1302 |
: CCallMobile(aATIO,aInit,aPhoneGlobals)
|
|
1303 |
{}
|
|
1304 |
|
|
1305 |
void CCallMobileData::ConstructL(const TName& aName)
|
|
1306 |
{
|
|
1307 |
CCallHayes::ConstructL(aName);
|
|
1308 |
iCallInfo.iLineOwnerName = KDataLineName;
|
|
1309 |
iDialData=CATDialData::NewL(iIo,this,iInit,iPhoneGlobals);
|
|
1310 |
iAnswerData=CATAnswerData::NewL(iIo,this,iInit,iPhoneGlobals);
|
|
1311 |
iSetCBST=CATSetCBST::NewL(iIo,this,iInit,iPhoneGlobals);
|
|
1312 |
iConnectData=CATConnectData::NewL(iIo,this,iInit,iPhoneGlobals);
|
|
1313 |
iHangUpData=CATHangUpData::NewL(iIo,this,iInit,iPhoneGlobals);
|
|
1314 |
iATSetToOnlineDataMode=CATSetToOnlineDataMode::NewL(iIo,this,iInit,iPhoneGlobals);
|
|
1315 |
}
|
|
1316 |
|
|
1317 |
CCallMobileData::~CCallMobileData()
|
|
1318 |
//
|
|
1319 |
// Removes itself from array of calls in CLineMobileData
|
|
1320 |
//
|
|
1321 |
{
|
|
1322 |
delete iDialData;
|
|
1323 |
delete iSetCBST;
|
|
1324 |
delete iAnswerData;
|
|
1325 |
delete iConnectData;
|
|
1326 |
delete iHangUpData;
|
|
1327 |
delete iATSetToOnlineDataMode;
|
|
1328 |
}
|
|
1329 |
|
|
1330 |
TInt CCallMobileData::ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,
|
|
1331 |
const TDataPackage& aPackage)
|
|
1332 |
/**
|
|
1333 |
* Process the IPC locally, otherwise delegate to our base class.
|
|
1334 |
*/
|
|
1335 |
{
|
|
1336 |
switch (aIpc)
|
|
1337 |
{
|
|
1338 |
case EMobileCallGetMobileDataCallCaps:
|
|
1339 |
return GetMobileDataCallCaps(aTsyReqHandle, aPackage.Des1n());
|
|
1340 |
default:
|
|
1341 |
// Delegate the processing of the IPC to our base class
|
|
1342 |
return CCallMobile::ExtFunc(aTsyReqHandle,aIpc,aPackage);
|
|
1343 |
}
|
|
1344 |
}
|
|
1345 |
|
|
1346 |
|
|
1347 |
TInt CCallMobileData::GetMobileDataCallCaps(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps)
|
|
1348 |
{
|
|
1349 |
LOGTEXT(_L8("CCallMobileData::GetMobileDataCallCaps called"));
|
|
1350 |
|
|
1351 |
//
|
|
1352 |
// This is a synchronous client request so this method must complete quickly.
|
|
1353 |
// The call caps returned are those which were discovered during the
|
|
1354 |
// intialisation of the TSY (see ATINIT.CPP).
|
|
1355 |
TPckg<RMobileCall::TMobileCallDataCapsV1>* pckg = (TPckg<RMobileCall::TMobileCallDataCapsV1>*)aCaps;
|
|
1356 |
RMobileCall::TMobileCallDataCapsV1& caps = (*pckg)();
|
|
1357 |
caps=iPhoneGlobals->iCallDataCaps;
|
|
1358 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1359 |
return KErrNone;
|
|
1360 |
}
|
|
1361 |
|
|
1362 |
void CCallMobileData::CollateCoreCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps)
|
|
1363 |
{
|
|
1364 |
*aCallCaps = RCall::KCapsData;
|
|
1365 |
if (iPhoneGlobals->iPhoneStatus.iModemDetected==RPhone::EDetectedPresent)
|
|
1366 |
{
|
|
1367 |
CCallBase::TCallOwnership owner = CheckOwnership(aTsyReqHandle);
|
|
1368 |
if (ValidateRequest(aTsyReqHandle,RCall::EStatusIdle)==KErrNone)
|
|
1369 |
*aCallCaps |= (RCall::KCapsDial | RCall::KCapsConnect);
|
|
1370 |
TInt ret=KErrNone;
|
|
1371 |
if (owner==CCallBase::EOwnedFalse) // call owned by another client
|
|
1372 |
ret=KErrEtelNotCallOwner;
|
|
1373 |
else
|
|
1374 |
{
|
|
1375 |
if (!iIsForIncomingCall)
|
|
1376 |
{
|
|
1377 |
if (REINTERPRET_CAST(CPhoneHayes*,Owner()->Owner())->CheckForOutstandingAnswer())
|
|
1378 |
ret=KErrEtelAnswerAlreadyOutstanding;
|
|
1379 |
}
|
|
1380 |
else
|
|
1381 |
ret=KErrEtelAnswerAlreadyOutstanding;
|
|
1382 |
}
|
|
1383 |
if (ret==KErrNone && (iCallInfo.iMobileStatus==RMobileCall::EStatusIdle || iCallInfo.iMobileStatus==RMobileCall::EStatusRinging))
|
|
1384 |
*aCallCaps |= RCall::KCapsAnswer;
|
|
1385 |
if ((owner==CCallBase::EOwnedTrue || owner==CCallBase::EOwnedPriorityClient)
|
|
1386 |
&& iCallInfo.iMobileStatus==RMobileCall::EStatusConnected)
|
|
1387 |
{
|
|
1388 |
*aCallCaps |= RCall::KCapsHangUp;
|
|
1389 |
if (iCallInfo.iLoanedToClient==EFalse)
|
|
1390 |
*aCallCaps |= RCall::KCapsLoanDataPort;
|
|
1391 |
else
|
|
1392 |
*aCallCaps |= RCall::KCapsRecoverDataPort;
|
|
1393 |
}
|
|
1394 |
}
|
|
1395 |
}
|
|
1396 |
|
|
1397 |
TInt CCallMobileData::AssembleCBSTSetString(TBuf8<KGenericBufferSize>& aTxBuffer)
|
|
1398 |
/**
|
|
1399 |
* This funciton assembles a +CBST= string ready to be sent to the modem using
|
|
1400 |
* the values from CCallHayes::iCallInfo.
|
|
1401 |
* This utility funciton is used by objects created and owned by this class.
|
|
1402 |
* This has been done to reduce code size.
|
|
1403 |
* @return KErrNone if and only if CBST string assembled
|
|
1404 |
*/
|
|
1405 |
{
|
|
1406 |
TInt ret(KErrNone); // Return value of this function
|
|
1407 |
|
|
1408 |
TInt speed(0); // these are the names that etsi use
|
|
1409 |
TInt name(0); // these are the names that etsi use
|
|
1410 |
TInt ce(0); // these are the names that etsi use
|
|
1411 |
TBool speedSet(ETrue);
|
|
1412 |
TBool nameSet(ETrue);
|
|
1413 |
TBool ceSet(ETrue);
|
|
1414 |
|
|
1415 |
switch (iCallInfo.iCallParams.iService)
|
|
1416 |
{
|
|
1417 |
case RMobileCall::EServiceDataCircuitAsync:
|
|
1418 |
name = 0;
|
|
1419 |
break;
|
|
1420 |
case RMobileCall::EServiceDataCircuitAsyncRdi:
|
|
1421 |
name = 4;
|
|
1422 |
break;
|
|
1423 |
case RMobileCall::EServiceDataCircuitSync:
|
|
1424 |
name = 1;
|
|
1425 |
break;
|
|
1426 |
case RMobileCall::EServiceDataCircuitSyncRdi:
|
|
1427 |
name = 5;
|
|
1428 |
break;
|
|
1429 |
case RMobileCall::EServicePADAsyncUDI:
|
|
1430 |
name = 2;
|
|
1431 |
break;
|
|
1432 |
case RMobileCall::EServicePADAsyncRDI:
|
|
1433 |
name = 6;
|
|
1434 |
break;
|
|
1435 |
case RMobileCall::EServicePacketAccessSyncUDI:
|
|
1436 |
name = 3;
|
|
1437 |
break;
|
|
1438 |
case RMobileCall::EServicePacketAccessSyncRDI:
|
|
1439 |
name = 7;
|
|
1440 |
break;
|
|
1441 |
case RMobileCall::EServiceUnspecified: // taking the default value of 0
|
|
1442 |
default:
|
|
1443 |
nameSet=EFalse;
|
|
1444 |
break;
|
|
1445 |
}
|
|
1446 |
|
|
1447 |
switch(iCallInfo.iCallParams.iQoS)
|
|
1448 |
{
|
|
1449 |
case RMobileCall::EQoSTransparent:
|
|
1450 |
ce = 0;
|
|
1451 |
break;
|
|
1452 |
case RMobileCall::EQosTransparentPreferred:
|
|
1453 |
ce = 2;
|
|
1454 |
break;
|
|
1455 |
case RMobileCall::EQoSNonTransparent:
|
|
1456 |
ce = 1;
|
|
1457 |
break;
|
|
1458 |
case RMobileCall::EQosNonTransparentPreferred:
|
|
1459 |
ce = 3;
|
|
1460 |
break;
|
|
1461 |
case RMobileCall::EQoSUnspecified:
|
|
1462 |
default:
|
|
1463 |
ceSet=EFalse;
|
|
1464 |
break;
|
|
1465 |
}
|
|
1466 |
|
|
1467 |
switch(iCallInfo.iCallParams.iSpeed)
|
|
1468 |
{
|
|
1469 |
case RMobileCall::ESpeedAutobauding:
|
|
1470 |
speed = 0;
|
|
1471 |
break;
|
|
1472 |
|
|
1473 |
case RMobileCall::ESpeed2400:
|
|
1474 |
{
|
|
1475 |
if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV22bis)
|
|
1476 |
speed = 4;
|
|
1477 |
else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
|
|
1478 |
speed = 36;
|
|
1479 |
else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) ||
|
|
1480 |
(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
|
|
1481 |
speed = 68;
|
|
1482 |
else
|
|
1483 |
speedSet=EFalse;
|
|
1484 |
break;
|
|
1485 |
}
|
|
1486 |
case RMobileCall::ESpeed4800:
|
|
1487 |
{
|
|
1488 |
if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV32)
|
|
1489 |
speed = 6;
|
|
1490 |
else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
|
|
1491 |
speed = 38;
|
|
1492 |
else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) ||
|
|
1493 |
(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
|
|
1494 |
speed = 70;
|
|
1495 |
else
|
|
1496 |
speedSet=EFalse;
|
|
1497 |
break;
|
|
1498 |
}
|
|
1499 |
case RMobileCall::ESpeed9600:
|
|
1500 |
{
|
|
1501 |
if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV32)
|
|
1502 |
speed = 7;
|
|
1503 |
else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV34)
|
|
1504 |
speed = 12;
|
|
1505 |
else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
|
|
1506 |
speed = 39;
|
|
1507 |
else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) ||
|
|
1508 |
(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
|
|
1509 |
speed = 71;
|
|
1510 |
else
|
|
1511 |
speedSet=EFalse;
|
|
1512 |
break;
|
|
1513 |
}
|
|
1514 |
case RMobileCall::ESpeed14400:
|
|
1515 |
{
|
|
1516 |
if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV34)
|
|
1517 |
speed = 14;
|
|
1518 |
else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
|
|
1519 |
speed = 43;
|
|
1520 |
else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) ||
|
|
1521 |
(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
|
|
1522 |
speed = 75;
|
|
1523 |
else
|
|
1524 |
speedSet=EFalse;
|
|
1525 |
break;
|
|
1526 |
}
|
|
1527 |
case RMobileCall::ESpeed19200:
|
|
1528 |
{
|
|
1529 |
if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV34)
|
|
1530 |
speed = 15;
|
|
1531 |
else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
|
|
1532 |
speed = 47;
|
|
1533 |
else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) ||
|
|
1534 |
(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
|
|
1535 |
speed = 79;
|
|
1536 |
else
|
|
1537 |
speedSet=EFalse;
|
|
1538 |
break;
|
|
1539 |
}
|
|
1540 |
case RMobileCall::ESpeed28800:
|
|
1541 |
{
|
|
1542 |
if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV34)
|
|
1543 |
speed = 16;
|
|
1544 |
else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
|
|
1545 |
speed = 48;
|
|
1546 |
else if ((iCallInfo.iCallParams.iProtocol ==RMobileCall:: EProtocolV110) ||
|
|
1547 |
(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
|
|
1548 |
speed = 80;
|
|
1549 |
else
|
|
1550 |
speedSet=EFalse;
|
|
1551 |
break;
|
|
1552 |
}
|
|
1553 |
case RMobileCall::ESpeed38400:
|
|
1554 |
{
|
|
1555 |
if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) ||
|
|
1556 |
(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
|
|
1557 |
speed = 81;
|
|
1558 |
else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
|
|
1559 |
speed = 49;
|
|
1560 |
else
|
|
1561 |
speedSet=EFalse;
|
|
1562 |
break;
|
|
1563 |
}
|
|
1564 |
case RMobileCall::ESpeed48000:
|
|
1565 |
if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
|
|
1566 |
speed = 50;
|
|
1567 |
else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) ||
|
|
1568 |
(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
|
|
1569 |
speed = 82;
|
|
1570 |
else
|
|
1571 |
speedSet=EFalse;
|
|
1572 |
break;
|
|
1573 |
case RMobileCall::ESpeed56000:
|
|
1574 |
if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
|
|
1575 |
speed = 51;
|
|
1576 |
else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) ||
|
|
1577 |
(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
|
|
1578 |
speed = 83;
|
|
1579 |
else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolBitTransparent)
|
|
1580 |
speed = 115;
|
|
1581 |
else
|
|
1582 |
speedSet=EFalse;
|
|
1583 |
break;
|
|
1584 |
case RMobileCall::ESpeed64000:
|
|
1585 |
if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolBitTransparent)
|
|
1586 |
speed = 116;
|
|
1587 |
else
|
|
1588 |
speedSet=EFalse;
|
|
1589 |
break;
|
|
1590 |
|
|
1591 |
case RMobileCall::ESpeed33600: // this baud rate is not currently used in the etsi table
|
|
1592 |
case RMobileCall::ESpeedUnspecified:
|
|
1593 |
default:
|
|
1594 |
speedSet=EFalse;
|
|
1595 |
break;
|
|
1596 |
}
|
|
1597 |
|
|
1598 |
//
|
|
1599 |
// Try to assemble as much of the +CBST= command as we can.
|
|
1600 |
// If we do not have a <speed> value we can not send the command.
|
|
1601 |
// If we do not have a <ce> value then we can send a command giving only <speed> and <name>.
|
|
1602 |
// etc...
|
|
1603 |
if(speedSet)
|
|
1604 |
{
|
|
1605 |
aTxBuffer.Zero(); // Clear tx buffer
|
|
1606 |
|
|
1607 |
// Append +CBST= and the <speed> parameter
|
|
1608 |
aTxBuffer.Append(KDataCallBearerServiceType);
|
|
1609 |
aTxBuffer.AppendNum(speed);
|
|
1610 |
|
|
1611 |
if(nameSet)
|
|
1612 |
{
|
|
1613 |
// Append the <name> parameter
|
|
1614 |
aTxBuffer.Append(TChar(','));
|
|
1615 |
aTxBuffer.AppendNum(name);
|
|
1616 |
|
|
1617 |
if(ceSet)
|
|
1618 |
{
|
|
1619 |
// Append the <ce> parameter
|
|
1620 |
aTxBuffer.Append(TChar(','));
|
|
1621 |
aTxBuffer.AppendNum(ce);
|
|
1622 |
}
|
|
1623 |
}
|
|
1624 |
|
|
1625 |
// Append final \r char to AT command
|
|
1626 |
aTxBuffer.Append(TChar('\r'));
|
|
1627 |
}
|
|
1628 |
else
|
|
1629 |
{
|
|
1630 |
// We have not have enough info to create a +CBST= string
|
|
1631 |
ret=KErrArgument;
|
|
1632 |
}
|
|
1633 |
|
|
1634 |
return ret;
|
|
1635 |
}
|
|
1636 |
|
|
1637 |
|
|
1638 |
|
|
1639 |
TInt CCallMobileData::Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams,TDesC* aTelNumber)
|
|
1640 |
//
|
|
1641 |
// Dial a data call
|
|
1642 |
//
|
|
1643 |
{
|
|
1644 |
TInt ret(KErrNone);
|
|
1645 |
|
|
1646 |
SetDataCallParams(aCallParams);
|
|
1647 |
|
|
1648 |
ret=ValidateRequest(aTsyReqHandle,RCall::EStatusIdle);
|
|
1649 |
if (ret==KErrNone)
|
|
1650 |
{
|
|
1651 |
(void)SetOwnership(aTsyReqHandle);
|
|
1652 |
LOGTEXT(_L8("DataCall:\tSubmitting Dial command for Data call"));
|
|
1653 |
iDialData->ExecuteCommand(aTsyReqHandle,aTelNumber,&iCallInfo);
|
|
1654 |
}
|
|
1655 |
else
|
|
1656 |
ReqCompleted(aTsyReqHandle,ret); // An error occurred
|
|
1657 |
|
|
1658 |
return KErrNone; // Real return code is returned to client thru request completion
|
|
1659 |
}
|
|
1660 |
|
|
1661 |
|
|
1662 |
TInt CCallMobileData::DialCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1663 |
//
|
|
1664 |
// Cancel the dial request if possible
|
|
1665 |
//
|
|
1666 |
{
|
|
1667 |
LOGTEXT(_L8("DataCall:\tSubmitting Cancel Dial command for Data call"));
|
|
1668 |
iDialData->CancelCommand(aTsyReqHandle);
|
|
1669 |
return KErrNone;
|
|
1670 |
}
|
|
1671 |
|
|
1672 |
|
|
1673 |
void CCallMobileData::SetDataCallParams(const TDesC8* aCallParams)
|
|
1674 |
/**
|
|
1675 |
* Utility function which unpacks the call parameters supplied by the client
|
|
1676 |
* and saves their values in iPhoneGlobals.
|
|
1677 |
* If the client did not supply parameters then default ones are used.
|
|
1678 |
*/
|
|
1679 |
{
|
|
1680 |
if(aCallParams->Length()==0)
|
|
1681 |
{
|
|
1682 |
//
|
|
1683 |
// Client did not supply parameters, so we use default ones
|
|
1684 |
LOGTEXT(_L8("CCallMobileData::SetDataCallParams Using default parameters"));
|
|
1685 |
CCallHayes::SetCallParams(aCallParams);
|
|
1686 |
|
|
1687 |
//
|
|
1688 |
// Ensure the speed parameter is undefined so that we prevent the
|
|
1689 |
// +CBST=... command being sent to the phone when dialling a CSD data call.
|
|
1690 |
iCallInfo.iCallParams.iService = RMobileCall::EServiceUnspecified;
|
|
1691 |
}
|
|
1692 |
else
|
|
1693 |
{
|
|
1694 |
//
|
|
1695 |
// Use call parameters that client supplied us
|
|
1696 |
LOGTEXT(_L8("CCallMobileData::SetDataCallParams Using clients parameters"));
|
|
1697 |
RCall::TCallParamsPckg* paramsPckgV1 = (RCall::TCallParamsPckg*)aCallParams;
|
|
1698 |
RCall::TCallParams& paramsV1 = (*paramsPckgV1)();
|
|
1699 |
|
|
1700 |
CCallHayes::SetCallParams(aCallParams);
|
|
1701 |
if (paramsV1.ExtensionId()==RMobileCall::KETelMobileCallParamsV1)
|
|
1702 |
{
|
|
1703 |
RMobileCall::TMobileCallParamsV1Pckg* mmParamsPckgV1 = (RMobileCall::TMobileCallParamsV1Pckg*)aCallParams;
|
|
1704 |
RMobileCall::TMobileCallParamsV1& mmParamsV1 = (*mmParamsPckgV1)();
|
|
1705 |
iCallInfo.iCallParams.iIdRestrict = mmParamsV1.iIdRestrict;
|
|
1706 |
iCallInfo.iCallParams.iCug = mmParamsV1.iCug;
|
|
1707 |
iCallInfo.iCallParams.iAutoRedial = mmParamsV1.iAutoRedial;
|
|
1708 |
}
|
|
1709 |
|
|
1710 |
if((paramsV1.ExtensionId()==RMobileCall::KETelMobileDataCallParamsV1) ||
|
|
1711 |
(paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV1))
|
|
1712 |
{
|
|
1713 |
RMobileCall::TMobileDataCallParamsV1Pckg* dataParamsPckgV1 = (RMobileCall::TMobileDataCallParamsV1Pckg*)aCallParams;
|
|
1714 |
RMobileCall::TMobileDataCallParamsV1& dataParamsV1 = (*dataParamsPckgV1)();
|
|
1715 |
iCallInfo.iCallParams.iService=dataParamsV1.iService;
|
|
1716 |
iCallInfo.iCallParams.iSpeed=dataParamsV1.iSpeed;
|
|
1717 |
iCallInfo.iCallParams.iProtocol=dataParamsV1.iProtocol;
|
|
1718 |
iCallInfo.iCallParams.iQoS=dataParamsV1.iQoS;
|
|
1719 |
iCallInfo.iCallParams.iRLPVersion=dataParamsV1.iRLPVersion;
|
|
1720 |
iCallInfo.iCallParams.iModemToMSWindowSize=dataParamsV1.iModemToMSWindowSize;
|
|
1721 |
iCallInfo.iCallParams.iMSToModemWindowSize=dataParamsV1.iMSToModemWindowSize;
|
|
1722 |
iCallInfo.iCallParams.iAckTimer=dataParamsV1.iAckTimer;
|
|
1723 |
iCallInfo.iCallParams.iRetransmissionAttempts=dataParamsV1.iRetransmissionAttempts;
|
|
1724 |
iCallInfo.iCallParams.iResequencingPeriod=dataParamsV1.iResequencingPeriod;
|
|
1725 |
iCallInfo.iCallParams.iV42bisReq=dataParamsV1.iV42bisReq;
|
|
1726 |
iCallInfo.iCallParams.iV42bisCodewordsNum=dataParamsV1.iV42bisCodewordsNum;
|
|
1727 |
iCallInfo.iCallParams.iV42bisMaxStringLength=dataParamsV1.iV42bisMaxStringLength;
|
|
1728 |
}
|
|
1729 |
|
|
1730 |
if (paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV1)
|
|
1731 |
{
|
|
1732 |
RMobileCall::TMobileHscsdCallParamsV1Pckg* hscsdParamsPckgV1 = (RMobileCall::TMobileHscsdCallParamsV1Pckg*)aCallParams;
|
|
1733 |
RMobileCall::TMobileHscsdCallParamsV1& hscsdParamsV1 = (*hscsdParamsPckgV1)();
|
|
1734 |
iCallInfo.iCallParams.iWantedAiur = hscsdParamsV1.iWantedAiur;
|
|
1735 |
iCallInfo.iCallParams.iWantedRxTimeSlots = hscsdParamsV1.iWantedRxTimeSlots;
|
|
1736 |
iCallInfo.iCallParams.iMaxTimeSlots = hscsdParamsV1.iMaxTimeSlots;
|
|
1737 |
iCallInfo.iCallParams.iCodings = hscsdParamsV1.iCodings;
|
|
1738 |
iCallInfo.iCallParams.iAsymmetry = hscsdParamsV1.iAsymmetry;
|
|
1739 |
iCallInfo.iCallParams.iUserInitUpgrade = hscsdParamsV1.iUserInitUpgrade;
|
|
1740 |
}
|
|
1741 |
}
|
|
1742 |
}
|
|
1743 |
|
|
1744 |
TInt CCallMobileData::AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams)
|
|
1745 |
/**
|
|
1746 |
* If there is no waiting call, will wait for one and then answer it.
|
|
1747 |
* If there is a waiting call, will answer immediatly.
|
|
1748 |
* Regardless of if there is a waiting call or not, the +CBST= command is sent immediatly.
|
|
1749 |
*/
|
|
1750 |
{
|
|
1751 |
const CCallBase::TCallOwnership owned = CheckOwnership(aTsyReqHandle);
|
|
1752 |
TInt ret=KErrNone;
|
|
1753 |
if (owned==CCallBase::EOwnedFalse) // call owned by another client
|
|
1754 |
{
|
|
1755 |
ret=KErrEtelNotCallOwner;
|
|
1756 |
}
|
|
1757 |
else
|
|
1758 |
{
|
|
1759 |
if (!iIsForIncomingCall)
|
|
1760 |
{
|
|
1761 |
if (REINTERPRET_CAST(CPhoneHayes*,Owner()->Owner())->CheckForOutstandingAnswer())
|
|
1762 |
ret=KErrEtelAnswerAlreadyOutstanding;
|
|
1763 |
}
|
|
1764 |
else
|
|
1765 |
ret=KErrEtelAnswerAlreadyOutstanding;
|
|
1766 |
}
|
|
1767 |
|
|
1768 |
if (ret==KErrNone)
|
|
1769 |
{
|
|
1770 |
CLineHayes* line = STATIC_CAST(CLineHayes*,Owner());
|
|
1771 |
STATIC_CAST(CPhoneHayes*,line->Owner())->CancelOtherRingingCall(line);
|
|
1772 |
line->FreePreAllocCallIfNecessary();
|
|
1773 |
SetDataCallParams(aCallParams);
|
|
1774 |
if (iCallInfo.iMobileStatus==RMobileCall::EStatusRinging)
|
|
1775 |
{
|
|
1776 |
(void)SetOwnership(aTsyReqHandle);
|
|
1777 |
LOGTEXT(_L8("DataCall:\tSubmitting Answer command"));
|
|
1778 |
|
|
1779 |
// Start the 'send CBST to phone' AT machine and pass the
|
|
1780 |
// CATAnswerData object, so that the call is answered after
|
|
1781 |
// the CBST is sent.
|
|
1782 |
iSetCBST->ExecuteCommand(aTsyReqHandle,iAnswerData,&iCallInfo);
|
|
1783 |
}
|
|
1784 |
else // This call is now a client-designated Incoming Call object.
|
|
1785 |
{
|
|
1786 |
iIsForIncomingCall=ETrue;
|
|
1787 |
iAnswerTsyReqHandle = aTsyReqHandle;
|
|
1788 |
|
|
1789 |
// Start the 'send CBST to phone' AT machine. This state machine
|
|
1790 |
// will not complete any client request.
|
|
1791 |
iSetCBST->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
|
|
1792 |
}
|
|
1793 |
return KErrNone;
|
|
1794 |
}
|
|
1795 |
|
|
1796 |
ReqCompleted(aTsyReqHandle,ret);
|
|
1797 |
return KErrNone;
|
|
1798 |
}
|
|
1799 |
|
|
1800 |
|
|
1801 |
TInt CCallMobileData::AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1802 |
{
|
|
1803 |
LOGTEXT(_L8("DataCall:\tSubmitting Cancel Answer command"));
|
|
1804 |
if (iIsForIncomingCall)
|
|
1805 |
{
|
|
1806 |
iIsForIncomingCall=EFalse;
|
|
1807 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1808 |
}
|
|
1809 |
else
|
|
1810 |
iAnswerData->CancelCommand(aTsyReqHandle);
|
|
1811 |
return KErrNone;
|
|
1812 |
}
|
|
1813 |
|
|
1814 |
void CCallMobileData::AnswerImmediately()
|
|
1815 |
{
|
|
1816 |
(void)SetOwnership(iAnswerTsyReqHandle);
|
|
1817 |
// EStatusRinging always results in KErrNone return
|
|
1818 |
(void) ChangeCallStatus(RMobileCall::EStatusRinging); // new 14/1/99
|
|
1819 |
iPhoneGlobals->iNotificationStore->CheckNotification(this,ERingOccurred);
|
|
1820 |
iIsForIncomingCall=EFalse; // this must be after the check notification as CNotifications
|
|
1821 |
// asks line for info about the call which Is For Incoming Call
|
|
1822 |
LOGTEXT(_L8("DataCall:\tSubmitting Answer command"));
|
|
1823 |
iAnswerData->ExecuteCommand(iAnswerTsyReqHandle,NULL,&iCallInfo);
|
|
1824 |
}
|
|
1825 |
|
|
1826 |
TInt CCallMobileData::Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams)
|
|
1827 |
//
|
|
1828 |
// Connect to an already dialled call
|
|
1829 |
//
|
|
1830 |
{
|
|
1831 |
TInt ret = ValidateRequest(aTsyReqHandle,RCall::EStatusIdle);
|
|
1832 |
if (ret==KErrNone)
|
|
1833 |
{
|
|
1834 |
(void)SetOwnership(aTsyReqHandle);
|
|
1835 |
SetCallParams(aCallParams);
|
|
1836 |
LOGTEXT(_L8("DataCall:\tSubmitting Immediate Connect command"));
|
|
1837 |
iConnectData->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
|
|
1838 |
}
|
|
1839 |
else
|
|
1840 |
ReqCompleted(aTsyReqHandle,ret);
|
|
1841 |
return KErrNone;
|
|
1842 |
}
|
|
1843 |
|
|
1844 |
TInt CCallMobileData::ConnectCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1845 |
//
|
|
1846 |
// Cancel immediate connect command
|
|
1847 |
//
|
|
1848 |
{
|
|
1849 |
LOGTEXT(_L8("DataCall:\tSubmitting Cancel Connect command"));
|
|
1850 |
iConnectData->CancelCommand(aTsyReqHandle);
|
|
1851 |
return KErrNone;
|
|
1852 |
}
|
|
1853 |
|
|
1854 |
TInt CCallMobileData::HangUp(const TTsyReqHandle aTsyReqHandle)
|
|
1855 |
//
|
|
1856 |
// Terminate a data call. If someone else owns call complete with error, but if no-one owns
|
|
1857 |
// it send an ATH anyway, as the connection may have failed and the user wants to ensure
|
|
1858 |
// call has hung up. Call Start() instead of ExecuteCommand() because there is no need to
|
|
1859 |
// initialise before doing this or to send the escape sequence - the hang up sequence drops
|
|
1860 |
// DTR anyway.
|
|
1861 |
//
|
|
1862 |
{
|
|
1863 |
if (CheckOwnership(aTsyReqHandle)==CCallBase::EOwnedFalse)
|
|
1864 |
{
|
|
1865 |
ReqCompleted(aTsyReqHandle,KErrEtelNotCallOwner);
|
|
1866 |
return KErrNone;
|
|
1867 |
}
|
|
1868 |
if ((iCallInfo.iMobileStatus!=RMobileCall::EStatusIdle) &&
|
|
1869 |
(iCallInfo.iMobileStatus!=RMobileCall::EStatusDisconnecting))
|
|
1870 |
{
|
|
1871 |
LOGTEXT(_L8("DataCall:\tSubmitting Hang Up command"));
|
|
1872 |
iHangUpData->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
|
|
1873 |
return KErrNone;
|
|
1874 |
}
|
|
1875 |
else
|
|
1876 |
{
|
|
1877 |
// Call not in a state to be terminated - but return KErrNone
|
|
1878 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1879 |
return KErrNone;
|
|
1880 |
}
|
|
1881 |
}
|
|
1882 |
|
|
1883 |
TInt CCallMobileData::HangUpCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1884 |
//
|
|
1885 |
// Cancel the hang up command.
|
|
1886 |
//
|
|
1887 |
{
|
|
1888 |
LOGTEXT(_L8("DataCall:\tSubmitting Cancel Hang Up command"));
|
|
1889 |
iHangUpData->Stop(aTsyReqHandle);
|
|
1890 |
return KErrNone;
|
|
1891 |
}
|
|
1892 |
|
|
1893 |
TInt CCallMobileData::RelinquishOwnership()
|
|
1894 |
//
|
|
1895 |
// Called by server to tell TSY to either pass ownership on to another interested client
|
|
1896 |
// or hang up immediately. If call is currently connecting, RelinquishOwnershipComplete
|
|
1897 |
// will be called once cancelling has finished.
|
|
1898 |
//
|
|
1899 |
{
|
|
1900 |
LOGTEXT(_L8("DataCall:\tRelinquish Ownership"));
|
|
1901 |
if(iList->iAcquireList.IsEmpty())
|
|
1902 |
{
|
|
1903 |
if (iDialData->IsPreConnectInProgress() ||
|
|
1904 |
iConnectData->IsPreConnectInProgress() ||
|
|
1905 |
iAnswerData->IsPreConnectInProgress())
|
|
1906 |
{
|
|
1907 |
iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
|
|
1908 |
return KErrNone;
|
|
1909 |
}
|
|
1910 |
switch(iCallInfo.iMobileStatus)
|
|
1911 |
{
|
|
1912 |
case RMobileCall::EStatusConnected:
|
|
1913 |
iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
|
|
1914 |
//iHangUpData->ExecuteCommand(0,NULL,&iCallInfo);
|
|
1915 |
iQuickInit->CancelAndHangUp(&iCallInfo,iHangUpData);
|
|
1916 |
break;
|
|
1917 |
case RMobileCall::EStatusDialling:
|
|
1918 |
case RMobileCall::EStatusConnecting:
|
|
1919 |
case RMobileCall::EStatusAnswering:
|
|
1920 |
case RMobileCall::EStatusDisconnecting:
|
|
1921 |
iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
|
|
1922 |
break;
|
|
1923 |
default:
|
|
1924 |
if (iPhoneGlobals->iPhoneStatus.iInitStatus==EPhoneInitialising)
|
|
1925 |
iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
|
|
1926 |
else
|
|
1927 |
RelinquishOwnershipCompleted(KErrNone);
|
|
1928 |
break;
|
|
1929 |
}
|
|
1930 |
return KErrNone;
|
|
1931 |
}
|
|
1932 |
CAcquireEntry* entry=iList->iAcquireList.First();
|
|
1933 |
if (entry)
|
|
1934 |
{
|
|
1935 |
(void)SetOwnership(entry->iTsyReqHandle);
|
|
1936 |
ReqCompleted(entry->iTsyReqHandle,KErrNone);
|
|
1937 |
iList->Remove(entry);
|
|
1938 |
}
|
|
1939 |
RelinquishOwnershipCompleted(KErrNone);
|
|
1940 |
return KErrNone;
|
|
1941 |
}
|
|
1942 |
|
|
1943 |
TInt CCallMobileData::RecoverDataPortAndRelinquishOwnership()
|
|
1944 |
//
|
|
1945 |
// Called by server to tell TSY to either pass ownership on to another interested client
|
|
1946 |
// after regaining control of the port and performing a swift initialisation,
|
|
1947 |
// or hang up immediately
|
|
1948 |
//
|
|
1949 |
{
|
|
1950 |
LOGTEXT(_L8("DataPort Recover and Relinquish Ownership"));
|
|
1951 |
iCallInfo.iLoanedToClient=EFalse;
|
|
1952 |
iPhoneGlobals->iPhoneStatus.iDataPortLoaned = EFalse;
|
|
1953 |
if(iList->iAcquireList.IsEmpty())
|
|
1954 |
{
|
|
1955 |
(void)SetUnowned();
|
|
1956 |
iCallInfo.iClientPanicOccurred = EPanicOccurredDuringDataPortLoan;
|
|
1957 |
iIo->Read();
|
|
1958 |
iHangUpData->ExecuteCommand(0,NULL,&iCallInfo);
|
|
1959 |
return KErrNone;
|
|
1960 |
}
|
|
1961 |
CAcquireEntry* entry=iList->iAcquireList.First();
|
|
1962 |
if (entry)
|
|
1963 |
{
|
|
1964 |
(void)SetOwnership(entry->iTsyReqHandle);
|
|
1965 |
ReqCompleted(entry->iTsyReqHandle,KErrNone);
|
|
1966 |
iList->Remove(entry);
|
|
1967 |
iQuickInit->StartQuickInit();
|
|
1968 |
}
|
|
1969 |
RecoverDataPortAndRelinquishOwnershipCompleted(KErrNone);
|
|
1970 |
return KErrNone;
|
|
1971 |
}
|
|
1972 |
|
|
1973 |
TInt CCallMobileData::LoanDataPort(const TTsyReqHandle aTsyReqHandle, RCall::TCommPort* aCommPort)
|
|
1974 |
//
|
|
1975 |
// Get the port info
|
|
1976 |
//
|
|
1977 |
{
|
|
1978 |
LOGTEXT(_L8(" DataPort Loan"));
|
|
1979 |
if (CheckOwnership(aTsyReqHandle)!=CCallBase::EOwnedTrue)
|
|
1980 |
{
|
|
1981 |
ReqCompleted(aTsyReqHandle,KErrEtelNotCallOwner);
|
|
1982 |
return KErrNone;
|
|
1983 |
}
|
|
1984 |
if (iCallInfo.iMobileStatus != RMobileCall::EStatusConnected)
|
|
1985 |
{
|
|
1986 |
ReqCompleted(aTsyReqHandle,KErrEtelCallNotActive);
|
|
1987 |
return KErrNone;
|
|
1988 |
}
|
|
1989 |
TInt ret = iPhoneGlobals->iConfiguration->ConfigModemString(TPtrC(KCDTypeNameCsyName),aCommPort->iCsy);
|
|
1990 |
if (!ret)
|
|
1991 |
{
|
|
1992 |
ret = iPhoneGlobals->iConfiguration->ConfigModemString(TPtrC(KCDTypeNamePortName),aCommPort->iPort);
|
|
1993 |
}
|
|
1994 |
if (ret)
|
|
1995 |
{
|
|
1996 |
ReqCompleted(aTsyReqHandle,ret);
|
|
1997 |
return KErrNone;
|
|
1998 |
}
|
|
1999 |
iCallInfo.iLoanedToClient = ETrue;
|
|
2000 |
iPhoneGlobals->iPhoneStatus.iDataPortLoaned = ETrue;
|
|
2001 |
iPhoneGlobals->iNotificationStore->CheckNotification(this,EDataPortLoaned);
|
|
2002 |
iWaitForNoCarrier->StopWait();
|
|
2003 |
if (iPhoneGlobals->iPhoneStatus.iMode==RPhone::EModeOnlineCommand)
|
|
2004 |
iATSetToOnlineDataMode->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
|
|
2005 |
else
|
|
2006 |
{
|
|
2007 |
iIo->Cancel();
|
|
2008 |
TCommConfig aConfigPckg;
|
|
2009 |
TInt ret = iPhoneGlobals->iConfiguration->PortConfig(aConfigPckg,EConfigTypeFull);
|
|
2010 |
if (ret==KErrNone)
|
|
2011 |
ret = iIo->ConfigurePort(aConfigPckg);
|
|
2012 |
ReqCompleted(aTsyReqHandle,ret);
|
|
2013 |
}
|
|
2014 |
return KErrNone;
|
|
2015 |
}
|
|
2016 |
|
|
2017 |
TInt CCallMobileData::LoanDataPortCancel(const TTsyReqHandle aTsyReqHandle)
|
|
2018 |
{
|
|
2019 |
iATSetToOnlineDataMode->CancelCommand(aTsyReqHandle);
|
|
2020 |
return KErrNone;
|
|
2021 |
}
|
|
2022 |
|
|
2023 |
TInt CCallMobileData::RecoverDataPort(const TTsyReqHandle aTsyReqHandle)
|
|
2024 |
//
|
|
2025 |
// Take back control of data port
|
|
2026 |
// Check that call had been loaned to client
|
|
2027 |
//
|
|
2028 |
{
|
|
2029 |
if (iCallInfo.iLoanedToClient==EFalse)
|
|
2030 |
{
|
|
2031 |
ReqCompleted(aTsyReqHandle,KErrEtelPortNotLoanedToClient);
|
|
2032 |
return KErrNone;
|
|
2033 |
}
|
|
2034 |
TCallOwnership owner = CheckOwnership(aTsyReqHandle);
|
|
2035 |
if (owner!=CCallBase::EOwnedTrue && owner!=CCallBase::EOwnedPriorityClient)
|
|
2036 |
{
|
|
2037 |
ReqCompleted(aTsyReqHandle,KErrEtelNotCallOwner);
|
|
2038 |
return KErrNone;
|
|
2039 |
}
|
|
2040 |
LOGTEXT(_L8("DataPort Recover"));
|
|
2041 |
iCallInfo.iLoanedToClient=EFalse;
|
|
2042 |
iPhoneGlobals->iPhoneStatus.iDataPortLoaned = EFalse;
|
|
2043 |
LOGTEXT2(_L8("Comm signals : %x"),iIo->Signals());
|
|
2044 |
iIo->ResetReadAndWriteBuffers(); // in case client has left RxBuffer non-empty
|
|
2045 |
LOGTEXT2(_L8("Comm signals after ResetBuffers : %x"),iIo->Signals());
|
|
2046 |
FlowControlSuspend(); // Defect fix for MPO-4ZECUN
|
|
2047 |
iQuickInit->StartQuickInit();
|
|
2048 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
2049 |
return KErrNone;
|
|
2050 |
}
|