|
1 // Copyright (c) 2005-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 : UserAgentTimer.cpp |
|
15 // Part of : TransactionUser |
|
16 // Version : SIP/4.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 #include "SipAssert.h" |
|
22 #include "UserAgentTimer.h" |
|
23 #include "InviteUAS.h" |
|
24 #include "InviteUAC.h" |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // CUserAgentTimer::CUserAgentTimer |
|
28 // ----------------------------------------------------------------------------- |
|
29 // |
|
30 CUserAgentTimer::CUserAgentTimer(MTimerManager& aTimerMgr, |
|
31 MExpirationHandler* aObserver, |
|
32 TUint32 aDuration) : |
|
33 CTimerBase(aTimerMgr, aObserver, aDuration) |
|
34 { |
|
35 } |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CTimerStopUA::NewL |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 CTimerStopUA* CTimerStopUA::NewL(MTimerManager& aTimerMgr, |
|
42 MExpirationHandler* aObserver, |
|
43 TUint32 aDuration, |
|
44 TInt aReason) |
|
45 { |
|
46 __SIP_ASSERT_LEAVE(aObserver, KErrArgument); |
|
47 |
|
48 CTimerStopUA* self = new (ELeave) CTimerStopUA(aTimerMgr, |
|
49 aObserver, |
|
50 aDuration, |
|
51 aReason); |
|
52 CleanupStack::PushL(self); |
|
53 self->ConstructL(); |
|
54 CleanupStack::Pop(); |
|
55 return self; |
|
56 } |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // CTimerStopUA::CTimerStopUA |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 CTimerStopUA::CTimerStopUA(MTimerManager& aTimerMgr, |
|
63 MExpirationHandler* aObserver, |
|
64 TUint32 aDuration, |
|
65 TInt aReason) : |
|
66 CUserAgentTimer(aTimerMgr, aObserver, aDuration), |
|
67 iReason(aReason) |
|
68 { |
|
69 } |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // CTimerStopUA::ExpiredL |
|
73 // CUserAgent::DeleteTimer() is not called, as it will delete this object and |
|
74 // the execution is currently inside it. |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 void CTimerStopUA::ExpiredL(CUserAgent* aUserAgent, TTimerId aTimerId) |
|
78 { |
|
79 __SIP_ASSERT_LEAVE(aUserAgent, KErrArgument); |
|
80 __SIP_ASSERT_LEAVE(aTimerId == iId, KErrArgument); |
|
81 |
|
82 aUserAgent->Stop(iReason); |
|
83 } |
|
84 |
|
85 // ----------------------------------------------------------------------------- |
|
86 // CTimerRetransmit2xx::NewL |
|
87 // ----------------------------------------------------------------------------- |
|
88 // |
|
89 CTimerRetransmit2xx* CTimerRetransmit2xx::NewL(MTimerManager& aTimerMgr, |
|
90 MExpirationHandler* aObserver, |
|
91 TUint32 aDuration) |
|
92 { |
|
93 CTimerRetransmit2xx* self = new (ELeave) CTimerRetransmit2xx(aTimerMgr, |
|
94 aObserver, |
|
95 aDuration); |
|
96 CleanupStack::PushL(self); |
|
97 self->ConstructL(); |
|
98 CleanupStack::Pop(self); |
|
99 return self; |
|
100 } |
|
101 |
|
102 // ----------------------------------------------------------------------------- |
|
103 // CTimerRetransmit2xx::CTimerRetransmit2xx |
|
104 // ----------------------------------------------------------------------------- |
|
105 // |
|
106 CTimerRetransmit2xx::CTimerRetransmit2xx(MTimerManager& aTimerMgr, |
|
107 MExpirationHandler* aObserver, |
|
108 TUint32 aDuration) : |
|
109 CUserAgentTimer(aTimerMgr, aObserver, aDuration) |
|
110 { |
|
111 } |
|
112 |
|
113 // ----------------------------------------------------------------------------- |
|
114 // CTimerRetransmit2xx::ExpiredL |
|
115 // ----------------------------------------------------------------------------- |
|
116 // |
|
117 void CTimerRetransmit2xx::ExpiredL(CUserAgent* aUserAgent, TTimerId aTimerId) |
|
118 { |
|
119 __SIP_ASSERT_LEAVE(aUserAgent, KErrArgument); |
|
120 __SIP_ASSERT_LEAVE(aTimerId == iId, KErrArgument); |
|
121 |
|
122 CInviteUAS::Ptr(*aUserAgent).Retransmit2xxL(); |
|
123 } |
|
124 |
|
125 // ----------------------------------------------------------------------------- |
|
126 // CTimerOwnerResolver::NewL |
|
127 // ----------------------------------------------------------------------------- |
|
128 // |
|
129 CTimerOwnerResolver* CTimerOwnerResolver::NewL(MTimerManager& aTimerMgr, |
|
130 MExpirationHandler* aObserver, |
|
131 TUint32 aDuration) |
|
132 { |
|
133 CTimerOwnerResolver* self = new (ELeave) CTimerOwnerResolver(aTimerMgr, |
|
134 aObserver, |
|
135 aDuration); |
|
136 CleanupStack::PushL(self); |
|
137 self->ConstructL(); |
|
138 CleanupStack::Pop(self); |
|
139 return self; |
|
140 } |
|
141 |
|
142 // ----------------------------------------------------------------------------- |
|
143 // CTimerOwnerResolver::CTimerOwnerResolver |
|
144 // ----------------------------------------------------------------------------- |
|
145 // |
|
146 CTimerOwnerResolver::CTimerOwnerResolver(MTimerManager& aTimerMgr, |
|
147 MExpirationHandler* aObserver, |
|
148 TUint32 aDuration) : |
|
149 CUserAgentTimer(aTimerMgr, aObserver, aDuration) |
|
150 { |
|
151 } |
|
152 |
|
153 // ----------------------------------------------------------------------------- |
|
154 // CTimerOwnerResolver::ExpiredL |
|
155 // ----------------------------------------------------------------------------- |
|
156 // |
|
157 void CTimerOwnerResolver::ExpiredL(CUserAgent* aUserAgent, TTimerId aTimerId) |
|
158 { |
|
159 __SIP_ASSERT_LEAVE(aUserAgent, KErrArgument); |
|
160 __SIP_ASSERT_LEAVE(aTimerId == iId, KErrArgument); |
|
161 |
|
162 static_cast<CUserAgentServer*>(aUserAgent)->RequestRouterErrorL(); |
|
163 } |
|
164 |
|
165 // ----------------------------------------------------------------------------- |
|
166 // CTimerAsyncSIPSec::NewL |
|
167 // ----------------------------------------------------------------------------- |
|
168 // |
|
169 CTimerAsyncSIPSec* CTimerAsyncSIPSec::NewL(MTimerManager& aTimerMgr, |
|
170 MExpirationHandler* aObserver) |
|
171 { |
|
172 CTimerAsyncSIPSec* self = new (ELeave) CTimerAsyncSIPSec(aTimerMgr, |
|
173 aObserver); |
|
174 CleanupStack::PushL(self); |
|
175 self->ConstructL(); |
|
176 CleanupStack::Pop(self); |
|
177 return self; |
|
178 } |
|
179 |
|
180 // ----------------------------------------------------------------------------- |
|
181 // CTimerAsyncSIPSec::CTimerAsyncSIPSec |
|
182 // ----------------------------------------------------------------------------- |
|
183 // |
|
184 CTimerAsyncSIPSec::CTimerAsyncSIPSec(MTimerManager& aTimerMgr, |
|
185 MExpirationHandler* aObserver) : |
|
186 CUserAgentTimer(aTimerMgr, aObserver, 0) |
|
187 { |
|
188 } |
|
189 |
|
190 // ----------------------------------------------------------------------------- |
|
191 // CTimerAsyncSIPSec::ExpiredL |
|
192 // ----------------------------------------------------------------------------- |
|
193 // |
|
194 void CTimerAsyncSIPSec::ExpiredL(CUserAgent* aUserAgent, TTimerId aTimerId) |
|
195 { |
|
196 __SIP_ASSERT_LEAVE(aUserAgent, KErrArgument); |
|
197 __SIP_ASSERT_LEAVE(aTimerId == iId, KErrArgument); |
|
198 |
|
199 CInviteUAC::Ptr(*aUserAgent).SIPSecTimerExpiredL(); |
|
200 } |