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