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 CALL_MANAGER_INNER_TYPE_H 17 #define CALL_MANAGER_INNER_TYPE_H 18 19 #include <algorithm> 20 #include <cstdio> 21 #include <ctime> 22 #include <string> 23 #include <vector> 24 25 namespace OHOS { 26 namespace Telephony { 27 /** 28 * @brief Indicates Maximum length of a string. 29 */ 30 constexpr int16_t kMaxNumberLen = 100; 31 /** 32 * @brief Indicates Maximum length of a bundle name. 33 */ 34 constexpr int16_t kMaxBundleNameLen = 100; 35 /** 36 * @brief Indicates Maximum length of a address. 37 */ 38 constexpr int16_t kMaxAddressLen = 100; 39 /** 40 * @brief Indicates Maximum length of the reject call message. 41 */ 42 constexpr uint16_t REJECT_CALL_MSG_MAX_LEN = 300; 43 /** 44 * @brief Indicates Maximum length of the account number. 45 */ 46 constexpr uint16_t ACCOUNT_NUMBER_MAX_LENGTH = 100; 47 /** 48 * @brief Indicates Maximum duration(ms) when connect service. 49 */ 50 constexpr uint16_t CONNECT_SERVICE_WAIT_TIME = 1000; 51 /** 52 * @brief Indicates the main call id is invalid. 53 */ 54 constexpr int16_t ERR_ID = -1; 55 /** 56 * @brief Indicates the call id is invalid. 57 */ 58 constexpr int16_t INVALID_CALLID = 0; 59 /** 60 * @brief Indicates one second duration. 61 */ 62 constexpr int16_t WAIT_TIME_ONE_SECOND = 1; 63 /** 64 * @brief Indicates No Call Exist. 65 */ 66 constexpr int16_t NO_CALL_EXIST = 0; 67 /** 68 * @brief Indicates One Call Exist. 69 */ 70 constexpr int16_t ONE_CALL_EXIST = 1; 71 /** 72 * @brief The follow hour and minute was use to confirm the set 73 * call transfer beginning and ending time restriction. 74 * 75 * MIN_HOUR: the minimum hour value. 76 * MAX_HOUR: the maximum hour value. 77 * MIN_MINUTE: the minimum minute value. 78 * MAX_MINUTE: the maximum minute value. 79 * INVALID_TIME: the time value is invalid. 80 */ 81 constexpr int16_t MIN_HOUR = 0; 82 constexpr int16_t MAX_HOUR = 24; 83 constexpr int16_t MIN_MINUTE = 0; 84 constexpr int16_t MAX_MINUTE = 60; 85 constexpr int16_t INVALID_TIME = -1; 86 87 /** 88 * @brief Indicates the type of call, includs CS, IMS, OTT, OTHER. 89 */ 90 enum class CallType { 91 /** 92 * Indicates the call type is CS. 93 */ 94 TYPE_CS = 0, 95 /** 96 * Indicates the call type is IMS. 97 */ 98 TYPE_IMS = 1, 99 /** 100 * Indicates the call type is OTT. 101 */ 102 TYPE_OTT = 2, 103 /** 104 * Indicates the call type is OTHER. 105 */ 106 TYPE_ERR_CALL = 3, 107 }; 108 109 /** 110 * @brief Indicates the detailed state of call. 111 */ 112 enum class TelCallState { 113 /** 114 * Indicates the call is unknown. 115 */ 116 CALL_STATUS_UNKNOWN = -1, 117 /** 118 * Indicates the call is active. 119 */ 120 CALL_STATUS_ACTIVE = 0, 121 /** 122 * Indicates the call is holding. 123 */ 124 CALL_STATUS_HOLDING, 125 /** 126 * Indicates the call is dialing. 127 */ 128 CALL_STATUS_DIALING, 129 /** 130 * Indicates the call is alerting. 131 */ 132 CALL_STATUS_ALERTING, 133 /** 134 * Indicates the call is incoming. 135 */ 136 CALL_STATUS_INCOMING, 137 /** 138 * Indicates the call is waiting. 139 */ 140 CALL_STATUS_WAITING, 141 /** 142 * Indicates the call is disconnected. 143 */ 144 CALL_STATUS_DISCONNECTED, 145 /** 146 * Indicates the call is disconnecting. 147 */ 148 CALL_STATUS_DISCONNECTING, 149 /** 150 * Indicates the call is idle. 151 */ 152 CALL_STATUS_IDLE, 153 }; 154 155 /** 156 * @brief Indicates the state of conference call. 157 */ 158 enum class TelConferenceState { 159 /** 160 * Indicates the state is idle. 161 */ 162 TEL_CONFERENCE_IDLE = 0, 163 /** 164 * Indicates the state is active. 165 */ 166 TEL_CONFERENCE_ACTIVE, 167 /** 168 * Indicates the state is hold. 169 */ 170 TEL_CONFERENCE_HOLDING, 171 /** 172 * Indicates the state is disconnecting. 173 */ 174 TEL_CONFERENCE_DISCONNECTING, 175 /** 176 * Indicates the state is disconnected. 177 */ 178 TEL_CONFERENCE_DISCONNECTED, 179 }; 180 181 /** 182 * @brief Indicates the Network type. 183 */ 184 enum class PhoneNetType { 185 /** 186 * Indicates the Network type is GSM. 187 */ 188 PHONE_TYPE_GSM = 1, 189 /** 190 * Indicates the Network type is CDMA. 191 */ 192 PHONE_TYPE_CDMA = 2, 193 }; 194 195 /** 196 * @brief Indicates the type of video state. 197 */ 198 enum class VideoStateType { 199 /** 200 * Indicates the call is in voice state. 201 */ 202 TYPE_VOICE = 0, 203 /** 204 * Indicates the call is in video state. 205 */ 206 TYPE_VIDEO, 207 }; 208 209 /** 210 * @brief Indicates the scenarios of the call to be made. 211 */ 212 enum class DialScene { 213 /** 214 * Indicates this is a common call. 215 */ 216 CALL_NORMAL = 0, 217 /** 218 * Indicates this is a privileged call. 219 */ 220 CALL_PRIVILEGED, 221 /** 222 * Indicates this is an emergency call. 223 */ 224 CALL_EMERGENCY, 225 }; 226 227 /** 228 * @brief Indicates the call is MO or MT. 229 */ 230 enum class CallDirection { 231 /** 232 * Indicates the call is a incoming call. 233 */ 234 CALL_DIRECTION_IN = 0, 235 /** 236 * Indicates the call is a outgoing call. 237 */ 238 CALL_DIRECTION_OUT, 239 /** 240 * Indicates the call is unknown. 241 */ 242 CALL_DIRECTION_UNKNOW, 243 }; 244 245 /** 246 * @brief Indicates the call state in progress. 247 */ 248 enum class CallRunningState { 249 /** 250 * Indicates to create a new call session. 251 */ 252 CALL_RUNNING_STATE_CREATE = 0, 253 /** 254 * Indicates the call state is in connecting. 255 */ 256 CALL_RUNNING_STATE_CONNECTING, 257 /** 258 * Indicates the call state is in dialing. 259 */ 260 CALL_RUNNING_STATE_DIALING, 261 /** 262 * Indicates the call state is in ringing. 263 */ 264 CALL_RUNNING_STATE_RINGING, 265 /** 266 * Indicates the call state is in active. 267 */ 268 CALL_RUNNING_STATE_ACTIVE, 269 /** 270 * Indicates the call state is in hold. 271 */ 272 CALL_RUNNING_STATE_HOLD, 273 /** 274 * Indicates the call state is ended. 275 */ 276 CALL_RUNNING_STATE_ENDED, 277 /** 278 * Indicates the call state is in ending. 279 */ 280 CALL_RUNNING_STATE_ENDING, 281 }; 282 283 /** 284 * @brief Indicates the cause of the ended call. 285 */ 286 enum class CallEndedType { 287 /** 288 * Indicates the cause is unknown. 289 */ 290 UNKNOWN = 0, 291 /** 292 * Indicates the cause is phone busy. 293 */ 294 PHONE_IS_BUSY, 295 /** 296 * Indicates the cause is invalid phone number. 297 */ 298 INVALID_NUMBER, 299 /** 300 * Indicates the call is ended normally. 301 */ 302 CALL_ENDED_NORMALLY, 303 }; 304 305 /** 306 * @brief Indicates the information of SIM card. 307 */ 308 struct SIMCardInfo { 309 /** 310 * Indicates the SIM ICC id. 311 */ 312 int32_t simId = 0; 313 /** 314 * Indicated the country to which the SIM card belongs. 315 */ 316 int32_t country = 0; 317 /** 318 * Indicates wether the SIM card is active. 319 */ 320 int32_t state = 0; 321 /** 322 * Indicates the Network type. 323 */ 324 PhoneNetType phoneNetType = PhoneNetType::PHONE_TYPE_GSM; 325 }; 326 327 /** 328 * @brief Indicates the dialing call type. 329 */ 330 enum class DialType { 331 /** 332 * Indicates the dialing call type is normal cellular call. 333 */ 334 DIAL_CARRIER_TYPE = 0, 335 /** 336 * Indicates the dialing call type is voice mail. 337 */ 338 DIAL_VOICE_MAIL_TYPE, 339 /** 340 * Indicates the dialing call type is OTT. 341 */ 342 DIAL_OTT_TYPE, 343 }; 344 345 /** 346 * @brief Indicates the call state which will report to APP. 347 */ 348 enum class CallStateToApp { 349 /** 350 * Indicates an invalid state, which is used when the call state 351 * fails to be obtained. 352 */ 353 CALL_STATE_UNKNOWN = -1, 354 355 /** 356 * Indicates that there is no ongoing call. 357 */ 358 CALL_STATE_IDLE = 0, 359 360 /** 361 * Indicates that an incoming call is ringing or waiting. 362 */ 363 CALL_STATE_RINGING = 1, 364 365 /** 366 * Indicates that a least one call is in the dialing, active, or hold 367 * state, and there is no new incoming call ringing or waiting. 368 */ 369 CALL_STATE_OFFHOOK = 2 370 }; 371 372 /** 373 * @brief Indicates the cause when the call is answered. 374 */ 375 enum class CallAnswerType { 376 /** 377 * Indicates the call answer is call missed. 378 */ 379 CALL_ANSWER_MISSED = 0, 380 /** 381 * Indicates the call answer is call active. 382 */ 383 CALL_ANSWER_ACTIVED, 384 /** 385 * Indicates the call answer is call rejected. 386 */ 387 CALL_ANSWER_REJECT, 388 }; 389 390 /** 391 * @brief Indicates the detail information of a call. 392 */ 393 struct CallAttributeInfo { 394 /** 395 * Indicates the call phone number. 396 */ 397 char accountNumber[kMaxNumberLen + 1] = { 0 }; 398 /** 399 * Indicates the bundle name. 400 */ 401 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 402 /** 403 * Indicates whether the speaker phone is on. 404 */ 405 bool speakerphoneOn = false; 406 int32_t accountId = 0; 407 /** 408 * Indicates the type of video state. {@link VideoStateType} 409 */ 410 VideoStateType videoState = VideoStateType::TYPE_VOICE; 411 /** 412 * Indicates the Call start time. 413 */ 414 int64_t startTime = 0; 415 /** 416 * Indicates whether the call is emergency call. 417 */ 418 bool isEcc = false; 419 /** 420 * Indicates the type of call, includs CS, IMS, OTT, OTHER. {@link CallType} 421 */ 422 CallType callType = CallType::TYPE_ERR_CALL; 423 /** 424 * Indicates the call index. 425 */ 426 int32_t callId = 0; 427 /** 428 * Indicates the detailed state of call. {@link TelCallState} 429 */ 430 TelCallState callState = TelCallState::CALL_STATUS_UNKNOWN; 431 /** 432 * Indicates the state of conference call. {@link TelConferenceState} 433 */ 434 TelConferenceState conferenceState = TelConferenceState::TEL_CONFERENCE_IDLE; 435 /** 436 * Indicates the call beginning and ending time. 437 */ 438 time_t callBeginTime = 0; 439 time_t callEndTime = 0; 440 time_t ringBeginTime = 0; 441 time_t ringEndTime = 0; 442 /** 443 * Indicates the call is MO or MT. {@link CallDirection} 444 */ 445 CallDirection callDirection = CallDirection::CALL_DIRECTION_UNKNOW; 446 /** 447 * Indicates the cause when the call is answered. {@link CallAnswerType} 448 */ 449 CallAnswerType answerType = CallAnswerType::CALL_ANSWER_MISSED; 450 /* 451 * Indicates the call index in cellular call 452 */ 453 int32_t index = 0; 454 }; 455 456 /** 457 * @brief Indicates the detail information of call record. 458 */ 459 struct CallRecordInfo { 460 /** 461 * Indicates the call index. 462 */ 463 int32_t callId = 0; 464 /** 465 * Indicates the call phone number. 466 */ 467 char phoneNumber[kMaxNumberLen + 1] = { 0 }; 468 /** 469 * Indicates the phone number after formatted. 470 */ 471 char formattedPhoneNumber[kMaxNumberLen + 1] = { 0 }; 472 /** 473 * Indicates the type of call, includs CS, IMS, OTT, OTHER. {@link CallType} 474 */ 475 CallType callType = CallType::TYPE_ERR_CALL; 476 /** 477 * Indicates the call beginning time. 478 */ 479 time_t callBeginTime = 0; 480 /** 481 * Indicates the call ending time. 482 */ 483 time_t callEndTime = 0; 484 /** 485 * Indicates the call ring duration. 486 */ 487 uint32_t ringDuration = 0; 488 /** 489 * Indicates the call session duration. 490 */ 491 uint32_t callDuration = 0; 492 /** 493 * Indicates the call is MO or MT. {@link CallDirection} 494 */ 495 CallDirection directionType = CallDirection::CALL_DIRECTION_UNKNOW; 496 /** 497 * Indicates the cause when the call is answered. {@link CallAnswerType} 498 */ 499 CallAnswerType answerType = CallAnswerType::CALL_ANSWER_MISSED; 500 /** 501 * Indicates the country code of the call. 502 */ 503 int32_t countryCode = 0; 504 /** 505 * Indicates the slot id. 506 */ 507 int32_t slotId = 0; 508 CallRecordInfoCallRecordInfo509 CallRecordInfo() {} 510 CallRecordInfoCallRecordInfo511 CallRecordInfo(const CallRecordInfo &temp) 512 { 513 *this = temp; 514 } 515 516 CallRecordInfo &operator=(const CallRecordInfo &temp) 517 { 518 callId = temp.callId; 519 std::copy(std::begin(temp.phoneNumber), std::end(temp.phoneNumber), std::begin(phoneNumber)); 520 std::copy(std::begin(temp.formattedPhoneNumber), std::end(temp.formattedPhoneNumber), 521 std::begin(formattedPhoneNumber)); 522 callType = temp.callType; 523 callBeginTime = temp.callBeginTime; 524 callEndTime = temp.callEndTime; 525 ringDuration = temp.ringDuration; 526 callDuration = temp.callDuration; 527 directionType = temp.directionType; 528 answerType = temp.answerType; 529 countryCode = temp.countryCode; 530 slotId = temp.slotId; 531 return *this; 532 } 533 }; 534 535 /** 536 * @brief Indicates the event ID of call ability. 537 */ 538 enum class CallAbilityEventId { 539 /** 540 * Indicates that there is no available carrier during dialing. 541 */ 542 EVENT_DIAL_NO_CARRIER = 1, 543 /** 544 * Indicates that FDN is invalid. 545 */ 546 EVENT_INVALID_FDN_NUMBER, 547 /** 548 * Indicates that the OTT is not supported. 549 */ 550 EVENT_OTT_FUNCTION_UNSUPPORTED, 551 }; 552 553 /** 554 * @brief Indicates the call event detail information. 555 */ 556 struct CallEventInfo { 557 /** 558 * Indicates the event ID of call ability. {@link CallAbilityEventId} 559 */ 560 CallAbilityEventId eventId = CallAbilityEventId::EVENT_DIAL_NO_CARRIER; 561 /** 562 * Indicates the call phone number. 563 */ 564 char phoneNum[kMaxNumberLen + 1] = { 0 }; 565 /** 566 * Indicates the bundle name. 567 */ 568 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 569 }; 570 571 struct AccountInfo { 572 int32_t accountId = 0; 573 int32_t power = 0; 574 char bundleName[kMaxNumberLen + 1] = { 0 }; 575 bool isEnabled = false; 576 }; 577 578 /** 579 * @brief Indicates the call report information. 580 */ 581 struct CallReportInfo { 582 int32_t index = 0; 583 /** 584 * Indicates the call phone number. 585 */ 586 char accountNum[kMaxNumberLen + 1] = { 0 }; 587 int32_t accountId = 0; 588 /** 589 * Indicates the type of call, includs CS, IMS, OTT, OTHER. {@link CallType} 590 */ 591 CallType callType = CallType::TYPE_ERR_CALL; 592 /** 593 * Indicates the type of video state. {@link VideoStateType} 594 */ 595 VideoStateType callMode = VideoStateType::TYPE_VOICE; 596 /** 597 * Indicates the detailed state of call. {@link TelCallState} 598 */ 599 TelCallState state = TelCallState::CALL_STATUS_UNKNOWN; 600 /** 601 * Indicates the voica domain, 0: CS, 1: IMS 602 */ 603 int32_t voiceDomain = 0; 604 /** 605 * Indicates the Multi-party call status: 606 * 0: not a multi-party(conference) call 607 * 1: a multi-party(conference) call 608 */ 609 int32_t mpty = 0; 610 }; 611 612 /** 613 * @brief Indicates the detail information of some calls record. 614 */ 615 struct CallsReportInfo { 616 /** 617 * Indicates a list of the call report information. 618 */ 619 std::vector<CallReportInfo> callVec {}; 620 /** 621 * Indicates the slot id. 622 */ 623 int32_t slotId = 0; 624 }; 625 626 /** 627 * @brief Indicates the causes of call disconnection. 628 * 629 * 3GPP TS 24.008 630 * V17.4.0 10.5.4.11 Cause 631 * The purpose of the cause information element is to describe the reason for 632 * generating certain messages, to provide diagnostic information in the event 633 * of procedural errors and to indicate the location of the cause originator. 634 */ 635 enum class DisconnectedReason : int32_t { 636 /** 637 * Indicates the call disconnect due to Unassigned (unallocated) number. 638 */ 639 UNASSIGNED_NUMBER = 1, 640 /** 641 * Indicates the call disconnect due to No route to destination. 642 */ 643 NO_ROUTE_TO_DESTINATION = 3, 644 /** 645 * Indicates the call disconnect due to Channel unacceptable. 646 */ 647 CHANNEL_UNACCEPTABLE = 6, 648 /** 649 * Indicates the call disconnect due to Operator determined barring. 650 */ 651 OPERATOR_DETERMINED_BARRING = 8, 652 /** 653 * Indicates the call disconnect due to Call completed elsewhere. 654 */ 655 CALL_COMPLETED_ELSEWHERE = 13, 656 /** 657 * Indicates the call disconnect due to Normal call clearing. 658 */ 659 NORMAL_CALL_CLEARING = 16, 660 /** 661 * Indicates the call disconnect due to User busy. 662 */ 663 USER_BUSY = 17, 664 /** 665 * Indicates the call disconnect due to No user responding. 666 */ 667 NO_USER_RESPONDING = 18, 668 /** 669 * Indicates the call disconnect due to User alerting, no answer. 670 */ 671 USER_ALERTING_NO_ANSWER = 19, 672 /** 673 * Indicates the call disconnect due to Call rejected. 674 */ 675 CALL_REJECTED = 21, 676 /** 677 * Indicates the call disconnect due to Number changed. 678 */ 679 NUMBER_CHANGED = 22, 680 /** 681 * Indicates the call disconnect cause is Call rejected due to feature 682 * at the destination. 683 */ 684 CALL_REJECTED_DUE_TO_FEATURE_AT_THE_DESTINATION = 24, 685 /** 686 * Indicates the call disconnect due to Pre-emption. 687 */ 688 FAILED_PRE_EMPTION = 25, 689 /** 690 * Indicates the call disconnect due to Non selected user clearing. 691 */ 692 NON_SELECTED_USER_CLEARING = 26, 693 /** 694 * Indicates the call disconnect due to Destination out of order. 695 */ 696 DESTINATION_OUT_OF_ORDER = 27, 697 /** 698 * Indicates the call disconnect due to Invalid number format 699 * (incomplete number). 700 */ 701 INVALID_NUMBER_FORMAT = 28, 702 /** 703 * Indicates the call disconnect due to Facility rejected. 704 */ 705 FACILITY_REJECTED = 29, 706 /** 707 * Indicates the call disconnect due to Response to STATUS ENQUIRY. 708 */ 709 RESPONSE_TO_STATUS_ENQUIRY = 30, 710 /** 711 * Indicates the call disconnect due to Normal, unspecified. 712 */ 713 NORMAL_UNSPECIFIED = 31, 714 /** 715 * Indicates the call disconnect due to No circuit/channel available. 716 */ 717 NO_CIRCUIT_CHANNEL_AVAILABLE = 34, 718 /** 719 * Indicates the call disconnect due to Network out of order. 720 */ 721 NETWORK_OUT_OF_ORDER = 38, 722 /** 723 * Indicates the call disconnect due to Temporary failure. 724 */ 725 TEMPORARY_FAILURE = 41, 726 /** 727 * Indicates the call disconnect due to Switching equipment congestion. 728 */ 729 SWITCHING_EQUIPMENT_CONGESTION = 42, 730 /** 731 * Indicates the call disconnect due to Access information discarded. 732 */ 733 ACCESS_INFORMATION_DISCARDED = 43, 734 /** 735 * Indicates the call disconnect due to requested circuit/channel 736 * not available. 737 */ 738 REQUEST_CIRCUIT_CHANNEL_NOT_AVAILABLE = 44, 739 /** 740 * Indicates the call disconnect due to Resources unavailable, unspecified. 741 */ 742 RESOURCES_UNAVAILABLE_UNSPECIFIED = 47, 743 /** 744 * Indicates the call disconnect due to Quality of service unavailable. 745 */ 746 QUALITY_OF_SERVICE_UNAVAILABLE = 49, 747 /** 748 * Indicates the call disconnect due to Requested facility not subscribed. 749 */ 750 REQUESTED_FACILITY_NOT_SUBSCRIBED = 50, 751 /** 752 * Indicates the call disconnect due to Incoming calls barred within the CUG. 753 */ 754 INCOMING_CALLS_BARRED_WITHIN_THE_CUG = 55, 755 /** 756 * Indicates the call disconnect due to Bearer capability not authorized. 757 */ 758 BEARER_CAPABILITY_NOT_AUTHORIZED = 57, 759 /** 760 * Indicates the call disconnect due to Bearer capability not presently 761 * available. 762 */ 763 BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE = 58, 764 /** 765 * Indicates the call disconnect due to Service or option not available, 766 * unspecified. 767 */ 768 SERVICE_OR_OPTION_NOT_AVAILABLE_UNSPECIFIED = 63, 769 /** 770 * Indicates the call disconnect due to Bearer service not implemented. 771 */ 772 BEARER_SERVICE_NOT_IMPLEMENTED = 65, 773 /** 774 * Indicates the call disconnect due to ACM equal to or greater than ACMmax. 775 */ 776 ACM_EQUALTO_OR_GREATE_THAN_ACMMAX = 68, 777 /** 778 * Indicates the call disconnect due to Requested facility not implemented. 779 */ 780 REQUESTED_FACILITY_NOT_IMPLEMENTED = 69, 781 /** 782 * Indicates the call disconnect due to Only restricted digital information 783 * bearer capability is available. 784 */ 785 ONLY_RESTRICTED_DIGITAL_INFO_BEARER_CAPABILITY_IS_AVAILABLE = 70, 786 /** 787 * Indicates the call disconnect due to Service or option not implemented, 788 * unspecified. 789 */ 790 SERVICE_OR_OPTION_NOT_IMPLEMENTED_UNSPECIFIED = 79, 791 /** 792 * Indicates the call disconnect due to Invalid transaction identifier 793 * value. 794 */ 795 INVALID_TRANSACTION_IDENTIFIER_VALUE = 81, 796 /** 797 * Indicates the call disconnect due to User not member of CUG. 798 */ 799 USER_NOT_MEMBER_OF_CUG = 87, 800 /** 801 * Indicates the call disconnect due to Incompatible destination. 802 */ 803 INCOMPATIBLE_DESTINATION = 88, 804 /** 805 * Indicates the call disconnect due to Invalid transit network selection. 806 */ 807 INVALID_TRANSIT_NETWORK_SELECTION = 91, 808 /** 809 * Indicates the call disconnect due to Semantically incorrect message. 810 */ 811 SEMANTICALLY_INCORRECT_MESSAGE = 95, 812 /** 813 * Indicates the call disconnect due to Invalid mandatory information. 814 */ 815 INVALID_MANDATORY_INFORMATION = 96, 816 /** 817 * Indicates the call disconnect due to Message type non-existent or not 818 * implemented. 819 */ 820 MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 97, 821 /** 822 * Indicates the call disconnect due to Message type not compatible with 823 * protocol state. 824 */ 825 MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, 826 /** 827 * Indicates the call disconnect due to Information element non-existent or 828 * not implemented. 829 */ 830 INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 99, 831 /** 832 * Indicates the call disconnect due to Conditional IE error. 833 */ 834 CONDITIONAL_IE_ERROR = 100, 835 /** 836 * Indicates the call disconnect due to Message not compatible with 837 * protocol state. 838 */ 839 MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, 840 /** 841 * Indicates the call disconnect due to Recovery on timer expiry. 842 */ 843 RECOVERY_ON_TIMER_EXPIRED = 102, 844 /** 845 * Indicates the call disconnect due to Protocol error, unspecified. 846 */ 847 PROTOCOL_ERROR_UNSPECIFIED = 111, 848 /** 849 * Indicates the call disconnect due to Interworking, unspecified. 850 */ 851 INTERWORKING_UNSPECIFIED = 127, 852 /** 853 * Indicates the call disconnect due to Call barred. 854 */ 855 CALL_BARRED = 240, 856 /** 857 * Indicates the call disconnect due to FDN blocked. 858 */ 859 FDN_BLOCKED = 241, 860 /** 861 * Indicates the call disconnect due to IMSI in VLR is unknown. 862 */ 863 IMSI_UNKNOWN_IN_VLR = 242, 864 /** 865 * Indicates the call disconnect due to IMEI not accepted. 866 */ 867 IMEI_NOT_ACCEPTED = 243, 868 /** 869 * Indicates the call disconnect due to dial modified to USSD. 870 */ 871 DIAL_MODIFIED_TO_USSD = 244, 872 /** 873 * Indicates the call disconnect due to dial modified to SS. 874 */ 875 DIAL_MODIFIED_TO_SS = 245, 876 /** 877 * Indicates the call disconnect due to dial modified to dial. 878 */ 879 DIAL_MODIFIED_TO_DIAL = 246, 880 /** 881 * Indicates the call disconnect due to Radio off. 882 */ 883 RADIO_OFF = 247, 884 /** 885 * Indicates the call disconnect due to out of service. 886 */ 887 OUT_OF_SERVICE = 248, 888 /** 889 * Indicates the call disconnect due to invalid SIM. 890 */ 891 NO_VALID_SIM = 249, 892 /** 893 * Indicates the call disconnect due to radio internal error in modem. 894 */ 895 RADIO_INTERNAL_ERROR = 250, 896 /** 897 * Indicates the call disconnect due to network response timeout. 898 */ 899 NETWORK_RESP_TIMEOUT = 251, 900 /** 901 * Indicates the call disconnect due to network reject. 902 */ 903 NETWORK_REJECT = 252, 904 /** 905 * Indicates the call disconnect due to RRC connection failure. Eg.RACH 906 */ 907 RADIO_ACCESS_FAILURE = 253, 908 /** 909 * Indicates the call disconnect due to radio link failure. 910 */ 911 RADIO_LINK_FAILURE = 254, 912 /** 913 * Indicates the call disconnect due to poor coverage. 914 */ 915 RADIO_LINK_LOST = 255, 916 /** 917 * Indicates the call disconnect due to Radio uplink failure. 918 */ 919 RADIO_UPLINK_FAILURE = 256, 920 /** 921 * Indicates the call disconnect due to RRC connection setup failure. 922 */ 923 RADIO_SETUP_FAILURE = 257, 924 /** 925 * Indicates the call disconnect due to RRC connection release, normal. 926 */ 927 RADIO_RELEASE_NORMAL = 258, 928 /** 929 * Indicates the call disconnect due to RRC connection release, abnormal. 930 */ 931 RADIO_RELEASE_ABNORMAL = 259, 932 /** 933 * Indicates the call disconnect due to Access class barring. 934 */ 935 ACCESS_CLASS_BLOCKED = 260, 936 /** 937 * Indicates the call disconnect due to Explicit network detach. 938 */ 939 NETWORK_DETACH = 261, 940 /** 941 * Indicates the call disconnect due to invalid parameter. 942 */ 943 INVALID_PARAMETER = 1025, 944 /** 945 * Indicates the call disconnect due to sim not exit. 946 */ 947 SIM_NOT_EXIT = 1026, 948 /** 949 * Indicates the call disconnect due to sim pin need. 950 */ 951 SIM_PIN_NEED = 1027, 952 /** 953 * Indicates the call disconnect due to call not allow. 954 */ 955 CALL_NOT_ALLOW = 1029, 956 /** 957 * Indicates the call disconnect due to sim invalid. 958 */ 959 SIM_INVALID = 1045, 960 /** 961 * Indicates the call disconnect due to unknown error. 962 */ 963 FAILED_UNKNOWN = 1279, 964 }; 965 966 /** 967 * @brief Indicates the cause detail of a call disconnection. 968 */ 969 struct DisconnectedDetails { 970 /** 971 * Indicates the reason for ending the call. 972 */ 973 DisconnectedReason reason = DisconnectedReason::FAILED_UNKNOWN; 974 /** 975 * Indicates the detail message for the ending call reason. 976 */ 977 std::string message = ""; 978 DisconnectedDetailsDisconnectedDetails979 DisconnectedDetails() {} 980 DisconnectedDetailsDisconnectedDetails981 DisconnectedDetails(const DisconnectedDetails &temp) 982 { 983 *this = temp; 984 } 985 986 DisconnectedDetails &operator=(const DisconnectedDetails &temp) 987 { 988 reason = temp.reason; 989 message = temp.message; 990 return *this; 991 } 992 }; 993 994 /** 995 * @brief Indicates the what the Audio device type is used. 996 */ 997 enum class AudioDeviceType { 998 /** 999 * Indicates the device type is a earphone speaker. 1000 */ 1001 DEVICE_EARPIECE = 0, 1002 /** 1003 * Indicates the device type is the speaker system (i.e. a mono speaker or 1004 * stereo speakers) built in a device. 1005 */ 1006 DEVICE_SPEAKER, 1007 /** 1008 * Indicates the device type is a headset, which is the combination of a 1009 * headphones and microphone. 1010 */ 1011 DEVICE_WIRED_HEADSET, 1012 /** 1013 * Indicates the device type is a Bluetooth device typically used for 1014 * telephony. 1015 */ 1016 DEVICE_BLUETOOTH_SCO, 1017 /** 1018 * Indicates the audio device is disabled. 1019 */ 1020 DEVICE_DISABLE, 1021 /** 1022 * Indicates the device type is an unknown or uninitialized. 1023 */ 1024 DEVICE_UNKNOWN, 1025 }; 1026 1027 /** 1028 * @brief Indicates the call event type. 1029 */ 1030 enum class CellularCallEventType { 1031 EVENT_REQUEST_RESULT_TYPE = 0, 1032 }; 1033 1034 /** 1035 * @brief Indicates the call event id, one id corresponds to one request. 1036 */ 1037 enum class RequestResultEventId { 1038 INVALID_REQUEST_RESULT_EVENT_ID = -1, 1039 RESULT_DIAL_SEND_FAILED = 0, 1040 RESULT_DIAL_NO_CARRIER, 1041 RESULT_END_SEND_FAILED, 1042 RESULT_REJECT_SEND_FAILED, 1043 RESULT_ACCEPT_SEND_FAILED, 1044 RESULT_HOLD_SEND_FAILED, 1045 RESULT_ACTIVE_SEND_FAILED, 1046 RESULT_SWAP_SEND_FAILED, 1047 RESULT_COMBINE_SEND_FAILED, 1048 RESULT_JOIN_SEND_FAILED, 1049 RESULT_SPLIT_SEND_FAILED, 1050 RESULT_SUPPLEMENT_SEND_FAILED, 1051 RESULT_INVITE_TO_CONFERENCE_SUCCESS, 1052 RESULT_INVITE_TO_CONFERENCE_FAILED, 1053 RESULT_KICK_OUT_FROM_CONFERENCE_SUCCESS, 1054 RESULT_KICK_OUT_FROM_CONFERENCE_FAILED, 1055 1056 RESULT_SEND_DTMF_SUCCESS, 1057 RESULT_SEND_DTMF_FAILED, 1058 1059 RESULT_GET_CURRENT_CALLS_FAILED, 1060 1061 RESULT_SET_CALL_PREFERENCE_MODE_SUCCESS, 1062 RESULT_SET_CALL_PREFERENCE_MODE_FAILED, 1063 RESULT_GET_IMS_CALLS_DATA_FAILED, 1064 1065 RESULT_GET_CALL_WAITING_SUCCESS, 1066 RESULT_GET_CALL_WAITING_FAILED, 1067 RESULT_SET_CALL_WAITING_SUCCESS, 1068 RESULT_SET_CALL_WAITING_FAILED, 1069 RESULT_GET_CALL_RESTRICTION_SUCCESS, 1070 RESULT_GET_CALL_RESTRICTION_FAILED, 1071 RESULT_SET_CALL_RESTRICTION_SUCCESS, 1072 RESULT_SET_CALL_RESTRICTION_FAILED, 1073 RESULT_GET_CALL_TRANSFER_SUCCESS, 1074 RESULT_GET_CALL_TRANSFER_FAILED, 1075 RESULT_SET_CALL_TRANSFER_SUCCESS, 1076 RESULT_SET_CALL_TRANSFER_FAILED, 1077 RESULT_SEND_USSD_SUCCESS, 1078 RESULT_SEND_USSD_FAILED, 1079 1080 RESULT_SET_MUTE_SUCCESS, 1081 RESULT_SET_MUTE_FAILED, 1082 1083 RESULT_CTRL_CAMERA_SUCCESS, 1084 RESULT_CTRL_CAMERA_FAILED, 1085 RESULT_SET_PREVIEW_WINDOW_SUCCESS, 1086 RESULT_SET_PREVIEW_WINDOW_FAILED, 1087 RESULT_SET_DISPLAY_WINDOW_SUCCESS, 1088 RESULT_SET_DISPLAY_WINDOW_FAILED, 1089 RESULT_SET_CAMERA_ZOOM_SUCCESS, 1090 RESULT_SET_CAMERA_ZOOM_FAILED, 1091 RESULT_SET_PAUSE_IMAGE_SUCCESS, 1092 RESULT_SET_PAUSE_IMAGE_FAILED, 1093 RESULT_SET_DEVICE_DIRECTION_SUCCESS, 1094 RESULT_SET_DEVICE_DIRECTION_FAILED, 1095 }; 1096 1097 /** 1098 * @brief Indicates the call result report id in callback, 1099 * one id corresponds to one request. 1100 */ 1101 enum class CallResultReportId { 1102 START_DTMF_REPORT_ID = 0, 1103 STOP_DTMF_REPORT_ID, 1104 SEND_USSD_REPORT_ID, 1105 GET_IMS_CALL_DATA_REPORT_ID, 1106 GET_CALL_WAITING_REPORT_ID, 1107 SET_CALL_WAITING_REPORT_ID, 1108 GET_CALL_RESTRICTION_REPORT_ID, 1109 SET_CALL_RESTRICTION_REPORT_ID, 1110 GET_CALL_TRANSFER_REPORT_ID, 1111 SET_CALL_TRANSFER_REPORT_ID, 1112 GET_CALL_CLIP_ID, 1113 GET_CALL_CLIR_ID, 1114 SET_CALL_CLIR_ID, 1115 START_RTT_REPORT_ID, 1116 STOP_RTT_REPORT_ID, 1117 GET_IMS_CONFIG_REPORT_ID, 1118 SET_IMS_CONFIG_REPORT_ID, 1119 GET_IMS_FEATURE_VALUE_REPORT_ID, 1120 SET_IMS_FEATURE_VALUE_REPORT_ID, 1121 INVITE_TO_CONFERENCE_REPORT_ID, 1122 UPDATE_MEDIA_MODE_REPORT_ID, 1123 CLOSE_UNFINISHED_USSD_REPORT_ID, 1124 SET_CALL_RESTRICTION_PWD_REPORT_ID, 1125 }; 1126 1127 /** 1128 * @brief Indicates the cellular call event information. 1129 */ 1130 struct CellularCallEventInfo { 1131 /** 1132 * Indicates the call event type. {@link CellularCallEventType} 1133 */ 1134 CellularCallEventType eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE; 1135 /** 1136 * Indicates the call event id, one id corresponds to one request. 1137 * {@link RequestResultEventId} 1138 */ 1139 RequestResultEventId eventId = RequestResultEventId::INVALID_REQUEST_RESULT_EVENT_ID; 1140 }; 1141 1142 /** 1143 * @brief Indicates the ringback tone playing mode. 1144 */ 1145 enum class RBTPlayInfo { 1146 /** 1147 * Indicates the mode is network, the tone is from network. 1148 */ 1149 NETWORK_ALERTING, 1150 /** 1151 * Indicates the mode is local, the tone is from local file. 1152 */ 1153 LOCAL_ALERTING, 1154 }; 1155 1156 /** 1157 * @brief Indicates the Call Waiting response result. 1158 */ 1159 struct CallWaitResponse { 1160 /** 1161 * 0: ok other: error 1162 */ 1163 int32_t result = 0; 1164 /** 1165 * parameter sets/shows the result code presentation status in the TA. 1166 */ 1167 int32_t status = 0; 1168 /** 1169 * parameter shows the subscriber CW service status in the network. 1170 */ 1171 int32_t classCw = 0; 1172 }; 1173 1174 /** 1175 * @brief Indicates the Clip response result. 1176 */ 1177 struct ClipResponse { 1178 /** 1179 * 0: ok other: error 1180 */ 1181 int32_t result = 0; 1182 /** 1183 * parameter sets/shows the result code presentation status in the TA. 1184 */ 1185 int32_t action = 0; 1186 /** 1187 * parameter shows the subscriber CLIP service status in the network. 1188 */ 1189 int32_t clipStat = 0; 1190 }; 1191 1192 /** 1193 * @brief Indicates the Clir response result. 1194 */ 1195 struct ClirResponse { 1196 /** 1197 * 0: ok other: error 1198 */ 1199 int32_t result = 0; 1200 /** 1201 * parameter sets/shows the result code presentation status in the TA. 1202 */ 1203 int32_t action = 0; 1204 /** 1205 * parameter shows the subscriber CLIR service status in the network. 1206 */ 1207 int32_t clirStat = 0; 1208 }; 1209 1210 /** 1211 * @brief Indicates the Colr response result. 1212 */ 1213 struct ColrResponse { 1214 /** 1215 * 0: ok other: error 1216 */ 1217 int32_t result = 0; 1218 /** 1219 * parameter sets/shows the result code presentation status in the TA. 1220 */ 1221 int32_t action = 0; 1222 /** 1223 * parameter shows the subscriber COLR service status in the network. 1224 */ 1225 int32_t colrStat = 0; 1226 }; 1227 1228 /** 1229 * @brief Indicates the Colp response result. 1230 */ 1231 struct ColpResponse { 1232 /** 1233 * 0: ok other: error 1234 */ 1235 int32_t result = 0; 1236 /** 1237 * parameter sets/shows the result code presentation status in the TA. 1238 */ 1239 int32_t action = 0; 1240 /** 1241 * parameter shows the subscriber COLP service status in the network. 1242 */ 1243 int32_t colpStat = 0; 1244 }; 1245 1246 /** 1247 * @brief Indicates the MMI Code response result. 1248 */ 1249 struct MmiCodeInfo { 1250 /** 1251 * 0: ok other: error 1252 */ 1253 int32_t result = 0; 1254 /** 1255 * Indicates the specific message of MMI code response. 1256 */ 1257 char message[kMaxNumberLen + 1] = { 0 }; 1258 }; 1259 1260 /** 1261 * @brief Indicates the Call Transfer response result. 1262 */ 1263 struct CallTransferResponse { 1264 /** 1265 * 0: ok other: error 1266 */ 1267 int32_t result = 0; 1268 /** 1269 * Indicates the status of the CF option. 0: not active; 1: active 1270 */ 1271 int32_t status = 0; 1272 /** 1273 * <classx> is a sum of integers each representing a class of information 1274 * (default 7): 1275 * 1 voice (telephony) 1276 * 2 data (refers to all bearer services) 1277 * 4 fax (facsimile services) 1278 * 8 short message service 1279 * 16 data circuit sync 1280 * 32 data circuit async 1281 * 64 dedicated packet access 1282 * 128 dedicated PAD access 1283 */ 1284 int32_t classx = 0; 1285 /** 1286 * type of address octet in integer format (refer GSM 04.08 [8] 1287 * subclause 10.5.4.7); default 145 when dialling string includes 1288 * international access code character "+", otherwise 129. 1289 */ 1290 int32_t type = 0; 1291 /** 1292 * Indication the phone number which will forward to. 1293 */ 1294 char number[kMaxNumberLen + 1] = { 0 }; 1295 int32_t reason = 0; 1296 int32_t time = 0; 1297 /** 1298 * Indicates the Call forwarding start time. 1299 */ 1300 int32_t startHour = INVALID_TIME; 1301 int32_t startMinute = INVALID_TIME; 1302 /** 1303 * Indicates the Call forwarding end time. 1304 */ 1305 int32_t endHour = INVALID_TIME; 1306 int32_t endMinute = INVALID_TIME; 1307 }; 1308 1309 /** 1310 * @brief Indicates the Call Restriction response result. 1311 */ 1312 struct CallRestrictionResponse { 1313 /** 1314 * 0: ok other: error 1315 */ 1316 int32_t result = 0; 1317 /** 1318 * parameter sets/shows the result code presentation status in the TA 1319 */ 1320 int32_t status = 0; 1321 /** 1322 * parameter shows the subscriber Call Restriction service status 1323 * in the network. 1324 */ 1325 int32_t classCw = 0; 1326 }; 1327 1328 /** 1329 * @brief Indicates the Call Preference response result. 1330 */ 1331 struct CallPreferenceResponse { 1332 /** 1333 * 0: ok other: error 1334 */ 1335 int32_t result = 0; 1336 /** 1337 * Indicates the specific value of the call preference mode. 1338 * 1339 * 1:CS Voice only 1340 * 2:CS Voice preferred, IMS PS Voice as secondary 1341 * 3:IMS PS Voice preferred, CS Voice as secondary 1342 * 4:IMS PS Voice only 1343 */ 1344 int32_t mode = 0; 1345 }; 1346 1347 /** 1348 * @brief Indicates the GetImsConfig response result. 1349 */ 1350 struct GetImsConfigResponse { 1351 /** 1352 * 0: ok other: error 1353 */ 1354 int32_t result = 0; 1355 /** 1356 * Indicates the specific value of the corresponding IMS config. 1357 */ 1358 int32_t value = 0; 1359 }; 1360 1361 /** 1362 * @brief Indicates the GetImsFeatureValue response result. 1363 */ 1364 struct GetImsFeatureValueResponse { 1365 /** 1366 * 0: ok other: error 1367 */ 1368 int32_t result = 0; 1369 /** 1370 * Indicates the specific value of the corresponding IMS feature. 1371 */ 1372 int32_t value = 0; 1373 }; 1374 1375 struct GetLteEnhanceModeResponse { 1376 /** 1377 * 0: ok other: error 1378 */ 1379 int32_t result = 0; 1380 /** 1381 * Indicates the specific value of the LTE Enhance mode. 1382 */ 1383 int32_t value = 0; 1384 }; 1385 1386 struct MuteControlResponse { 1387 /** 1388 * 0: ok other: error 1389 */ 1390 int32_t result = 0; 1391 /** 1392 * Indicates the specific value of mute setting. 0: not mute 1: set mute 1393 */ 1394 int32_t value = 0; 1395 }; 1396 1397 /** 1398 * @brief Indicates the cellular call detail information. 1399 */ 1400 struct CellularCallInfo { 1401 /** 1402 * Indicates the call index 1403 */ 1404 int32_t callId = 0; 1405 /** 1406 * Indicates the call phone number. 1407 */ 1408 char phoneNum[kMaxNumberLen] = { 0 }; 1409 /** 1410 * Indicates the slot id. 1411 */ 1412 int32_t slotId = 0; 1413 int32_t accountId = 0; 1414 /** 1415 * Indicates the type of call, includs CS, IMS, OTT, OTHER. {@link CallType} 1416 */ 1417 CallType callType = CallType::TYPE_ERR_CALL; 1418 /** 1419 * Indicates whether the call is video. 0: audio 1:video 1420 */ 1421 int32_t videoState = 0; 1422 int32_t index = 0; 1423 }; 1424 1425 /** 1426 * @brief Indicates the type of call transfer setting. 1427 * 1428 * 27007-430_2001 7.11 Call forwarding number and conditions +CCFC 1429 * 3GPP TS 22.082 [4] 1430 * <mode>: 1431 * 0 disable 1432 * 1 enable 1433 * 3 registration 1434 * 4 erasure 1435 */ 1436 enum class CallTransferSettingType { 1437 /** 1438 * Indicates disable the call transfer. 1439 */ 1440 CALL_TRANSFER_DISABLE = 0, 1441 /** 1442 * Indicates enable the call transfer. 1443 */ 1444 CALL_TRANSFER_ENABLE = 1, 1445 /** 1446 * Indicates register the call transfer. 1447 */ 1448 CALL_TRANSFER_REGISTRATION = 3, 1449 /** 1450 * Indicates erasure the call transfer. 1451 */ 1452 CALL_TRANSFER_ERASURE = 4, 1453 }; 1454 1455 /** 1456 * @brief Indicates the Call forwarding type 1457 * 1458 * 27007-430_2001 7.11 Call forwarding number and conditions +CCFC 1459 * 3GPP TS 22.082 [4] 1460 * <reason>: 1461 * 0 unconditional 1462 * 1 mobile busy 1463 * 2 no reply 1464 * 3 not reachable 1465 */ 1466 enum class CallTransferType { 1467 /** 1468 * Indicates transfer the call unconditionally. 1469 */ 1470 TRANSFER_TYPE_UNCONDITIONAL = 0, 1471 /** 1472 * Indicates transfer the call when busy. 1473 */ 1474 TRANSFER_TYPE_BUSY = 1, 1475 /** 1476 * Indicates transfer the call when no reply. 1477 */ 1478 TRANSFER_TYPE_NO_REPLY = 2, 1479 /** 1480 * Indicates transfer the call when unreachable. 1481 */ 1482 TRANSFER_TYPE_NOT_REACHABLE = 3, 1483 }; 1484 1485 /** 1486 * @brief Indicates the information of call transfer. 1487 */ 1488 struct CallTransferInfo { 1489 /** 1490 * Indication the phone number which will forward to. 1491 */ 1492 char transferNum[kMaxNumberLen + 1] = { 0 }; 1493 /** 1494 * Indicates the type of call transfer setting. {@link CallTransferSettingType} 1495 */ 1496 CallTransferSettingType settingType = CallTransferSettingType::CALL_TRANSFER_DISABLE; 1497 /** 1498 * Indicates the Call forwarding type. {@link CallTransferType} 1499 */ 1500 CallTransferType type = CallTransferType::TRANSFER_TYPE_UNCONDITIONAL; 1501 /** 1502 * Start time hours. 1503 */ 1504 int32_t startHour = 0; 1505 /** 1506 * Start time minutes. 1507 */ 1508 int32_t startMinute = 0; 1509 /** 1510 * End time hours. 1511 */ 1512 int32_t endHour = 0; 1513 /** 1514 * End time minutes. 1515 */ 1516 int32_t endMinute = 0; 1517 }; 1518 1519 /** 1520 * @brief Indicates the type of supplementary service request. 1521 */ 1522 enum class SsRequestType { 1523 SS_ACTIVATION = 0, 1524 SS_DEACTIVATION, 1525 SS_INTERROGATION, 1526 SS_REGISTRATION, 1527 SS_ERASURE, 1528 }; 1529 1530 /** 1531 * @brief Indicates the video window size and location in video call. 1532 */ 1533 struct VideoWindow { 1534 /** 1535 * X coordinate of window 1536 */ 1537 int32_t x = 0; 1538 /** 1539 * Y coordinate of window 1540 */ 1541 int32_t y = 0; 1542 /** 1543 * Z coordinate of window 1544 */ 1545 int32_t z = 0; 1546 /** 1547 * the width of window 1548 */ 1549 int32_t width = 0; 1550 /** 1551 * the height of window 1552 */ 1553 int32_t height = 0; 1554 }; 1555 1556 /** 1557 * @brief Indicates the type of call restriction. 1558 * 1559 * 3GPP TS 22.030 V4.0.0 (2001-03) 1560 * 3GPP TS 22.088 V4.0.0 (2001-03) 1561 */ 1562 enum class CallRestrictionType { 1563 /** 1564 * Indicates restrict all incoming calls. 1565 */ 1566 RESTRICTION_TYPE_ALL_INCOMING = 0, 1567 /** 1568 * Indicates restrict all outgoing calls. 1569 */ 1570 RESTRICTION_TYPE_ALL_OUTGOING, 1571 /** 1572 * Indicates restrict international calls. 1573 */ 1574 RESTRICTION_TYPE_INTERNATIONAL, 1575 /** 1576 * Indicates restrict international roaming calls. 1577 */ 1578 RESTRICTION_TYPE_INTERNATIONAL_EXCLUDING_HOME, 1579 /** 1580 * Indicates restrict roaming calls. 1581 */ 1582 RESTRICTION_TYPE_ROAMING_INCOMING, 1583 /** 1584 * Indicates restrict all calls. 1585 */ 1586 RESTRICTION_TYPE_ALL_CALLS, 1587 /** 1588 * Indicates restrict all outgoing services. 1589 */ 1590 RESTRICTION_TYPE_OUTGOING_SERVICES, 1591 /** 1592 * Indicates restrict all incoming services. 1593 */ 1594 RESTRICTION_TYPE_INCOMING_SERVICES, 1595 }; 1596 1597 /** 1598 * @brief Indicates the mode of call restriction. 1599 * 1600 * 3GPP TS 22.088 V4.0.0 (2001-03) 1601 */ 1602 enum class CallRestrictionMode { 1603 /** 1604 * Indicates call restriction is deactivated. 1605 */ 1606 RESTRICTION_MODE_DEACTIVATION = 0, 1607 /** 1608 * Indicates call restriction is activated. 1609 */ 1610 RESTRICTION_MODE_ACTIVATION = 1, 1611 }; 1612 1613 /** 1614 * @brief Indicates the information of call restriction. 1615 */ 1616 struct CallRestrictionInfo { 1617 /** 1618 * Indicates the password required to set call restrictions. 1619 */ 1620 char password[kMaxNumberLen + 1] = { 0 }; 1621 /** 1622 * Indicates the type of call restriction. 1623 */ 1624 CallRestrictionType fac = CallRestrictionType::RESTRICTION_TYPE_ALL_INCOMING; 1625 /** 1626 * Indicates the mode of call restriction. 1627 */ 1628 CallRestrictionMode mode = CallRestrictionMode::RESTRICTION_MODE_DEACTIVATION; 1629 }; 1630 1631 /** 1632 * @brief Indicates the +CHLD related supplementary services 1633 * 1634 * 3GPP TS 27.007 V3.9.0 (2001-06) Call related supplementary services +CHLD 1635 * 3GPP TS 27.007 V3.9.0 (2001-06) 7.22 Informative examples 1636 */ 1637 enum CallSupplementType { 1638 /** 1639 * default type 1640 */ 1641 TYPE_DEFAULT = 0, 1642 /** 1643 * release the held call and the wait call 1644 */ 1645 TYPE_HANG_UP_HOLD_WAIT = 1, 1646 /** 1647 * release the active call and recover the held call 1648 */ 1649 TYPE_HANG_UP_ACTIVE = 2, 1650 /** 1651 * release all calls 1652 */ 1653 TYPE_HANG_UP_ALL = 3, 1654 }; 1655 1656 enum CellularCallReturnType { 1657 /** 1658 * 3GPP TS 27.007 V3.9.0 (2001-06) 6.27 Informative examples 1659 */ 1660 RETURN_TYPE_MMI = 0, 1661 }; 1662 1663 /** 1664 * @brief Indicates the voice domain preference. 1665 * 1666 * 3GPP TS 27.007 V17.3.0 (2021-09) 10.1.35 UE's voice domain 1667 * preference E-UTRAN +CEVDP 1668 */ 1669 enum DomainPreferenceMode { 1670 /** 1671 * Indicates the voice domain preference is CS only. 1672 */ 1673 CS_VOICE_ONLY = 1, 1674 /** 1675 * Indicates the voice domain preference is CS prefered. 1676 */ 1677 CS_VOICE_PREFERRED = 2, 1678 /** 1679 * Indicates the voice domain preference is PS prefered. 1680 */ 1681 IMS_PS_VOICE_PREFERRED = 3, 1682 /** 1683 * Indicates the voice domain preference is PS only. 1684 */ 1685 IMS_PS_VOICE_ONLY = 4, 1686 }; 1687 1688 /** 1689 * @brief Indicates the IMS call mode. 1690 */ 1691 enum ImsCallMode { 1692 CALL_MODE_AUDIO_ONLY = 0, 1693 CALL_MODE_SEND_ONLY, 1694 CALL_MODE_RECEIVE_ONLY, 1695 CALL_MODE_SEND_RECEIVE, 1696 CALL_MODE_VIDEO_PAUSED, 1697 }; 1698 1699 /** 1700 * @brief Indicates the request call media mode. 1701 */ 1702 struct CallMediaModeRequest { 1703 /** 1704 * Indicates the call phone number. 1705 */ 1706 char phoneNum[kMaxNumberLen + 1] = { 0 }; 1707 /** 1708 * Indicates the IMS call mode. {@link ImsCallMode} 1709 */ 1710 ImsCallMode mode = ImsCallMode::CALL_MODE_AUDIO_ONLY; 1711 }; 1712 1713 /** 1714 * @brief Indicates the response of the call media mode request. 1715 */ 1716 struct CallMediaModeResponse { 1717 /** 1718 * Indicates the call phone number. 1719 */ 1720 char phoneNum[kMaxNumberLen + 1] = { 0 }; 1721 /** 1722 * Indicates the response result. 1723 */ 1724 int32_t result = 0; 1725 CallMediaModeResponseCallMediaModeResponse1726 CallMediaModeResponse() {} 1727 CallMediaModeResponseCallMediaModeResponse1728 CallMediaModeResponse(const CallMediaModeResponse &temp) 1729 { 1730 *this = temp; 1731 } 1732 1733 CallMediaModeResponse &operator=(const CallMediaModeResponse &temp) 1734 { 1735 std::copy(std::begin(temp.phoneNum), std::end(temp.phoneNum), std::begin(phoneNum)); 1736 result = temp.result; 1737 return *this; 1738 } 1739 }; 1740 1741 /** 1742 * @brief Indicates the specific IMS config item. 1743 */ 1744 enum ImsConfigItem { 1745 /** 1746 * Indicates the specific IMS config item is video quality. 1747 */ 1748 ITEM_VIDEO_QUALITY = 0, 1749 1750 /** 1751 * Indicates the specific IMS config item is IMS switch status. 1752 * 1753 * 3GPP TS 24.167 V17.1.0 (2020-12) 5.31 1754 * /<X>/Mobility_Management_IMS_Voice_Termination 1755 * Ims Switch Status 1756 * 1757 * format: bool 1758 * Access Types: Get, Replace 1759 * Values: 0, 1 1760 * 0 – Mobility Management for IMS Voice Termination disabled. 1761 * 1 – Mobility Management for IMS Voice Termination enabled. 1762 */ 1763 ITEM_IMS_SWITCH_STATUS, 1764 }; 1765 1766 /** 1767 * @brief Indicates the VoNR switch status. 1768 */ 1769 enum class VoNRState { 1770 /** 1771 * Indicates the VoNR switch is off. 1772 */ 1773 VONR_STATE_OFF = 0, 1774 /** 1775 * Indicates the VoNR switch is on. 1776 */ 1777 VONR_STATE_ON = 1, 1778 }; 1779 1780 /** 1781 * @brief Indicates the video quality is high or low. 1782 */ 1783 enum VideoQualityValue { 1784 /** 1785 * Indicates the video quality is high. 1786 */ 1787 LOW = 0, 1788 /** 1789 * Indicates the video quality is low. 1790 */ 1791 HIGH = 1, 1792 }; 1793 1794 enum ImsConfigValue { 1795 CONFIG_SUCCESS = 0, 1796 CONFIG_FAILED = 1, 1797 }; 1798 1799 /** 1800 * @brief Indicates the specific IMS feature. 1801 * 1802 * Official Document IR.92 - IMS Profile for Voice and SMS 1803 * Annex C MNO provisioning and Late Customization 1804 * 1805 * format: bool 1806 * 3GPP TS 24.167 V17.1.0 (2020-12) 5.43 /<X>/Media_type_restriction_policy 1807 */ 1808 enum FeatureType { 1809 /** 1810 * Indicates the IMS feature is Voice over LTE. 1811 */ 1812 TYPE_VOICE_OVER_LTE = 0, 1813 /** 1814 * Indicates the IMS feature is Video over LTE. 1815 */ 1816 TYPE_VIDEO_OVER_LTE, 1817 /** 1818 * Indicates the IMS feature is SS over UT. 1819 */ 1820 TYPE_SS_OVER_UT, 1821 }; 1822 1823 /** 1824 * @brief Indicates the specific OTT call request service. 1825 */ 1826 enum class OttCallRequestId { 1827 OTT_REQUEST_DIAL = 0, 1828 OTT_REQUEST_HANG_UP, 1829 OTT_REQUEST_REJECT, 1830 OTT_REQUEST_ANSWER, 1831 OTT_REQUEST_HOLD, 1832 OTT_REQUEST_UN_HOLD, 1833 OTT_REQUEST_SWITCH, 1834 OTT_REQUEST_COMBINE_CONFERENCE, 1835 OTT_REQUEST_SEPARATE_CONFERENCE, 1836 OTT_REQUEST_KICK_OUT_CONFERENCE, 1837 OTT_REQUEST_INVITE_TO_CONFERENCE, 1838 OTT_REQUEST_UPDATE_CALL_MEDIA_MODE, 1839 }; 1840 1841 /** 1842 * @brief Indicates the OTT call request information. 1843 */ 1844 struct OttCallRequestInfo { 1845 /** 1846 * Indicates the call phone number. 1847 */ 1848 char phoneNum[kMaxNumberLen + 1] = { 0 }; 1849 /** 1850 * Indicates the bundle name. 1851 */ 1852 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 1853 /** 1854 * Indicates the call video state, 0: audio 1:video. 1855 */ 1856 VideoStateType videoState = VideoStateType::TYPE_VOICE; 1857 }; 1858 1859 /** 1860 * @brief Indicates the OTT call detail information. 1861 */ 1862 struct OttCallDetailsInfo { 1863 /** 1864 * Indicates the call phone number. 1865 */ 1866 char phoneNum[kMaxNumberLen + 1] = { 0 }; 1867 /** 1868 * Indicates the bundle name. 1869 */ 1870 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 1871 /** 1872 * Indicates the call video state, 0: audio 1:video. 1873 */ 1874 VideoStateType videoState = VideoStateType::TYPE_VOICE; 1875 /** 1876 * Indicates the call status. 1877 */ 1878 TelCallState callState = TelCallState::CALL_STATUS_UNKNOWN; 1879 }; 1880 1881 /** 1882 * @brief Indicates the OTT call event ID. 1883 */ 1884 enum class OttCallEventId { 1885 OTT_CALL_EVENT_FUNCTION_UNSUPPORTED = 0, 1886 }; 1887 1888 /** 1889 * @brief Indicates the OTT call event information. 1890 */ 1891 struct OttCallEventInfo { 1892 /** 1893 * Indicates the OTT call event ID. 1894 */ 1895 OttCallEventId ottCallEventId = OttCallEventId::OTT_CALL_EVENT_FUNCTION_UNSUPPORTED; 1896 /** 1897 * Indicates the bundle name. 1898 */ 1899 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 1900 OttCallEventInfoOttCallEventInfo1901 OttCallEventInfo() {} 1902 OttCallEventInfoOttCallEventInfo1903 OttCallEventInfo(const OttCallEventInfo &temp) 1904 { 1905 *this = temp; 1906 } 1907 1908 OttCallEventInfo &operator=(const OttCallEventInfo &temp) 1909 { 1910 ottCallEventId = temp.ottCallEventId; 1911 std::copy(std::begin(temp.bundleName), std::end(temp.bundleName), std::begin(bundleName)); 1912 return *this; 1913 } 1914 }; 1915 1916 /** 1917 * @brief Indicates detail information of a call. 1918 */ 1919 struct CallDetailInfo { 1920 /** 1921 * Indicates the call index. 1922 */ 1923 int32_t index = 0; 1924 /** 1925 * Indicates the call phone number. 1926 */ 1927 char phoneNum[kMaxNumberLen + 1] = { 0 }; 1928 /** 1929 * Indicates the bundle name. 1930 */ 1931 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 1932 /** 1933 * Indicates the account id. 1934 */ 1935 int32_t accountId = 0; 1936 /** 1937 * Indicates the call type, CS, IMS, ERROR 1938 */ 1939 CallType callType = CallType::TYPE_ERR_CALL; 1940 /** 1941 * Indicates the call video state, 0: audio 1:video. 1942 */ 1943 VideoStateType callMode = VideoStateType::TYPE_VOICE; 1944 /** 1945 * Indicates the call status. 1946 */ 1947 TelCallState state = TelCallState::CALL_STATUS_UNKNOWN; 1948 /** 1949 * Indicates the voice domain. 0: CS, 1: IMS 1950 */ 1951 int32_t voiceDomain = 0; 1952 /** 1953 * Indicates the Multi-party call status: 1954 * 0: not a multi-party(conference) call 1955 * 1: a multi-party(conference) call 1956 */ 1957 int32_t mpty = 0; 1958 CallDetailInfoCallDetailInfo1959 CallDetailInfo() {} 1960 CallDetailInfoCallDetailInfo1961 CallDetailInfo(const CallDetailInfo &temp) 1962 { 1963 *this = temp; 1964 } 1965 1966 CallDetailInfo &operator=(const CallDetailInfo &temp) 1967 { 1968 index = temp.index; 1969 std::copy(std::begin(temp.phoneNum), std::end(temp.phoneNum), std::begin(phoneNum)); 1970 std::copy(std::begin(temp.bundleName), std::end(temp.bundleName), std::begin(bundleName)); 1971 accountId = temp.accountId; 1972 callType = temp.callType; 1973 callMode = temp.callMode; 1974 state = temp.state; 1975 voiceDomain = temp.voiceDomain; 1976 mpty = temp.mpty; 1977 return *this; 1978 } 1979 1980 }; 1981 1982 /** 1983 * @brief Indicates detail information of some calls. 1984 */ 1985 struct CallDetailsInfo { 1986 /** 1987 * Indicates a CallDetailInfo list. {@link CallDetailInfo} 1988 */ 1989 std::vector<CallDetailInfo> callVec {}; 1990 /** 1991 * Indicates the slot id. 1992 */ 1993 int32_t slotId = 0; 1994 /** 1995 * Indicates the bundle name. 1996 */ 1997 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 1998 }; 1999 2000 /** 2001 * @brief Indicates the audio device type and address. 2002 */ 2003 struct AudioDevice { 2004 /** 2005 * Indicates the audio device type. {@link AudioDeviceType} 2006 */ 2007 AudioDeviceType deviceType = AudioDeviceType::DEVICE_UNKNOWN; 2008 /** 2009 * Indicates the device address. 2010 */ 2011 char address[kMaxAddressLen + 1] = { 0 }; 2012 }; 2013 2014 /** 2015 * @brief Indicates the audio device information. 2016 */ 2017 struct AudioDeviceInfo { 2018 /** 2019 * Indicates the list of all audio devices. 2020 */ 2021 std::vector<AudioDevice> audioDeviceList {}; 2022 /** 2023 * Indicates the current audio device. 2024 */ 2025 AudioDevice currentAudioDevice; 2026 /** 2027 * Indicates wether the device is muted, true: mute, false: no mute 2028 */ 2029 bool isMuted = false; 2030 }; 2031 2032 enum class MmiCodeResult { 2033 MMI_CODE_SUCCESS = 0, 2034 MMI_CODE_FAILED = 1 2035 }; 2036 } // namespace Telephony 2037 } // namespace OHOS 2038 #endif // CALL_MANAGER_INNER_TYPE_H 2039