• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef TELEPHONY_IMS_CALL_TYPES_H
17 #define TELEPHONY_IMS_CALL_TYPES_H
18 
19 #include "call_manager_errors.h"
20 #include "call_manager_inner_type.h"
21 #include "hril_call_parcel.h"
22 #include "ims_core_service_types.h"
23 
24 namespace OHOS {
25 namespace Telephony {
26 const int32_t kMaxNumberLength = 30;
27 
28 /**
29  * @brief Indicates the reason for rejecting the ims call.
30  */
31 enum ImsRejectReason {
32     /**
33      * Indicates the reject reason is user busy.
34      */
35     USER_IS_BUSY = 0,
36     /**
37      * Indicates the reject reason is user decline.
38      */
39     USER_DECLINE = 1,
40 };
41 
42 /**
43  * @brief Indicates the class of Ims service,which used in IMS Set Call Waiting interface.
44  */
45 enum ImsServiceClass {
46     /**
47      * Indicates service class is voice.
48      */
49     SERVICE_CLASS_VOICE = 1,
50     /**
51      * Indicates service class is video.
52      */
53     SERVICE_CLASS_VIDEO = 2,
54 };
55 
56 /**
57  * @brief Indicates the state of Srvcc.
58  */
59 enum SrvccState {
60     /**
61      * Indicates SrvccState is null.
62      */
63     SRVCC_NONE = -1,
64     /**
65      * Indicates SrvccState is started.
66      */
67     STARTED = 0,
68     /**
69      * Indicates SrvccState is completed.
70      */
71     COMPLETED = 1,
72     /**
73      * Indicates SrvccState is failed.
74      */
75     FAILED = 2,
76     /**
77      * Indicates SrvccState is canceled.
78      */
79     CANCELED = 3
80 };
81 
82 enum ImsSrvccAction {
83     ACTION_DIAL,
84     ACTION_HANGUP,
85     ACTION_ANSWER,
86     ACTION_REJECT,
87     ACTION_CONFERENCE,
88     ACTION_SWITCH_CALL,
89     ACTION_SEND_DTMF,
90     ACTION_START_DTMF,
91     ACTION_STOP_DTMF,
92 };
93 
94 /**
95  * @brief Indicates the type of ImsCall.
96  */
97 enum ImsCallType {
98     /**
99      * Indicates the ImsCall type is voice.
100      */
101     TEL_IMS_CALL_TYPE_VOICE,
102     /**
103      * Indicates the ImsCall type is VT_TX.
104      */
105     TEL_IMS_CALL_TYPE_VT_TX,
106     /**
107      * Indicates the ImsCall type is VT_RX.
108      */
109     TEL_IMS_CALL_TYPE_VT_RX,
110     /**
111      * Indicates the ImsCall type is VT.
112      */
113     TEL_IMS_CALL_TYPE_VT,
114 };
115 
116 /**
117  * @brief Indicates the type of ImsCall.
118  */
119 struct ImsSrvccActionInfo {
120     CellularCallInfo callInfo;
121     /**
122      * Indicates the initial value of dtmfCode is 0.
123      */
124     char dtmfCode = 0;
125 };
126 
127 /**
128  * @brief Indicates the code of TransferState.
129  */
130 enum TransferState {
131     /**
132      * Indicates the code value of VT transfer to WFC is 0.
133      */
134     VT_TRANSFER_TO_WFC = 0,
135     /**
136      * Indicates the code value of WFC transfer to VT is 1.
137      */
138     WFC_TRANSFER_TO_VT = 1,
139 };
140 
141 /**
142  * @brief Indicates the information of ImsCall.
143  */
144 struct ImsCallInfo {
145     /**
146      * Indicates the call phone number,its initial value is 0.
147      */
148     char phoneNum[kMaxNumberLength] = { 0 };
149     /**
150      * Indicates the slotId.
151      */
152     int32_t slotId = 0;
153     /**
154      * Indicates the video state,when the audio state is 0 represents audio and 1 represents video.
155      */
156     int32_t videoState = 0;
157     /**
158      * Indicates the call index and its initial value is 0.
159      */
160     int32_t index = 0;
161 };
162 
163 /**
164  * @brief Indicates the call status information.
165  */
166 struct ImsCurrentCall {
167     /**
168      * Indicates connection Index for use with, eg, AT+CHLD.
169      */
170     int32_t index = 0;
171     /**
172      * Indicates the call direction, The value 0 indicates mobile originated (MO) call,
173      * and the value 1 indicates mobile terminated (MT) call.
174      */
175     int32_t dir = 0;
176     /**
177      * Indicates the call state:
178      * - 0: activated state
179      * - 1: holding state
180      * - 2: MO call, dialing state
181      * - 3: MO call, alerting state
182      * - 4: MT call, incoming call state
183      * - 5: MT call, call waiting state
184      */
185     int32_t state = 0;
186     /**
187      * Indicates the call mode:
188      * - 0: voice call
189      * - 1: data call
190      * - 2: fax
191      */
192     int32_t mode = 0;
193     /**
194      * Indicates the multiparty call status:
195      * - 0: not one of multiparty (conference) call parties
196      * - 1: one of multiparty (conference) call parties
197      */
198     int32_t mpty = 0;
199     /**
200      * Identifies the service domain:
201      * - 0: CS domain phone
202      * - 1: IMS domain phone
203      */
204     int32_t voiceDomain = 0;
205     /**
206      * Indicates the call type:
207      * - 0: Voice call
208      * - 1: VT_TX Video call: send one-way video, two-way voice
209      * - 2: VT_RX Video call: one-way receiving video, two-way voice
210      * - 3: VT Video call: two-way video, two-way voice
211      */
212     ImsCallType callType = ImsCallType::TEL_IMS_CALL_TYPE_VOICE;
213     /**
214      * Indicates remote party number.
215      */
216     std::string number = "";
217     /**
218      * Indicates the type of address octet in integer format.
219      */
220     int32_t type = 0;
221     /**
222      * Indicates alphanumeric representation of <number> corresponding to the entry found in phonebook;
223      */
224     std::string alpha = "";
225 };
226 
227 /**
228  * @brief Indicates the call status information list.
229  */
230 struct ImsCurrentCallList {
231     /**
232      * Indicates the size of call status information list.
233      */
234     int32_t callSize = 0;
235     /**
236      * Indicates the ID of call status information list.
237      */
238     int32_t flag = 0;
239     /**
240      * Indicates the call status information list.
241      */
242     std::vector<ImsCurrentCall> calls {};
243 };
244 } // namespace Telephony
245 } // namespace OHOS
246 
247 #endif // TELEPHONY_IMS_CALL_TYPES_H
248