1 /* 2 * Copyright (C) 2023 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_INFO_H 17 #define CALL_MANAGER_INFO_H 18 19 #include "call_manager_base.h" 20 #include "call_manager_disconnected_details.h" 21 22 namespace OHOS { 23 namespace Telephony { 24 /** 25 * @brief Indicates the cellular call detail information. 26 */ 27 struct CellularCallInfo { 28 /** 29 * Indicates the call index 30 */ 31 int32_t callId = 0; 32 /** 33 * Indicates the call phone number. 34 */ 35 char phoneNum[kMaxNumberLen] = { 0 }; 36 /** 37 * Indicates the slot id. 38 */ 39 int32_t slotId = 0; 40 int32_t accountId = 0; 41 /** 42 * Indicates the type of call, includs CS, IMS, OTT, OTHER. {@link CallType} 43 */ 44 CallType callType = CallType::TYPE_ERR_CALL; 45 /** 46 * Indicates whether the call is video. 0: audio 1: send only 2: revive ony 3:video 47 */ 48 int32_t videoState = 0; 49 int32_t index = 0; 50 }; 51 52 /** 53 * @brief Indicates the cellular call event information. 54 */ 55 struct CellularCallEventInfo { 56 /** 57 * Indicates the call event type. {@link CellularCallEventType} 58 */ 59 CellularCallEventType eventType = CellularCallEventType::EVENT_REQUEST_RESULT_TYPE; 60 /** 61 * Indicates the call event id, one id corresponds to one request. 62 * {@link RequestResultEventId} 63 */ 64 RequestResultEventId eventId = RequestResultEventId::INVALID_REQUEST_RESULT_EVENT_ID; 65 }; 66 67 /** 68 * @brief Indicates the ringback tone playing mode. 69 */ 70 enum class RBTPlayInfo { 71 /** 72 * Indicates the mode is network, the tone is from network. 73 */ 74 NETWORK_ALERTING, 75 /** 76 * Indicates the mode is local, the tone is from local file. 77 */ 78 LOCAL_ALERTING, 79 }; 80 81 struct VoipCallReportInfo { 82 std::string voipCallId = ""; 83 std::string userName = ""; 84 std::vector<uint8_t> userProfile = {}; 85 std::string abilityName = ""; 86 std::string extensionId = ""; 87 std::string voipBundleName = ""; 88 bool showBannerForIncomingCall = true; 89 bool isConferenceCall = false; 90 bool isVoiceAnswerSupported = true; 91 bool hasMicPermission = true; 92 bool isCapsuleSticky = false; 93 int32_t uid = 0; 94 }; 95 96 /** 97 * @brief Indicates detail information of the number mark. 98 */ 99 struct NumberMarkInfo { 100 /** 101 * Indicates the type of number mark. 102 */ 103 MarkType markType = MarkType::MARK_TYPE_DEFAULT; 104 /** 105 * Indicates the content of number mark. 106 */ 107 char markContent[kMaxNumberLen + 1] = { 0 }; 108 /** 109 * Indicates the count of number mark. 110 */ 111 int32_t markCount = -1; 112 /** 113 * Indicates the source of number mark. 114 */ 115 char markSource[kMaxNumberLen + 1] = { 0 }; 116 /** 117 * Indicates if this is a number mark from cloud. 118 */ 119 bool isCloud = false; 120 /** 121 * Indicates the details of number mark. 122 */ 123 char markDetails[kMaxNumberLen + 1] = { 0 }; 124 }; 125 126 /** 127 * @brief Indicates the call event detail information. 128 */ 129 struct CallEventInfo { 130 /** 131 * Indicates the event ID of call ability. {@link CallAbilityEventId} 132 */ 133 CallAbilityEventId eventId = CallAbilityEventId::EVENT_DIAL_NO_CARRIER; 134 /** 135 * Indicates the call phone number. 136 */ 137 char phoneNum[kMaxNumberLen + 1] = { 0 }; 138 /** 139 * Indicates the bundle name. 140 */ 141 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 142 }; 143 144 struct AccountInfo { 145 int32_t accountId = 0; 146 int32_t power = 0; 147 char bundleName[kMaxNumberLen + 1] = { 0 }; 148 bool isEnabled = false; 149 }; 150 151 /** 152 * @brief Indicates the call report information. 153 */ 154 struct CallReportInfo { 155 int32_t index = 0; 156 /** 157 * Indicates the call phone number. 158 */ 159 char accountNum[kMaxNumberLen + 1] = { 0 }; 160 int32_t accountId = 0; 161 /** 162 * Indicates the type of call, includs CS, IMS, OTT, OTHER. {@link CallType} 163 */ 164 CallType callType = CallType::TYPE_ERR_CALL; 165 /** 166 * Indicates the type of video state. {@link VideoStateType} 167 */ 168 VideoStateType callMode = VideoStateType::TYPE_VOICE; 169 /** 170 * Indicates the detailed state of call. {@link TelCallState} 171 */ 172 TelCallState state = TelCallState::CALL_STATUS_UNKNOWN; 173 /** 174 * Indicates the voica domain, 0: CS, 1: IMS 175 */ 176 int32_t voiceDomain = 0; 177 /** 178 * Indicates the Multi-party call status: 179 * 0: not a multi-party(conference) call 180 * 1: a multi-party(conference) call 181 */ 182 int32_t mpty = 0; 183 /** 184 * Indicates the color tone type. 185 */ 186 int32_t crsType = 0; 187 /** 188 * Indicates the initial type of this call. 189 */ 190 int32_t originalCallType = 0; 191 /** 192 * Indicates the VoIP call specific information 193 */ 194 VoipCallReportInfo voipCallInfo; 195 /** 196 * Call state between with holdRequest and holdResponse 197 */ 198 bool isPendingHold = false; 199 /** 200 * Identifies the CNAP display name; 201 * - 0:Allowed 202 * - 1:Restricted 203 * - 2:Not Specified/Unknown 204 * - 3:Payphone 205 */ 206 int32_t namePresentation = 0; 207 /** 208 * Indicates remote party name. 209 */ 210 std::string name = ""; 211 /** 212 * Indicates the call disconnect information 213 */ 214 DisconnectedReason reason = DisconnectedReason::FAILED_UNKNOWN; 215 }; 216 217 /** 218 * @brief Indicates the detail information of some calls record. 219 */ 220 struct CallsReportInfo { 221 /** 222 * Indicates a list of the call report information. 223 */ 224 std::vector<CallReportInfo> callVec {}; 225 /** 226 * Indicates the slot id. 227 */ 228 int32_t slotId = 0; 229 }; 230 231 /** 232 * @brief Indicates the detail information of a call. 233 */ 234 struct CallAttributeInfo { 235 /** 236 * Indicates the call phone number. 237 */ 238 char accountNumber[kMaxNumberLen + 1] = { 0 }; 239 /** 240 * Indicates the bundle name. 241 */ 242 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 243 /** 244 * Indicates whether the speaker phone is on. 245 */ 246 bool speakerphoneOn = false; 247 int32_t accountId = 0; 248 /** 249 * Indicates the type of video state. {@link VideoStateType} 250 */ 251 VideoStateType videoState = VideoStateType::TYPE_VOICE; 252 /** 253 * Indicates the Call start time. 254 */ 255 int64_t startTime = 0; 256 /** 257 * Indicates whether the call is emergency call. 258 */ 259 bool isEcc = false; 260 /** 261 * Indicates whether the call is emergency Contact call. 262 */ 263 bool isEccContact = false; 264 /** 265 * Indicates the type of call, includs CS, IMS, OTT, OTHER. {@link CallType} 266 */ 267 CallType callType = CallType::TYPE_ERR_CALL; 268 /** 269 * Indicates the call index. 270 */ 271 int32_t callId = 0; 272 /** 273 * Indicates the detailed state of call. {@link TelCallState} 274 */ 275 TelCallState callState = TelCallState::CALL_STATUS_UNKNOWN; 276 /** 277 * Indicates the state of conference call. {@link TelConferenceState} 278 */ 279 TelConferenceState conferenceState = TelConferenceState::TEL_CONFERENCE_IDLE; 280 /** 281 * Indicates the call beginning and ending time. 282 */ 283 time_t callBeginTime = 0; 284 time_t callCreateTime = 0; 285 time_t callEndTime = 0; 286 time_t ringBeginTime = 0; 287 time_t ringEndTime = 0; 288 /** 289 * Indicates the call is MO or MT. {@link CallDirection} 290 */ 291 CallDirection callDirection = CallDirection::CALL_DIRECTION_UNKNOW; 292 /** 293 * Indicates the cause when the call is answered. {@link CallAnswerType} 294 */ 295 CallAnswerType answerType = CallAnswerType::CALL_ANSWER_MISSED; 296 /* 297 * Indicates the call index in cellular call 298 */ 299 int32_t index = 0; 300 /** 301 * Indicates the color tone type. 302 */ 303 int32_t crsType = 0; 304 /** 305 * Indicates the initial type of this call. 306 */ 307 int32_t originalCallType = 0; 308 /** 309 * Indicates the VoIP call specific information 310 */ 311 VoipCallReportInfo voipCallInfo; 312 /** 313 * Indicates the location of phone number. 314 */ 315 char numberLocation[kMaxNumberLen + 1] = { 0 }; 316 /** 317 * Indicates the mark information of the phone number. 318 */ 319 NumberMarkInfo numberMarkInfo; 320 /** 321 * Indicates the reason of call blocked. 322 */ 323 int32_t blockReason = 0; 324 /** 325 * Indicates the type of celia call. 326 */ 327 int32_t celiaCallType = -1; 328 /** 329 * Indicates the extraParamsString information. 330 */ 331 std::string extraParamsString; 332 /** 333 * Indicates the contact name. 334 */ 335 char contactName[kMaxNumberLen + 1] = { 0 }; 336 /** 337 * Indicates the details of call detect result. 338 */ 339 char detectDetails[kMaxNumberLen + 1] = { 0 }; 340 /** 341 * Indicates the type of dial call from phone or watch. 342 */ 343 int32_t phoneOrWatch = 0; 344 /** 345 * Identifies the CNAP display name; 346 * - 0:Allowed 347 * - 1:Restricted 348 * - 2:Not Specified/Unknown 349 * - 3:Payphone 350 */ 351 int32_t namePresentation = 0; 352 /** 353 * Indicates remote party name. 354 */ 355 std::string name = ""; 356 /** 357 * Indicates the AntiFraud state. 358 * - 0: AntiFraud is not started. 359 * - 1: AntiFraud is started. 360 * - 2: detect the call is fraud call. 361 * - 3: AntiFraud is finished. 362 */ 363 int32_t antiFraudState = 0; 364 }; 365 366 /** 367 * @brief Indicates the detail information of call record. 368 */ 369 struct CallRecordInfo { 370 /** 371 * Indicates the call index. 372 */ 373 int32_t callId = 0; 374 /** 375 * Indicates the call phone number. 376 */ 377 char phoneNumber[kMaxNumberLen + 1] = { 0 }; 378 /** 379 * Indicates the number after formatted. 380 */ 381 char formattedNumber[kMaxNumberLen + 1] = { 0 }; 382 /** 383 * Indicates the phone number after formatted. 384 */ 385 char formattedNumberToE164[kMaxNumberLen + 1] = { 0 }; 386 /** 387 * Indicates the location of phone number. 388 */ 389 char numberLocation[kMaxNumberLen + 1] = { 0 }; 390 /** 391 * Indicates the type of call, includs CS, IMS, OTT, OTHER. {@link CallType} 392 */ 393 CallType callType = CallType::TYPE_ERR_CALL; 394 /** 395 * Indicates the type of video state. {@link VideoStateType} 396 */ 397 VideoStateType videoState = VideoStateType::TYPE_VOICE; 398 /** 399 * Indicates the call beginning time. 400 */ 401 time_t callBeginTime = 0; 402 /** 403 * Indicates the call create time. 404 */ 405 time_t callCreateTime = 0; 406 /** 407 * Indicates the call ending time. 408 */ 409 time_t callEndTime = 0; 410 /** 411 * Indicates the call ring duration. 412 */ 413 uint32_t ringDuration = 0; 414 /** 415 * Indicates the call session duration. 416 */ 417 uint32_t callDuration = 0; 418 /** 419 * Indicates the call is MO or MT. {@link CallDirection} 420 */ 421 CallDirection directionType = CallDirection::CALL_DIRECTION_UNKNOW; 422 /** 423 * Indicates the cause when the call is answered. {@link CallAnswerType} 424 */ 425 CallAnswerType answerType = CallAnswerType::CALL_ANSWER_MISSED; 426 /** 427 * Indicates the country code of the call. 428 */ 429 int32_t countryCode = 0; 430 /** 431 * Indicates the slot id. 432 */ 433 int32_t slotId = 0; 434 /** 435 * Indicates the call features. 436 */ 437 int32_t features = 0; 438 /** 439 * Indicates the mark information of the phone number. 440 */ 441 NumberMarkInfo numberMarkInfo; 442 /** 443 * Indicates the reason of call blocked. 444 */ 445 int32_t blockReason = 0; 446 447 /** 448 * Indicates the type of celia call. 449 */ 450 int32_t celiaCallType = -1; 451 452 /** 453 * Indicates the details of call detect result. 454 */ 455 char detectDetails[kMaxNumberLen + 1] = { 0 }; 456 /** 457 * Indicates remote party name. 458 */ 459 std::string name = ""; 460 /** 461 * Identifies the CNAP display name; 462 * - 0:Allowed 463 * - 1:Restricted 464 * - 2:Not Specified/Unknown 465 * - 3:Payphone 466 */ 467 int32_t namePresentation = 0; 468 CallRecordInfoCallRecordInfo469 CallRecordInfo() {} 470 CallRecordInfoCallRecordInfo471 CallRecordInfo(const CallRecordInfo &temp) 472 { 473 *this = temp; 474 } 475 476 CallRecordInfo &operator=(const CallRecordInfo &temp) 477 { 478 callId = temp.callId; 479 std::copy(std::begin(temp.phoneNumber), std::end(temp.phoneNumber), std::begin(phoneNumber)); 480 std::copy(std::begin(temp.formattedNumberToE164), std::end(temp.formattedNumberToE164), 481 std::begin(formattedNumberToE164)); 482 std::copy(std::begin(temp.formattedNumber), std::end(temp.formattedNumber), 483 std::begin(formattedNumber)); 484 std::copy(std::begin(temp.numberLocation), std::end(temp.numberLocation), 485 std::begin(numberLocation)); 486 callType = temp.callType; 487 callBeginTime = temp.callBeginTime; 488 callCreateTime = temp.callCreateTime; 489 callEndTime = temp.callEndTime; 490 ringDuration = temp.ringDuration; 491 callDuration = temp.callDuration; 492 directionType = temp.directionType; 493 answerType = temp.answerType; 494 countryCode = temp.countryCode; 495 slotId = temp.slotId; 496 videoState = temp.videoState; 497 features = temp.features; 498 numberMarkInfo.markType = temp.numberMarkInfo.markType; 499 std::copy(std::begin(temp.numberMarkInfo.markContent), std::end(temp.numberMarkInfo.markContent), 500 std::begin(numberMarkInfo.markContent)); 501 numberMarkInfo.markCount = temp.numberMarkInfo.markCount; 502 std::copy(std::begin(temp.numberMarkInfo.markSource), std::end(temp.numberMarkInfo.markSource), 503 std::begin(numberMarkInfo.markSource)); 504 numberMarkInfo.isCloud = temp.numberMarkInfo.isCloud; 505 std::copy(std::begin(temp.numberMarkInfo.markDetails), std::end(temp.numberMarkInfo.markDetails), 506 std::begin(numberMarkInfo.markDetails)); 507 blockReason = temp.blockReason; 508 celiaCallType = temp.celiaCallType; 509 std::copy(std::begin(temp.detectDetails), std::end(temp.detectDetails), 510 std::begin(detectDetails)); 511 namePresentation = temp.namePresentation; 512 name = temp.name; 513 return *this; 514 } 515 }; 516 517 /** 518 * @brief Indicates detail information of a call. 519 */ 520 struct CallDetailInfo { 521 /** 522 * Indicates the call index. 523 */ 524 int32_t index = 0; 525 /** 526 * Indicates the call phone number. 527 */ 528 char phoneNum[kMaxNumberLen + 1] = { 0 }; 529 /** 530 * Indicates the bundle name. 531 */ 532 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 533 /** 534 * Indicates the account id. 535 */ 536 int32_t accountId = 0; 537 /** 538 * Indicates the call type, CS, IMS, ERROR 539 */ 540 CallType callType = CallType::TYPE_ERR_CALL; 541 /** 542 * Indicates the call video state, 0: audio 1:video. 543 */ 544 VideoStateType callMode = VideoStateType::TYPE_VOICE; 545 /** 546 * Indicates the call status. 547 */ 548 TelCallState state = TelCallState::CALL_STATUS_UNKNOWN; 549 /** 550 * Indicates the voice domain. 0: CS, 1: IMS 551 */ 552 int32_t voiceDomain = 0; 553 /** 554 * Indicates the Multi-party call status: 555 * 0: not a multi-party(conference) call 556 * 1: a multi-party(conference) call 557 */ 558 int32_t mpty = 0; 559 /** 560 * Indicates the color tone type. 561 */ 562 int32_t crsType = 0; 563 /** 564 * Indicates the initial type of this call. 565 */ 566 int32_t originalCallType = 0; 567 /** 568 * Indicates the VoIP call specific information 569 */ 570 VoipCallReportInfo voipCallInfo; 571 /** 572 * Indicates remote party name. 573 */ 574 std::string name = ""; 575 /** 576 * Identifies the CNAP display name; 577 * - 0:Allowed 578 * - 1:Restricted 579 * - 2:Not Specified/Unknown 580 * - 3:Payphone 581 */ 582 int32_t namePresentation = 0; 583 584 int32_t phoneOrWatch = 0; 585 /** 586 * Indicates the disconnect reason. 587 */ 588 DisconnectedReason reason = DisconnectedReason::FAILED_UNKNOWN; 589 /** 590 * Indicates the AntiFraud state. 591 * - 0: AntiFraud is not started. 592 * - 1: AntiFraud is started. 593 * - 2: detect the call is fraud call. 594 * - 3: AntiFraud is finished. 595 */ 596 int32_t antiFraudState = 0; 597 CallDetailInfoCallDetailInfo598 CallDetailInfo() {} 599 CallDetailInfoCallDetailInfo600 CallDetailInfo(const CallDetailInfo &temp) 601 { 602 *this = temp; 603 } 604 605 CallDetailInfo &operator=(const CallDetailInfo &temp) 606 { 607 index = temp.index; 608 std::copy(std::begin(temp.phoneNum), std::end(temp.phoneNum), std::begin(phoneNum)); 609 std::copy(std::begin(temp.bundleName), std::end(temp.bundleName), std::begin(bundleName)); 610 accountId = temp.accountId; 611 callType = temp.callType; 612 callMode = temp.callMode; 613 state = temp.state; 614 voiceDomain = temp.voiceDomain; 615 mpty = temp.mpty; 616 crsType = temp.crsType; 617 originalCallType = temp.originalCallType; 618 voipCallInfo.voipCallId = temp.voipCallInfo.voipCallId; 619 voipCallInfo.extensionId = temp.voipCallInfo.extensionId; 620 voipCallInfo.userName = temp.voipCallInfo.userName; 621 (voipCallInfo.userProfile).assign( 622 (temp.voipCallInfo.userProfile).begin(), (temp.voipCallInfo.userProfile).end()); 623 voipCallInfo.abilityName = temp.voipCallInfo.abilityName; 624 voipCallInfo.voipBundleName = temp.voipCallInfo.voipBundleName; 625 voipCallInfo.showBannerForIncomingCall = temp.voipCallInfo.showBannerForIncomingCall; 626 voipCallInfo.isConferenceCall = temp.voipCallInfo.isConferenceCall; 627 voipCallInfo.isVoiceAnswerSupported = temp.voipCallInfo.isVoiceAnswerSupported; 628 voipCallInfo.hasMicPermission = temp.voipCallInfo.hasMicPermission; 629 voipCallInfo.isCapsuleSticky = temp.voipCallInfo.isCapsuleSticky; 630 voipCallInfo.uid = temp.voipCallInfo.uid; 631 name = temp.name; 632 namePresentation = temp.namePresentation; 633 phoneOrWatch = temp.phoneOrWatch; 634 reason = temp.reason; 635 antiFraudState = temp.antiFraudState; 636 return *this; 637 } 638 }; 639 640 /** 641 * @brief Indicates detail information of some calls. 642 */ 643 struct CallDetailsInfo { 644 /** 645 * Indicates a CallDetailInfo list. {@link CallDetailInfo} 646 */ 647 std::vector<CallDetailInfo> callVec {}; 648 /** 649 * Indicates the slot id. 650 */ 651 int32_t slotId = 0; 652 /** 653 * Indicates the bundle name. 654 */ 655 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 656 }; 657 658 /** 659 * @brief Indicates the type of call transfer setting. 660 * 661 * 27007-430_2001 7.11 Call forwarding number and conditions +CCFC 662 * 3GPP TS 22.082 [4] 663 * <mode>: 664 * 0 disable 665 * 1 enable 666 * 3 registration 667 * 4 erasure 668 */ 669 enum class CallTransferSettingType { 670 /** 671 * Indicates disable the call transfer. 672 */ 673 CALL_TRANSFER_DISABLE = 0, 674 /** 675 * Indicates enable the call transfer. 676 */ 677 CALL_TRANSFER_ENABLE = 1, 678 /** 679 * Indicates register the call transfer. 680 */ 681 CALL_TRANSFER_REGISTRATION = 3, 682 /** 683 * Indicates erasure the call transfer. 684 */ 685 CALL_TRANSFER_ERASURE = 4, 686 }; 687 688 /** 689 * @brief Indicates the Call forwarding type 690 * 691 * 27007-430_2001 7.11 Call forwarding number and conditions +CCFC 692 * 3GPP TS 22.082 [4] 693 * <reason>: 694 * 0 unconditional 695 * 1 mobile busy 696 * 2 no reply 697 * 3 not reachable 698 */ 699 enum class CallTransferType { 700 /** 701 * Indicates transfer the call unconditionally. 702 */ 703 TRANSFER_TYPE_UNCONDITIONAL = 0, 704 /** 705 * Indicates transfer the call when busy. 706 */ 707 TRANSFER_TYPE_BUSY = 1, 708 /** 709 * Indicates transfer the call when no reply. 710 */ 711 TRANSFER_TYPE_NO_REPLY = 2, 712 /** 713 * Indicates transfer the call when unreachable. 714 */ 715 TRANSFER_TYPE_NOT_REACHABLE = 3, 716 }; 717 718 /** 719 * @brief Indicates the information of call transfer. 720 */ 721 struct CallTransferInfo { 722 /** 723 * Indication the phone number which will forward to. 724 */ 725 char transferNum[kMaxNumberLen + 1] = { 0 }; 726 /** 727 * Indicates the type of call transfer setting. {@link CallTransferSettingType} 728 */ 729 CallTransferSettingType settingType = CallTransferSettingType::CALL_TRANSFER_DISABLE; 730 /** 731 * Indicates the Call forwarding type. {@link CallTransferType} 732 */ 733 CallTransferType type = CallTransferType::TRANSFER_TYPE_UNCONDITIONAL; 734 /** 735 * Start time hours. 736 */ 737 int32_t startHour = 0; 738 /** 739 * Start time minutes. 740 */ 741 int32_t startMinute = 0; 742 /** 743 * End time hours. 744 */ 745 int32_t endHour = 0; 746 /** 747 * End time minutes. 748 */ 749 int32_t endMinute = 0; 750 }; 751 752 /** 753 * @brief Indicates the type of call restriction. 754 * 755 * 3GPP TS 22.030 V4.0.0 (2001-03) 756 * 3GPP TS 22.088 V4.0.0 (2001-03) 757 */ 758 enum class CallRestrictionType { 759 /** 760 * Indicates restrict all incoming calls. 761 */ 762 RESTRICTION_TYPE_ALL_INCOMING = 0, 763 /** 764 * Indicates restrict all outgoing calls. 765 */ 766 RESTRICTION_TYPE_ALL_OUTGOING, 767 /** 768 * Indicates restrict international calls. 769 */ 770 RESTRICTION_TYPE_INTERNATIONAL, 771 /** 772 * Indicates restrict international roaming calls. 773 */ 774 RESTRICTION_TYPE_INTERNATIONAL_EXCLUDING_HOME, 775 /** 776 * Indicates restrict roaming calls. 777 */ 778 RESTRICTION_TYPE_ROAMING_INCOMING, 779 /** 780 * Indicates restrict all calls. 781 */ 782 RESTRICTION_TYPE_ALL_CALLS, 783 /** 784 * Indicates restrict all outgoing services. 785 */ 786 RESTRICTION_TYPE_OUTGOING_SERVICES, 787 /** 788 * Indicates restrict all incoming services. 789 */ 790 RESTRICTION_TYPE_INCOMING_SERVICES, 791 }; 792 793 /** 794 * @brief Indicates the mode of call restriction. 795 * 796 * 3GPP TS 22.088 V4.0.0 (2001-03) 797 */ 798 enum class CallRestrictionMode { 799 /** 800 * Indicates call restriction is deactivated. 801 */ 802 RESTRICTION_MODE_DEACTIVATION = 0, 803 /** 804 * Indicates call restriction is activated. 805 */ 806 RESTRICTION_MODE_ACTIVATION = 1, 807 }; 808 809 /** 810 * @brief Indicates the information of call restriction. 811 */ 812 struct CallRestrictionInfo { 813 /** 814 * Indicates the password required to set call restrictions. 815 */ 816 char password[kMaxNumberLen + 1] = { 0 }; 817 /** 818 * Indicates the type of call restriction. 819 */ 820 CallRestrictionType fac = CallRestrictionType::RESTRICTION_TYPE_ALL_INCOMING; 821 /** 822 * Indicates the mode of call restriction. 823 */ 824 CallRestrictionMode mode = CallRestrictionMode::RESTRICTION_MODE_DEACTIVATION; 825 }; 826 } // namespace Telephony 827 } // namespace OHOS 828 #endif // CALL_MANAGER_INFO_H