|
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 |
|
20 |
|
21 #ifndef CMCESIPEXTENSIONS_H |
|
22 #define CMCESIPEXTENSIONS_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include "mcesrv.h" |
|
27 #include "mcedefs.h" |
|
28 |
|
29 // FORWARD CLASS DECLARATIONS |
|
30 class CMceDictionary; |
|
31 class CSIPMessageElements; |
|
32 class CSIPServerTransaction; |
|
33 class CSIPClientTransaction; |
|
34 class CDesC8Array; |
|
35 class CMceComSession; |
|
36 |
|
37 /** |
|
38 * Class for modeling the level of support |
|
39 * for SIP extensions for local and remote |
|
40 * participants of a session. |
|
41 * @lib |
|
42 * @since |
|
43 */ |
|
44 class CMceSipExtensions : public CBase |
|
45 { |
|
46 public: // Enums |
|
47 |
|
48 // Extensions |
|
49 enum TExtension |
|
50 { |
|
51 E100rel = 1, |
|
52 EQosPreconds, |
|
53 ESecPreconds, |
|
54 EUpdate, |
|
55 EPrack, |
|
56 ESubscribe, |
|
57 ERefer, |
|
58 ENotify |
|
59 }; |
|
60 |
|
61 // Support levels |
|
62 enum TLevel |
|
63 { |
|
64 ENotSupported, |
|
65 ESupported, |
|
66 ERequired |
|
67 }; |
|
68 |
|
69 public: // Constructors and destructor |
|
70 |
|
71 /** |
|
72 * Two-phased constructor. |
|
73 */ |
|
74 static CMceSipExtensions* NewL(); |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 */ |
|
79 ~CMceSipExtensions(); |
|
80 |
|
81 public: // New functions |
|
82 |
|
83 /** |
|
84 * Query the level of local support for given extension. |
|
85 * Not stored extension is considered not supported. |
|
86 * @param aExtension the extension |
|
87 * @return the level of support |
|
88 */ |
|
89 TLevel Local( TExtension aExtension ); |
|
90 |
|
91 /** |
|
92 * Query the level of remote support for given extension. |
|
93 * Not stored extension is considered not supported. |
|
94 * @param aExtension the extension |
|
95 * @return the level of support |
|
96 */ |
|
97 TLevel Remote( TExtension aExtension ); |
|
98 |
|
99 /** |
|
100 * Set the level of local support for given extension. |
|
101 * Ignored, if the extension is not stored. |
|
102 * @param aExtension the extension |
|
103 * @param aLevel the level |
|
104 */ |
|
105 void SetLocal( TExtension aExtension, TLevel aLevel ); |
|
106 |
|
107 /** |
|
108 * Set the level of remote support for given extension. |
|
109 * Ignored, if the extension is not stored. |
|
110 * @param aExtension the extension |
|
111 * @param aLevel the level |
|
112 */ |
|
113 void SetRemote( TExtension aExtension, TLevel aLevel ); |
|
114 |
|
115 /** |
|
116 * Returns the level of support for certain SIP extension, |
|
117 * @param aTransaction the transaction |
|
118 * @param aExtension the extension |
|
119 * @return the level |
|
120 */ |
|
121 TLevel LevelL( CSIPTransactionBase& aTransaction, |
|
122 TExtension aExtension ); |
|
123 |
|
124 /** |
|
125 * Updates the extensions according to incoming request. |
|
126 * Leaves with KErrNotSupported, if unsupported extension is required. |
|
127 * @param aTransaction the transaction |
|
128 */ |
|
129 void UpdateL( CSIPServerTransaction& aTransaction ); |
|
130 |
|
131 /** |
|
132 * Updates the extensions according to incoming response |
|
133 * Leaves with KErrNotSupported, if unsupported extensions is required. |
|
134 * @param aTransaction the transaction |
|
135 */ |
|
136 void UpdateL( CSIPClientTransaction& aTransaction ); |
|
137 |
|
138 /** |
|
139 * Updates the extensions according to client preferences |
|
140 * Leaves with KErrNotSupported, if unsupported extensions is required. |
|
141 * @param aBody the client data |
|
142 */ |
|
143 void Update( CMceComSession& aBody ); |
|
144 |
|
145 /** |
|
146 * Finds out, is the remote UA IMS Rel5 terminal |
|
147 */ |
|
148 TBool RemoteIMSRel5(); |
|
149 |
|
150 /** |
|
151 * Put all allow headers supported by MCE into array |
|
152 * @param aArray contains the allow header values |
|
153 */ |
|
154 void ExtensionAllowMethodsL( RArray<TInt>& aArray ); |
|
155 |
|
156 /** |
|
157 * Put all Sip extension headers supported by MCE into array |
|
158 * @param aArray contains the allow header values |
|
159 */ |
|
160 void LocalSipExtensionsL(RArray<TExtension>& aArray ); |
|
161 |
|
162 private: |
|
163 |
|
164 /** |
|
165 * Constructor |
|
166 */ |
|
167 CMceSipExtensions(); |
|
168 |
|
169 /** |
|
170 * Second phase constructor |
|
171 */ |
|
172 void ConstructL(); |
|
173 |
|
174 private: // utility |
|
175 /** |
|
176 * Adds the default items in dictionary |
|
177 * @param aDictionary the dictionary |
|
178 */ |
|
179 void AddDefaultsL( CMceDictionary& aDictionary ); |
|
180 |
|
181 /** |
|
182 * Returns the level of extension in dictionary |
|
183 * @param aDictionary the dictionary |
|
184 * @param aExtension the extension |
|
185 * @return the level of support |
|
186 */ |
|
187 TLevel Level( const CMceDictionary& aDictionary, |
|
188 TExtension aExtension ) const; |
|
189 |
|
190 /** |
|
191 * Set the level of support for given extension in dictionary. |
|
192 * Ignored, if the extension is not stored. |
|
193 * @param aDictionary the dictionary |
|
194 * @param aExtension the extension |
|
195 * @param aLevel the level |
|
196 */ |
|
197 void SetLevel( CMceDictionary& aDictionary, |
|
198 TExtension aExtension, |
|
199 TLevel aLevel ); |
|
200 |
|
201 /** |
|
202 * Update extension value specified by session modifier |
|
203 * according to given value. |
|
204 * @param aModifier the session modifier |
|
205 * @param aValue the value |
|
206 */ |
|
207 void Update( TMceSessionModifier aModifier, TUint aValue ); |
|
208 |
|
209 /** |
|
210 * Setting romete extesion header support status |
|
211 * @param aMessage SipMessages |
|
212 * @return void |
|
213 */ |
|
214 void SetExtensionAllowHeadersL( const CSIPMessageElements* aMessage ); |
|
215 |
|
216 private: // Data |
|
217 |
|
218 // Dictionary for local extensions |
|
219 CMceDictionary* iLocal; |
|
220 |
|
221 // Dictionary for remote extensions |
|
222 CMceDictionary* iRemote; |
|
223 |
|
224 MCESRV_UT_DEFINITIONS |
|
225 }; |
|
226 |
|
227 #endif //CMceSipEXTENSIONS_H |
|
228 |
|
229 // End of File |