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