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_CALL_PARCEL_H 17 #define OHOS_RIL_CALL_PARCEL_H 18 19 #include "hril_base_parcel.h" 20 21 namespace OHOS { 22 namespace Telephony { 23 /** 24 * @brief Defines the dial information in 3GPP TS 27.007 V4.3.0 (2001-12) 7.7, 25 * AT + ATD 26 */ 27 struct DialInfo { 28 /** Request serial number. */ 29 int32_t serial = 0; 30 31 /** 32 * Type of address octet in integer format (refer TS 24.008 [8] 33 * subclauses 10.5.4.7); default 145 when dialling string includes 34 * international access code character "+", otherwise 129. 35 */ 36 std::string address = ""; 37 38 /** 39 * Calling Line Identification Restriction. From TS 27.007 V3.4.0 40 * (2000-03). 41 */ 42 int32_t clir = 0; 43 }; 44 45 /** 46 * @brief Defines the call status information in 3GPP TS 27.007 V4.3.0 47 * (2001-12) AT+CGDCONT. 48 */ 49 struct CallInfo { 50 /** 51 * Call identification number as described in 3GPP TS 22.030 [19] 52 * sub-clause 6.5.5.1. This number can be used in +CHLD command operations. 53 */ 54 int32_t index = 0; 55 56 /** Call direction. The value 0 indicates the calling party, and the value 57 * 1 indicates the called party. */ 58 int32_t dir = 0; 59 60 /** 61 * Indicates the call state: 62 * 0: activated state 63 * 1: call hold state 64 * 2: calling party, dialing state 65 * 3: calling party, ringback tone state 66 * 4: called party, incoming call state 67 * 5: called party, call waiting state 68 * 6: disconnected state 69 * 7: disconnecting state 70 * 8: idle state 71 */ 72 int32_t state = 0; 73 74 /** 75 * Indicates the call mode: 76 * 0: voice call 77 * 1: data call 78 * 2: fax 79 */ 80 int32_t mode = 0; 81 82 /** 83 * Indicates the Multi-party call status: 84 * 0: not a multi-party(conference) call 85 * 1: a multi-party(conference) call 86 */ 87 int32_t mpty = 0; 88 89 /** 90 * Indicates the call domain of the voice call: 91 * 0: CS domain 92 * 1: IP multimedia system (IMS) domain 93 */ 94 int32_t voiceDomain = 0; 95 96 /** 97 * Indicates the call type: 98 * 0: Voice call 99 * 1: Video call: send one-way video, two-way voice 100 * 2: Video call: one-way receiving video, two-way voice 101 * 3: Video call: two-way video, two-way voice 102 */ 103 int32_t callType = 0; 104 105 /** phone number in format specified by <type> */ 106 std::string number = ""; 107 108 /** 109 * Type of address octet in integer format (refer TS 24.008 [8] 110 * subclauses 10.5.4.7); default 145 when dialling string includes 111 * international access code character "+", otherwise 129. See 3GPP 112 * TS 27.007 V4.3.0 (2001-12) 6.1. 113 */ 114 int32_t type = 0; 115 116 /** 117 * Alphanumeric representation of <number> corresponding to the entry found 118 * in phonebook; used character set should be the one selected with command 119 * select TE character set +CSCS. 120 */ 121 std::string alpha = ""; 122 }; 123 124 /** 125 * @brief Defines the call status information list. 126 */ 127 struct CallInfoList { 128 /** The size of CallInfoList. */ 129 int32_t callSize = 0; 130 131 /** The ID of the call status information list. */ 132 int32_t flag = 0; 133 134 /** Call status information list. */ 135 std::vector<CallInfo> calls {}; 136 }; 137 138 /** 139 * @brief Defines the emergency information. 140 */ 141 struct EmergencyInfo { 142 /** Number index. */ 143 int32_t index = 0; 144 145 /** Total number of numbers. */ 146 int32_t total = 0; 147 148 /** Emergency call number in string format. */ 149 std::string eccNum = ""; 150 151 /** 152 * Emergency call type: 153 * 0: Interface message of initiating an emergency call 154 * 1: Bandit police 155 * 2: Rescue 156 * 4: Fire alarm 157 * 8: Marine Police 158 * 16: Alpine rescue 159 */ 160 int32_t category = 0; 161 162 /** 163 * Whether the number is valid with or without a card: 164 * 0: valid without card 165 * 1: Valid with card 166 */ 167 int32_t simpresent = 0; 168 169 /** Mobile country code. */ 170 std::string mcc = ""; 171 172 /** 173 * Distinguishes CS domain abnormal service status: 174 * 0: all States are valid 175 * 1: the CS domain is not in normal service 176 */ 177 int32_t abnormalService = 0; 178 }; 179 180 /** 181 * @brief Defines the emergency info list. 182 */ 183 struct EmergencyInfoList { 184 /** The size of the emergency info list. */ 185 int32_t callSize = 0; 186 187 /** The ID of emergency info list. */ 188 int32_t flag = 0; 189 190 /** Emergency info list. */ 191 std::vector<EmergencyInfo> calls {}; 192 }; 193 194 /** 195 * @brief Defines the call forwarding information. 196 */ 197 struct CallForwardSetInfo { 198 /** Request serial number. */ 199 int32_t serial = 0; 200 201 /** 202 * Call forwarding type: 203 * 0: call forwarding unconditional 204 * 1: call forwarding on busy 205 * 2: call forwarding on no reply 206 * 3: call forwarding not reachable (no network service, or power-off) 207 * 4: any call forwarding 208 * 5: any call forwarding conditional 209 */ 210 int32_t reason = 0; 211 212 /** 213 * Call forwarding operation mode: 214 * 0: deactivation 215 * 1: activation 216 * 2: status query 217 * 3: registration 218 * 4: deletion 219 */ 220 int32_t mode = 0; 221 222 /** Phone number. */ 223 std::string number = ""; 224 225 /** Service class. For details, see 3GPP TS 27.007. */ 226 int32_t classx = 0; 227 }; 228 229 /** 230 * @brief Defines the Unstructured Supplementary Data Service (USSD) 231 * information. 232 */ 233 struct UssdNoticeInfo { 234 /** 235 * Integer value. 236 * 0: The network does not require a TE reply (USSD-Notify initiated by the 237 * network or TE. The network does not need further information after 238 * starting operation); 239 * 1: The network needs a TE reply (USSD-Request initiated by the network, 240 * or TE sent After starting the operation, the network needs further 241 * information); 242 * 2: The USSD session is released by the network; 243 * 3: Other local clients have responded; 244 * 4: The operation is not supported; 245 * 5: The network timed out. 246 */ 247 int32_t m = 0; 248 /** USSD string, the maximum length is 160 characters. */ 249 std::string str = ""; 250 }; 251 252 /** 253 * @brief Defines the supplementary service information. 254 */ 255 struct SsNoticeInfo { 256 /** 257 * Service type: 258 * 0: call forwarding unconditional 259 * 1: call forwarding on busy 260 * 2: call forwarding on no reply 261 * 3: call forwarding not reachable (no network service, or power-off) 262 */ 263 int32_t serviceType = 0; 264 265 /** 266 * Request type: 267 * 0: deactivation 268 * 1: activated 269 * 2: status query 270 * 3: registration 271 * 4: deletion 272 */ 273 int32_t requestType = 0; 274 275 /** Service class. For details, see 3GPP TS 27.007. */ 276 int32_t serviceClass = 0; 277 278 /** Query result. For details, see {@link RilErrType}. */ 279 int32_t result = 0; 280 }; 281 282 /** 283 * @brief Active reporting of SRVCC status is controlled by the +CIREP command. 284 * 285 * This command complies with the 3GPP TS 27.007 protocol. 286 */ 287 struct SrvccStatus { 288 /** 289 * SRVCC status. 290 * 1: SRVCC starts; 291 * 2: SRVCC is successful; 292 * 3: SRVCC is cancelled; 293 * 4: SRVCC failed. 294 */ 295 int32_t status = 1; 296 }; 297 298 /** 299 * @brief ringback voice event reported by the modem during dialing. 300 * 301 * Modem private commands, not a reported field specified by the 3gpp 302 * protocol. 303 */ 304 struct RingbackVoice { 305 /** 0 network alerting; 1 local alerting */ 306 int32_t status = 0; 307 }; 308 } // namespace Telephony 309 } // namespace OHOS 310 #endif // OHOS_RIL_CALL_PARCEL_H 311