1 /* 2 * Copyright (C) 2021-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_INNER_TYPE_H 17 #define CALL_MANAGER_INNER_TYPE_H 18 19 #include "call_manager_base.h" 20 #include "call_manager_disconnected_details.h" 21 #include "call_manager_info.h" 22 23 namespace OHOS { 24 namespace Telephony { 25 /** 26 * @brief Indicates the Call Waiting response result. 27 */ 28 struct CallWaitResponse { 29 /** 30 * 0: ok other: error 31 */ 32 int32_t result = 0; 33 /** 34 * parameter sets/shows the result code presentation status in the TA. 35 */ 36 int32_t status = 0; 37 /** 38 * parameter shows the subscriber CW service status in the network. 39 */ 40 int32_t classCw = 0; 41 }; 42 43 /** 44 * @brief Indicates the Clip response result. 45 */ 46 struct ClipResponse { 47 /** 48 * 0: ok other: error 49 */ 50 int32_t result = 0; 51 /** 52 * parameter sets/shows the result code presentation status in the TA. 53 */ 54 int32_t action = 0; 55 /** 56 * parameter shows the subscriber CLIP service status in the network. 57 */ 58 int32_t clipStat = 0; 59 }; 60 61 /** 62 * @brief Indicates the Clir response result. 63 */ 64 struct ClirResponse { 65 /** 66 * 0: ok other: error 67 */ 68 int32_t result = 0; 69 /** 70 * parameter sets/shows the result code presentation status in the TA. 71 */ 72 int32_t action = 0; 73 /** 74 * parameter shows the subscriber CLIR service status in the network. 75 */ 76 int32_t clirStat = 0; 77 }; 78 79 /** 80 * @brief Indicates the Colr response result. 81 */ 82 struct ColrResponse { 83 /** 84 * 0: ok other: error 85 */ 86 int32_t result = 0; 87 /** 88 * parameter sets/shows the result code presentation status in the TA. 89 */ 90 int32_t action = 0; 91 /** 92 * parameter shows the subscriber COLR service status in the network. 93 */ 94 int32_t colrStat = 0; 95 }; 96 97 /** 98 * @brief Indicates the Colp response result. 99 */ 100 struct ColpResponse { 101 /** 102 * 0: ok other: error 103 */ 104 int32_t result = 0; 105 /** 106 * parameter sets/shows the result code presentation status in the TA. 107 */ 108 int32_t action = 0; 109 /** 110 * parameter shows the subscriber COLP service status in the network. 111 */ 112 int32_t colpStat = 0; 113 }; 114 115 /** 116 * @brief Indicates the MMI Code response result. 117 */ 118 struct MmiCodeInfo { 119 /** 120 * 0: ok other: error 121 */ 122 int32_t result = 0; 123 /** 124 * Indicates the specific message of MMI code response. 125 */ 126 char message[kMaxMessageLen + 1] = { 0 }; 127 /** 128 * SC type 129 */ 130 int32_t mmiCodeType = -1; 131 /** 132 * 0: query, 1:active, 2:deactive 133 */ 134 int32_t action = -1; 135 /** 136 * parameter sets/shows the result code presentation status in the TA 137 * 0: disable 138 * 1: enable 139 */ 140 int32_t status = -1; 141 /* 142 * <classCw> is a sum of integers each representing a class of information (default 7): 143 * 1 voice (telephony) 144 * 2 data (refers to all bearer services) 145 * 4 fax (facsimile services) 146 * 8 short message service 147 * 16 data circuit sync 148 * 32 data circuit async 149 * 64 dedicated packet access 150 * 128 dedicated PAD access 151 */ 152 int32_t classCw = -1; 153 /** 154 * Indication the phone number which will forward to. 155 */ 156 char number[kMaxNumberLen + 1] = { 0 }; 157 int32_t reason = -1; 158 int32_t time = -1; 159 }; 160 161 /** 162 * @brief Indicates the Call Transfer response result. 163 */ 164 struct CallTransferResponse { 165 /** 166 * 0: ok other: error 167 */ 168 int32_t result = 0; 169 /** 170 * Indicates the status of the CF option. 0: not active; 1: active 171 */ 172 int32_t status = 0; 173 /** 174 * <classx> is a sum of integers each representing a class of information 175 * (default 7): 176 * 1 voice (telephony) 177 * 2 data (refers to all bearer services) 178 * 4 fax (facsimile services) 179 * 8 short message service 180 * 16 data circuit sync 181 * 32 data circuit async 182 * 64 dedicated packet access 183 * 128 dedicated PAD access 184 */ 185 int32_t classx = 0; 186 /** 187 * type of address octet in integer format (refer GSM 04.08 [8] 188 * subclause 10.5.4.7); default 145 when dialling string includes 189 * international access code character "+", otherwise 129. 190 */ 191 int32_t type = 0; 192 /** 193 * Indication the phone number which will forward to. 194 */ 195 char number[kMaxNumberLen + 1] = { 0 }; 196 int32_t reason = 0; 197 int32_t time = 0; 198 /** 199 * Indicates the Call forwarding start time. 200 */ 201 int32_t startHour = INVALID_TIME; 202 int32_t startMinute = INVALID_TIME; 203 /** 204 * Indicates the Call forwarding end time. 205 */ 206 int32_t endHour = INVALID_TIME; 207 int32_t endMinute = INVALID_TIME; 208 }; 209 210 /** 211 * @brief Indicates the Call Restriction response result. 212 */ 213 struct CallRestrictionResponse { 214 /** 215 * 0: ok other: error 216 */ 217 int32_t result = 0; 218 /** 219 * parameter sets/shows the result code presentation status in the TA 220 */ 221 int32_t status = 0; 222 /** 223 * parameter shows the subscriber Call Restriction service status 224 * in the network. 225 */ 226 int32_t classCw = 0; 227 }; 228 229 /** 230 * @brief Indicates the Call Preference response result. 231 */ 232 struct CallPreferenceResponse { 233 /** 234 * 0: ok other: error 235 */ 236 int32_t result = 0; 237 /** 238 * Indicates the specific value of the call preference mode. 239 * 240 * 1:CS Voice only 241 * 2:CS Voice preferred, IMS PS Voice as secondary 242 * 3:IMS PS Voice preferred, CS Voice as secondary 243 * 4:IMS PS Voice only 244 */ 245 int32_t mode = 0; 246 }; 247 248 /** 249 * @brief Indicates the GetImsConfig response result. 250 */ 251 struct GetImsConfigResponse { 252 /** 253 * 0: ok other: error 254 */ 255 int32_t result = 0; 256 /** 257 * Indicates the specific value of the corresponding IMS config. 258 */ 259 int32_t value = 0; 260 }; 261 262 /** 263 * @brief Indicates the GetImsFeatureValue response result. 264 */ 265 struct GetImsFeatureValueResponse { 266 /** 267 * 0: ok other: error 268 */ 269 int32_t result = 0; 270 /** 271 * Indicates the specific value of the corresponding IMS feature. 272 */ 273 int32_t value = 0; 274 }; 275 276 struct GetLteEnhanceModeResponse { 277 /** 278 * 0: ok other: error 279 */ 280 int32_t result = 0; 281 /** 282 * Indicates the specific value of the LTE Enhance mode. 283 */ 284 int32_t value = 0; 285 }; 286 287 struct MuteControlResponse { 288 /** 289 * 0: ok other: error 290 */ 291 int32_t result = 0; 292 /** 293 * Indicates the specific value of mute setting. 0: not mute 1: set mute 294 */ 295 int32_t value = 0; 296 }; 297 298 /** 299 * @brief Indicates the type of supplementary service request. 300 */ 301 enum class SsRequestType { 302 SS_ACTIVATION = 0, 303 SS_DEACTIVATION, 304 SS_INTERROGATION, 305 SS_REGISTRATION, 306 SS_ERASURE, 307 }; 308 309 /** 310 * @brief Indicates the video window size and location in video call. 311 */ 312 struct VideoWindow { 313 /** 314 * X coordinate of window 315 */ 316 int32_t x = 0; 317 /** 318 * Y coordinate of window 319 */ 320 int32_t y = 0; 321 /** 322 * Z coordinate of window 323 */ 324 int32_t z = 0; 325 /** 326 * the width of window 327 */ 328 int32_t width = 0; 329 /** 330 * the height of window 331 */ 332 int32_t height = 0; 333 }; 334 335 /** 336 * @brief Indicates the +CHLD related supplementary services 337 * 338 * 3GPP TS 27.007 V3.9.0 (2001-06) Call related supplementary services +CHLD 339 * 3GPP TS 27.007 V3.9.0 (2001-06) 7.22 Informative examples 340 */ 341 enum CallSupplementType { 342 /** 343 * default type 344 */ 345 TYPE_DEFAULT = 0, 346 /** 347 * release the held call and the wait call 348 */ 349 TYPE_HANG_UP_HOLD_WAIT = 1, 350 /** 351 * release the active call and recover the held call 352 */ 353 TYPE_HANG_UP_ACTIVE = 2, 354 /** 355 * release all calls 356 */ 357 TYPE_HANG_UP_ALL = 3, 358 }; 359 360 enum CellularCallReturnType { 361 /** 362 * 3GPP TS 27.007 V3.9.0 (2001-06) 6.27 Informative examples 363 */ 364 RETURN_TYPE_MMI = 0, 365 }; 366 367 /** 368 * @brief Indicates the voice domain preference. 369 * 370 * 3GPP TS 27.007 V17.3.0 (2021-09) 10.1.35 UE's voice domain 371 * preference E-UTRAN +CEVDP 372 */ 373 enum DomainPreferenceMode { 374 /** 375 * Indicates the voice domain preference is CS only. 376 */ 377 CS_VOICE_ONLY = 1, 378 /** 379 * Indicates the voice domain preference is CS prefered. 380 */ 381 CS_VOICE_PREFERRED = 2, 382 /** 383 * Indicates the voice domain preference is PS prefered. 384 */ 385 IMS_PS_VOICE_PREFERRED = 3, 386 /** 387 * Indicates the voice domain preference is PS only. 388 */ 389 IMS_PS_VOICE_ONLY = 4, 390 }; 391 392 /** 393 * @brief Indicates the IMS call mode. 394 */ 395 enum ImsCallMode { 396 CALL_MODE_AUDIO_ONLY = 0, 397 CALL_MODE_SEND_ONLY, 398 CALL_MODE_RECEIVE_ONLY, 399 CALL_MODE_SEND_RECEIVE, 400 CALL_MODE_VIDEO_PAUSED, 401 }; 402 403 /** 404 * @brief Indicates the IMS call mode request result. 405 */ 406 enum VideoRequestResultType { 407 TYPE_REQUEST_SUCCESS = 0, 408 TYPE_REQUEST_FAIL, 409 TYPE_REQUEST_INVALID, 410 TYPE_REQUEST_TIMED_OUT, 411 REQUEST_REJECTED_BY_REMOTE, 412 TYPE_REQUEST_UPGRADE_CANCELED, 413 TYPE_MODIFY_DOWNGRADE_RTP_OR_RTCP_TIMEOUT = 100, 414 TYPE_MODIFY_DOWNGRADE_RTP_AND_RTCP_TIMEOUT, 415 }; 416 417 /** 418 * @brief Indicates the request call media mode. 419 */ 420 struct CallMediaModeRequest { 421 /** 422 * Indicates the call phone number. 423 */ 424 char phoneNum[kMaxNumberLen + 1] = { 0 }; 425 /** 426 * Indicates the IMS call mode. {@link ImsCallMode} 427 */ 428 ImsCallMode mode = ImsCallMode::CALL_MODE_AUDIO_ONLY; 429 }; 430 431 /** 432 * @brief Indicates the response of the call media mode request. 433 */ 434 struct CallMediaModeInfo { 435 /** 436 * Indicates the call id. 437 */ 438 int32_t callId = 0; 439 /** 440 * Indicates if the ims call info is request which received from remote. 441 */ 442 bool isRequestInfo = false; 443 /** 444 * Indicates the response result. 445 */ 446 VideoRequestResultType result = VideoRequestResultType::TYPE_REQUEST_SUCCESS; 447 /** 448 * Indicates the call mode result. 449 */ 450 ImsCallMode callMode = ImsCallMode::CALL_MODE_AUDIO_ONLY; 451 CallMediaModeInfoCallMediaModeInfo452 CallMediaModeInfo() {} 453 CallMediaModeInfoCallMediaModeInfo454 CallMediaModeInfo(const CallMediaModeInfo &temp) 455 { 456 *this = temp; 457 } 458 459 CallMediaModeInfo &operator=(const CallMediaModeInfo &temp) 460 { 461 callId = temp.callId; 462 isRequestInfo = temp.isRequestInfo; 463 result = temp.result; 464 callMode = temp.callMode; 465 return *this; 466 } 467 }; 468 469 /** 470 * @brief Indicates the ImsCallMode report information from cellular call. 471 */ 472 struct CallModeReportInfo { 473 /** 474 * Indicates the call index. 475 */ 476 int32_t callIndex = 0; 477 /** 478 * Indicates the response result. 479 */ 480 VideoRequestResultType result = VideoRequestResultType::TYPE_REQUEST_SUCCESS; 481 /** 482 * Indicates the response result. 483 */ 484 ImsCallMode callMode = ImsCallMode::CALL_MODE_AUDIO_ONLY; 485 486 int32_t slotId = -1; 487 }; 488 489 /** 490 * @brief Indicates the response of the call media mode request. 491 */ 492 struct CallSessionEvent { 493 /** 494 * Indicates the event ID of call ability. {@link CallAbilityEventId} 495 */ 496 CallSessionEventId eventId = CallSessionEventId::EVENT_CAMERA_FAILURE; 497 /** 498 * Indicates the call phone number. 499 */ 500 int32_t callId = 0; 501 CallSessionEventCallSessionEvent502 CallSessionEvent() {} 503 CallSessionEventCallSessionEvent504 CallSessionEvent(const CallSessionEvent &temp) 505 { 506 *this = temp; 507 } 508 509 CallSessionEvent &operator=(const CallSessionEvent &temp) 510 { 511 callId = temp.callId; 512 eventId = temp.eventId; 513 return *this; 514 } 515 }; 516 517 /** 518 * @brief Indicates the detail information of some calls record. 519 */ 520 struct CallSessionReportInfo { 521 /** 522 * Indicates call index. 523 */ 524 int32_t index = 0; 525 /** 526 * Indicates the response result. 527 */ 528 CallSessionEventId eventId = CallSessionEventId::EVENT_CAMERA_FAILURE; 529 }; 530 531 struct PeerDimensionsDetail { 532 /** 533 * Indicates the call phone number. 534 */ 535 int32_t callId = 0; 536 /** 537 * Indicates the call phone number. 538 */ 539 int32_t width = 0; 540 /** 541 * Indicates the response result. 542 */ 543 int32_t height = 0; 544 PeerDimensionsDetailPeerDimensionsDetail545 PeerDimensionsDetail() {} 546 PeerDimensionsDetailPeerDimensionsDetail547 PeerDimensionsDetail(const PeerDimensionsDetail &temp) 548 { 549 *this = temp; 550 } 551 552 PeerDimensionsDetail &operator=(const PeerDimensionsDetail &temp) 553 { 554 callId = temp.callId; 555 width = temp.width; 556 height = temp.height; 557 return *this; 558 } 559 }; 560 561 struct PeerDimensionsReportInfo { 562 /** 563 * Indicates call index. 564 */ 565 int32_t index = 0; 566 /** 567 * Indicates the peer window width. 568 */ 569 int32_t width = 0; 570 /** 571 * Indicates the peer window height. 572 */ 573 int32_t height = 0; 574 }; 575 576 struct CameraCapabilities { 577 /** 578 * Indicates the call phone number. 579 */ 580 int32_t callId = 0; 581 /** 582 * Indicates the call phone number. 583 */ 584 int32_t width = 0; 585 /** 586 * Indicates the response result. 587 */ 588 int32_t height = 0; 589 CameraCapabilitiesCameraCapabilities590 CameraCapabilities() {} 591 CameraCapabilitiesCameraCapabilities592 CameraCapabilities(const CameraCapabilities &temp) 593 { 594 *this = temp; 595 } 596 597 CameraCapabilities &operator=(const CameraCapabilities &temp) 598 { 599 callId = temp.callId; 600 width = temp.width; 601 height = temp.height; 602 return *this; 603 } 604 }; 605 606 struct CameraCapabilitiesReportInfo { 607 /** 608 * Indicates call index. 609 */ 610 int32_t index = 0; 611 /** 612 * Indicates the camera width. 613 */ 614 int32_t width = 0; 615 /** 616 * Indicates the camera height. 617 */ 618 int32_t height = 0; 619 }; 620 621 /** 622 * @brief Indicates the specific IMS config item. 623 */ 624 enum ImsConfigItem { 625 /** 626 * Indicates the specific IMS config item is video quality. 627 */ 628 ITEM_VIDEO_QUALITY = 0, 629 630 /** 631 * Indicates the specific IMS config item is IMS switch status. 632 * 633 * 3GPP TS 24.167 V17.1.0 (2020-12) 5.31 634 * /<X>/Mobility_Management_IMS_Voice_Termination 635 * Ims Switch Status 636 * 637 * format: bool 638 * Access Types: Get, Replace 639 * Values: 0, 1 640 * 0 – Mobility Management for IMS Voice Termination disabled. 641 * 1 – Mobility Management for IMS Voice Termination enabled. 642 */ 643 ITEM_IMS_SWITCH_STATUS, 644 }; 645 646 /** 647 * @brief Indicates the VoNR switch status. 648 */ 649 enum class VoNRState { 650 /** 651 * Indicates the VoNR switch is off. 652 */ 653 VONR_STATE_OFF = 0, 654 /** 655 * Indicates the VoNR switch is on. 656 */ 657 VONR_STATE_ON = 1, 658 }; 659 660 /** 661 * @brief Indicates the video quality is high or low. 662 */ 663 enum VideoQualityValue { 664 /** 665 * Indicates the video quality is high. 666 */ 667 LOW = 0, 668 /** 669 * Indicates the video quality is low. 670 */ 671 HIGH = 1, 672 }; 673 674 enum ImsConfigValue { 675 CONFIG_SUCCESS = 0, 676 CONFIG_FAILED = 1, 677 }; 678 679 /** 680 * @brief Indicates the specific IMS feature. 681 * 682 * Official Document IR.92 - IMS Profile for Voice and SMS 683 * Annex C MNO provisioning and Late Customization 684 * 685 * format: bool 686 * 3GPP TS 24.167 V17.1.0 (2020-12) 5.43 /<X>/Media_type_restriction_policy 687 */ 688 enum FeatureType { 689 /** 690 * Indicates the IMS feature is Voice over LTE. 691 */ 692 TYPE_VOICE_OVER_LTE = 0, 693 /** 694 * Indicates the IMS feature is Video over LTE. 695 */ 696 TYPE_VIDEO_OVER_LTE, 697 /** 698 * Indicates the IMS feature is SS over UT. 699 */ 700 TYPE_SS_OVER_UT, 701 }; 702 703 /** 704 * @brief Indicates the specific OTT call request service. 705 */ 706 enum class OttCallRequestId { 707 OTT_REQUEST_DIAL = 0, 708 OTT_REQUEST_HANG_UP, 709 OTT_REQUEST_REJECT, 710 OTT_REQUEST_ANSWER, 711 OTT_REQUEST_HOLD, 712 OTT_REQUEST_UN_HOLD, 713 OTT_REQUEST_SWITCH, 714 OTT_REQUEST_COMBINE_CONFERENCE, 715 OTT_REQUEST_SEPARATE_CONFERENCE, 716 OTT_REQUEST_KICK_OUT_CONFERENCE, 717 OTT_REQUEST_INVITE_TO_CONFERENCE, 718 OTT_REQUEST_UPDATE_CALL_MEDIA_MODE, 719 }; 720 721 /** 722 * @brief Indicates the OTT call request information. 723 */ 724 struct OttCallRequestInfo { 725 /** 726 * Indicates the call phone number. 727 */ 728 char phoneNum[kMaxNumberLen + 1] = { 0 }; 729 /** 730 * Indicates the bundle name. 731 */ 732 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 733 /** 734 * Indicates the call video state, 0: audio 1:video. 735 */ 736 VideoStateType videoState = VideoStateType::TYPE_VOICE; 737 }; 738 739 /** 740 * @brief Indicates the OTT call detail information. 741 */ 742 struct OttCallDetailsInfo { 743 /** 744 * Indicates the call phone number. 745 */ 746 char phoneNum[kMaxNumberLen + 1] = { 0 }; 747 /** 748 * Indicates the bundle name. 749 */ 750 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 751 /** 752 * Indicates the call video state, 0: audio 1:video. 753 */ 754 VideoStateType videoState = VideoStateType::TYPE_VOICE; 755 /** 756 * Indicates the call status. 757 */ 758 TelCallState callState = TelCallState::CALL_STATUS_UNKNOWN; 759 }; 760 761 /** 762 * @brief Indicates the OTT call event ID. 763 */ 764 enum class OttCallEventId { 765 OTT_CALL_EVENT_FUNCTION_UNSUPPORTED = 0, 766 }; 767 768 /** 769 * @brief Indicates the OTT call event information. 770 */ 771 struct OttCallEventInfo { 772 /** 773 * Indicates the OTT call event ID. 774 */ 775 OttCallEventId ottCallEventId = OttCallEventId::OTT_CALL_EVENT_FUNCTION_UNSUPPORTED; 776 /** 777 * Indicates the bundle name. 778 */ 779 char bundleName[kMaxBundleNameLen + 1] = { 0 }; 780 OttCallEventInfoOttCallEventInfo781 OttCallEventInfo() {} 782 OttCallEventInfoOttCallEventInfo783 OttCallEventInfo(const OttCallEventInfo &temp) 784 { 785 *this = temp; 786 } 787 788 OttCallEventInfo &operator=(const OttCallEventInfo &temp) 789 { 790 ottCallEventId = temp.ottCallEventId; 791 std::copy(std::begin(temp.bundleName), std::end(temp.bundleName), std::begin(bundleName)); 792 return *this; 793 } 794 }; 795 796 /** 797 * @brief Indicates the audio device type and address. 798 */ 799 struct AudioDevice { 800 /** 801 * Indicates the audio device type. {@link AudioDeviceType} 802 */ 803 AudioDeviceType deviceType = AudioDeviceType::DEVICE_UNKNOWN; 804 /** 805 * Indicates the device address. 806 */ 807 char address[kMaxAddressLen + 1] = { 0 }; 808 /** 809 * Indicates the device name. 810 */ 811 char deviceName[kMaxDeviceNameLen + 1] = { 0 }; 812 }; 813 814 /** 815 * @brief Indicates the audio device information. 816 */ 817 struct AudioDeviceInfo { 818 /** 819 * Indicates the list of all audio devices. 820 */ 821 std::vector<AudioDevice> audioDeviceList {}; 822 /** 823 * Indicates the current audio device. 824 */ 825 AudioDevice currentAudioDevice; 826 /** 827 * Indicates wether the device is muted, true: mute, false: no mute 828 */ 829 bool isMuted = false; 830 /** 831 * The callId of audio device change. 832 */ 833 int32_t callId = 0; 834 }; 835 836 enum class MmiCodeResult { 837 MMI_CODE_SUCCESS = 0, 838 MMI_CODE_FAILED = 1 839 }; 840 } // namespace Telephony 841 } // namespace OHOS 842 #endif // CALL_MANAGER_INNER_TYPE_H 843