|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Name : Terminated.cpp |
|
15 // Part of : SIPDialogs |
|
16 // Version : SIP/6.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 #include "Terminated.h" |
|
22 #include "MDialogContext.h" |
|
23 #include "TransactionItemBase.h" |
|
24 #include "siperr.h" |
|
25 #include "sipinternalstates.h" |
|
26 |
|
27 _LIT8(KTerminated, "Terminated"); |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // TTerminated::TTerminated |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 TTerminated::TTerminated (MDialogContext& aDialog) |
|
34 : TDialogStateBase(aDialog) |
|
35 { |
|
36 } |
|
37 |
|
38 // ----------------------------------------------------------------------------- |
|
39 // TTerminated::Name |
|
40 // ----------------------------------------------------------------------------- |
|
41 // |
|
42 const TDesC8& TTerminated::Name () const |
|
43 { |
|
44 return KTerminated; |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // TTerminated::RequestsWithinDialogAllowed |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 TBool TTerminated::RequestsWithinDialogAllowed () const |
|
52 { |
|
53 return EFalse; |
|
54 } |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // TTerminated::Accept |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 TBool TTerminated::Accept(CSIPRequest& /*aRequest*/) const |
|
61 { |
|
62 return EFalse; |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // TTerminated::SendL |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 void TTerminated::SendL (TTransactionId& /*aTransactionId*/, |
|
70 CSIPRequest* /*aRequest*/, |
|
71 CTransactionItemBase& /*aTransactionItem*/, |
|
72 CURIContainer& /*aRemoteTarget*/) |
|
73 { |
|
74 User::Leave(KErrSIPInvalidDialogState); |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // TTerminated::SendL |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 void TTerminated::SendL (CTransactionItemBase& aTransactionItem, |
|
82 CSIPResponse* aSipResponse) |
|
83 { |
|
84 TSIPTransportParams params(iDialog.TransportParams(KEmptyRegistrationId)); |
|
85 aTransactionItem.SendL(params,aSipResponse,EFalse); |
|
86 } |
|
87 |
|
88 // ----------------------------------------------------------------------------- |
|
89 // TTerminated::ReceiveL |
|
90 // ----------------------------------------------------------------------------- |
|
91 // |
|
92 void TTerminated::ReceiveL (CTransactionItemBase& aTransactionItem, |
|
93 CSIPResponse* aResponse) |
|
94 { |
|
95 PassToOwnerL(aTransactionItem,aResponse); |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // TTerminated::ReceiveL |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 void TTerminated::ReceiveL (TTransactionId /*aTransactionId*/, |
|
103 CSIPRequest* /*aRequest*/) |
|
104 { |
|
105 User::Leave(KErrSIPInvalidDialogState); |
|
106 } |
|
107 |
|
108 |
|
109 // ----------------------------------------------------------------------------- |
|
110 // TTerminated::EndTransaction |
|
111 // ----------------------------------------------------------------------------- |
|
112 // |
|
113 void TTerminated::EndTransaction (CTransactionItemBase& aTransactionItem, |
|
114 TInt aReason) |
|
115 { |
|
116 if (aReason) |
|
117 { |
|
118 PassToOwner(aTransactionItem,aReason); |
|
119 } |
|
120 } |
|
121 |
|
122 // ----------------------------------------------------------------------------- |
|
123 // TTerminated::GetState |
|
124 // ----------------------------------------------------------------------------- |
|
125 // |
|
126 void TTerminated::GetState (CSIPInternalStates::TState& aState) |
|
127 { |
|
128 aState = CSIPInternalStates::EDialogTerminated; |
|
129 } |