|
1 /* |
|
2 * Copyright (c) 2007 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 #include "turnudpsettings.h" |
|
22 |
|
23 #include <unsafprotocolscrkeys.h> |
|
24 |
|
25 |
|
26 // CONSTANTS |
|
27 |
|
28 //Settings |
|
29 //Domain spesific settings |
|
30 _LIT8( KTURNServAddr, "193.65.183.11:5070" ); |
|
31 _LIT8( KTURNUser, "eballusr" ); |
|
32 _LIT8( KTURNPassword, "ebpassw" ); |
|
33 //const TInt KNATRefreshTCP = 500; |
|
34 //const TInt KNATRefreshUDP = 500; |
|
35 //const TInt KEnableCRLFRefresh = 0; |
|
36 // none additional STUN server settings |
|
37 _LIT8( KNatProtocol, "nokia.turn" ); |
|
38 //TURN specific in the Domain settings |
|
39 //const TInt KLifeTime = 500; |
|
40 //const TInt KTimerValue = 500; |
|
41 |
|
42 |
|
43 // ----------------------------------------------------------------------------- |
|
44 // CTurnUdpSettings::NewL |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 CTurnUdpSettings* CTurnUdpSettings::NewL( const TDesC8& aDomain, |
|
48 TUint aIapId ) |
|
49 { |
|
50 CTurnUdpSettings* self = CTurnUdpSettings::NewLC(aDomain, aIapId ); |
|
51 CleanupStack::Pop( self ); |
|
52 return self; |
|
53 } |
|
54 |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CTurnUdpSettings::NewL |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 CTurnUdpSettings* CTurnUdpSettings::NewLC( const TDesC8& aDomain, |
|
61 TUint aIapId ) |
|
62 { |
|
63 CTurnUdpSettings* self = new( ELeave ) CTurnUdpSettings( aIapId ); |
|
64 CleanupStack::PushL( self ); |
|
65 self->ConstructL( aDomain ); |
|
66 return self; |
|
67 } |
|
68 |
|
69 |
|
70 // ----------------------------------------------------------------------------- |
|
71 // CTurnUdpSettings::CTurnUdpSettings |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 CTurnUdpSettings::CTurnUdpSettings( TUint aIapId ) |
|
75 : CGeneralSettings( aIapId ) |
|
76 { |
|
77 } |
|
78 |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CTurnUdpSettings::~CTurnUdpSettings |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 CTurnUdpSettings::~CTurnUdpSettings( ) |
|
85 { |
|
86 EraseL( KUNSAFProtocolsDomainTableMask, 0xf0000000 ); |
|
87 EraseL( KUNSAFProtocolsIAPTableMask, 0xf0000000 ); |
|
88 } |
|
89 |
|
90 |
|
91 // ----------------------------------------------------------------------------- |
|
92 // CTurnUdpSettings::ConstructL |
|
93 // ----------------------------------------------------------------------------- |
|
94 // |
|
95 void CTurnUdpSettings::ConstructL( const TDesC8& aDomain ) |
|
96 { |
|
97 CGeneralSettings::ConstructL( aDomain ); |
|
98 } |
|
99 |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // CTurnUdpSettings::CreateSettingsL |
|
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 void CTurnUdpSettings::CreateSettingsL() |
|
106 { |
|
107 CGeneralSettings::CreateSettingsL(); |
|
108 |
|
109 User::LeaveIfError( GetDomainKey( iDomainKey ) ); |
|
110 |
|
111 //create key for the turn server settings in the domain settings |
|
112 TUint32 TURNServerKey = CreateNewTableKeyL( |
|
113 KUNSAFProtocolsTURNServerTableMask | iDomainKey, |
|
114 KUNSAFProtocolsSubTableFieldTypeMask ); |
|
115 |
|
116 //Settings |
|
117 /************************************************************************/ |
|
118 //domain specific |
|
119 StoreL( KUNSAFProtocolsUsedNATProtocolMask | iDomainKey, |
|
120 KNatProtocol ); |
|
121 /************************************************************************/ |
|
122 //TURN-server settings in the domain |
|
123 StoreL( KUNSAFProtocolsTURNAddressMask | iDomainKey | TURNServerKey, |
|
124 KTURNServAddr ); |
|
125 /* |
|
126 StoreL( KUNSAFProtocolsTURNTCPTimeoutMask | iDomainKey | TURNServerKey, |
|
127 KNATRefreshTCP ); |
|
128 StoreL( KUNSAFProtocolsTURNUDPTimeoutMask | iDomainKey | TURNServerKey, |
|
129 KNATRefreshUDP ); |
|
130 StoreL( KUNSAFProtocolsTURNEnableCRLFRefreshMask | iDomainKey | TURNServerKey, |
|
131 KEnableCRLFRefresh ); |
|
132 */ |
|
133 StoreL( KUNSAFProtocolsTURNUsernameMask | iDomainKey | TURNServerKey, |
|
134 KTURNUser ); |
|
135 StoreL( KUNSAFProtocolsTURNPasswordMask | iDomainKey | TURNServerKey, |
|
136 KTURNPassword ); |
|
137 /************************************************************************/ |
|
138 //TURN specific in the Domain settings |
|
139 StoreL( KUNSAFProtocolsTURNAddressMask | iDomainKey, KTURNServAddr ); |
|
140 /* |
|
141 StoreL( KUNSAFProtocolsTURNLifeTimeMask | iDomainKey, KLifeTime ); |
|
142 StoreL( KUNSAFProtocolsTURNTimerValueMask | iDomainKey, |
|
143 KTimerValue ); |
|
144 */ |
|
145 } |