|
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 : SIPRequestUtility.h |
|
16 * Part of : TransactionUser |
|
17 * Version : SIP/5.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 #ifndef SIPREQUESTUTILITY_H |
|
29 #define SIPREQUESTUTILITY_H |
|
30 |
|
31 // INCLUDES |
|
32 #include <e32base.h> |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CURIContainer; |
|
36 class CSIPRequest; |
|
37 class CRouteSet; |
|
38 class CSIPRouteHeader; |
|
39 |
|
40 // CLASS DECLARATION |
|
41 /* |
|
42 * Miscellaneous SIP request related functions |
|
43 */ |
|
44 class SIPRequestUtility |
|
45 { |
|
46 public: |
|
47 enum TMaxForwards |
|
48 { |
|
49 /** Max-forwards header is filled with this value */ |
|
50 EMaxForwardsValue = 70 |
|
51 }; |
|
52 |
|
53 /** |
|
54 * Checks that the request contains everything required to be filled by the |
|
55 * upper layers. If request isn't ok, function leaves. |
|
56 * |
|
57 * @param aReq SIP request |
|
58 */ |
|
59 static void CheckOutgoingRequestL(CSIPRequest& aReq); |
|
60 |
|
61 /** |
|
62 * Fills the Request-URI of aReq with the value in aUri. |
|
63 * |
|
64 * @param aReq SIP request |
|
65 * @param aUri URI to be filled into aReq |
|
66 */ |
|
67 static void SetRequestUriL(CSIPRequest& aReq, const CURIContainer& aUri); |
|
68 |
|
69 /** |
|
70 * Fills Route-headers and Request URI into the aReq. |
|
71 * |
|
72 * @param aReq SIP request to be filled |
|
73 * @param aRouteSet Route set |
|
74 * @param aRemoteTarget Remote target |
|
75 */ |
|
76 static void FillRouteAndRequestUriL(CSIPRequest& aReq, |
|
77 const CRouteSet& aRouteSet, |
|
78 const CURIContainer& aRemoteTarget); |
|
79 |
|
80 /** |
|
81 * Creates a Route header from the aUri. |
|
82 * |
|
83 * @param aUri URI to be put into Route header |
|
84 * @return value CSIPRouteHeader* New header. Ownership is transferred. |
|
85 */ |
|
86 static CSIPRouteHeader* CreateRouteHeaderLC(const CURIContainer& aUri); |
|
87 |
|
88 /** |
|
89 * Adds Max-Forwards header into the SIP request. |
|
90 * |
|
91 * @param aReq SIP request |
|
92 */ |
|
93 static void FillNewMaxForwardsL(CSIPRequest& aReq); |
|
94 |
|
95 /** |
|
96 * Adds "Supported: sec-agree" header to SIP request. |
|
97 * |
|
98 * @param aReq SIP request |
|
99 */ |
|
100 static void FillSupportedSecAgreeL(CSIPRequest& aReq); |
|
101 |
|
102 /** |
|
103 * Cleanup method for releasing the temporary Route-headers in case a leave |
|
104 * occurs during re-ordering the Route-headers of the SIP request. |
|
105 * |
|
106 * @param aRouteHeaders Pointer to RPointerArray holding the Route-headers |
|
107 */ |
|
108 static void CleanupRouteHeaders(TAny* aRouteHeaders); |
|
109 }; |
|
110 |
|
111 #endif // end of SIPREQUESTUTILITY_H |
|
112 |
|
113 // End of File |