|
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 * Name : sipclientconnectionobserver.h |
|
16 * Part of : SIPClient |
|
17 * Version : SIP/4.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 |
|
29 #ifndef MSIPCLIENTCONNECTIONOBSERVER_H |
|
30 #define MSIPCLIENTCONNECTIONOBSERVER_H |
|
31 |
|
32 #include "sipconnection.h" |
|
33 class CSIPRequestElements; |
|
34 class CSIPResponseElements; |
|
35 |
|
36 /** |
|
37 * @brief an interface to be implemented by users of CSIPClientConnection |
|
38 * to be able to receive requests, responses, network state |
|
39 * notifications and error notifications from sip stack |
|
40 * |
|
41 */ |
|
42 class MSIPClientConnectionObserver |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * A SIP request outside a dialog has been received from the network. |
|
48 * |
|
49 * @param aRequest contains local address, |
|
50 * remote address of a sip message, |
|
51 * as well as optional SIP message method, headers and body. |
|
52 * The ownership is transferred. |
|
53 * @param aRequestId the id to be used when sending the SIP response. |
|
54 */ |
|
55 |
|
56 virtual void IncomingRequestL (CSIPRequestElements* aRequest, |
|
57 TUint32 aRequestId) = 0; |
|
58 |
|
59 /** |
|
60 * A SIP request within a dialog has been received from the network. |
|
61 * |
|
62 * @param aRequest contains local address, |
|
63 * remote address of a sip message, |
|
64 * as well as optional SIP message method, headers and body. |
|
65 * The ownership is transferred. |
|
66 * @param aRequestId the id to be used when sending the SIP response |
|
67 * @param aDialogId identifies the dialog to which this request belongs to. |
|
68 */ |
|
69 |
|
70 virtual void IncomingDialogRequestL (CSIPRequestElements* aRequest, |
|
71 TUint32 aRequestId, |
|
72 TUint32 aDialogId) = 0; |
|
73 |
|
74 /** |
|
75 * A SIP response that doesn't create a dialog, |
|
76 * refresh, or registration binding has been received from the network. |
|
77 * |
|
78 * @param aResponse contains local address, |
|
79 * remote address of a sip message, |
|
80 * as well as optional SIP message method, headers and body. |
|
81 * The ownership is transferred. |
|
82 * @param aRequestId the request id to be used when matching |
|
83 * the response to the sent request. |
|
84 */ |
|
85 |
|
86 virtual void IncomingResponseL (CSIPResponseElements* aResponse, |
|
87 TUint32 aRequestId) = 0; |
|
88 |
|
89 /** |
|
90 * A SIP response within a dialog or a one that creates a dialog |
|
91 * has been received from the network. |
|
92 * |
|
93 * @param aResponse contains local address, |
|
94 * remote address of a sip message, |
|
95 * as well as optional SIP message method, headers and body. |
|
96 * The ownership is transferred. |
|
97 * @param aRequestId the request id to be used when matching |
|
98 * the response to the sent request. |
|
99 * @param aDialogId the id to be used when sending requests within dialogs. |
|
100 */ |
|
101 |
|
102 virtual void IncomingDialogResponseL (CSIPResponseElements* aResponse, |
|
103 TUint32 aRequestId, |
|
104 TUint32 aDialogId) = 0; |
|
105 |
|
106 /** |
|
107 * A SIP response within a dialog or a one that creates a dialog |
|
108 * has been received from the network. |
|
109 * |
|
110 * @param aResponse contains local address, |
|
111 * remote address of a sip message, |
|
112 * as well as optional SIP message method, headers and body. |
|
113 * The ownership is transferred. |
|
114 * @param aRequestId the request id to be used when matching |
|
115 * the response to the sent request. |
|
116 * @param aRefreshId the refresh id |
|
117 * @param aDialogId the id to be used when sending requests within dialogs. |
|
118 */ |
|
119 |
|
120 virtual void IncomingDialogResponseL (CSIPResponseElements* aResponse, |
|
121 TUint32 aRequestId, |
|
122 TUint32 aRefreshId, |
|
123 TUint32 aDialogId) = 0; |
|
124 |
|
125 /** |
|
126 * A SIP response that creates a registration binding or an error response |
|
127 * that is related to an existing refreshed registration binding |
|
128 * has been received from the network. |
|
129 * |
|
130 * @param aResponse contains local address, |
|
131 * remote address of a sip message, |
|
132 * as well as optional SIP message method, headers and body. |
|
133 * The ownership is transferred. |
|
134 * @param aRequestId the request id to be used when matching |
|
135 * the response to the sent request. |
|
136 * @param aRefreshId the refresh id, if the registration is refreshed |
|
137 * @param aRegistrationId the registration id to be used when sending |
|
138 * requests for updating bindings or for using an outbound proxy. |
|
139 */ |
|
140 |
|
141 virtual void IncomingRegistrationResponseL (CSIPResponseElements* aResponse, |
|
142 TUint32 aRequestId, |
|
143 TUint32 aRefreshId, |
|
144 TUint32 aRegistrationId) = 0; |
|
145 |
|
146 /** |
|
147 * A SIP response that creates a refresh or an error response that |
|
148 * is related to an existing refresh has been received from the network. |
|
149 * |
|
150 * @param aResponse contains local address, |
|
151 * remote address of a sip message, |
|
152 * as well as optional SIP message method, headers and body. |
|
153 * The ownership is transferred. |
|
154 * @param aRequestId the request id to be used when matching |
|
155 * the response to the sent request. |
|
156 * @param aRefreshId the refresh id to be used when sending requests |
|
157 * that update or terminate the ongoing refresh. |
|
158 */ |
|
159 |
|
160 virtual void IncomingRefreshResponseL (CSIPResponseElements* aResponse, |
|
161 TUint32 aRequestId, |
|
162 TUint32 aRefreshId) = 0; |
|
163 |
|
164 /** |
|
165 * An asynchronous error has occurred in the stack related to the |
|
166 * request indicated by the given request id. |
|
167 * |
|
168 * @param aError error code |
|
169 * @param aRequestId the request id |
|
170 */ |
|
171 |
|
172 virtual void ErrorOccured (TInt aError, |
|
173 TUint32 aRequestId) = 0; |
|
174 |
|
175 |
|
176 /** |
|
177 * An asynchronous error related to |
|
178 * an ongoing refresh has occurred in the stack. |
|
179 * This means that the refresh has failed and it has been removed. |
|
180 * |
|
181 * @param aError error code |
|
182 * @param aRefreshId the refresh id |
|
183 */ |
|
184 |
|
185 virtual void RefreshErrorOccured (TInt aError, |
|
186 TUint32 aRefreshId) = 0; |
|
187 |
|
188 /** |
|
189 * An asynchronous error related to an existing registration |
|
190 * has occurred in the stack. For a refreshed registration this means |
|
191 * that the registration has been removed from the stack. |
|
192 * For an update of a non-refreshed registration this means that |
|
193 * the update was not successful but the original registration is |
|
194 * still valid. For a failing refreshed registration the request id |
|
195 * contains the id of the original refreshed request. |
|
196 * |
|
197 * @param aError error code |
|
198 * @param aRegistartionId the registration id |
|
199 * @param aRequestId the request id |
|
200 */ |
|
201 |
|
202 virtual void RegistrationErrorOccured (TInt aError, |
|
203 TUint32 aRegistrationId, |
|
204 TUint32 aRequestId) = 0; |
|
205 |
|
206 /** |
|
207 * An asynchronous error has occured related to a request within |
|
208 * an existing dialog. |
|
209 * |
|
210 * @param aError error code |
|
211 * @param aDialogId the dialog id |
|
212 * @param aRequestId the request id |
|
213 */ |
|
214 |
|
215 virtual void DialogErrorOccured (TInt aError, |
|
216 TUint32 aDialogId, |
|
217 TUint32 aRequestId) = 0; |
|
218 |
|
219 /** |
|
220 * An asynchronous error has occured related to a request within |
|
221 * an existing dialog. |
|
222 * |
|
223 * @param aError error code |
|
224 * @param aDialogId the dialog id |
|
225 * @param aRefreshId the refresh id |
|
226 * @param aRequestId the request id |
|
227 */ |
|
228 |
|
229 virtual void DialogErrorOccured (TInt aError, |
|
230 TUint32 aDialogId, |
|
231 TUint32 aRefreshId, |
|
232 TUint32 aRequestId) = 0; |
|
233 |
|
234 /** |
|
235 * The specified INVITE transaction has ended successfully. |
|
236 * |
|
237 * @param aRequestId the request id |
|
238 */ |
|
239 virtual void InviteCompleted (TUint32 aRequestId) = 0; |
|
240 |
|
241 /** |
|
242 * Is called when the connection state changes |
|
243 * |
|
244 * @param aState indicates the current connection state |
|
245 */ |
|
246 |
|
247 virtual void ConnectionStateChanged (CSIPConnection::TState aState) = 0; |
|
248 }; |
|
249 |
|
250 #endif // MSIPCLIENTCONNECTIONOBSERVER_H |
|
251 |
|
252 // End of File |