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