|
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 : CSatCCTsy.h |
|
16 * Part of : Common SIM ATK TSY / commonsimatktsy |
|
17 * Interface : - |
|
18 * Call control-related functionality of Sat Tsy |
|
19 * Version : 1.0 |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 #ifndef CSATCCTSY_H |
|
27 #define CSATCCTSY_H |
|
28 |
|
29 |
|
30 // INCLUDES |
|
31 #include <e32base.h> |
|
32 #include <etelsat.h> |
|
33 #include "TTlv.h" |
|
34 #include "TSatUtility.h" |
|
35 // CONSTANTS |
|
36 const TUint16 KMaxLengthDefaultBearerData = 258; |
|
37 const TUint8 KMaxBccLength = 16; |
|
38 |
|
39 // MACROS |
|
40 //none |
|
41 |
|
42 // DATA TYPES |
|
43 //none |
|
44 |
|
45 // FUNCTION PROTOTYPES |
|
46 //none |
|
47 |
|
48 // FORWARD DECLARATIONS |
|
49 class CSatTsy; |
|
50 class CSatDataPackage; |
|
51 class CSatNotificationsTsy; |
|
52 |
|
53 // CLASS DECLARATION |
|
54 //none |
|
55 |
|
56 // DESCRIPTION |
|
57 /** |
|
58 * CSatCCTsy contains call control related handling functionality. |
|
59 * |
|
60 * @lib Commonsimatktsy |
|
61 * @since 2.6 |
|
62 */ |
|
63 NONSHARABLE_CLASS ( CSatCCTsy ) : public CBase |
|
64 { |
|
65 public: |
|
66 |
|
67 typedef TBuf8<KMaxLengthDefaultBearerData> TBearerData; |
|
68 |
|
69 /* |
|
70 * This structure contains information needed in constructing Call |
|
71 * Control (call/SS/USSD) Envelope and handling the call control events. |
|
72 */ |
|
73 struct TCCInfo |
|
74 { |
|
75 TUint8 iTag; // Tag of envelope |
|
76 TBuf8<KMaxBccLength> iBcc1; // For storing bearer capability 1 |
|
77 TBuf8<KMaxBccLength> iBcc2; // For storing bearer capability 2 |
|
78 TBuf8<KMaxAddressLength> iAddress; // For storing address |
|
79 TUint8 iTonNpi; // For storing ton&npi |
|
80 TUint8 iDcs; // For storing DCS (only USSD) |
|
81 }; |
|
82 |
|
83 public: |
|
84 |
|
85 /** |
|
86 * Two-phased constructor. |
|
87 * @param aSatTsy |
|
88 * @param aNotificationsTsy: Pointer to NotificationsTsy |
|
89 * return CSatTsy*: created CC object |
|
90 */ |
|
91 static CSatCCTsy* NewL( CSatTsy* aSatTsy, |
|
92 CSatNotificationsTsy* aNotificationsTsy ); |
|
93 |
|
94 /** |
|
95 * C++ Destructor. |
|
96 */ |
|
97 ~CSatCCTsy(); |
|
98 |
|
99 private: // Constructors |
|
100 |
|
101 /** |
|
102 * By default C++ constructor is private. |
|
103 * @param aNotificationsTsy: Pointer to NotificationsTsy |
|
104 */ |
|
105 CSatCCTsy( CSatNotificationsTsy* aNotificationsTsy ); |
|
106 |
|
107 /** |
|
108 * Class attributes are created in ConstructL. |
|
109 */ |
|
110 void ConstructL(); |
|
111 |
|
112 public: // New functions |
|
113 |
|
114 /** |
|
115 * Saves default bearer data for voice call. |
|
116 * @param aDataPackage contains default bearer capability |
|
117 * @param aResult KErrNone |
|
118 */ |
|
119 void CompleteBearerCapability( CSatDataPackage* aDataPackage, |
|
120 TInt aResult ); |
|
121 |
|
122 /** |
|
123 * Identifies the type of envelope and calls appropriate method |
|
124 * for constructing the envelope |
|
125 * @param aDataPackage: Contains index for iCCInfoArray |
|
126 */ |
|
127 void CreateEnvelopeL( CSatDataPackage* aDataPackage ); |
|
128 |
|
129 /** |
|
130 * Checks whether the Alpha ID is present in the data notification and |
|
131 * if that is the case - requests completion to the client |
|
132 * @param aDataPackage pointer to notification data |
|
133 */ |
|
134 void CheckIfAlphaIdPresent( CSatDataPackage* aDataPackage ); |
|
135 |
|
136 /** |
|
137 * Handles the call control event coming in data notification |
|
138 * @param aIpc: The IPC number of the request |
|
139 * @param aDataPackage: Contains the pointer to TCCInfo data structure |
|
140 */ |
|
141 void CompleteCCEventL( TInt aIpc, CSatDataPackage* aDataPackage ); |
|
142 |
|
143 /** |
|
144 * Set CSatCCTsy internal Ton and Npi |
|
145 * @param aTonNpi: Type Of Number and Numbering Plan Indicator |
|
146 */ |
|
147 void SetTonNpiForSS( const TUint8 aTonNpi ); |
|
148 |
|
149 /* |
|
150 * Set internal flag according to EF-SST |
|
151 * @param aDataPackage: Pointer to the status of USSD support |
|
152 */ |
|
153 void SetUssdStatus( CSatDataPackage* aDataPackage ); |
|
154 |
|
155 /** |
|
156 * Stores proactive originated Call/SS address. |
|
157 * @param aAddress: Destination address |
|
158 */ |
|
159 void StoreAddressForCC( const TDesC8& aAddress); |
|
160 |
|
161 private: // Methods |
|
162 |
|
163 /** |
|
164 * Creates Call Envelope and sends it to NAA. |
|
165 * @param aCCInfo: structure containing data to be sent |
|
166 */ |
|
167 void CreateCallEnvelopeL( const TCCInfo* aCCInfo ); |
|
168 |
|
169 /** |
|
170 * Creates SS Envelope and sends it to NAA. |
|
171 * @param aCCInfo: structure containing data to be sent |
|
172 */ |
|
173 void CreateSSEnvelopeL( const TCCInfo* aCCInfo ); |
|
174 |
|
175 /** |
|
176 * Creates USSD Envelope and sends it to NAA. |
|
177 * @param aCCInfo: structure containing data to be sent |
|
178 */ |
|
179 void CreateUSSDEnvelopeL( const TCCInfo* aCCInfo ); |
|
180 |
|
181 /* |
|
182 * Method checks if the given Ussd string contains |
|
183 * only characters "*", "#", and the numbers 0-9. |
|
184 * @param aSsUssdString: Ussd string to be checked |
|
185 * @return ETrue = Ussd string contains only "*", "#", and |
|
186 * the numbers 0-9. EFalse = Ussd string contains also other characters. |
|
187 */ |
|
188 TBool IsOnlyDigitsInUssd( const TDesC8& aUSSDString ); |
|
189 |
|
190 #ifdef USING_CTSY_DISPATCHER |
|
191 public: //to allow access to HasProactiveOrigin() from the dispatcher |
|
192 #endif //end USING_CTSY_DISPATCHER |
|
193 /** |
|
194 * Compares the given address with saved proactive originated |
|
195 * Call/SS address |
|
196 * @param aAddress: Address to compare |
|
197 * @return ETrue if addresses do match, otherwise EFalse |
|
198 */ |
|
199 TBool HasProactiveOrigin( const TDesC8& aAddress); |
|
200 |
|
201 private: // Data |
|
202 |
|
203 // Pointer to Sat TSY |
|
204 CSatTsy* iSatTsy; |
|
205 // Pointer to the notifications tsy class |
|
206 CSatNotificationsTsy* iNotificationsTsy; |
|
207 // Default bearer data for voice call. |
|
208 TBearerData iBearerData; |
|
209 // True if TonNpi is resolved from SEND SS proactive commmand. |
|
210 TBool iTonNpiPresent; |
|
211 // For setting TON/NPI for SendSSEnvelope |
|
212 TUint8 iTonNpiForSS; |
|
213 // Address of Send SS or Setup Call proactive command is stored here |
|
214 // Used to determined wether to check FDN when an event is received |
|
215 TBuf8<KMaxAddressLength> iProactiveCommandAddress; |
|
216 // The status of USSD support in EF-SST |
|
217 TUint8 iUssdTlvSupported; |
|
218 }; |
|
219 |
|
220 #endif // CSATCCTSY_H |
|
221 |
|
222 |
|
223 // End of File |