• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 CELLULAR_CALL_DATA_STRUCT_H
17 #define CELLULAR_CALL_DATA_STRUCT_H
18 
19 #include "call_manager_inner_type.h"
20 
21 namespace OHOS {
22 namespace Telephony {
23 enum CLIRMode {
24     DEFAULT = 0,
25     TRANSFER = 1,
26     INHIBITION = 2,
27 };
28 
29 struct DialRequestStruct {
30     std::string phoneNum;
31     CLIRMode clirMode;
32 };
33 
34 // GSM Association Non-confidential Official Document IR.92 - IMS Profile for Voice and SMS
35 struct ImsDialInfoStruct : public DialRequestStruct {
36     int32_t videoState; // 0: audio 1:video
37     bool bEmergencyCall;
38     bool bImsCallFirst;
39     bool bRoaming;
40 };
41 
42 enum MMIHandlerId {
43     EVENT_MMI_Id = 0,
44     EVENT_INQUIRE_MMI = 1,
45     EVENT_SET_MMI = 2,
46     EVENT_INQUIRE_CLIR_MMI = 3,
47     EVENT_INQUIRE_CALL_FORWARD_MMI = 4,
48     EVENT_SET_CALL_FORWARD_MMI = 5,
49     EVENT_DEAL_USSD_MMI = 6,
50 };
51 
52 /**
53  * 3GPP TS 22.030 V4.0.0 (2001-03)  6.5.2 Structure of the MMI
54  * The following sequence of functions shall be used for the control of Supplementary Services:
55  *  SELECT:	Entry of the procedure information (may be a digit or a sequence of characters).
56  *  SEND:	Transmission of the information to the network.
57  *  INDICATION:	Call progress indications.
58  */
59 struct MMIData {
60     std::string fullString;
61     std::string actionString;
62     std::string serviceCode;
63     // 3GPP TS 22.030 V4.0.0 (2001-03)  6.5.2 Structure of the MMI
64     // This structure consists of the following parts:
65     // Service Code, SC( (2 or 3 digits);
66     // Supplementary Information, SI (variable length).
67     std::string serviceInfoA;
68     std::string serviceInfoB;
69     std::string serviceInfoC;
70     std::string pwdString;
71     std::string dialString;
72 };
73 
74 /**
75  * 3GPP TS 22.030 V4.0.0 (2001-03)
76  * Tele- and Bearer Service Supplementary Information codes (SIb).
77 Alternate and speech/data services are included with the equivalent data service.
78 Basic Service
79 group number (note)	Telecommunication Service	MMI Service Code
80 1 to 12	        All tele and bearer services	no code required
81                 Teleservices
82 1 to 6, 12	    All teleservices	            10
83 1	            Telephony 	                    11
84 2 to 6	        All data teleservices	        12
85 6	            Facsimile services	            13
86 2	            Short Message Services	        16
87 1, 3 to 6, 12	All teleservices except SMS	    19
88 12	            Voice group services
89                 Voice Group Call Service (VGCS)	17
90                 Voice Broadcast Service (VBS)	18
91                 Bearer Service
92 7 to 11	        All bearer services	            20
93 7	            All async services	            21
94 8	            All sync services	            22
95 8	            All data circuit sync	        24
96 7	            All data circuit async	        25
97 13	            All GPRS bearer services	    99
98 */
99 enum CFServiceCode {
100     ALL_TELE_SERVICES = 10,
101     TELE_SERVICES = 11,
102     ALL_DATA_TELE_SERVICES = 12,
103     FACSIMILE_SERVICES = 13,
104     SHORT_MESSAGE_SERVICES = 16,
105     ALL_TELE_SERVICES_EXCEPT_SMS = 19,
106     ALL_BEARER_SERVICES = 20,
107     ALL_ASYNC_SERVICES = 21,
108     ALL_SYNC_SERVICES = 22,
109     ALL_DATA_CIRCUIT_SYNC = 24,
110     ALL_DATA_CIRCUIT_ASYNC = 25,
111     ALL_GPRS_BEARER_SERVICES = 99,
112 };
113 
114 /**
115 * 27007-430_2001 7.11	Call forwarding number and conditions +CCFC
116 * 3GPP TS 22.082 [4]
117 * <classx> is a sum of integers each representing a class of information (default 7):
118 * 1	voice (telephony)
119 * 2	data (refers to all bearer services; with <mode>=2 this may refer only to some bearer service if TA does
120 not support values 16, 32, 64 and 128)
121 * 4	fax (facsimile services)
122 * 8	short message service
123 * 16	data circuit sync
124 * 32	data circuit async
125 * 64	dedicated packet access
126 * 128	dedicated PAD access
127 */
128 enum CFInformation {
129     NONE = 0,
130     VOICE = 1,
131     FAX = 4,
132     SHORT_MESSAGE_SERVICE = 8,
133     DATA_CIRCUIT_SYNC = 16,
134     DATA_CIRCUIT_ASYNC = 32,
135     DEDICATED_PACKET_ACCESS = 64,
136     DEDICATED_PAD_ACCESS = 128,
137 };
138 
139 /**
140  * 3GPP TS 27.007 Vh.1.0 (2021-03)  8.74	List of current calls +CLCCS
141  * <neg_status>: integer type as defined in the +CCMMD command.
142  * 0	The parameter <neg_status> has no valid content. Parameter <SDP_md> is set to an empty string ("").
143  * 1	The <SDP_md> parameter describes the active media in the call.
144  * 2	The <SDP_md> parameter describes a proposed but not yet active new set of media for the call.
145  * 3	A proposed new set of media for the call was accepted by the remote party. The <SDP_md> parameter describes
146  * the active media in the call (if any).
147  * 4	A proposed new set of media for the call was rejected by the remote
148  * party. The <SDP_md> parameter describes the active media in the call (if any)
149  */
150 enum NegStatus {
151     NEG_INVALID = 0,
152     NEG_ACTIVE = 1,
153     NEG_PROPOSE = 2,
154     NEG_ACCEPT = 3,
155     NEG_REJECT = 4,
156 };
157 
158 /**
159  * 3GPP TS 27.007 Vh.1.0 (2021-03)  8.74	List of current calls +CLCCS
160  * <cs_mode>: integer type (bearer/teleservice)
161 0	no relevant information about bearer/teleservice
162 1	voice
163 2	data
164 3	fax
165 4	voice followed by data, voice mode
166 5	alternating voice/data, voice mode
167 6	alternating voice/fax, voice mode
168 7	voice followed by data, data mode
169 8	alternating voice/data, data mode
170 9	alternating voice/fax, fax mode
171 255	unknown
172  */
173 enum CsMode {
174     NO_INFORMATION = 0,
175     MODE_VOICE = 1,
176     MODE_DATA = 2,
177     MODE_FAX = 3,
178     VOICE_FOLLOWED_DATA = 4,
179     VOICE_DATA_ALTERNATE = 5,
180     VOICE_FAX_ALTERNATE = 6,
181     VOICE_FOLLOWED_DATA_MODE_DATA = 7,
182     VOICE_DATA_ALTERNATE_MODE_DATA = 8,
183     VOICE_FAX_ALTERNATE_MODE_FAX = 9,
184     UNKNOWN = 255,
185 };
186 
187 /**
188  * 3GPP TS 27.007 Vh.1.0 (2021-03)  8.74	List of current calls +CLCCS
189  * <ccstatus>: integer type. Indicating the state of the call.
190 1	Idle
191 2	Calling (MO); the call setup has been started
192 3	Connecting (MO); the call is in progress
193 4	Alerting (MO): an alert indication has been received
194 5	Alerting (MT); an alert indication has been sent
195 6	Active; the connection is established
196 7	Released; an outgoing (MO) call is released.
197 8	Released; an incoming (MT) call is released
198 9	User Busy
199 10	User Determined User Busy
200 11	Call Waiting (MO)
201 12	Call Waiting (MT)
202 13	Call Hold (MO)
203 14	Call Hold (MT)
204  */
205 enum CCstatus {
206     IDLE = 1,
207     DIALING = 2,
208     CONNECTING = 3,
209     MO_ALERTING = 4,
210     MT_ALERTING = 5,
211     ACTIVE = 6,
212     MO_RELEASED = 7,
213     MT_RELEASED = 8,
214     USER_BUSY = 9,
215     USER_DETERMINED_USER_BUSY = 10,
216     MO_CALL_WAITING = 11,
217     MT_CALL_WAITING = 12,
218     MO_CALL_HOLD = 13,
219     MT_CALL_HOLD = 14,
220 };
221 
222 /**
223  * 3GPP TS 27.007 Vh.1.0 (2021-03)  8.74	List of current calls +CLCCS
224  * <dir>: integer type
225 0	mobile originated (MO) call
226 1	mobile terminated (MT) call
227 
228  <neg_status_present>: integer type. Indicates whether parameter <neg_status> has any valid information.
229 0	No valid information in parameter <neg_status>. Parameter <neg_status> is set to zero.
230 1	Valid information in parameter <neg_status>
231 
232  <SDP_md>: string type represented with IRA characters. SDP media description as per the +CDEFMP command. This
233 parameter shall not be subject to conventional character conversion as per +CSCS. This parameter will be an empty
234 string ("") if the call has no multimedia content
235 
236  <mpty>: integer type
237 0	call is not one of multiparty (conference) call parties
238 1	call is one of multiparty (conference) call parties
239 
240  <numbertype>: integer type. Indicating type of information in parameter <number>.
241 0	No valid information in parameter <number>
242 1	Number in <number> according to URI including the prefix specifying the URI type (see command +CDU). Parameter
243  <ton> has no relevant information and is set to zero. 2	Number in <number> according to one of the formats
244 supported by 3GPP TS 24.008 [8] subclause 10.5.4.7)
245 
246  <ton>: type of number in integer format (refer 3GPP TS 24.008[8] subclause 10.5.4.7). The parameter is also set to
247 zero when it has no meaningful content, e.g. when <numbertype>=1.
248 
249  <number>: string type phone number in format specified by <numbertype>. This parameter shall not be subject to
250  conventional character conversion as per +CSCS.
251 
252  <priority_present>: integer type. Indicates whether parameter <priority> has any valid information.
253  0	No valid information in parameter <priority>. Parameter
254 <priority> is set to zero.
255  1	Valid information in parameter <priority>.
256 
257  <priority>: integer type parameter
258 indicating the eMLPP priority level of the call, values specified in 3GPP TS 22.067 [54].
259 
260  <CLI_validity_present>: integer type. Indicates whether parameter <CLI_validity> has any valid information.
261 0	No valid information in parameter <CLI_validity>. Parameter <priority> is set to zero.
262 1	Valid information in parameter <CLI_validity>
263  */
264 struct ImsCallInfoResponse {
265     int32_t index;
266     bool mt;
267     bool negStatusPresent;
268     NegStatus negStatus;
269     char sdpMd[kMaxNumberLen];
270     CsMode csMode;
271     TelCallState state;
272     bool mpty;
273     int32_t numberType;
274     int32_t ton;
275     char number[kMaxNumberLen];
276     bool priorityPresent;
277     int32_t priority;
278     bool cliValidityPresent;
279     CallType callType; // call type: CS、IMS
280     int32_t videoState; // 0: audio 1:video
281 };
282 
283 enum ImsHandleId {
284     IMS_RADIO_CALL_STATE = 2001,
285     IMS_RADIO_AVAIL,
286     IMS_RADIO_NOT_AVAIL,
287     IMS_RADIO_CURRENT_CALLS,
288 };
289 } // namespace Telephony
290 } // namespace OHOS
291 
292 #endif // CELLULAR_CALL_DATA_STRUCT_H