|
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 : TSIPRegEventStateSubscribed.cpp |
|
15 // Part of : SIP Profile Agent |
|
16 // implementation |
|
17 // Version : 1.0 |
|
18 // |
|
19 |
|
20 |
|
21 |
|
22 #include "TSIPRegEventStateSubscribed.h" |
|
23 #include "sipregeventcontext.h" |
|
24 |
|
25 // ---------------------------------------------------------------------------- |
|
26 // TSIPRegEventStateSubscribed::TSIPRegEventStateSubscribed |
|
27 // ---------------------------------------------------------------------------- |
|
28 // |
|
29 TSIPRegEventStateSubscribed::TSIPRegEventStateSubscribed( |
|
30 MSIPRegEventContext& aContext) |
|
31 : TSIPRegEventSubscriptionStateBase(aContext) |
|
32 { |
|
33 } |
|
34 |
|
35 // ---------------------------------------------------------------------------- |
|
36 // TSIPRegEventStateSubscribed::RefreshL |
|
37 // ---------------------------------------------------------------------------- |
|
38 // |
|
39 void TSIPRegEventStateSubscribed::RefreshL() |
|
40 { |
|
41 iContext.DoRefreshL(); |
|
42 } |
|
43 |
|
44 // ---------------------------------------------------------------------------- |
|
45 // TSIPRegEventStateSubscribed::ResponseReceivedL |
|
46 // ---------------------------------------------------------------------------- |
|
47 // |
|
48 void TSIPRegEventStateSubscribed::ResponseReceivedL( |
|
49 TUint aStatusCode, |
|
50 TUint aRetryAfter) |
|
51 { |
|
52 if (aStatusCode >= 300) |
|
53 { |
|
54 iContext.ChangeState(MSIPRegEventContext::ENotSubscribed); |
|
55 TUint retryAfter = 0; |
|
56 if (aStatusCode == 503) |
|
57 { |
|
58 retryAfter = aRetryAfter; |
|
59 } |
|
60 iContext.ReSubscribeAfterL(retryAfter); |
|
61 iContext.ChangeState(MSIPRegEventContext::EReSubscribing); |
|
62 } |
|
63 } |
|
64 |
|
65 // ---------------------------------------------------------------------------- |
|
66 // TSIPRegEventStateSubscribed::ErrorOccuredL |
|
67 // ---------------------------------------------------------------------------- |
|
68 // |
|
69 void TSIPRegEventStateSubscribed::ErrorOccuredL() |
|
70 { |
|
71 iContext.ChangeState(MSIPRegEventContext::ENotSubscribed); |
|
72 iContext.ReSubscribeAfterL(0); |
|
73 iContext.ChangeState(MSIPRegEventContext::EReSubscribing); |
|
74 } |