|
1 /* |
|
2 * Copyright (c) 2005 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 #ifndef MMUSAVASIPCONNECTIONADAPTER_H |
|
20 #define MMUSAVASIPCONNECTIONADAPTER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "sipconnection.h" |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CSIPDialogAssocBase; |
|
27 class CSIPInviteDialogAssoc; |
|
28 class CSIPRegistrationBinding; |
|
29 class CSIPDialog; |
|
30 class CSIPTransactionBase; |
|
31 class CSIPServerTransaction; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * @publishedAll |
|
37 * @released |
|
38 * |
|
39 * An interface to be implemented by users of CSIPConnection. |
|
40 * Interface allows to be able to receive requests, responses, connection state |
|
41 * notifications and error notifications from sip stack. |
|
42 * |
|
43 * Note: The client must not delete related CSIPConnection object |
|
44 * during the execution of the interface function. |
|
45 * |
|
46 * @lib n/a |
|
47 */ |
|
48 |
|
49 class MMusAvaSipConnectionAdapter |
|
50 { |
|
51 public: |
|
52 /** |
|
53 * A SIP request outside a dialog has been received from the network. |
|
54 * |
|
55 * @pre aTransaction != 0 |
|
56 * @param aTransaction SIP server transaction. The ownership is |
|
57 * transferred. |
|
58 */ |
|
59 virtual TInt IncomingRequest (CSIPServerTransaction* |
|
60 /*aTransaction*/) { return KErrNotFound; } |
|
61 |
|
62 /** |
|
63 * A SIP request within a dialog has been received from the network. |
|
64 * The client must resolve the actual dialog association to which |
|
65 * this request belongs. |
|
66 * |
|
67 * @pre aTransaction != 0 |
|
68 * @param aTransaction SIP server transaction. The ownership is |
|
69 * transferred. |
|
70 * @param aDialog the dialog that this transaction belongs to. |
|
71 */ |
|
72 virtual TInt IncomingRequest (CSIPServerTransaction* /*aTransaction*/, |
|
73 CSIPDialog& /*aDialog*/) { return KErrNotFound; } |
|
74 |
|
75 /** |
|
76 * A SIP response received from the network. |
|
77 * |
|
78 * @param aTransaction contains response elements. |
|
79 */ |
|
80 virtual TInt IncomingResponse (CSIPClientTransaction& |
|
81 /*aTransaction*/) { return KErrNotFound; } |
|
82 |
|
83 /** |
|
84 * A SIP response received from the network that is within a dialog |
|
85 * association or creates a dialog association. |
|
86 * |
|
87 * @param aTransaction contains response elements. |
|
88 * @param aDialogAssoc a dialog association. |
|
89 */ |
|
90 virtual TInt IncomingResponse ( |
|
91 CSIPClientTransaction& /*aTransaction*/, |
|
92 CSIPDialogAssocBase& /*aDialogAssoc*/) { return KErrNotFound; } |
|
93 |
|
94 /** |
|
95 * Multiple SIP responses have been received to the single INVITE due |
|
96 * to the forking proxy. Note that each response creates a separate |
|
97 * INVITE dialog association. |
|
98 * Multiple responses can arrive until SIP stack completes UAC core |
|
99 * INVITE transaction. |
|
100 * If clients deletes INVITE transaction after first SIP response |
|
101 * other possible responses will be consumed by the implementation. |
|
102 * |
|
103 * @param aTransaction contains response elements |
|
104 * @param aDialogAssoc INVITE dialog association; the ownership is |
|
105 * transferred |
|
106 */ |
|
107 virtual TInt IncomingResponse ( |
|
108 CSIPClientTransaction& /*aTransaction*/, |
|
109 CSIPInviteDialogAssoc* /*aDialogAssoc*/) { return KErrNotFound; } |
|
110 |
|
111 /** |
|
112 * A SIP response related a registration binding or an error response |
|
113 * that is related to registration binding has been received |
|
114 * from the network. |
|
115 * |
|
116 * @param aTransaction contains response elements |
|
117 * @param aRegistration registration binding this transaction belongs to |
|
118 */ |
|
119 virtual TInt |
|
120 IncomingResponse (CSIPClientTransaction& /*aTransaction*/, |
|
121 CSIPRegistrationBinding& /*aRegistration*/) { return KErrNotFound; } |
|
122 |
|
123 /** |
|
124 * An asynchronous error has occurred in the stack related to the |
|
125 * request indicated by the given transaction. |
|
126 * |
|
127 * @param aError system wide or SIP error code |
|
128 * @param aTransaction failed transaction |
|
129 * @param aSIPConnection a SIP connection |
|
130 */ |
|
131 virtual TInt ErrorOccured (TInt /*aError*/, |
|
132 CSIPTransactionBase& /*aTransaction*/) { return KErrNotFound; } |
|
133 |
|
134 /** |
|
135 * An asynchronous error has occurred in the stack related |
|
136 * to the request indicated by the given transaction. |
|
137 * |
|
138 * @param aError system wide or SIP error code |
|
139 * @param aTransaction the failed transaction |
|
140 * @param aRegistration the failed registration binding |
|
141 */ |
|
142 virtual TInt ErrorOccured( TInt /*aError*/, |
|
143 CSIPClientTransaction& /*aTransaction*/, |
|
144 CSIPRegistrationBinding& /*aRegistration*/) |
|
145 { return KErrNotFound; } |
|
146 |
|
147 /** |
|
148 * An asynchronous error has occured related to a request within |
|
149 * an existing dialog. |
|
150 * |
|
151 * @param aError system wide or SIP error code |
|
152 * @param aTransaction the failed transaction. |
|
153 * @param aDialogAssoc the failed dialog associoation. |
|
154 */ |
|
155 virtual TInt ErrorOccured ( |
|
156 TInt /*aError*/, |
|
157 CSIPTransactionBase& /*aTransaction*/, |
|
158 CSIPDialogAssocBase& /*aDialogAssoc*/) { return KErrNotFound; } |
|
159 |
|
160 /** |
|
161 * An asynchronous error has occured related to a refresh |
|
162 * |
|
163 * @param aError system wide or SIP error code |
|
164 * @param aSIPRefresh original refresh object. |
|
165 */ |
|
166 virtual TInt ErrorOccured ( TInt /*aError*/, |
|
167 CSIPRefresh& /*aSIPRefresh*/ ) { return KErrNotFound; } |
|
168 |
|
169 /** |
|
170 * An asynchronous error has occured related to a periodical refresh |
|
171 * that relates to a registration. |
|
172 * |
|
173 * @param aError system wide or SIP error code; |
|
174 * KErrCouldNotConnect if the refresh has failed |
|
175 * due to the suspended connection. |
|
176 * @param aRegistration associated registration binding |
|
177 */ |
|
178 virtual TInt ErrorOccured( TInt /*aError*/, |
|
179 CSIPRegistrationBinding& /*aRegistration*/ ) { return KErrNotFound; } |
|
180 |
|
181 /** |
|
182 * An asynchronous error has occured related to a periodical refresh |
|
183 * that belongs to SIP dialog association. |
|
184 * |
|
185 * @param aError system wide or SIP error code; |
|
186 * KErrCouldNotConnect if the refresh has failed |
|
187 * due to the suspended connection. |
|
188 * @param aDialogAssoc SIP dialog association. |
|
189 */ |
|
190 virtual TInt ErrorOccured( TInt /*aError*/, |
|
191 CSIPDialogAssocBase& /*aDialogAssoc*/) |
|
192 { return KErrNotFound; } |
|
193 |
|
194 /** |
|
195 * SIP stack has completed UAC core INVITE transaction 64*T1 seconds |
|
196 * after the reception of the first 2xx response. No more 2xx responses |
|
197 * can be received to the issued single INVITE. |
|
198 * |
|
199 * If the INVITE transaction does not create a dialog, or the INVITE |
|
200 * transaction encounters an error, this event will not be sent. |
|
201 * |
|
202 * @param aTransaction a complete UAC core INVITE transaction |
|
203 */ |
|
204 virtual TInt InviteCompleted (CSIPClientTransaction& /*aTransaction*/) |
|
205 { return KErrNotFound; } |
|
206 |
|
207 /** |
|
208 * Invite was canceled with the CANCEL |
|
209 * @param aTransaction a canceled INVITE UAS transaction |
|
210 */ |
|
211 virtual TInt InviteCanceled (CSIPServerTransaction& /*aTransaction*/) |
|
212 { return KErrNotFound; } |
|
213 |
|
214 /** |
|
215 * Connection state has changed. |
|
216 * If connection state has changed to EInactive or EUnavailable, |
|
217 * SIP stack has removed all stand-alone SIP refreshes, registrations |
|
218 * and dialog associations that client requested to refresh. Client may |
|
219 * re-issue refresh requests (stand-alone, registration or dialog |
|
220 * association related) when connection becomes EActive again. |
|
221 * SIP stack also terminates all pending SIP client transactions and no |
|
222 * errors are reported back to the client about the terminated |
|
223 * transactions nor about removed refreshes in order to avoid event |
|
224 * flood. |
|
225 * |
|
226 * @param aState indicates the current connection state |
|
227 */ |
|
228 virtual TInt ConnectionStateChanged (CSIPConnection::TState /*aState*/) |
|
229 { return KErrNotFound; } |
|
230 }; |
|
231 |
|
232 #endif // MMUSAVASIPCONNECTIONADAPTER_H |