24
|
1 |
// Copyright (c) 2008-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 |
@file
|
|
18 |
@internalAll
|
|
19 |
*/
|
|
20 |
|
|
21 |
#ifndef __CCALLCONTROLDISPATCHER_H_
|
|
22 |
#define __CCALLCONTROLDISPATCHER_H_
|
|
23 |
|
|
24 |
// INCLUDES
|
|
25 |
#include <e32std.h>
|
|
26 |
#include <e32base.h>
|
|
27 |
#include <e32def.h>
|
|
28 |
#include <etelmm.h>
|
|
29 |
#include <ctsy/rmmcustomapi.h>
|
|
30 |
|
|
31 |
#include <ctsy/ltsy/mltsydispatchfactory.h>
|
|
32 |
|
|
33 |
|
|
34 |
#include "requestqueueoneshot.h"
|
|
35 |
#include <ctsy/ltsy/ltsylogger.h>
|
|
36 |
#include "mdispatchercallback.h"
|
|
37 |
|
|
38 |
// CONSTANTS
|
|
39 |
const TInt KInvalidCallId = -1;
|
|
40 |
|
|
41 |
// FORWARD DECLARATIONS
|
|
42 |
class CMmDataPackage;
|
|
43 |
class MmMessageManagerCallback;
|
|
44 |
class TDispatcherHolder;
|
|
45 |
|
|
46 |
class MLtsyDispatchCallControlAnswer;
|
|
47 |
class MLtsyDispatchCallControlHold;
|
|
48 |
class MLtsyDispatchCallControlDialEmergency;
|
|
49 |
class MLtsyDispatchCallControlStopDtmfTone;
|
|
50 |
class MLtsyDispatchCallControlSetActiveAlsLine;
|
|
51 |
class MLtsyDispatchCallControlSendDtmfTonesCancel;
|
|
52 |
class MLtsyDispatchCallControlHangUp;
|
|
53 |
class MLtsyDispatchCallControlResume;
|
|
54 |
class MLtsyDispatchCallControlSetDynamicHscsdParams;
|
|
55 |
class MLtsyDispatchCallControlDialVoice;
|
|
56 |
class MLtsyDispatchCallControlTransfer;
|
|
57 |
class MLtsyDispatchCallControlSendDtmfTones;
|
|
58 |
class MLtsyDispatchCallControlGetIdentityServiceStatus;
|
|
59 |
class MLtsyDispatchCallControlSwap;
|
|
60 |
class MLtsyDispatchCallControlLoanDataPort;
|
|
61 |
class MLtsyDispatchCallControlRecoverDataPort;
|
|
62 |
class MLtsyDispatchCallControlStartDtmfTone;
|
|
63 |
class MLtsyDispatchCallControlGetActiveAlsLine;
|
|
64 |
class MLtsyDispatchCallControlDialData;
|
|
65 |
class MLtsyDispatchCallControlQueryIsEmergencyNumber;
|
|
66 |
class MLtsyDispatchCallControlGetAlsPpSupport;
|
|
67 |
class MLtsyDispatchCallControlGetAlsBlockedStatus;
|
|
68 |
class MLtsyDispatchCallControlSetAlsBlocked;
|
|
69 |
class MLtsyDispatchCallControlGetLifeTime;
|
|
70 |
class MLtsyDispatchCallControlTerminateErrorCall;
|
|
71 |
class MLtsyDispatchCallControlTerminateAllCalls;
|
|
72 |
class MLtsyDispatchCallControlGetCallForwardingIndicator;
|
|
73 |
class MLtsyDispatchCallControlUpdateLifeTimer;
|
|
74 |
|
|
75 |
// CLASS DECLARATION
|
|
76 |
|
|
77 |
/**
|
|
78 |
* This class is responsible for packing and unpacking data belonging
|
|
79 |
* to CallControl related requests to the Licensee LTSY.
|
|
80 |
*/
|
|
81 |
class CCallControlDispatcher : public CBase, public MDispatcherCallback
|
|
82 |
{
|
|
83 |
public:
|
|
84 |
|
|
85 |
virtual ~CCallControlDispatcher();
|
|
86 |
|
|
87 |
static CCallControlDispatcher* NewL(
|
|
88 |
MLtsyDispatchFactoryV1& aLtsyFactory,
|
|
89 |
MmMessageManagerCallback& aMessageManagerCallback,
|
|
90 |
CRequestQueueOneShot& aRequestAsyncOneShot);
|
|
91 |
|
|
92 |
static CCallControlDispatcher* NewLC(
|
|
93 |
MLtsyDispatchFactoryV1& aLtsyFactory,
|
|
94 |
MmMessageManagerCallback& aMessageManagerCallback,
|
|
95 |
CRequestQueueOneShot& aRequestAsyncOneShot);
|
|
96 |
|
|
97 |
// Dispatcher functions for dispatching requests DOWN to the Licensee LTSY
|
|
98 |
|
|
99 |
TInt DispatchAnswerL(const CMmDataPackage* aDataPackage);
|
|
100 |
TInt DispatchAnswerIsvL(const CMmDataPackage* aDataPackage);
|
|
101 |
TInt DispatchHoldL(const CMmDataPackage* aDataPackage);
|
|
102 |
TInt DispatchDialEmergencyL(const CMmDataPackage* aDataPackage);
|
|
103 |
TInt DispatchDialNoFdnCheckL(const CMmDataPackage* aDataPackage);
|
|
104 |
TInt DispatchStopDtmfToneL(const CMmDataPackage* aDataPackage);
|
|
105 |
TInt DispatchDialIsvL(const CMmDataPackage* aDataPackage);
|
|
106 |
TInt DispatchSetActiveAlsLineL(const CMmDataPackage* aDataPackage);
|
|
107 |
TInt DispatchSendDtmfTonesCancelL(const CMmDataPackage* aDataPackage);
|
|
108 |
TInt DispatchHangUpL(const CMmDataPackage* aDataPackage);
|
|
109 |
TInt DispatchResumeL(const CMmDataPackage* aDataPackage);
|
|
110 |
TInt DispatchSetDynamicHscsdParamsL(const CMmDataPackage* aDataPackage);
|
|
111 |
TInt DispatchDialL(const CMmDataPackage* aDataPackage);
|
|
112 |
TInt DispatchTransferL(const CMmDataPackage* aDataPackage);
|
|
113 |
TInt DispatchSendDtmfTonesL(const CMmDataPackage* aDataPackage);
|
|
114 |
TInt DispatchGetIdentityServiceStatusL(const CMmDataPackage* aDataPackage);
|
|
115 |
TInt DispatchSwapL(const CMmDataPackage* aDataPackage);
|
|
116 |
TInt DispatchContinueDtmfStringSendingL(const CMmDataPackage* aDataPackage);
|
|
117 |
TInt DispatchLoanDataPortL(const CMmDataPackage* aDataPackage);
|
|
118 |
TInt DispatchRecoverDataPortL(const CMmDataPackage* aDataPackage);
|
|
119 |
TInt DispatchStartDtmfToneL(const CMmDataPackage* aDataPackage);
|
|
120 |
TInt DispatchGetActiveAlsLineL();
|
|
121 |
TInt DispatchQueryIsEmergencyNumberL(const CMmDataPackage* aDataPackage);
|
|
122 |
TInt DispatchGetAlsPpSupportL();
|
|
123 |
TInt DispatchGetAlsBlockedStatusL();
|
|
124 |
TInt DispatchSetAlsBlockedL(const CMmDataPackage* aDataPackage);
|
|
125 |
TInt DispatchGetLifeTimeL();
|
|
126 |
TInt DispatchTerminateCallL(const CMmDataPackage* aDataPackage);
|
|
127 |
TInt DispatchGetCallForwardingIndicatorL();
|
|
128 |
TInt DispatchUpdateLifeTimeL(const CMmDataPackage* aDataPackage);
|
|
129 |
|
|
130 |
// Complete functions for receiving completions UP from the Licensee LTSY
|
|
131 |
// via the CCtsyDispatcherCallback object.
|
|
132 |
|
|
133 |
void CallbackNotifyCallStatusChange(TInt aError, TInt aCallId, RMobileCall::TMobileCallStatus aMobileCallStatus);
|
|
134 |
void CallbackReceiveUui(TInt aError, TInt aCallId, const TDesC& aCallUui);
|
|
135 |
void CallbackNotifyDataCallCapsChange(TInt aError, TInt aCallId, const RMobileCall::TMobileCallDataCapsV1& aMobileCallDataCaps);
|
|
136 |
void CallbackNotifyIncomingCall(TInt aError, const RMobileCall::TMobileCallInfoV1& aCallInfo);
|
|
137 |
void CallbackNotifyHscsdInfoChange(TInt aError, TInt aCallId, const RMobileCall::TMobileCallHscsdInfoV8& aCallParams, const RMobileCall::TMobileCallDataCapsV1& aCallCaps);
|
|
138 |
void CallbackNotifyCallEvent(TInt aError, TInt aCallId, RMobileCall::TMobileCallEvent aCallEvent);
|
|
139 |
void CallbackNotifyCallInfoChange(TInt aError, const RMobileCall::TMobileCallInfoV1& aMobileCallInfo);
|
|
140 |
void CallbackRemoteAlertingToneChange(TInt aError, RMmCustomAPI::TRemoteAlertingToneStatus aRemoteAlertingTone);
|
|
141 |
void CallbackAnswer(TInt aError, TInt aCallId);
|
|
142 |
void CallbackHold(TInt aError, TInt aCallId);
|
|
143 |
void CallbackDialEmergency(TInt aError, TInt aCallId);
|
|
144 |
void CallbackStopDtmfTone(TInt aError);
|
|
145 |
void CallbackSetActiveAlsLine(TInt aError);
|
|
146 |
void CallbackSendDtmfTonesCancel(TInt aError);
|
|
147 |
void CallbackHangUp(TInt aError, TInt aCallId);
|
|
148 |
void CallbackResume(TInt aError, TInt aCallId);
|
|
149 |
void CallbackSetDynamicHscsdParams(TInt aError, TInt aCallId);
|
|
150 |
void CallbackDialVoice(TInt aError, TInt aCallId);
|
|
151 |
void CallbackTransfer(TInt aError);
|
|
152 |
void CallbackSendDtmfTones(TInt aError);
|
|
153 |
void CallbackGetIdentityServiceStatus(TInt aError, RMobilePhone::TMobilePhoneIdServiceStatus aIdentityServiceStatus);
|
|
154 |
void CallbackSwap(TInt aError);
|
|
155 |
void CallbackStartDtmfTone(TInt aError);
|
|
156 |
void CallbackGetActiveAlsLine(TInt aError, RMobilePhone::TMobilePhoneALSLine aAlsLine);
|
|
157 |
void CallbackDialData(TInt aError, TInt aCallId);
|
|
158 |
void CallbackQueryIsEmergencyNumber(CRequestQueueOneShot::TIpcDataPackage* aDataPackage);
|
|
159 |
void CallbackNotifyIccCallForwardingStatusChange(TInt aError, const RMobilePhone::TMobileAddress& aCallForwardingNo,
|
|
160 |
RMobilePhone::TCFUIndicatorStatusFlags aCallForwardingStatusFlags,
|
|
161 |
RMmCustomAPI::TMultipleSubscriberProfileID aMultipleSubscriberProfileId);
|
|
162 |
void CallbackGetAlsPpSupport(TInt aError, RMmCustomAPI::TAlsSupport aAlsStatus);
|
|
163 |
void CallbackGetAlsBlockedStatus(TInt aError, RMmCustomAPI::TGetAlsBlockStatus aAlsSupport);
|
|
164 |
void CallbackSetAlsBlocked(TInt aError);
|
|
165 |
void CallbackGetLifeTime(TInt aError);
|
|
166 |
void CallbackGetLifeTime(TInt aError, TUint32 aHours, TUint8 aMinutes);
|
|
167 |
void CallbackGetLifeTime(TInt aError, const TDateTime &aManufacturingDate);
|
|
168 |
void CallbackGetLifeTime(TInt aError, const TDateTime &aManufacturingDate, TUint32 aHours, TUint8 aMinutes);
|
|
169 |
void CallbackTerminateErrorCall(TInt aError);
|
|
170 |
void CallbackTerminateAllCalls(TInt aError);
|
|
171 |
void CallbackGetCallForwardingIndicator(TInt aError, RMobilePhone::TMobileTON aTypeOfNumber,
|
|
172 |
RMobilePhone::TMobileNPI aMobilePlan,
|
|
173 |
const TDesC &aNumber,
|
|
174 |
RMobilePhone::TCFUIndicatorStatusFlags aCFUIndicatorStatusFlags,
|
|
175 |
RMobilePhone::TMultipleSubscriberProfileID aMultipleSubscriberProfileId);
|
|
176 |
void CallbackUpdateLifeTimer(TInt aError);
|
|
177 |
|
|
178 |
// From MDispatcherCallback
|
|
179 |
void CallbackSync(CRequestQueueOneShot::TIpcDataPackage& aIpcDataPackage);
|
|
180 |
|
|
181 |
// Other public functions
|
|
182 |
void SetDispatcherHolder(TDispatcherHolder& aDispatcherHolder);
|
|
183 |
|
|
184 |
private:
|
|
185 |
|
|
186 |
CCallControlDispatcher(MLtsyDispatchFactoryV1& aLtsyFactory,
|
|
187 |
MmMessageManagerCallback& aMessageManagerCallback,
|
|
188 |
CRequestQueueOneShot& aRequestAsyncOneShot);
|
|
189 |
|
|
190 |
void ConstructL();
|
|
191 |
|
|
192 |
// Helper functions
|
|
193 |
TInt DoDispatchDialL(const CMmDataPackage* aDataPackage, TBool aIsIsvCall, TBool aPerformFdnCheck);
|
|
194 |
TInt DoDispatchAnswerL(const CMmDataPackage* aDataPackage, TBool aIsIsvRequest);
|
|
195 |
void DoCallbackDial(TInt aError, TInt aCallId, RMobilePhone::TMobileService aMode);
|
|
196 |
TInt DoSendDtmfTonesL(TInt aCallId, const TDesC& aTones);
|
|
197 |
|
|
198 |
private: // Not owned
|
|
199 |
|
|
200 |
MLtsyDispatchFactoryV1& iLtsyFactoryV1;
|
|
201 |
MmMessageManagerCallback& iMessageManagerCallback;
|
|
202 |
CRequestQueueOneShot& iRequestAsyncOneShot;
|
|
203 |
TDispatcherHolder* iDispatcherHolder;
|
|
204 |
|
|
205 |
// Interfaces in the Licensee LTSY, not owned by this object
|
|
206 |
|
|
207 |
MLtsyDispatchCallControlAnswer* iLtsyDispatchCallControlAnswer;
|
|
208 |
MLtsyDispatchCallControlHold* iLtsyDispatchCallControlHold;
|
|
209 |
MLtsyDispatchCallControlDialEmergency* iLtsyDispatchCallControlDialEmergency;
|
|
210 |
MLtsyDispatchCallControlStopDtmfTone* iLtsyDispatchCallControlStopDtmfTone;
|
|
211 |
MLtsyDispatchCallControlSetActiveAlsLine* iLtsyDispatchCallControlSetActiveAlsLine;
|
|
212 |
MLtsyDispatchCallControlSendDtmfTonesCancel* iLtsyDispatchCallControlSendDtmfTonesCancel;
|
|
213 |
MLtsyDispatchCallControlHangUp* iLtsyDispatchCallControlHangUp;
|
|
214 |
MLtsyDispatchCallControlResume* iLtsyDispatchCallControlResume;
|
|
215 |
MLtsyDispatchCallControlSetDynamicHscsdParams* iLtsyDispatchCallControlSetDynamicHscsdParams;
|
|
216 |
MLtsyDispatchCallControlDialVoice* iLtsyDispatchCallControlDialVoice;
|
|
217 |
MLtsyDispatchCallControlTransfer* iLtsyDispatchCallControlTransfer;
|
|
218 |
MLtsyDispatchCallControlSendDtmfTones* iLtsyDispatchCallControlSendDtmfTones;
|
|
219 |
MLtsyDispatchCallControlGetIdentityServiceStatus* iLtsyDispatchCallControlGetIdentityServiceStatus;
|
|
220 |
MLtsyDispatchCallControlSwap* iLtsyDispatchCallControlSwap;
|
|
221 |
MLtsyDispatchCallControlSwap* iLtsyDispatchCallControlSingleSwap;
|
|
222 |
MLtsyDispatchCallControlLoanDataPort* iLtsyDispatchCallControlLoanDataPort;
|
|
223 |
MLtsyDispatchCallControlRecoverDataPort* iLtsyDispatchCallControlRecoverDataPort;
|
|
224 |
MLtsyDispatchCallControlStartDtmfTone* iLtsyDispatchCallControlStartDtmfTone;
|
|
225 |
MLtsyDispatchCallControlGetActiveAlsLine* iLtsyDispatchCallControlGetActiveAlsLine;
|
|
226 |
MLtsyDispatchCallControlDialData* iLtsyDispatchCallControlDialData;
|
|
227 |
MLtsyDispatchCallControlQueryIsEmergencyNumber* iLtsyDispatchCallControlQueryIsEmergencyNumber;
|
|
228 |
MLtsyDispatchCallControlGetAlsPpSupport* iLtsyDispatchCallControlGetAlsPpSupport;
|
|
229 |
MLtsyDispatchCallControlGetAlsBlockedStatus* iLtsyDispatchCallControlGetAlsBlockedStatus;
|
|
230 |
MLtsyDispatchCallControlSetAlsBlocked* iLtsyDispatchCallControlSetAlsBlocked;
|
|
231 |
MLtsyDispatchCallControlGetLifeTime* iLtsyDispatchCallControlGetLifeTime;
|
|
232 |
MLtsyDispatchCallControlTerminateErrorCall* iLtsyDispatchCallControlTerminateErrorCall;
|
|
233 |
MLtsyDispatchCallControlTerminateAllCalls* iLtsyDispatchCallControlTerminateAllCalls;
|
|
234 |
MLtsyDispatchCallControlGetCallForwardingIndicator* iLtsyDispatchCallControlGetCallForwardingIndicator;
|
|
235 |
MLtsyDispatchCallControlUpdateLifeTimer* iLtsyDispatchCallControlUpdateLifeTimer;
|
|
236 |
|
|
237 |
// Other data items
|
|
238 |
|
|
239 |
/**
|
|
240 |
* Cache of phone number passed to dispatcher in a
|
|
241 |
* ECustomCheckEmergencyNumberIPC request.
|
|
242 |
*/
|
|
243 |
RMmCustomAPI::TMobileTelNumber iQueryEmergencyNumber;
|
|
244 |
|
|
245 |
/**
|
|
246 |
* Buffer containing remains of DTMF string to be sent.
|
|
247 |
* This is used for handling 'w' (wait) characters passed into
|
|
248 |
* RMobilePhone::SendDTMFTones
|
|
249 |
*/
|
|
250 |
TBuf<KMaxInfoName> iDtmfString; // Created by this object but ownership passes to CTSY
|
|
251 |
|
|
252 |
/**
|
|
253 |
* The call ID of the call iDtmfString was sending tones to.
|
|
254 |
* Used if client decides to continue sending the string.
|
|
255 |
*/
|
|
256 |
TInt iCallIdForDtmf;
|
|
257 |
|
|
258 |
/**
|
|
259 |
* ETrue if a stop character has been found in the DTMF string,
|
|
260 |
* therefore client needs to be notified of stop on completion of
|
|
261 |
* send.
|
|
262 |
*/
|
|
263 |
TBool iFoundDtmfStop;
|
|
264 |
|
|
265 |
/**
|
|
266 |
* Caches the mode used to dial a voice call. This is needed for when the
|
|
267 |
* auxiliary line is used to dial a call. On the callback from the dial,
|
|
268 |
* the CTSY needs the call mode to locate the call object to set the Call ID.
|
|
269 |
*/
|
|
270 |
RMobilePhone::TMobileService iModeUsedForVoiceCallDial;
|
|
271 |
|
|
272 |
/**
|
|
273 |
* Caches whether an FDN check was performed, to allow the correct IPC to be
|
|
274 |
* completed.
|
|
275 |
*/
|
|
276 |
TBool iFdnCheckPerformed;
|
|
277 |
|
|
278 |
/**
|
|
279 |
* These are the two Call IDs of the calls on which a swap operation
|
|
280 |
* has been requested. It allows the dispatcher to return a Call ID to the CTSY
|
|
281 |
* on completion of a swap (if the swap failed) so that the CTSY can locate the
|
|
282 |
* call object to complete the swap back to the client.
|
|
283 |
*
|
|
284 |
* These Call IDs should only have a value != -1 when there is a pending swap
|
|
285 |
* operation.
|
|
286 |
*/
|
|
287 |
TInt iSwapCallId;
|
|
288 |
TInt iSecondSwapCallId;
|
|
289 |
|
|
290 |
/**
|
|
291 |
* These are the two Call IDs of the calls on which a transfer operation
|
|
292 |
* has been requested. It is needed for the same reason as iSwapCallId
|
|
293 |
* and iSecondSwapCallId above.
|
|
294 |
*/
|
|
295 |
TInt iTransferHeldCallId;
|
|
296 |
TInt iTransferSecondCallId;
|
|
297 |
}; // class CCallControlDispatcher
|
|
298 |
|
|
299 |
#endif // __CCALLCONTROLDISPATCHER_H_
|
|
300 |
|