• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021-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 OHOS_RIL_VENDOR_CALL_DEFS_H
17 #define OHOS_RIL_VENDOR_CALL_DEFS_H
18 
19 #include <stddef.h>
20 
21 #include "hril_enum.h"
22 #include "hril_public_struct.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /* From 3GPP TS 27.007 V4.3.0 (2001-12)  AT+CGDCONT */
29 typedef struct {
30     int32_t index; /* Call identification number as described in 3GPP TS 22.030 [19] sub-clause 6.5.5.1.
31                     * This number can be used in +CHLD command operations */
32     int32_t dir; /* 0 mobile originated (MO) call
33                   * 1 mobile terminated (MT) call */
34     HRilCallState state; /* call state */
35     HRilCallMode mode; /* call mode */
36     int32_t mpty; /* 0 call is not one of multiparty (conference) call parties
37                    * 1 call is one of multiparty (conference) call parties */
38     int32_t voiceDomain; /* Identifies the service domain.
39                           * 0: CS domain phone
40                           * 1: IMS domain phone */
41     int32_t callType; /* 0: voice call
42                        * 1: Video call: send one-way video, two-way voice
43                        * 2: Video call: one-way receiving video, two-way voice
44                        * 3: Video call: two-way video, two-way voice */
45     char *number; /* phone number in format specified by <type> */
46 
47     int32_t type; /* Type of address octet in integer format (refer TS 24.008 [8] subclauses 10.5.4.7);
48                    * default 145 when dialling string includes international access code character "+",
49                    * otherwise 129. see 3GPP TS 27.007 V4.3.0 (2001-12) 6.1 */
50     char *alpha; /* alphanumeric representation of <number> corresponding to the entry found in phonebook;
51                   * used character set should be the one selected with command select TE character set +CSCS */
52 } HRilCallInfo;
53 
54 /* From 3GPP TS 27.007 V4.3.0 (2001-12) ATD%s%s */
55 typedef struct {
56     char *address; /* Type of address octet in integer format (refer TS 24.008 [8] subclauses 10.5.4.7);
57                     * default 145 when dialling string includes international access code character "+", otherwise
58                     * 129. */
59     int32_t clir; /* This command refers to CLIR service according to 3GPP TS 22.081 [3] that allows a calling
60                    * subscriber to enable or disable the presentation of the CLI to the called party when originating
61                    * a call. <n> (parameter sets the adjustment for outgoing calls): 0	presentation indicator is used
62                    * according to the subscription of the CLIR service 1	CLIR invocation 2	CLIR suppression <m>
63                    * (parameter shows the subscriber CLIR service status in the network): 0	CLIR not provisioned 1
64                    * CLIR provisioned in permanent mode 2	unknown (e.g. no network, etc.) 3	CLIR temporary mode
65                    * presentation restricted 4	CLIR temporary mode presentation allowed */
66 } HRilDial;
67 
68 typedef struct {
69     int32_t reason; /* call forwarding type <0-5> */
70     int32_t mode; /* call forwarding operation mode */
71     char *number; /* phone number */
72     int32_t classx; /* is a sum of integers each representing a class of information default 255
73                      *  1	voice (telephony)
74                      *  2	data (refers to all bearer services; with <mode>=2 this may refer only
75                      *      to some bearer service if TA does not support values 16, 32, 64 and 128)
76                      *  4	fax (facsimile services)
77                      *  8	short message service
78                      *  16	data circuit sync
79                      *  32	data circuit async
80                      *  64	dedicated packet access
81                      *  128	dedicated PAD access
82                      */
83     int32_t time; /* when "no reply" is enabled or queried, this gives the time in seconds to wait
84                    * before call is forwarded, default value 20
85                    */
86     int32_t status; /* 0: not active, 1: active */
87 } HRilCFInfo;
88 
89 typedef struct {
90     int32_t callId;
91     const char *dtmfKey;
92     int32_t onLength;
93     int32_t offLength;
94     int32_t stringLength;
95 } CallDtmfInfo;
96 
97 typedef struct {
98     const char *fac;
99     int32_t mode;
100     const char *password;
101 } CallRestrictionInfo;
102 
103 typedef struct {
104     const char *fac;
105     const char *oldPassword;
106     const char *newPassword;
107 } HRilSetBarringInfo;
108 
109 typedef struct {
110     int32_t reason; /* call forwarding type <0-5> */
111     int32_t status;
112     int32_t classx;
113     char *number;
114     int32_t type; /* default 145 when dialling string includes international access code
115                    * character "+", otherwise 129,
116                    * other value refer TS 24.008 [8] sub-clause 10.5.4.7
117                    */
118     int32_t time;
119 } HRilCFQueryInfo;
120 
121 typedef struct {
122     int32_t action; /* parameter sets/shows the result code presentation status in the TA */
123     int32_t clipStat; /* parameter shows the subscriber CLIP service status in the network, <0-4> */
124 } HRilGetClipResult;
125 
126 typedef struct {
127     int32_t action; /* parameter sets/shows the result code presentation status in the TA */
128     int32_t clirStat; /* parameter shows the subscriber CLIP service status in the network, <0-4> */
129 } HRilGetCallClirResult;
130 
131 typedef struct {
132     int32_t status; /* 0 or 1 */
133     /**
134      * 1: voice (telephony);
135      * 2: data;
136      * 4: fax (facsimile services);
137      * 8: short message service;
138      * 16: data circuit sync;
139      * 32: data circuit async;
140      * 64: dedicated packet access;
141      * 128: dedicated PAD access.
142      */
143     int32_t classCw;
144 } HRilCallWaitResult;
145 
146 typedef struct {
147     int32_t status; /* 0 or 1 */
148     /**
149      * 1: voice (telephony);
150      * 2: data;
151      * 4: fax (facsimile services);
152      * 8: short message service;
153      * 16: data circuit sync;
154      * 32: data circuit async;
155      * 64: dedicated packet access;
156      * 128: dedicated PAD access.
157      */
158     int32_t classCw;
159 } HRilCallRestrictionResult;
160 
161 typedef struct {
162     int32_t m; /* Integer value.
163                             0: The network does not require a TE reply (USSD-Notify initiated by the network or TE
164                             The network does not need further information after starting operation);
165                             1: The network needs a TE reply (USSD-Request initiated by the network, or TE sent
166                             After starting the operation, the network needs further information);
167                             2: The USSD session is released by the network;
168                             3: Other local clients have responded;
169                             4: The operation is not supported;
170                             5: The network timed out. */
171     char *str; /* USSD string, the maximum length is 160 characters. */
172 } HRilUssdNoticeInfo;
173 
174 typedef struct {
175     int32_t serviceType;
176     int32_t requestType;
177     int32_t serviceClass;
178     int32_t result; /* the result of the SS request */
179 } HRilSsNoticeInfo;
180 
181 typedef struct {
182     int32_t index; /* Number index */
183     int32_t total; /*  Total number of numbers */
184     char *eccNum; /*  Emergency call number in string format */
185     int32_t category; /*  Emergency call type
186                                             0: interface message of initiating an emergency call
187                                             1: Bandit police
188                                             2: Rescue
189                                             4: Fire alarm
190                                             8: Marine Police
191                                             16: Alpine rescue */
192     int32_t simpresent; /*  the number is valid with or without a card
193                                                 0: valid without card
194                                                 1: Valid with card */
195     char *mcc; /* Country code */
196     int32_t abnormalService; /* distinguishes CS domain abnormal service status
197                                                                 0: all States are valid
198                                                                 1: the CS domain is not in normal service */
199 } HRilEmergencyInfo;
200 
201 /*
202  * Active reporting of SRVCC status is controlled by the +CIREP command.
203  * This command complies with the 3GPP TS 27.007 protocol.
204  */
205 typedef struct {
206     /*
207      * SRVCC status.
208      *  1: SRVCC starts;
209      *   2: SRVCC is successful;
210      *   3: SRVCC is cancelled;
211      *   4: SRVCC failed.
212      */
213     int32_t status;
214 } HRilCallSrvccStatus;
215 
216 /*
217  * Query the bandwidth information of the voice channel during the call.
218  * Note: Modem private commands, not a reported field specified by the 3gpp protocol.
219  */
220 typedef struct {
221     /**
222      * Integer value, voice channel type:
223      *   0: No in-band audio information;
224      *   1: In-band voice is available, narrowband voice;
225      *   2: In-band voice is available, broadband voice.
226      */
227     int32_t status;
228     /**
229      * Integer value, call domain of voice call:
230      *   0: 3GPP CS domain voice call;
231      *   1: IMS domain voice call;
232      *   2: 3GPP2 CS domain voice call.
233      */
234     int32_t voiceDomain;
235 } HRilCallCsChannelInfo;
236 
237 typedef struct {
238     void (*GetCallList)(const ReqDataInfo *requestInfo);
239     void (*Dial)(const ReqDataInfo *requestInfo, const HRilDial *data, size_t dataLen);
240     void (*Hangup)(const ReqDataInfo *requestInfo, const uint32_t *data, size_t dataLen);
241     void (*Reject)(const ReqDataInfo *requestInfo);
242     void (*Answer)(const ReqDataInfo *requestInfo);
243     void (*GetClip)(const ReqDataInfo *requestInfo);
244     void (*SetClip)(const ReqDataInfo *requestInfo, int32_t action);
245     void (*HoldCall)(const ReqDataInfo *requestInfo);
246     void (*UnHoldCall)(const ReqDataInfo *requestInfo);
247     void (*SwitchCall)(const ReqDataInfo *requestInfo);
248     void (*CombineConference)(const ReqDataInfo *requestInfo, int32_t callType);
249     void (*SeparateConference)(const ReqDataInfo *requestInfo, int32_t callIndex, int32_t callType);
250     void (*CallSupplement)(const ReqDataInfo *requestInfo, int32_t type);
251     void (*GetCallWaiting)(const ReqDataInfo *requestInfo);
252     void (*SetCallWaiting)(const ReqDataInfo *requestInfo, int32_t active);
253     void (*SetCallTransferInfo)(const ReqDataInfo *requestInfo, HRilCFInfo info);
254     void (*GetCallTransferInfo)(const ReqDataInfo *requestInfo, int32_t reason);
255     void (*GetCallRestriction)(const ReqDataInfo *requestInfo, const char *fac);
256     void (*SetCallRestriction)(const ReqDataInfo *requestInfo, CallRestrictionInfo info);
257     void (*GetClir)(const ReqDataInfo *requestInfo);
258     void (*SetClir)(const ReqDataInfo *requestInfo, int32_t action);
259     void (*StartDtmf)(const ReqDataInfo *requestInfo, CallDtmfInfo info);
260     void (*SendDtmf)(const ReqDataInfo *requestInfo, CallDtmfInfo info);
261     void (*StopDtmf)(const ReqDataInfo *requestInfo, CallDtmfInfo info);
262     void (*GetImsCallList)(const ReqDataInfo *requestInfo);
263     void (*GetCallPreferenceMode)(const ReqDataInfo *requestInfo);
264     void (*SetCallPreferenceMode)(const ReqDataInfo *requestInfo, int32_t mode);
265     void (*GetLteImsSwitchStatus)(const ReqDataInfo *requestInfo);
266     void (*SetLteImsSwitchStatus)(const ReqDataInfo *requestInfo, int32_t active);
267     void (*SetUssd)(const ReqDataInfo *requestInfo, const char *str);
268     void (*GetUssd)(const ReqDataInfo *requestInfo);
269     void (*SetMute)(const ReqDataInfo *requestInfo, int32_t mute);
270     void (*GetMute)(const ReqDataInfo *requestInfo);
271     void (*GetEmergencyCallList)(const ReqDataInfo *requestInfo);
272     void (*GetCallFailReason)(const ReqDataInfo *requestInfo);
273     void (*SetEmergencyCallList)(const ReqDataInfo *requestInfo, HRilEmergencyInfo *emergencyInfo, const int len);
274     void (*SetBarringPassword)(const ReqDataInfo *requestInfo, HRilSetBarringInfo info);
275 } HRilCallReq;
276 #ifdef __cplusplus
277 }
278 #endif
279 #endif // OHOS_RIL_VENDOR_CALL_DEFS_H
280