|
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 <sipservertransaction.h> |
|
20 #include <sipprofile.h> |
|
21 |
|
22 #include "TCmdSendResponseCreateDialog.h" |
|
23 #include "SIPConstants.h" |
|
24 |
|
25 /** |
|
26 * INPUT: |
|
27 * Headers: Contact*, Content-Type*, Content-Encoding* |
|
28 * Parameters: StatusCode, Reason, Content* |
|
29 * IDs: ServerTransactionId, ProfileId |
|
30 * |
|
31 * OUTPUT: |
|
32 * Parameters: - |
|
33 * IDs: InviteDialogId |
|
34 */ |
|
35 void TCmdSendResponseCreateDialog::ExecuteL() |
|
36 { |
|
37 // -- Setup --------------------------------------------------------------- |
|
38 |
|
39 // Get SIP objects from registry |
|
40 CSIPServerTransaction* serverTransaction = GetServerTransactionL(); |
|
41 |
|
42 CSIPProfile* profile = GetProfileL(); |
|
43 |
|
44 // -- Execution ----------------------------------------------------------- |
|
45 |
|
46 // Create an invite dialog association |
|
47 CSIPInviteDialogAssoc* dialogAssoc = NULL; |
|
48 |
|
49 if ( profile ) |
|
50 { |
|
51 dialogAssoc = |
|
52 CSIPInviteDialogAssoc::NewLC( *serverTransaction, *profile ); |
|
53 } |
|
54 else |
|
55 { |
|
56 dialogAssoc = CSIPInviteDialogAssoc::NewLC( *serverTransaction ); |
|
57 } |
|
58 |
|
59 // Use base class to do the hard work |
|
60 TCmdSendResponse::ExecuteL(); |
|
61 |
|
62 // -- Response creation --------------------------------------------------- |
|
63 |
|
64 CleanupStack::Pop( dialogAssoc ); |
|
65 AddIdResponseL( KInviteDialogId, dialogAssoc ); |
|
66 } |
|
67 |
|
68 TBool TCmdSendResponseCreateDialog::Match( const TTcIdentifier& aId ) |
|
69 { |
|
70 return TTcSIPCommandBase::Match( aId, _L8("SendResponseCreateDialog") ); |
|
71 } |
|
72 |
|
73 TTcCommandBase* TCmdSendResponseCreateDialog::CreateL( MTcTestContext& aContext ) |
|
74 { |
|
75 return new( ELeave ) TCmdSendResponseCreateDialog( aContext ); |
|
76 } |
|
77 |