|
1 /* |
|
2 * Copyright (c) 2006-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 : MSipConnectionMgr.h |
|
16 * Part of : ConnectionMgr |
|
17 * Version : SIP/5.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 #ifndef MSIPCONNECTIONMGR_H |
|
28 #define MSIPCONNECTIONMGR_H |
|
29 |
|
30 #include <e32std.h> |
|
31 #include "sipconnection.h" |
|
32 |
|
33 class TSIPTransportParams; |
|
34 class CSIPRequest; |
|
35 class CSIPResponse; |
|
36 class MSIPNATBindingObserver; |
|
37 class CUri8; |
|
38 |
|
39 class MSipConnectionMgr |
|
40 { |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 virtual ~MSipConnectionMgr () {} |
|
47 |
|
48 /** |
|
49 * Opens an IAP for use and creates a new sending socket. |
|
50 * Multiple users may share the same IAP but each has an own sending socket. |
|
51 * So the IAP may already be open. |
|
52 * |
|
53 * @param aParams the transport params including the IAP ID. |
|
54 * |
|
55 * @return The current connection state |
|
56 */ |
|
57 virtual CSIPConnection::TState OpenL( |
|
58 const TSIPTransportParams& aParams) = 0; |
|
59 |
|
60 /** |
|
61 * Checks whether a connection and the related sockets have been opened. |
|
62 * |
|
63 * @param aParams the transport params including the IAP ID. |
|
64 * |
|
65 * @returns ETrue if opened, otherwise EFalse |
|
66 */ |
|
67 virtual TBool IsOpen(const TSIPTransportParams& aParams) = 0; |
|
68 |
|
69 /** |
|
70 * Closes a connection and the related sockets. |
|
71 * Closes the actual IAP based on a reference count. |
|
72 * When the last users calls this function the actual IAP is closed. |
|
73 * Sending sockets for the user are closed whether or not there |
|
74 * are other users for the IAP. |
|
75 * |
|
76 * @param aParams the transport params including the IAP ID. |
|
77 */ |
|
78 virtual void Close(const TSIPTransportParams& aParams) = 0; |
|
79 |
|
80 /** |
|
81 * Sets a RSocket option used for all the sending sockets |
|
82 * related to the given transport owner. |
|
83 * @pre IsOpen() == ETrue |
|
84 * @param aParams the transport params including the IAP ID. |
|
85 * @param aOptionName An integer constant which identifies an option. |
|
86 * @param aOptionLevel An integer constant which identifies |
|
87 * level of an option. |
|
88 * @param aOption Option value packaged in a descriptor. |
|
89 */ |
|
90 virtual void SetOptL(const TSIPTransportParams& aParams, |
|
91 TUint aOptionName, |
|
92 TUint aOptionLevel, |
|
93 const TDesC8& aOption) = 0; |
|
94 |
|
95 /** |
|
96 * Sets a RSocket option used for all the sending sockets |
|
97 * related to the given transport owner. |
|
98 * @pre IsOpen() == ETrue |
|
99 * @param aParams the transport params including the IAP ID. |
|
100 * @param aOptionName An integer constant which identifies an option. |
|
101 * @param aOptionLevel An integer constant which identifies |
|
102 * level of an option. |
|
103 * @param aOption Option value as an integer. |
|
104 */ |
|
105 virtual void SetOptL(const TSIPTransportParams& aParams, |
|
106 TUint aOptionName, |
|
107 TUint aOptionLevel, |
|
108 TInt aOption) = 0; |
|
109 |
|
110 /** |
|
111 * Function sends a SIP Request to a remote host. |
|
112 * |
|
113 * @pre IsOpen() == ETrue |
|
114 * @param aParams the transport params including the IAP ID. |
|
115 * @param aRequest A reference to a CSIPRequest object |
|
116 * @param aForceUDP ETrue if transport protocol can't be changed from UDP. |
|
117 * @param aOutboundProxy outbound proxy, NULL pointer if not used. |
|
118 * The ownership is not transferred. |
|
119 * @param aAddress A remote destination address |
|
120 * @param aStatus On completion, will contain an error code |
|
121 * The aStatus is a reference to the calling active |
|
122 * object´s iStatus. |
|
123 */ |
|
124 virtual void SendL(const TSIPTransportParams& aParams, |
|
125 CSIPRequest& aRequest, |
|
126 TBool aForceUDP, |
|
127 const CUri8* aOutboundProxy, |
|
128 const TInetAddr& aRemoteAddr, |
|
129 TRequestStatus& aStatus) = 0; |
|
130 |
|
131 /** |
|
132 * Function sends a SIP Response to a remote host. |
|
133 * |
|
134 * @pre IsOpen() == ETrue |
|
135 * @param aParams the transport params including the IAP ID. |
|
136 * @param aResponse A reference to a CSIPResponse object |
|
137 * @param aId The Id of transaction that is sending RESPONSE |
|
138 * @param aStatus On completion, will contain an error code. |
|
139 * The aStatus is a reference to the calling active |
|
140 * object´s iStatus. |
|
141 */ |
|
142 virtual void SendL(const TSIPTransportParams& aParams, |
|
143 CSIPResponse& aResponse, |
|
144 TTransactionId aId, |
|
145 TRequestStatus& aStatus) = 0; |
|
146 |
|
147 /** |
|
148 * Function cancels an outstanding operation. |
|
149 * |
|
150 * @param aStatus The aStatus is a reference to the calling active |
|
151 * object´s iStatus. |
|
152 * @return A system wide error code |
|
153 */ |
|
154 virtual TInt CancelSend(TRequestStatus &aStatus)=0; |
|
155 |
|
156 /** |
|
157 * Function cancels all outstanding operations for a transaction. |
|
158 * |
|
159 * @param aId TransactionId |
|
160 * @param aCancelAlso2xxResponses If EFalse, outstanding 2xx responses |
|
161 * of the transaction are not canceled. If ETrue, all operations |
|
162 * related to the transaction are canceled. |
|
163 * @return A system wide error code |
|
164 */ |
|
165 virtual TInt CancelResponseSend(TTransactionId aId, |
|
166 TBool aCancelAlso2xxResponses) = 0; |
|
167 |
|
168 /** |
|
169 * Disconnect the TCP connection to the remote host |
|
170 * |
|
171 * @param aParams the transport params including the IAP ID. |
|
172 * @param aRemoteAddress Address of remote host |
|
173 * |
|
174 */ |
|
175 virtual void TcpDisconnect(const TSIPTransportParams& aParams, |
|
176 const TInetAddr& aRemoteAddress) = 0; |
|
177 |
|
178 /** |
|
179 * Frees all the resources reserved for the observer. |
|
180 * @param aSIPNATBindingObserver a observer |
|
181 */ |
|
182 virtual void FreeResources( |
|
183 MSIPNATBindingObserver& aSIPNATBindingObserver ) = 0; |
|
184 }; |
|
185 |
|
186 #endif // MSIPCONNECTIONMGR_H |
|
187 |
|
188 // End of File |