|
1 |
|
2 // Copyright (c) 2004-2009 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: |
|
15 // |
|
16 |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "SIPExSIPServerEstablishingState.h" |
|
21 #include "SIPExSIPEngine.h" |
|
22 |
|
23 #include <sipstrings.h> |
|
24 #include <sipstrconsts.h> |
|
25 |
|
26 // ============================ MEMBER FUNCTIONS =============================== |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CSIPExSIPServerEstablishingState::CSIPExSIPServerEstablishingState |
|
30 // (other items were commented in a header). |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 CSIPExSIPServerEstablishingState::CSIPExSIPServerEstablishingState() |
|
34 { |
|
35 } |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CSIPExSIPServerEstablishingState::~CSIPExSIPServerEstablishingState |
|
39 // (other items were commented in a header). |
|
40 // ----------------------------------------------------------------------------- |
|
41 // |
|
42 EXPORT_C CSIPExSIPServerEstablishingState::~CSIPExSIPServerEstablishingState() |
|
43 { |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CSIPExSIPServerEstablishingState::NewL() |
|
48 // (other items were commented in a header). |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 EXPORT_C CSIPExSIPServerEstablishingState* CSIPExSIPServerEstablishingState::NewL() |
|
52 { |
|
53 CSIPExSIPServerEstablishingState* self = |
|
54 new (ELeave) CSIPExSIPServerEstablishingState(); |
|
55 return self; |
|
56 } |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // CSIPExSIPServerEstablishingState::LinkStates() |
|
60 // (other items were commented in a header). |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 void CSIPExSIPServerEstablishingState::LinkStates( |
|
64 CSIPExSIPStateBase& aEstablishedState, |
|
65 CSIPExSIPStateBase& aTerminatedState ) |
|
66 { |
|
67 iEstablishedState = &aEstablishedState; |
|
68 iTerminatedState = &aTerminatedState; |
|
69 } |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // CSIPExSIPServerEstablishingState::ByeReceivedL() |
|
73 // (other items were commented in a header). |
|
74 // ----------------------------------------------------------------------------- |
|
75 void CSIPExSIPServerEstablishingState::ByeReceivedL( |
|
76 CSIPExSIPEngine& aEngine, |
|
77 CSIPServerTransaction& aTransaction ) |
|
78 { |
|
79 // Create and send response |
|
80 CSIPResponseElements* elem = |
|
81 CSIPResponseElements::NewLC( |
|
82 200, SIPStrings::StringF( SipStrConsts::EPhraseOk ) ); |
|
83 aTransaction.SendResponseL( elem ); |
|
84 CleanupStack::Pop( elem ); |
|
85 |
|
86 // Inform observer |
|
87 aEngine.Observer()->SessionEnded(); |
|
88 |
|
89 // Set state |
|
90 aEngine.SetCurrentState( iTerminatedState ); |
|
91 } |
|
92 |
|
93 // ----------------------------------------------------------------------------- |
|
94 // CSIPExSIPServerEstablishingState::CancelReceivedL() |
|
95 // (other items were commented in a header). |
|
96 // ----------------------------------------------------------------------------- |
|
97 void CSIPExSIPServerEstablishingState::CancelReceivedL( |
|
98 CSIPExSIPEngine& aEngine, |
|
99 CSIPClientTransaction& /*aTransaction */ ) |
|
100 { |
|
101 aEngine.Observer()->SessionEnded(); |
|
102 aEngine.SetCurrentState( iTerminatedState ); |
|
103 } |
|
104 |
|
105 // ----------------------------------------------------------------------------- |
|
106 // CSIPExSIPServerEstablishingState::AckReceivedL() |
|
107 // (other items were commented in a header). |
|
108 // ----------------------------------------------------------------------------- |
|
109 void CSIPExSIPServerEstablishingState::AckReceivedL( |
|
110 CSIPExSIPEngine& aEngine, |
|
111 CSIPServerTransaction& /* aTransaction */ ) |
|
112 { |
|
113 aEngine.Observer()->InviteAcceptedByUs(); |
|
114 aEngine.SetCurrentState( iEstablishedState ); |
|
115 } |
|
116 |