|
1 /* |
|
2 * Copyright (c) 2005-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 : CSIPOptionsHandler.h |
|
16 * Part of : SIP Client Resolver |
|
17 * Version : 1.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 #ifndef CSIPOPTIONSHANDLER_H |
|
29 #define CSIPOPTIONSHANDLER_H |
|
30 |
|
31 #include <e32base.h> |
|
32 #include <stringpool.h> |
|
33 #include "MSipClients.h" |
|
34 #include "MSipClient.h" |
|
35 #include "CSIPClientResolver2.h" |
|
36 #include "_sipcodecdefs.h" |
|
37 |
|
38 class CSIPRequest; |
|
39 class CSIPResponse; |
|
40 class CSdpDocument; |
|
41 class CSdpOriginField; |
|
42 class CSdpMediaField; |
|
43 class CSdpFmtAttributeField; |
|
44 class CSIPHeaderBase; |
|
45 class CSIPContentTypeHeader; |
|
46 class MSipClient; |
|
47 class CSIPResolvedClient2; |
|
48 class CSIPAcceptHeader; |
|
49 |
|
50 class CSIPOptionsHandler : public CBase |
|
51 { |
|
52 public: |
|
53 |
|
54 static CSIPOptionsHandler* NewLC(CSIPRequest& aRequest); |
|
55 ~CSIPOptionsHandler(); |
|
56 |
|
57 void AddClientDataL(CSdpDocument& aSdpDocument); |
|
58 |
|
59 void AddClientDataL(RPointerArray<CSdpMediaField>* aMediaFields); |
|
60 |
|
61 CSIPResponse* CreateResponseL( RArray<TUid>& aUids, |
|
62 MSipClients& aSipClients, |
|
63 CSIPClientResolver2& aClientResolver2 ); |
|
64 |
|
65 static void PushLC(RPointerArray<CSIPContentTypeHeader>* aArray); |
|
66 static void ResetAndDestroyArray(TAny* anArray); |
|
67 |
|
68 static void PushLC(RPointerArray<CSIPAcceptHeader>* aArray); |
|
69 static void ResetAndDestroy(TAny* anArray); |
|
70 |
|
71 private: |
|
72 |
|
73 CSIPOptionsHandler(); |
|
74 void ConstructL(CSIPRequest& aRequest); |
|
75 |
|
76 TBool SDPAccepted(CSIPRequest& aRequest); |
|
77 |
|
78 CSdpMediaField* FindMatchingField(const CSdpMediaField& aMediaField); |
|
79 |
|
80 void AppendMediaFieldL( CSdpMediaField* aMediafield ); |
|
81 |
|
82 void AddAttributesL(CSdpMediaField& aSource, |
|
83 CSdpMediaField& aDestination); |
|
84 |
|
85 void AddAttributesL(CSdpMediaField* aSource, |
|
86 CSdpMediaField& aDestination); |
|
87 |
|
88 TBool AppendFormatAttributeFieldsL( CSdpFmtAttributeField* aAttribute, |
|
89 CSdpMediaField& aDestination ); |
|
90 |
|
91 CSdpOriginField* CreateOriginFieldL(const TDesC8& aLocalHost, |
|
92 const RStringF& aHostType) const; |
|
93 |
|
94 void LocalHostL(CSIPRequest& aRequest, |
|
95 TPtrC8& aLocalHost, |
|
96 RStringF& aHostType) const; |
|
97 |
|
98 TBool HasMatchingFmtAttritbute(CSdpMediaField& aMedia, |
|
99 const CSdpFmtAttributeField& aAttribute); |
|
100 |
|
101 void UpdateFormatListL(CSdpMediaField& aMedia); |
|
102 |
|
103 void AddAcceptToResponseL( CSIPResponse& aResponse, |
|
104 RArray<TUid>& aUids, |
|
105 MSipClients& aSipClients, |
|
106 CSIPClientResolver2& aClientResolver2 ); |
|
107 void CollectHeadersL( RArray<TUid>& aUids, |
|
108 MSipClients& aSipClients, |
|
109 CSIPClientResolver2& aClientResolver2 ); |
|
110 |
|
111 void RemoveDuplicateAcceptHeaders(); |
|
112 void CollectHeadersL( MSipClient* aSipClient ); |
|
113 void CollectHeadersL( CSIPResolvedClient2* aClient ); |
|
114 private: // Data |
|
115 |
|
116 RStringF iSdpNetType; |
|
117 RStringF iSdpIPv4Type; |
|
118 RStringF iSdpIPv6Type; |
|
119 RStringF iRtpAvp; |
|
120 RStringF iRtpmap; |
|
121 RStringF iApplication; |
|
122 CSdpDocument* iSdpDocument; |
|
123 TBool iSdpAccepted; |
|
124 RPointerArray<CSIPHeaderBase> iSipAcceptHeaders; |
|
125 |
|
126 private: // For testing purposes |
|
127 |
|
128 UNIT_TEST(CSIPOptionsHandlerTest) |
|
129 }; |
|
130 |
|
131 #endif // CSIPOPTIONSHANDLER_H |
|
132 |
|
133 // End of File |