|
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 <sipclienttransaction.h> |
|
19 #include <sipinvitedialogassoc.h> |
|
20 #include <sipmessageelements.h> |
|
21 |
|
22 #include "TCmdSendBye.h" |
|
23 #include "SIPConstants.h" |
|
24 |
|
25 /** |
|
26 * INPUT: |
|
27 * Headers: Contact*, Content-Type*, Content-Encoding* |
|
28 * Parameters: Content* |
|
29 * IDs: InviteDialogId |
|
30 * |
|
31 * OUTPUT: |
|
32 * Parameters: - |
|
33 * IDs: TransactionId |
|
34 */ |
|
35 void TCmdSendBye::ExecuteL() |
|
36 { |
|
37 // -- Setup --------------------------------------------------------------- |
|
38 |
|
39 // Get SIP objects from registry |
|
40 CSIPInviteDialogAssoc* dialog = GetInviteDialogAssocL(); |
|
41 |
|
42 // Extract both headers (that are still left) and content. |
|
43 CSIPMessageElements* elements = ExtractHeadersAndContentLC(); |
|
44 |
|
45 // -- Execution ----------------------------------------------------------- |
|
46 |
|
47 // Start SIP Bye transaction |
|
48 CSIPClientTransaction* transaction = dialog->SendByeL( elements ); |
|
49 CleanupStack::Pop( elements ); |
|
50 |
|
51 // -- Response creation --------------------------------------------------- |
|
52 |
|
53 AddIdResponseL( KTransactionId, transaction ); |
|
54 } |
|
55 |
|
56 TBool TCmdSendBye::Match( const TTcIdentifier& aId ) |
|
57 { |
|
58 return TTcSIPCommandBase::Match( aId, _L8("SendBye") ); |
|
59 } |
|
60 |
|
61 TTcCommandBase* TCmdSendBye::CreateL( MTcTestContext& aContext ) |
|
62 { |
|
63 return new( ELeave ) TCmdSendBye( aContext ); |
|
64 } |
|
65 |