1 /* |
|
2 * Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Specific class for Conference call tests |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <e32svr.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 #include "voice.h" |
|
25 |
|
26 // CONSTANTS |
|
27 |
|
28 // ============================ MEMBER FUNCTIONS =============================== |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CVoice::CreateConference |
|
31 // CreateConference method function. |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 TInt CVoice::CreateConference( CStifItemParser& /*aItem*/ ) |
|
35 { |
|
36 _LIT8 (KCC, "Voice::CreateConference" ); |
|
37 iVoiceLog->Log((TDesC8)KCC); |
|
38 |
|
39 TInt ret( KErrNotFound ); |
|
40 ret = HandleRequestL( EMobileConferenceCallCreateConference ); |
|
41 if ( KErrNone == ret ) |
|
42 { |
|
43 _LIT8(KCallOk, " CreateConference call successful" ); |
|
44 iVoiceLog->Log((TDesC8)KCallOk ); |
|
45 iTestOngoing = ECreateCCTestOngoing; |
|
46 iNumberOfCallsInCC = 2; |
|
47 } |
|
48 else |
|
49 { |
|
50 _LIT8(KCallFailed, " CreateConference call fails: %d" ); |
|
51 iVoiceLog->Log((TDesC8)KCallFailed ); |
|
52 } |
|
53 |
|
54 return ret; |
|
55 } |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CVoice::HangUpCC |
|
59 // HangUpCC method function. |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 TInt CVoice::HangUpCC( CStifItemParser& /*aItem*/ ) |
|
63 { |
|
64 _LIT8 (KCC, "Voice::HangUpCC" ); |
|
65 iVoiceLog->Log((TDesC8)KCC); |
|
66 |
|
67 TInt ret( KErrNotFound ); |
|
68 ret = HandleRequestL( EMobileConferenceCallHangUp ); |
|
69 if ( KErrNone == ret ) |
|
70 { |
|
71 _LIT8(KCallOk, " HangUpCC call successful" ); |
|
72 iVoiceLog->Log((TDesC8)KCallOk ); |
|
73 iTestOngoing = EHangUpCCTestOngoing; |
|
74 } |
|
75 else |
|
76 { |
|
77 _LIT8(KCallFailed, " HangUpCC call fails: %d" ); |
|
78 iVoiceLog->Log((TDesC8)KCallFailed ); |
|
79 } |
|
80 |
|
81 return ret; |
|
82 } |
|
83 |
|
84 // ----------------------------------------------------------------------------- |
|
85 // CVoice::AddCallToCC |
|
86 // AddCallToCC method function. |
|
87 // ----------------------------------------------------------------------------- |
|
88 // |
|
89 TInt CVoice::AddCallToCC( CStifItemParser& aItem ) |
|
90 { |
|
91 _LIT8 (KCC, "Voice::AddCallToCC" ); |
|
92 iVoiceLog->Log((TDesC8)KCC); |
|
93 |
|
94 TInt ret (KErrNotFound); |
|
95 RMobilePhone::TMobileService mode( RMobilePhone::EVoiceService ); |
|
96 |
|
97 TInt callId; |
|
98 aItem.GetNextInt( callId ); |
|
99 |
|
100 //Create package |
|
101 CCallDataPackage package; |
|
102 //Set call id and call mode |
|
103 package.SetCallIdAndMode( callId, mode ); |
|
104 |
|
105 ret = HandleRequestL( EMobileConferenceCallAddCall, &package ); |
|
106 if ( KErrNone == ret ) |
|
107 { |
|
108 _LIT8(KCallOk, " AddCallToCC call successful" ); |
|
109 iVoiceLog->Log((TDesC8)KCallOk ); |
|
110 iTestOngoing = EAddCallToCCTestOngoing; |
|
111 iNumberOfCallsInCC++; |
|
112 } |
|
113 else |
|
114 { |
|
115 _LIT8(KCallFailed, " AddCallToCC call fails: %d" ); |
|
116 iVoiceLog->Log((TDesC8)KCallFailed ); |
|
117 } |
|
118 |
|
119 return ret; |
|
120 } |
|
121 |
|
122 // ----------------------------------------------------------------------------- |
|
123 // CVoice::HoldConference |
|
124 // CreateConference method function. |
|
125 // ----------------------------------------------------------------------------- |
|
126 // |
|
127 TInt CVoice::HoldConference( CStifItemParser& aItem ) |
|
128 { |
|
129 _LIT8 (KCC, "Voice::HoldConference" ); |
|
130 iVoiceLog->Log((TDesC8)KCC); |
|
131 |
|
132 TInt ret (KErrNotFound); |
|
133 RMobilePhone::TMobileService mode( RMobilePhone::EVoiceService ); |
|
134 |
|
135 TInt callId; |
|
136 aItem.GetNextInt( callId ); |
|
137 |
|
138 //Create package |
|
139 CCallDataPackage package; |
|
140 //Set call id and call mode |
|
141 package.SetCallIdAndMode( callId, mode ); |
|
142 |
|
143 ret = HandleRequestL( EMobileCallHold, &package ); |
|
144 if ( KErrNone == ret ) |
|
145 { |
|
146 _LIT8(KCallOk, " HoldConference call successful" ); |
|
147 iVoiceLog->Log((TDesC8)KCallOk ); |
|
148 iTestOngoing = EHoldCCTestOngoing; |
|
149 } |
|
150 else |
|
151 { |
|
152 _LIT8(KCallFailed, " HoldConference call fails: %d" ); |
|
153 iVoiceLog->Log((TDesC8)KCallFailed ); |
|
154 } |
|
155 |
|
156 return ret; |
|
157 } |
|
158 |
|
159 // ----------------------------------------------------------------------------- |
|
160 // CVoice::ResumeConference |
|
161 // ResumeConference method function. |
|
162 // ----------------------------------------------------------------------------- |
|
163 // |
|
164 TInt CVoice::ResumeConference( CStifItemParser& aItem ) |
|
165 { |
|
166 _LIT8 (KCC, "Voice::ResumeConference" ); |
|
167 iVoiceLog->Log((TDesC8)KCC); |
|
168 |
|
169 TInt ret (KErrNotFound); |
|
170 RMobilePhone::TMobileService mode( RMobilePhone::EVoiceService ); |
|
171 |
|
172 TInt callId; |
|
173 aItem.GetNextInt( callId ); |
|
174 |
|
175 //Create package |
|
176 CCallDataPackage package; |
|
177 //Set call id and call mode |
|
178 package.SetCallIdAndMode( callId, mode ); |
|
179 |
|
180 ret = HandleRequestL( EMobileCallResume, &package ); |
|
181 if ( KErrNone == ret ) |
|
182 { |
|
183 _LIT8(KCallOk, " ResumeConference call successful" ); |
|
184 iVoiceLog->Log((TDesC8)KCallOk ); |
|
185 iTestOngoing = EResumeCCTestOngoing; |
|
186 } |
|
187 else |
|
188 { |
|
189 _LIT8(KCallFailed, "ResumeConference call fails: %d" ); |
|
190 iVoiceLog->Log((TDesC8)KCallFailed ); |
|
191 } |
|
192 |
|
193 return ret; |
|
194 } |
|
195 |
|
196 // ----------------------------------------------------------------------------- |
|
197 // CVoice::SwapConference |
|
198 // CreateConference method function. |
|
199 // ----------------------------------------------------------------------------- |
|
200 // |
|
201 TInt CVoice::SwapConference( CStifItemParser& /*aItem*/ ) |
|
202 { |
|
203 _LIT8 (KCC, "Voice::SwapConference" ); |
|
204 iVoiceLog->Log((TDesC8)KCC); |
|
205 |
|
206 TInt ret (KErrNotFound); |
|
207 |
|
208 ret = HandleRequestL( EMobileConferenceCallSwap ); |
|
209 if ( KErrNone == ret ) |
|
210 { |
|
211 _LIT8(KCallOk, " SwapConference call successful" ); |
|
212 iVoiceLog->Log((TDesC8)KCallOk ); |
|
213 iTestOngoing = ESwapCCTestOngoing; |
|
214 } |
|
215 else |
|
216 { |
|
217 _LIT8(KCallFailed, " SwapConference call fails: %d" ); |
|
218 iVoiceLog->Log((TDesC8)KCallFailed ); |
|
219 } |
|
220 |
|
221 return ret; |
|
222 } |
|
223 |
|
224 // ----------------------------------------------------------------------------- |
|
225 // CVoice::GoOneToOne |
|
226 // CreateConference method function. |
|
227 // ----------------------------------------------------------------------------- |
|
228 // |
|
229 TInt CVoice::GoOneToOne( CStifItemParser& aItem ) |
|
230 { |
|
231 _LIT8 (KCC, "Voice::GoOneToOne" ); |
|
232 iVoiceLog->Log((TDesC8)KCC); |
|
233 |
|
234 TInt ret (KErrNotFound); |
|
235 RMobilePhone::TMobileService mode( RMobilePhone::EVoiceService ); |
|
236 |
|
237 TInt callId; |
|
238 aItem.GetNextInt( callId ); |
|
239 |
|
240 //Create package |
|
241 CCallDataPackage package; |
|
242 //Set call id and call mode |
|
243 package.SetCallIdAndMode( callId, mode ); |
|
244 |
|
245 ret = HandleRequestL( EMobileCallGoOneToOne, &package ); |
|
246 if ( KErrNone == ret ) |
|
247 { |
|
248 _LIT8(KCallOk, " GoOneToOne call successful" ); |
|
249 iVoiceLog->Log((TDesC8)KCallOk ); |
|
250 iTestOngoing = EGoOneToOneTestOngoing; |
|
251 } |
|
252 else |
|
253 { |
|
254 _LIT8(KCallFailed, " GoOneToOne call fails: %d" ); |
|
255 iVoiceLog->Log((TDesC8)KCallFailed ); |
|
256 } |
|
257 |
|
258 return ret; |
|
259 } |
|
260 |
|
261 // ----------------------------------------------------------------------------- |
|
262 // CVoice::CompleteMobileCallGetMobileCallInfo |
|
263 // Completes |
|
264 // ----------------------------------------------------------------------------- |
|
265 // |
|
266 void CVoice::CompleteMobileCallGetMobileCallInfo( |
|
267 TInt aResult, |
|
268 const CCallDataPackage* aCallData ) |
|
269 { |
|
270 TInt callId( 0 ); |
|
271 RMobilePhone::TMobileService callMode( RMobilePhone::EServiceUnspecified ); |
|
272 |
|
273 aCallData->GetCallIdAndMode( callId, callMode ); |
|
274 |
|
275 _LIT8(KId, "CVoice::CompleteMobileCallGetMobileCallInfo - callId: %d" ); |
|
276 _LIT8(KMode, "CVoice::CompleteMobileCallGetMobileCallInfo - callMode: %d" ); |
|
277 iVoiceLog->Log((TDesC8)KId, callId ); |
|
278 iVoiceLog->Log((TDesC8)KMode, callMode ); |
|
279 |
|
280 // Parameter checking |
|
281 if ( iVoiceParameterCheck && |
|
282 ( ETestCaseVoice032 == iTestCaseNumber || |
|
283 ETestCaseVoice033 == iTestCaseNumber ) ) |
|
284 { |
|
285 if ( callId != iRefCallId || callMode != iRefCallMode ) |
|
286 { |
|
287 aResult = KErrGeneral; |
|
288 } |
|
289 } |
|
290 |
|
291 Signal( aResult); |
|
292 } |
|
293 |
|
294 |
|
295 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
296 // None |
|
297 // End of File |
|