|
1 /* |
|
2 * Copyright (c) 2004 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: Implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "CTcSIPContext.h" |
|
19 #include "SIPConstants.h" |
|
20 #include "TCmdTerminate.h" |
|
21 |
|
22 #include <sipclienttransaction.h> |
|
23 #include <sipdialogassocbase.h> |
|
24 #include <siprefresh.h> |
|
25 #include <sipregistrationbinding.h> |
|
26 |
|
27 /** |
|
28 * INPUT: |
|
29 * Headers: - |
|
30 * Parameters: - |
|
31 * IDs: InviteDialogId*, SubscribeDialogId*, RefreshId*, |
|
32 * RegistrationId*, TransactionId* |
|
33 * |
|
34 * OUTPUT: |
|
35 * Parameters: - |
|
36 * IDs: TransactionId* |
|
37 */ |
|
38 void TCmdTerminate::ExecuteL() |
|
39 { |
|
40 // -- Setup --------------------------------------------------------------- |
|
41 |
|
42 // Get SIP objects from registry |
|
43 CSIPRefresh* refresh = GetRefreshL( EFalse ); |
|
44 |
|
45 CSIPRegistrationBinding* registration = GetRegistrationL( EFalse ); |
|
46 CSIPClientTransaction* transaction = GetClientTransactionL( EFalse ); |
|
47 CSIPDialogAssocBase* dialogAssoc= GetAnyDialogAssocL( EFalse ); |
|
48 |
|
49 // -- Execution ----------------------------------------------------------- |
|
50 |
|
51 // Destroying NULL objects is safe.. |
|
52 iContext.Registry().DestroyObject( registration ); |
|
53 iContext.Registry().DestroyObject( transaction ); |
|
54 iContext.Registry().DestroyObject( dialogAssoc ); |
|
55 |
|
56 CSIPClientTransaction* newTransaction; |
|
57 if( refresh ) |
|
58 { |
|
59 newTransaction = refresh->TerminateL(); |
|
60 } |
|
61 else |
|
62 { |
|
63 return; |
|
64 } |
|
65 |
|
66 // -- Response creation --------------------------------------------------- |
|
67 |
|
68 AddIdResponseL( KTransactionId, newTransaction ); |
|
69 } |
|
70 |
|
71 TBool TCmdTerminate::Match( const TTcIdentifier& aId ) |
|
72 { |
|
73 return TTcSIPCommandBase::Match( aId, _L8("Terminate") ); |
|
74 } |
|
75 |
|
76 TTcCommandBase* TCmdTerminate::CreateL( MTcTestContext& aContext ) |
|
77 { |
|
78 return new( ELeave ) TCmdTerminate( aContext ); |
|
79 } |
|
80 |