|
1 |
|
2 /* |
|
3 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 * All rights reserved. |
|
5 * This component and the accompanying materials are made available |
|
6 * under the terms of "Eclipse Public License v1.0" |
|
7 * which accompanies this distribution, and is available |
|
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 * |
|
10 * Initial Contributors: |
|
11 * Nokia Corporation - initial contribution. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef _SIPEXSIPSTATEBASE_H_ |
|
22 #define _SIPEXSIPSTATEBASE_H_ |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 |
|
27 // From sipapi |
|
28 #include <sipclienttransaction.h> |
|
29 #include <sipservertransaction.h> |
|
30 #include <sipresponseelements.h> |
|
31 |
|
32 // From Codec |
|
33 #include <siptoheader.h> |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class CSIPExSIPEngine; |
|
37 class CSIPClientTransaction; |
|
38 class CSIPResponseElements; |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * SIP state base; provides function default implementation, |
|
44 * common error handling and function for getting state name. |
|
45 * |
|
46 * Function will leave with KErrTotalLossOfPrecision in case of |
|
47 * invalid state. |
|
48 */ |
|
49 class CSIPExSIPStateBase: public CBase |
|
50 { |
|
51 public:// Constructors and destructor |
|
52 /** |
|
53 * Destructor |
|
54 */ |
|
55 virtual ~CSIPExSIPStateBase(); |
|
56 |
|
57 |
|
58 public://new functions |
|
59 |
|
60 /** |
|
61 * SendInviteL |
|
62 * Sends an INVITE to peer. |
|
63 * @param aEngine Reference to SIP Engine. |
|
64 * @param aSipUri uri of recipient. |
|
65 */ |
|
66 virtual void SendInviteL( |
|
67 CSIPExSIPEngine& aEngine, |
|
68 const TDesC8& aSipUri ); |
|
69 |
|
70 |
|
71 /** |
|
72 * CancelInviteL |
|
73 * Cancel an INVITE sent previously. |
|
74 * @param aEngine Reference to Engine object. |
|
75 */ |
|
76 virtual void CancelInviteL( |
|
77 CSIPExSIPEngine& aEngine ); |
|
78 |
|
79 |
|
80 /** |
|
81 * AcceptInviteL |
|
82 * Send 200 (OK) as response to an INVITE |
|
83 * received from peer. |
|
84 * @param aEngine Reference to Engine object. |
|
85 */ |
|
86 virtual void AcceptInviteL( |
|
87 CSIPExSIPEngine& aEngine ); |
|
88 |
|
89 /** |
|
90 * DeclineInviteL |
|
91 * Send 486 (Busy Here) as response |
|
92 * to an INVITE received from peer. |
|
93 * @param aEngine Reference to Engine object. |
|
94 */ |
|
95 virtual void DeclineInviteL( |
|
96 CSIPExSIPEngine& aEngine ); |
|
97 |
|
98 |
|
99 |
|
100 /** |
|
101 * EndSessionL |
|
102 * Send BYE in an established session. |
|
103 * @param aEngine Reference to Engine object. |
|
104 */ |
|
105 virtual void EndSessionL( |
|
106 CSIPExSIPEngine& aEngine ); |
|
107 |
|
108 |
|
109 /** |
|
110 * ResponseReceivedL |
|
111 * A SIP response has been received from the network. |
|
112 * @param aEngine Reference to Engine object. |
|
113 * @param aTransaction Contains response elements. |
|
114 */ |
|
115 virtual void ResponseReceivedL( |
|
116 CSIPExSIPEngine& aEngine, |
|
117 CSIPClientTransaction& aTransaction ); |
|
118 |
|
119 |
|
120 /** |
|
121 * AckReceivedL |
|
122 * ACK has been received. |
|
123 * @param aEngine Reference to Engine object. |
|
124 * @param aTransaction Contains response elements. |
|
125 */ |
|
126 virtual void AckReceivedL( |
|
127 CSIPExSIPEngine& aEngine, |
|
128 CSIPServerTransaction& aTransaction ); |
|
129 |
|
130 |
|
131 /** |
|
132 * ByeReceivedL |
|
133 * BYE has been received. |
|
134 * @param aEngine Reference to Engine object. |
|
135 * @param aTransaction Contains response elements. |
|
136 */ |
|
137 virtual void ByeReceivedL( |
|
138 CSIPExSIPEngine& aEngine, |
|
139 CSIPServerTransaction& aTransaction ); |
|
140 |
|
141 |
|
142 /** |
|
143 * CancelReceivedL |
|
144 * CANCEL has been received. |
|
145 * @param aEngine Reference to Engine object. |
|
146 * @param aTransaction Contains response elements. |
|
147 */ |
|
148 virtual void CancelReceivedL( |
|
149 CSIPExSIPEngine& aEngine, |
|
150 CSIPClientTransaction& aTransaction ); |
|
151 |
|
152 |
|
153 /** |
|
154 * InviteReceivedL |
|
155 * INVITE has been received. |
|
156 * @param aEngine Reference to Engine object. |
|
157 * @param aTransaction Contains response elements. |
|
158 * The ownership is transferred. |
|
159 */ |
|
160 virtual void InviteReceivedL( |
|
161 CSIPExSIPEngine& aEngine, |
|
162 CSIPServerTransaction* aTransaction ); |
|
163 |
|
164 |
|
165 |
|
166 /** |
|
167 * An asynchronous error has occured related to a periodical refresh |
|
168 * that relates to a registration. |
|
169 * @param aEngine Reference to Engine object. |
|
170 * @param aError error code |
|
171 * @param aSIPRegistration associated registration |
|
172 */ |
|
173 virtual void ErrorOccured( |
|
174 CSIPExSIPEngine& aEngine, |
|
175 TInt aError ); |
|
176 |
|
177 |
|
178 protected: |
|
179 /** |
|
180 * C++ default constructor. |
|
181 * @param aName a state name |
|
182 */ |
|
183 CSIPExSIPStateBase(); |
|
184 |
|
185 |
|
186 private://data members |
|
187 |
|
188 }; |
|
189 |
|
190 #endif // _SIPEXSIPSTATEBASE_H_ |
|
191 |