|
1 // Copyright (c) 2006-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 : UserAgentState.cpp |
|
15 // Part of : TransactionUser |
|
16 // Version : SIP/5.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 #include "SipAssert.h" |
|
22 |
|
23 #include "CUserAgent.h" |
|
24 #include "UserAgentState.h" |
|
25 #include "UserAgentTimer.h" |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CUserAgentState::CUserAgentState |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 CUserAgentState::CUserAgentState() |
|
32 { |
|
33 } |
|
34 |
|
35 // ----------------------------------------------------------------------------- |
|
36 // CUserAgentState::~CUserAgentState |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 CUserAgentState::~CUserAgentState() |
|
40 { |
|
41 } |
|
42 |
|
43 // ----------------------------------------------------------------------------- |
|
44 // CUserAgentState::IsResolving |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 TBool CUserAgentState::IsResolving() const |
|
48 { |
|
49 return EFalse; |
|
50 } |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // CUserAgentState::CanContinueWithoutOutgoingMsg |
|
54 // By default, UA can't continue without iOutgoingMsg. |
|
55 // ----------------------------------------------------------------------------- |
|
56 // |
|
57 TBool CUserAgentState::CanContinueWithoutOutgoingMsg( |
|
58 TBool /*aFinalRespPassed*/) const |
|
59 { |
|
60 return EFalse; |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // CUserAgentState::ShouldUASStop |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 TBool CUserAgentState::ShouldUASStop() const |
|
68 { |
|
69 return EFalse; |
|
70 } |
|
71 |
|
72 // ----------------------------------------------------------------------------- |
|
73 // CUserAgentState::CancelL |
|
74 // Only certain UAs can be canceled, and they have to be in a certain state. |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 TBool CUserAgentState::CancelL(CUserAgent& /*aUserAgent*/) const |
|
78 { |
|
79 return EFalse; |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CUserAgentState::SendRequestL |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 void CUserAgentState::SendRequestL(CUserAgent& /*aUserAgent*/, |
|
87 CSIPRequest* aReq, |
|
88 TRegistrationId /*aRegisterId*/, |
|
89 const CURIContainer& /*aRemoteTarget*/) const |
|
90 { |
|
91 __SIP_ASSERT_LEAVE(aReq, KErrArgument); |
|
92 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
93 } |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // CUserAgentState::SendResponseL |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 void |
|
100 CUserAgentState::SendResponseL(CUserAgent& /*aUserAgent*/, |
|
101 CSIPResponse* aResp, |
|
102 const TSIPTransportParams& /*aParams*/) const |
|
103 { |
|
104 __SIP_ASSERT_LEAVE(aResp, KErrArgument); |
|
105 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
106 } |
|
107 |
|
108 // ----------------------------------------------------------------------------- |
|
109 // CUserAgentState::SendCancelL |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 void CUserAgentState::SendCancelL(CUserAgent& /*aUserAgent*/, |
|
113 TTransactionId /*aInviteTaId*/) const |
|
114 { |
|
115 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
116 } |
|
117 |
|
118 // ----------------------------------------------------------------------------- |
|
119 // CUserAgentState::SendAckL |
|
120 // ----------------------------------------------------------------------------- |
|
121 // |
|
122 void CUserAgentState::SendAckL(CUserAgent& /*aUserAgent*/, |
|
123 CSIPRequest* aAck, |
|
124 MTransactionOwner& /*aObserver*/, |
|
125 const TSIPTransportParams& /*aParams*/, |
|
126 TRegistrationId /*aRegisterId*/, |
|
127 const CURIContainer& /*aRemoteTarget*/, |
|
128 TBool /*aDeleteRequest*/, |
|
129 RStringF /*aBranch*/) const |
|
130 { |
|
131 __SIP_ASSERT_LEAVE(aAck, KErrArgument); |
|
132 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
133 } |
|
134 |
|
135 // ----------------------------------------------------------------------------- |
|
136 // CUserAgentState::AddressResolvedL |
|
137 // ----------------------------------------------------------------------------- |
|
138 // |
|
139 void CUserAgentState::AddressResolvedL(CUserAgent& /*aUserAgent*/) const |
|
140 { |
|
141 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
142 } |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // CUserAgentState::ResolvingFailed |
|
146 // ----------------------------------------------------------------------------- |
|
147 // |
|
148 void CUserAgentState::ResolvingFailed(CUserAgent& /*aUserAgent*/) const |
|
149 { |
|
150 __SIP_ASSERT_RETURN(EFalse, KErrGeneral); |
|
151 } |
|
152 |
|
153 // ----------------------------------------------------------------------------- |
|
154 // CUserAgentState::TransactionEndsL |
|
155 // ----------------------------------------------------------------------------- |
|
156 // |
|
157 void CUserAgentState::TransactionEndsL(CUserAgent& /*aUserAgent*/, |
|
158 TInt /*aReason*/) const |
|
159 { |
|
160 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
161 } |
|
162 |
|
163 // ----------------------------------------------------------------------------- |
|
164 // CUserAgentState::ReceiveL |
|
165 // ----------------------------------------------------------------------------- |
|
166 // |
|
167 void CUserAgentState::ReceiveL(CUserAgent& /*aUserAgent*/, |
|
168 CSIPRequest* aRequest) const |
|
169 { |
|
170 __SIP_ASSERT_LEAVE(aRequest, KErrArgument); |
|
171 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
172 } |
|
173 |
|
174 // ----------------------------------------------------------------------------- |
|
175 // CUserAgentState::ReceiveL |
|
176 // ----------------------------------------------------------------------------- |
|
177 // |
|
178 void CUserAgentState::ReceiveL(CUserAgent& /*aUserAgent*/, |
|
179 CSIPResponse* aResponse) const |
|
180 { |
|
181 __SIP_ASSERT_LEAVE(aResponse, KErrArgument); |
|
182 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
183 } |
|
184 |
|
185 // ----------------------------------------------------------------------------- |
|
186 // CUserAgentState::OwnerFoundL |
|
187 // ----------------------------------------------------------------------------- |
|
188 // |
|
189 void CUserAgentState::OwnerFoundL(CUserAgent& /*aUserAgent*/, |
|
190 MTransactionOwner* aOwner) const |
|
191 { |
|
192 __SIP_ASSERT_LEAVE(aOwner, KErrArgument); |
|
193 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
194 } |
|
195 |
|
196 // ----------------------------------------------------------------------------- |
|
197 // CUserAgentState::OwnerNotFoundL |
|
198 // ----------------------------------------------------------------------------- |
|
199 // |
|
200 void CUserAgentState::OwnerNotFoundL(CUserAgent& /*aUserAgent*/, |
|
201 CSIPResponse* aResp) const |
|
202 { |
|
203 __SIP_ASSERT_LEAVE(aResp, KErrArgument); |
|
204 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
205 } |
|
206 |
|
207 // ----------------------------------------------------------------------------- |
|
208 // CUserAgentState::SendCompleteL |
|
209 // ----------------------------------------------------------------------------- |
|
210 // |
|
211 void CUserAgentState::SendCompleteL(CUserAgent& /*aUserAgent*/) const |
|
212 { |
|
213 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
214 } |
|
215 |
|
216 // ----------------------------------------------------------------------------- |
|
217 // CUserAgentState::SendFailedL |
|
218 // ----------------------------------------------------------------------------- |
|
219 // |
|
220 void CUserAgentState::SendFailedL(CUserAgent& /*aUserAgent*/, |
|
221 TInt /*aErrcode*/) const |
|
222 { |
|
223 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
224 } |
|
225 |
|
226 // ----------------------------------------------------------------------------- |
|
227 // CUserAgentState::SIPSecCacheUpdatedL |
|
228 // SIPSec uses this callback also when UAC has canceled the pending operations. |
|
229 // So the default implementation just ignores the event. |
|
230 // ----------------------------------------------------------------------------- |
|
231 // |
|
232 void CUserAgentState::SIPSecCacheUpdatedL(CUserAgent& /*aUserAgent*/, |
|
233 TBool /*aSuccess*/) const |
|
234 { |
|
235 } |
|
236 |
|
237 // ----------------------------------------------------------------------------- |
|
238 // CUserAgentState::IcmpErrorL |
|
239 // By default, UA ignores ICMP errors. |
|
240 // ----------------------------------------------------------------------------- |
|
241 // |
|
242 void |
|
243 CUserAgentState::IcmpErrorL(CUserAgent& /*aUserAgent*/, |
|
244 const TInetAddr& /*aAddress*/, |
|
245 CSipConnectionMgr::TICMPError /*aError*/) const |
|
246 { |
|
247 } |
|
248 |
|
249 // ----------------------------------------------------------------------------- |
|
250 // CUserAgentState::TimerExpiredL |
|
251 // ----------------------------------------------------------------------------- |
|
252 // |
|
253 void CUserAgentState::TimerExpiredL(CUserAgent& /*aUserAgent*/, |
|
254 TTimerId /*aTimerId*/, |
|
255 TAny* aTimerParam) const |
|
256 { |
|
257 __SIP_ASSERT_LEAVE(aTimerParam, KErrArgument); |
|
258 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
259 } |
|
260 |
|
261 // ----------------------------------------------------------------------------- |
|
262 // CUserAgentState::RequestRouterErrorL |
|
263 // ----------------------------------------------------------------------------- |
|
264 // |
|
265 void CUserAgentState::RequestRouterErrorL(CUserAgent& /*aUserAgent*/) const |
|
266 { |
|
267 __SIP_ASSERT_LEAVE(EFalse, KErrGeneral); |
|
268 } |
|
269 |
|
270 // ----------------------------------------------------------------------------- |
|
271 // CUserAgentState::HandleTimerExpirationL |
|
272 // ----------------------------------------------------------------------------- |
|
273 // |
|
274 void CUserAgentState::HandleTimerExpirationL(CUserAgent& aUserAgent, |
|
275 TTimerId aTimerId, |
|
276 TAny* aTimerParam) const |
|
277 { |
|
278 __SIP_ASSERT_LEAVE(aTimerParam, KErrArgument); |
|
279 |
|
280 CUserAgentTimer* timer = reinterpret_cast<CUserAgentTimer*>(aTimerParam); |
|
281 timer->ExpiredL(&aUserAgent, aTimerId); |
|
282 aUserAgent.DeleteTimer(*timer); |
|
283 } |