|
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 <sipinvitedialogassoc.h> |
|
19 #include <sipnotifydialogassoc.h> |
|
20 #include <sipservertransaction.h> |
|
21 #include <sipdialog.h> |
|
22 #include <sipprofile.h> |
|
23 |
|
24 #include "TCmdSendReferResponseCreateDialog.h" |
|
25 #include "SIPConstants.h" |
|
26 |
|
27 /** |
|
28 * INPUT: |
|
29 * Headers: Contact*, Content-Type*, Content-Encoding* |
|
30 * Parameters: StatusCode, Reason, Content* |
|
31 * IDs: ServerTransactionId, ProfileId |
|
32 * |
|
33 * OUTPUT: |
|
34 * Parameters: - |
|
35 * IDs: NotifyId, DialogId |
|
36 */ |
|
37 void TCmdSendReferResponseCreateDialog::ExecuteL() |
|
38 { |
|
39 // -- Setup --------------------------------------------------------------- |
|
40 |
|
41 // Get SIP objects from registry |
|
42 CSIPServerTransaction* serverTransaction = GetServerTransactionL(); |
|
43 |
|
44 CSIPProfile* profile = GetProfileL(); |
|
45 |
|
46 // Extract required headers |
|
47 CSIPEventHeader* eventHeader = ExtractEventHeaderLC(); |
|
48 CSIPSubscriptionStateHeader* stateHeader = ExtractSubStateHeaderLC(); |
|
49 |
|
50 // -- Execution ----------------------------------------------------------- |
|
51 |
|
52 // Create an notify dialog association |
|
53 CSIPNotifyDialogAssoc* dialogAssoc = NULL; |
|
54 |
|
55 if ( profile ) |
|
56 { |
|
57 dialogAssoc = CSIPNotifyDialogAssoc::NewL( |
|
58 *serverTransaction, *profile, eventHeader, stateHeader ); |
|
59 } |
|
60 else |
|
61 { |
|
62 dialogAssoc = CSIPNotifyDialogAssoc::NewL( |
|
63 *serverTransaction, eventHeader, stateHeader ); |
|
64 } |
|
65 |
|
66 CleanupStack::Pop( 2 ); //eventHeader, stateHeader |
|
67 CleanupStack::PushL( dialogAssoc ); |
|
68 |
|
69 // Use base class to do the hard work |
|
70 TCmdSendResponse::ExecuteL(); |
|
71 |
|
72 // -- Response creation --------------------------------------------------- |
|
73 |
|
74 CleanupStack::Pop( dialogAssoc ); |
|
75 AddIdResponseL( KNotifyDialogId, dialogAssoc ); |
|
76 AddIdResponseL( KDialogId, dialogAssoc->Dialog() ); |
|
77 } |
|
78 |
|
79 TBool TCmdSendReferResponseCreateDialog::Match( const TTcIdentifier& aId ) |
|
80 { |
|
81 return TTcSIPCommandBase::Match( aId, _L8("SendReferResponseCreateDialog") ); |
|
82 } |
|
83 |
|
84 TTcCommandBase* TCmdSendReferResponseCreateDialog::CreateL( MTcTestContext& aContext ) |
|
85 { |
|
86 return new( ELeave ) TCmdSendReferResponseCreateDialog( aContext ); |
|
87 } |
|
88 |