|
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 <sipnotifydialogassoc.h> |
|
19 #include <sipinvitedialogassoc.h> |
|
20 #include <sipservertransaction.h> |
|
21 #include <sipsubscriptionstateheader.h> |
|
22 #include <sipeventheader.h> |
|
23 #include <sipprofile.h> |
|
24 |
|
25 #include "TCmdCreateNotifyDialogAssociation.h" |
|
26 #include "SIPConstants.h" |
|
27 |
|
28 /** |
|
29 * INPUT: |
|
30 * Headers: Event, Subscription-State |
|
31 * Parameters: - |
|
32 * IDs: ServerTransactionId, ProfileId |
|
33 * |
|
34 * OUTPUT: |
|
35 * Parameters: - |
|
36 * IDs: NotifyDialogId |
|
37 */ |
|
38 void TCmdCreateNotifyDialogAssociation::ExecuteL() |
|
39 { |
|
40 // -- Setup --------------------------------------------------------------- |
|
41 |
|
42 // Get SIP objects from registry |
|
43 CSIPServerTransaction* serverTransaction = GetServerTransactionL(); |
|
44 CSIPProfile* profile = GetProfileL(); |
|
45 |
|
46 // Extract required headers |
|
47 CSIPEventHeader* eventHeader = ExtractEventHeaderLC(); |
|
48 CSIPSubscriptionStateHeader* stateHeader = ExtractSubStateHeaderLC(); |
|
49 |
|
50 // -- Execution ----------------------------------------------------------- |
|
51 |
|
52 // Create a notify dialog association |
|
53 CSIPNotifyDialogAssoc* dialogAssoc = NULL; |
|
54 |
|
55 if ( profile ) |
|
56 { |
|
57 dialogAssoc = CSIPNotifyDialogAssoc::NewLC( |
|
58 *serverTransaction, *profile, eventHeader, stateHeader ); |
|
59 } |
|
60 else |
|
61 { |
|
62 dialogAssoc = CSIPNotifyDialogAssoc::NewLC( |
|
63 *serverTransaction, eventHeader, stateHeader ); |
|
64 } |
|
65 |
|
66 // -- Response creation --------------------------------------------------- |
|
67 |
|
68 CleanupStack::Pop( 3 ); //eventHeader, stateHeader,dialogAssoc |
|
69 AddIdResponseL( KNotifyDialogId, dialogAssoc ); |
|
70 } |
|
71 |
|
72 TBool TCmdCreateNotifyDialogAssociation::Match( const TTcIdentifier& aId ) |
|
73 { |
|
74 return TTcSIPCommandBase::Match( aId, _L8("CreateNotifyDialogAssociation") ); |
|
75 } |
|
76 |
|
77 TTcCommandBase* TCmdCreateNotifyDialogAssociation::CreateL( MTcTestContext& aContext ) |
|
78 { |
|
79 return new( ELeave )TCmdCreateNotifyDialogAssociation( aContext ); |
|
80 } |
|
81 |