|
1 /* |
|
2 * Copyright (c) 2007-2008 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 the License "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 #ifndef CMMCONFERENCECALLMESSHANDLER_H |
|
21 #define CMMCONFERENCECALLMESSHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "mmmmesshandlerbase.h" |
|
25 #include "cmmphonetreceiver.h" |
|
26 |
|
27 #include <e32base.h> |
|
28 |
|
29 // CONSTANTS |
|
30 // hard-coded transaction id for ISI messages |
|
31 const TUint8 KConferenceCallTransId = 2; |
|
32 |
|
33 // MACROS |
|
34 // None |
|
35 |
|
36 // DATA TYPES |
|
37 // None |
|
38 |
|
39 // FUNCTION PROTOTYPES |
|
40 // None |
|
41 |
|
42 // FORWARD DECLARATIONS |
|
43 class CMmPhoNetSender; |
|
44 class CMmMessageRouter; |
|
45 |
|
46 // CLASS DECLARATION |
|
47 |
|
48 /** |
|
49 * Used for creating and sending conference call ISI messages to |
|
50 * PhoNet via PhoNetSender. It also receives conference call |
|
51 * ISI messages from PhoNetReceiver. |
|
52 */ |
|
53 class CMmConferenceCallMessHandler : |
|
54 public CBase, |
|
55 public MMmMessHandlerBase, |
|
56 public MMmMessageReceiver |
|
57 { |
|
58 public: // Constructors and destructor |
|
59 |
|
60 /** |
|
61 * Two-phased constructor. |
|
62 * @param aPhoNetSender pointer to the Phonet sender |
|
63 * @param aPhoNetReceiver pointer to the Phonet receiver |
|
64 * @param aMessageRouter pointer to the message router object |
|
65 * @return created message handler object |
|
66 */ |
|
67 static CMmConferenceCallMessHandler* NewL( |
|
68 CMmPhoNetSender* aPhoNetSender, |
|
69 CMmPhoNetReceiver* aPhoNetReceiver, |
|
70 CMmMessageRouter* aMessageRouter ); |
|
71 |
|
72 /** |
|
73 * Destructor. |
|
74 */ |
|
75 ~CMmConferenceCallMessHandler(); |
|
76 |
|
77 public: // Methods from base classes |
|
78 |
|
79 /** |
|
80 * From MMmMessHandlerBase. This method is the single entry point for |
|
81 * requests coming from the Symbian OS layer to this message handler |
|
82 * @param aIpc IPC number of the request |
|
83 * @param CMmDataPackage* aDataPackage: pointer to datapackage |
|
84 * @return KErrNone or error code |
|
85 */ |
|
86 TInt ExtFuncL( TInt aIpc, const CMmDataPackage* aDataPackage ); |
|
87 |
|
88 public: // New functions |
|
89 |
|
90 /** |
|
91 * Checks if the received message should be handled in the common |
|
92 * Conference Call Message handler. |
|
93 * @param aIsiMsg, reference to the received message. |
|
94 */ |
|
95 void ReceiveMessageL( const TIsiReceiveC& aIsiMsg ); |
|
96 |
|
97 /** |
|
98 * Handles errors comes from PhoNetReceiver RunError |
|
99 * @param aIsiMsg The received ISI message |
|
100 * @param aError: Error code |
|
101 */ |
|
102 void HandleError( const TIsiReceiveC& aIsiMsg, TInt aError ); |
|
103 |
|
104 protected: // New functions |
|
105 |
|
106 /** |
|
107 * C++ default constructor. |
|
108 */ |
|
109 CMmConferenceCallMessHandler(); |
|
110 |
|
111 private: |
|
112 |
|
113 /** |
|
114 * By default Symbian OS constructor is private. |
|
115 */ |
|
116 void ConstructL(); |
|
117 |
|
118 private: // New functions |
|
119 |
|
120 /** |
|
121 * Creates Call control request ( create conference call etc. ) ISI |
|
122 * message and sends it to Phonet. |
|
123 * @param aTransactionId: unique TransactionId number |
|
124 * @param aCallId: call ID (sometimes common CC Call ID) |
|
125 * @param aOperation: control operation |
|
126 * @param aIsCreateConference: is this CreateConference request |
|
127 * @return success/failure value |
|
128 */ |
|
129 TInt CallControlReq( |
|
130 TUint8 aTransactionId, |
|
131 TUint8 aCallId, |
|
132 TUint8 aOperation, |
|
133 TBool aIsCreateConference ); |
|
134 |
|
135 /** |
|
136 * Breaks received CallControlResp ISI message. |
|
137 * @param aIsiMsg, reference to the received message. |
|
138 */ |
|
139 void CallControlResp( const TIsiReceiveC& aIsiMsg ); |
|
140 |
|
141 /** |
|
142 * Breaks received CallControlInd ISI message. |
|
143 * @param aIsiMsg, reference to the received message. |
|
144 */ |
|
145 void CallControlInd( const TIsiReceiveC& aIsiMsg ); |
|
146 |
|
147 /** |
|
148 * Creates CallReleaseReq (HangUp conference call) ISI |
|
149 * message and sends it to Phonet. |
|
150 * @param aTransactionId, unique transaction id |
|
151 * @param aCallId, Call ID of this call (Conference Call ID) |
|
152 * @param aCause, cause of releasing |
|
153 * @return success/failure value |
|
154 */ |
|
155 TInt CallReleaseReq( |
|
156 TUint8 aTransactionId, |
|
157 TUint8 aCallId, |
|
158 TUint8 aCause ); |
|
159 |
|
160 /** |
|
161 * Breaks received CallReleaseResp ISI message. |
|
162 * @param aIsiMsg, reference to the received message. |
|
163 */ |
|
164 void CallReleaseResp( const TIsiReceiveC& aIsiMsg ); |
|
165 |
|
166 /** |
|
167 * Utility function that maps an ETel call id to a call id |
|
168 * in ISA Call Server's format. |
|
169 * @param aETelCallId call Id in ETel format |
|
170 * @return call Id in ISA format, or KCallIdNone if illegal argument. |
|
171 */ |
|
172 static TUint8 MapETelCallIdToISACallId( const TInt aETelCallId ); |
|
173 |
|
174 public: // Member data |
|
175 // None |
|
176 |
|
177 protected: // Member data |
|
178 // None |
|
179 |
|
180 private: // Member data |
|
181 |
|
182 // Pointer to the PhonetSender |
|
183 CMmPhoNetSender* iPhoNetSender; |
|
184 |
|
185 // Last release cause value |
|
186 TUint8 iReleaseCauseValueSent; |
|
187 |
|
188 // Last transaction id for conference call creation |
|
189 TBool iIsCreateConference; |
|
190 |
|
191 // Last conference call control operation |
|
192 TUint8 iLastOperation; |
|
193 |
|
194 // Pointer to the CMmMessageRouter |
|
195 CMmMessageRouter* iMessageRouter; |
|
196 |
|
197 }; |
|
198 |
|
199 #endif // CMMCONFERENCECALLMESSHANDLER_H |
|
200 |
|
201 // End of File |