|
1 /* |
|
2 * Copyright (c) 2005 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 "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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MCETESTHELPER_H |
|
22 #define MCETESTHELPER_H |
|
23 |
|
24 |
|
25 #pragma warn_illtokenpasting off |
|
26 |
|
27 #include <e32std.h> |
|
28 #include <bamdesca.h> |
|
29 #include <siperr.h> |
|
30 #include <sipaddress.h> |
|
31 #include <sipextensionheader.h> |
|
32 #include <sipaddress.h> |
|
33 #include <sipsupportedheader.h> |
|
34 #include <sipcontenttypeheader.h> |
|
35 #include <sipfromheader.h> |
|
36 #include <siptoheader.h> |
|
37 #include <sipstrings.h> |
|
38 #include <sipstrconsts.h> |
|
39 #include <Uri8.h> |
|
40 #include <sdpdocument.h> |
|
41 |
|
42 |
|
43 // INTERNAL INCLUDES |
|
44 #include "sip.h" |
|
45 #include "sipconnection.h" |
|
46 #include "sipprofile.h" |
|
47 #include "SIPClientTransaction.h" |
|
48 #include "SIPDialog.h" |
|
49 #include "SIPServerTransaction.h" |
|
50 #include "SIPRequestElements.h" |
|
51 #include "SIPResponseElements.h" |
|
52 #include "SIPMessageElements.h" |
|
53 #include "SIPInviteDialogAssoc.h" |
|
54 #include "uricontainer.h" |
|
55 |
|
56 #include "mcecomsession.h" |
|
57 #include "mcesession.h" |
|
58 #include "mcecomaudiostream.h" |
|
59 #include "mcecomrtpsource.h" |
|
60 #include "mcecomspeakersink.h" |
|
61 #include "mcecomrtpsink.h" |
|
62 #include "mcecommicsource.h" |
|
63 #include "mcecomamrcodec.h" |
|
64 |
|
65 #include "cmcetls.h" |
|
66 #include "mcesip.h" |
|
67 #include "mceclientserver.h" |
|
68 #include "mceevents.h" |
|
69 #include "mcecssubsessionreceiver.h" |
|
70 #include "mcecsreceivequeue.h" |
|
71 |
|
72 |
|
73 _LIT8(KSDPMessage_OK1, "v=0\r\n\ |
|
74 o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4\r\n\ |
|
75 s=SDP Seminar\n\ |
|
76 i=A Seminar on the session description protocol\r\n\ |
|
77 u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps\r\n\ |
|
78 e=mjh@isi.edu (Mark Handley)\r\n\ |
|
79 e=j.doe@example.com (Jane Doe)\r\n\ |
|
80 p=+44-171-380-7777\r\n\ |
|
81 p=+1 617 555 6011\r\n\ |
|
82 c=IN IP4 224.2.17.12/127\r\n\ |
|
83 b=X-YZ:128\r\n\ |
|
84 t=0 0\r\n\ |
|
85 r=604800 3600 0 90000\r\n\ |
|
86 t=2873397496 2873404696\r\n\ |
|
87 z=2882844526 -1h 2898848070 0\r\n\ |
|
88 k=uri:http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps\r\n\ |
|
89 a=recvonly\r\n\ |
|
90 a=orient:landscape\r\n\ |
|
91 m=application 32416/234 udp wb\r\n\ |
|
92 a=orient:portrait\r\n\ |
|
93 m=audio 49170 RTP/AVP 0 96\r\n\ |
|
94 a=rtpmap:0 PCMU/8000\r\n\ |
|
95 a=rtpmap:96 AMR/8000/1\r\n\ |
|
96 i=A Seminar on the session description protocol\r\n\ |
|
97 c=IN IP4 224.2.17.12/127\r\n\ |
|
98 c=IN IP4 224.2.17.12/127\r\n\ |
|
99 b=X-YZ:128\r\n\ |
|
100 k=uri:http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps\r\n\ |
|
101 a=orient:portrait\r\n\ |
|
102 m=video 51372 RTP/AVP 32\r\n\ |
|
103 a=rtpmap:32 MPV/90000\r\n"); |
|
104 |
|
105 |
|
106 _LIT8(KSDPMessage_OK2, "v=0\r\n\ |
|
107 o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4\r\n\ |
|
108 s=SDP Seminar\n\ |
|
109 i=UPDATED A Seminar on the session description protocol is UPDATED\r\n\ |
|
110 u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps\r\n\ |
|
111 e=mjh@isi.edu (Mark Handley)\r\n\ |
|
112 e=j.doe@example.com (Jane Doe)\r\n\ |
|
113 p=+44-171-380-7777\r\n\ |
|
114 p=+1 617 555 6011\r\n\ |
|
115 c=IN IP4 224.2.17.12/127\r\n\ |
|
116 b=X-YZ:128\r\n\ |
|
117 t=0 0\r\n\ |
|
118 r=604800 3600 0 90000\r\n\ |
|
119 t=2873397496 2873404696\r\n\ |
|
120 z=2882844526 -1h 2898848070 0\r\n\ |
|
121 k=uri:http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps\r\n\ |
|
122 a=recvonly\r\n\ |
|
123 a=orient:landscape\r\n\ |
|
124 m=application 32416/234 udp wb\r\n\ |
|
125 a=orient:portrait\r\n\ |
|
126 m=audio 49170 RTP/AVP 0 96\r\n\ |
|
127 a=rtpmap:0 PCMU/8000\r\n\ |
|
128 a=rtpmap:96 AMR/8000/1\r\n\ |
|
129 i=A Seminar on the session description protocol\r\n\ |
|
130 c=IN IP4 224.2.17.12/127\r\n\ |
|
131 c=IN IP4 224.2.17.12/127\r\n\ |
|
132 b=X-YZ:128\r\n\ |
|
133 k=uri:http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps\r\n\ |
|
134 a=orient:portrait\r\n\ |
|
135 m=video 51372 RTP/AVP 32\r\n\ |
|
136 a=rtpmap:32 MPV/90000\r\n"); |
|
137 |
|
138 _LIT8(KSDPMessage_BAD, "badSDP"); |
|
139 |
|
140 const TInt KMaxLengthOfSDPMessage = 1000; |
|
141 const TInt KMaxLengthOfSessionExpires = 40; |
|
142 const TUint KMillisecondToSecond = 1000; |
|
143 //const TChar KSipSeparator = ':'; |
|
144 const TChar KSipHeaderSeparator = ';'; |
|
145 const TChar KSipEqualsTo = '='; |
|
146 _LIT8(KSessionExpires, "Session-Expires"); |
|
147 _LIT8(KSessionExpiresCompactForm, "x"); |
|
148 _LIT8(KRequire, "Require"); |
|
149 _LIT8(KMinSE, "Min-SE"); |
|
150 _LIT8(KReresher, "refresher"); |
|
151 _LIT8(KReresherUAC, "uac"); |
|
152 _LIT8(KReresherUAS, "uas"); |
|
153 _LIT8(KRecipient, " <sip:you@yours.com;p=fuu>;q=fuu"); |
|
154 _LIT8(KFrom, "sip:me@here.com"); |
|
155 _LIT8(KTo, "sip:you@here.com"); |
|
156 _LIT8(KEvent, "anevent"); |
|
157 _LIT8(KEvent2, "anotherevent"); |
|
158 _LIT8(KReferTo, "someone@there.com"); |
|
159 _LIT8(KContentType, "text/plain"); |
|
160 _LIT8(KReason, "Can't explain what happened"); |
|
161 _LIT8(KMethod, "FUU"); |
|
162 _LIT8(KHeader, "Header: Value"); |
|
163 _LIT8(KHeader2, "Header2: Value2"); |
|
164 _LIT8(KHeader3, "Header3: Value3"); |
|
165 _LIT8(KHeader4, "Header4: Value4"); |
|
166 _LIT8(KMediaToken, "media authorization token" ); |
|
167 _LIT8(KFeatureTag, "+featuretag"); |
|
168 _LIT8(KParamValue, "param=value" ); |
|
169 _LIT8(KParam, "param" ); |
|
170 _LIT8(KValue, "value" ); |
|
171 _LIT8(KRequestUriUser, "user"); |
|
172 _LIT8( KSIPProfileDefAOR, "sip:user@aa"); |
|
173 _LIT8(KContactValue, "sip:user@localhost"); |
|
174 _LIT8(KContactHeaderValue, "sip:user@172.21.11.216;expires=3600"); |
|
175 _LIT8(KContactValueTls, "<sip:user@localhost;transport=tls>;expires=3600"); |
|
176 _LIT8(KContactValueSips, "<sips:user@localhost>;expires=3600"); |
|
177 _LIT8(KContactValueSipsAndTls, "<sips:user@localhost;transport=tls>;expires=3600"); |
|
178 _LIT8(KRequestUri, "sip:user@1.2.3.4"); |
|
179 |
|
180 _LIT8(KForwarded, "sip:he@there.com" ); |
|
181 const TUint KMceTestLoops = 10; |
|
182 const TUint32 KRSeq = 1; |
|
183 const TUint32 KInviteCSeq = 1; |
|
184 |
|
185 #define MCE_SET_URIL( uri )\ |
|
186 uri->SetComponentL( _L8("sip"), EUriScheme );\ |
|
187 uri->SetComponentL( _L8("nokia.com"), EUriHost );\ |
|
188 uri->SetComponentL( KRequestUriUser, EUriUserinfo ) |
|
189 |
|
190 |
|
191 // FORWARD DECLARATION |
|
192 |
|
193 class CMceSipSession; |
|
194 class CMceCsSession; |
|
195 class CMceSipEvent; |
|
196 |
|
197 // CLASS DECLARATION |
|
198 |
|
199 #define MCE_EUNIT_ASSERT( func ) \ |
|
200 if ( !(func) )\ |
|
201 {\ |
|
202 static TInt i = 20;\ |
|
203 --i;\ |
|
204 if ( i )\ |
|
205 {\ |
|
206 User::Leave(KErrNoMemory);\ |
|
207 }\ |
|
208 }\ |
|
209 EUNIT_ASSERT( func ); |
|
210 |
|
211 #define MCE_EUNIT_ASSERT_LEAVE( func ) { TRAPD( leaveErr, func );\ |
|
212 if ( leaveErr == KErrNoMemory )\ |
|
213 {\ |
|
214 User::Leave( KErrNoMemory );\ |
|
215 }\ |
|
216 EUNIT_ASSERT( leaveErr != KErrNone );} |
|
217 |
|
218 #define MCE_EUNIT_ASSERT_EQUALS( func, val ) \ |
|
219 {\ |
|
220 TInt mceUnitTestRetVal = func;\ |
|
221 if ( mceUnitTestRetVal != KErrNoMemory ){\ |
|
222 EUNIT_ASSERT_EQUALS( mceUnitTestRetVal, val );\ |
|
223 }\ |
|
224 else{\ |
|
225 User::Leave( KErrNoMemory );\ |
|
226 }\ |
|
227 } |
|
228 |
|
229 #define MCE_EUNIT_ASSERT_SPECIFIC_LEAVE( func, val ) \ |
|
230 {\ |
|
231 TRAPD( mceUnitTestRetVal, func );\ |
|
232 if ( val != KErrNoMemory && mceUnitTestRetVal == KErrNoMemory ){\ |
|
233 User::Leave( KErrNoMemory );\ |
|
234 }\ |
|
235 else{\ |
|
236 EUNIT_ASSERT_EQUALS( mceUnitTestRetVal, val );\ |
|
237 }\ |
|
238 } |
|
239 |
|
240 #define MCE_EUNIT_ASSERT_NO_LEAVE( func ) MCE_EUNIT_ASSERT_SPECIFIC_LEAVE( func, KErrNone ) |
|
241 |
|
242 #define MCE_LEAVE_HANDLING( func, oomMappedError ) {\ |
|
243 TRAPD( mceUnitTestLeaveError, func );\ |
|
244 if ( mceUnitTestLeaveError == KErrNoMemory || mceUnitTestLeaveError == oomMappedError )\ |
|
245 {\ |
|
246 User::Leave( KErrNoMemory );\ |
|
247 }\ |
|
248 } |
|
249 |
|
250 #define MCE_DELETE_SUBSESSION_POSTCODITION( mceUnitTestSession, mceUnitTestSubSession )\ |
|
251 if ( mceUnitTestSession && \ |
|
252 mceUnitTestSession->Implementation().SubSessions().Find( mceUnitTestSubSession ) == KErrNotFound && \ |
|
253 mceUnitTestSession->ServerCore().Manager().iOrphanSubSessions->SubSessions().Find( mceUnitTestSubSession ) == KErrNotFound )\ |
|
254 {\ |
|
255 User::Leave( KErrNoMemory );\ |
|
256 } |
|
257 |
|
258 #define MCE_RECEIVE_QUEUE_POSTCONDITION( mceUnitTestSipSession ){ \ |
|
259 TInt lastIndex = mceUnitTestSipSession->iReceiver->iReceiveQueue->iReceiveItems.Count() - 1; \ |
|
260 if ( lastIndex >= 0 && mceUnitTestSipSession->iReceiver->iReceiveQueue->iReceiveItems[ lastIndex ].Error() == KErrNoMemory )\ |
|
261 {\ |
|
262 User::Leave( KErrNoMemory );\ |
|
263 }} |
|
264 |
|
265 #define MCE_TH_SET( instance, value ) delete instance;instance=NULL;instance=value |
|
266 |
|
267 #define MCE_RESET_STUBS()\ |
|
268 iStorage->SIPSends( SIPStrings::StringF( SipStrConsts::EEmpty ), (CSIPMessageElements*)NULL );\ |
|
269 iStorage->SIPSends( SIPStrings::StringF( SipStrConsts::EEmpty ), (CSIPResponseElements*)NULL );\ |
|
270 iStorage->iAckSent = EFalse;\ |
|
271 iStorage->iMediaManagerAction = CMCETls::ENone;\ |
|
272 iStorage->iMediaManagerSdpAction = CMCETls::ENone;\ |
|
273 iStorage->iMediaManagerUpdateStatus = KMceReady;\ |
|
274 iStorage->iMediaManagerDecodeStatus = KErrNone;\ |
|
275 iStorage->iMediaManagerReserveStatus = KMceReady;\ |
|
276 iStorage->iMediaManagerNeedToNegotiate = ETrue;\ |
|
277 iStorage->iCompletionCode = KErrNotFound |
|
278 |
|
279 |
|
280 #define MCE_ASSERT_STUBS( mmaction, mmsdpaction, sentMethod, sentResponse )\ |
|
281 EUNIT_ASSERT_EQUALS( mmaction, iStorage->iMediaManagerAction )\ |
|
282 EUNIT_ASSERT_EQUALS( mmsdpaction, iStorage->iMediaManagerSdpAction )\ |
|
283 EUNIT_ASSERT_EQUALS( SIPStrings::StringF( sentMethod ).DesC(), iStorage->iSipSentMethod.DesC() )\ |
|
284 if ( sentResponse > 0 )\ |
|
285 {\ |
|
286 EUNIT_ASSERT( iStorage->iSipSentResponse != NULL )\ |
|
287 EUNIT_ASSERT_EQUALS( sentResponse, iStorage->iSipSentResponse->StatusCode() )\ |
|
288 } |
|
289 |
|
290 #define MCE_ASSERT_STATES( session, clientState, serverState )\ |
|
291 EUNIT_ASSERT ( session->CurrentState().Id() == serverState );\ |
|
292 EUNIT_ASSERT ( session->iBody->iState == clientState ) |
|
293 |
|
294 #define MCE_SET_STATES( session, clientState, serverState )\ |
|
295 session->NextState( serverState );\ |
|
296 session->iBody->iState = clientState |
|
297 |
|
298 #define MCE_ASSERT_EVENT( event, code, status )\ |
|
299 EUNIT_ASSERT( event.Code() == code );\ |
|
300 EUNIT_ASSERT( event.ParamStatus() == status ) |
|
301 |
|
302 #define MCE_CLEAR_LEAVE()\ |
|
303 iStorage->SetLeave( KErrNone ) |
|
304 |
|
305 #define MCE_CHECK_MEMORY_LEAVE( conditions ) \ |
|
306 if ( conditions )\ |
|
307 {\ |
|
308 User::Leave( KErrNoMemory );\ |
|
309 } |
|
310 |
|
311 #define MCE_ASSERT_ENDPOINT_ENABLE_AND_DISABLE() \ |
|
312 CMceComAudioStream* inStream = CMceComAudioStream::NewLC();\ |
|
313 CMceComRtpSource* rtpSource = CMceComRtpSource::NewLC();\ |
|
314 inStream->SetSourceL( rtpSource );\ |
|
315 CleanupStack::Pop( rtpSource );\ |
|
316 CMceComSpeakerSink* speaker = CMceComSpeakerSink::NewLC();\ |
|
317 inStream->AddSinkL( speaker );\ |
|
318 CleanupStack::Pop( speaker );\ |
|
319 iSipSession->iBody->AddStreamL( inStream );\ |
|
320 CleanupStack::Pop( inStream );\ |
|
321 iSipSession->iBody->InitializeL();\ |
|
322 TUid appUid = TUid::Uid( 10 );\ |
|
323 iSipSession->iBody->iID = 1;\ |
|
324 inStream->iID = TMceMediaId(appUid,1);\ |
|
325 rtpSource->iID = TMceMediaId(appUid,2);\ |
|
326 speaker->iID = TMceMediaId(appUid,3);\ |
|
327 iStorage->iMMObject = NULL;\ |
|
328 ids.iAppUID = 10;\ |
|
329 ids.iSessionID = 1;\ |
|
330 ids.iMediaID = inStream->iID;\ |
|
331 ids.iSourceID = rtpSource->iID;\ |
|
332 TMceStateTransitionEvent eventDisable( *iSipSession, EMceItcDisable, ids, *msg );\ |
|
333 iState->EntryL( eventDisable );\ |
|
334 EUNIT_ASSERT ( iStorage->iMediaManagerAction == CMCETls::EPauseSource );\ |
|
335 EUNIT_ASSERT ( static_cast<const CMceComMediaSource*>(iStorage->iMMObject) == rtpSource );\ |
|
336 MCE_RESET_STUBS();\ |
|
337 iStorage->iMMObject = NULL;\ |
|
338 ids.iAppUID = 10;\ |
|
339 ids.iSessionID = 1;\ |
|
340 ids.iMediaID = inStream->iID;\ |
|
341 ids.iSourceID = rtpSource->iID;\ |
|
342 TMceStateTransitionEvent eventEnable( *iSipSession, EMceItcEnable, ids, *msg );\ |
|
343 iState->EntryL( eventEnable );\ |
|
344 EUNIT_ASSERT ( iStorage->iMediaManagerAction == CMCETls::EResumeSource );\ |
|
345 EUNIT_ASSERT ( static_cast<const CMceComMediaSource*>(iStorage->iMMObject) == rtpSource ); |
|
346 |
|
347 // MCE memory leave asserting can be used to help on cases where memory leave |
|
348 // which occured deep inside function, cannot be determined from function return |
|
349 // values (i.e. memory leave was ignored and execution did not go as expected) |
|
350 #define MCE_MEMORY_LEAVE_CHECKING_ON |
|
351 |
|
352 #ifdef MCE_MEMORY_LEAVE_CHECKING_ON |
|
353 #define MCE_CHECK_MEMORY_LEAVE( conditions ) \ |
|
354 if ( conditions )\ |
|
355 {\ |
|
356 User::Leave( KErrNoMemory );\ |
|
357 } |
|
358 |
|
359 #else |
|
360 #define MCE_CHECK_MEMORY_LEAVE( conditions ) |
|
361 #endif |
|
362 |
|
363 /** |
|
364 * MCE SIP state machine |
|
365 * |
|
366 * @lib |
|
367 * @since |
|
368 */ |
|
369 class MCETestHelper |
|
370 { |
|
371 |
|
372 public: |
|
373 |
|
374 |
|
375 static void ManagerReadyToReceiveL( CMceCsSession* aClient ); |
|
376 |
|
377 static CMceSipSession* ClientCreateSessionL( CMceCsSession* aClient, |
|
378 const TDesC8& aParam1, |
|
379 const TDesC8& aParam2 ); |
|
380 |
|
381 static CMceSipSession* ClientIncomingSessionL( CMceCsSession* aClient, |
|
382 TBool aInvalid = EFalse, |
|
383 TBool aSupported100rel = EFalse ); |
|
384 |
|
385 static CMceSipEvent* ClientIncomingEventL( CMceCsSession* aClient, |
|
386 TInt aMethod ); |
|
387 |
|
388 |
|
389 static void ClientReadyToReceiveL( CMceSipSession* aSession ); |
|
390 static CMceMsgBase* ClientReceiveLC( CMceSipSession* aSession, TMceIds& aIds ); |
|
391 |
|
392 static CMceComSession* ClientEstablishL( CMceSipSession* aSession, |
|
393 const TDesC8& aHeader = KNullDesC8, |
|
394 const TDesC8& aContentType = KNullDesC8, |
|
395 const TDesC8& aContent = KNullDesC8, |
|
396 TBool aRequire100rel = EFalse ); |
|
397 |
|
398 static void ClientTerminateL( CMceSipSession* aSession , |
|
399 const TDesC8& aHeader = KNullDesC8, |
|
400 const TDesC8& aContentType = KNullDesC8, |
|
401 const TDesC8& aContent = KNullDesC8 ); |
|
402 |
|
403 static void ClientAcceptL( CMceSipSession* aSession, |
|
404 const TDesC8& aReason = KNullDesC8, |
|
405 TInt aReasonCode = -1 ); |
|
406 |
|
407 static void ClientDeclineL( CMceSipSession* aSession, |
|
408 const TDesC8& aHeader = KNullDesC8, |
|
409 const TDesC8& aContent = KNullDesC8, |
|
410 const TDesC8& aContentType = KNullDesC8, |
|
411 const TDesC8& aReason = KNullDesC8, |
|
412 TInt aReasonCode = -1 ); |
|
413 |
|
414 static void ClientRingL( CMceSipSession* aSession, |
|
415 const TDesC8& aHeader = KNullDesC8, |
|
416 const TDesC8& aContent = KNullDesC8, |
|
417 const TDesC8& aContentType = KNullDesC8 ); |
|
418 |
|
419 static void ClientCancelL( CMceSipSession* aSession ); |
|
420 |
|
421 static void ClientUpdateSessionL( CMceSipSession* aSession, |
|
422 CMceComSession& aUpdate, |
|
423 TUint32 aTimeout = 180, |
|
424 const TDesC8& aHeader = KNullDesC8, |
|
425 const TDesC8& aContentType = KNullDesC8, |
|
426 const TDesC8& aContent = KNullDesC8, |
|
427 const TDesC8& aContentHeader = KNullDesC8 ); |
|
428 |
|
429 static CMceComSession* ClientGetSessionL( CMceSipSession* aSession ); |
|
430 |
|
431 static void MediaManagerCallBack( CMceSipSession* aSession, |
|
432 TMceMediaEventCode aEvent, |
|
433 TInt aError = KErrNone ); |
|
434 |
|
435 static void MediaManagerSinkCallBack( CMceSipSession* aSession, |
|
436 TMceItcFunctions aEventTo, |
|
437 TInt aStream, |
|
438 TInt aSink ); |
|
439 |
|
440 static void MediaManagerSourceCallBack( CMceSipSession* aSession, |
|
441 TMceItcFunctions aEventTo, |
|
442 TInt aStream ); |
|
443 |
|
444 |
|
445 static CSIPClientTransaction& ResponseL( CMceSipSession* aSession, |
|
446 TUint aReasonCode, |
|
447 TInt aReasonPhrase, |
|
448 TInt aTrx = 0, |
|
449 TBool aSDPContent = EFalse, |
|
450 TBool aRequire100rel = EFalse, |
|
451 TUint aRSeqV = 1, |
|
452 TBool aExpectOkStateChange = ETrue ); |
|
453 |
|
454 static CSIPClientTransaction& ForkedResponseL( |
|
455 CMceSipSession* aSession, |
|
456 CSIPInviteDialogAssoc* dialog, |
|
457 TUint aReasonCode, |
|
458 TInt aReasonPhrase, |
|
459 TInt aTrx = 0, |
|
460 TBool aSDPContent = EFalse ); |
|
461 |
|
462 static CSIPServerTransaction& RequestL( CMceSipSession* aSession, |
|
463 TInt aRequest, |
|
464 TInt aSDPContent = 0, |
|
465 TBool aExpectOkStateChange = ETrue ); |
|
466 |
|
467 static CSIPClientTransaction* ClientTransactionLC( TInt aToMethod, |
|
468 TUint aResponse = 0, |
|
469 TInt aPhrase = SipStrConsts::EEmpty, |
|
470 TBool aContent = EFalse ); |
|
471 |
|
472 static CSIPClientTransaction* ClientTransactionLC( TInt aToMethod, |
|
473 RPointerArray<CSIPHeaderBase>& aSipHeaders, |
|
474 TUint aResponse = 0, |
|
475 TInt aPhrase = SipStrConsts::EEmpty, |
|
476 TBool aContent = EFalse ); |
|
477 |
|
478 |
|
479 |
|
480 static CSIPServerTransaction* ServerTransactionL( TInt aMethod, |
|
481 TBool aContent = EFalse, |
|
482 TBool aToAndFromHeaders = ETrue ); |
|
483 |
|
484 static CSIPServerTransaction* ServerTransaction2L( TInt aMethod ); |
|
485 |
|
486 static CSIPServerTransaction* ServerTransactionBadSDPL( TInt aMethod ); |
|
487 |
|
488 static CSIPServerTransaction* ServerTransactionL( TInt aMethod, |
|
489 RPointerArray<CSIPHeaderBase>& aSipHeaders, |
|
490 TBool aContent = EFalse ); |
|
491 |
|
492 |
|
493 static CSIPResponseElements* SetResponseL( CSIPClientTransaction& aTrx, |
|
494 TUint aResponse, |
|
495 TInt aPhrase, |
|
496 TBool aContent = EFalse, |
|
497 TBool aRequire100rel = EFalse, |
|
498 TUint aRSeqValue = 1 ); |
|
499 |
|
500 |
|
501 static CSIPResponseElements* SetResponse2L( CSIPClientTransaction& aTrx, TUint aResponse, TInt aPhrase ); |
|
502 |
|
503 static CSIPResponseElements* SetResponseBADL( CSIPClientTransaction& aTrx, TUint aResponse, TInt aPhrase ); |
|
504 |
|
505 static void SetMessageElementsL( CSIPMessageElements& aElements, TInt sdpId = 1 ); |
|
506 |
|
507 |
|
508 |
|
509 static CMceComSession* ComSessionL( TUint32 aSessionId, TBool aRequire100rel = EFalse ); |
|
510 |
|
511 static CSdpDocument* OfferL(); |
|
512 |
|
513 static CMceMsgBase* EventMsg( TInt aEventType ); |
|
514 static CMceMsgBase* ReplyMsg( TUint aReasonCode ); |
|
515 |
|
516 static CMceMsgBase* RequestMsg( const TDesC8& aMethod ); |
|
517 static CMceComMediaSink* Sink( CMceSipSession* aSession, TInt aStream = 0, TInt aSink = 0 ); |
|
518 |
|
519 static CMceComMediaSource* Source( CMceSipSession* aSession, TInt aStream = 0 ); |
|
520 |
|
521 static void SinkEvent( TMceMccComEvent& aEvent, CMceSipSession* aSession, TInt aStream = 0, TInt aSink = 0 ); |
|
522 static void SourceEvent( TMceMccComEvent& aEvent, CMceSipSession* aSession, TInt aStream = 0 ); |
|
523 static void AppendContactToUserHeaders( RPointerArray<CSIPHeaderBase>& aSipHeaders, |
|
524 const TDesC8& aContact ); |
|
525 |
|
526 static void ChangeResponseTypeL( const CSIPResponseElements& aResponse, |
|
527 TUint aResponseCode, |
|
528 TInt aReasonPhrase ); |
|
529 }; |
|
530 |
|
531 #endif //MCETESTHELPER_H |