• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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      * Indicates the detail message for the ending call reason.
217      */
218     std::string message = "";
219     /**
220      * Whether to use the message box.
221      * - 0: No
222      * - 1: Yes
223      */
224     int32_t newCallUseBox = 0;
225 };
226 
227 /**
228  * @brief Indicates the detail information of some calls record.
229  */
230 struct CallsReportInfo {
231     /**
232      * Indicates a list of the call report information.
233      */
234     std::vector<CallReportInfo> callVec {};
235     /**
236      * Indicates the slot id.
237      */
238     int32_t slotId = 0;
239 };
240 
241 /**
242  * @brief Indicates the detail information of a call.
243  */
244 struct CallAttributeInfo {
245     /**
246      * Indicates the call phone number.
247      */
248     char accountNumber[kMaxNumberLen + 1] = { 0 };
249     /**
250      * Indicates the bundle name.
251      */
252     char bundleName[kMaxBundleNameLen + 1] = { 0 };
253     /**
254      * Indicates whether the speaker phone is on.
255      */
256     bool speakerphoneOn = false;
257     int32_t accountId = 0;
258     /**
259      * Indicates the type of video state. {@link VideoStateType}
260      */
261     VideoStateType videoState = VideoStateType::TYPE_VOICE;
262     /**
263      * Indicates the Call start time.
264      */
265     int64_t startTime = 0;
266     /**
267      * Indicates whether the call is emergency call.
268      */
269     bool isEcc = false;
270     /**
271      * Indicates whether the call is emergency Contact call.
272      */
273     bool isEccContact = false;
274     /**
275      * Indicates the type of call, includs CS, IMS, OTT, OTHER. {@link CallType}
276      */
277     CallType callType = CallType::TYPE_ERR_CALL;
278     /**
279      * Indicates the call index.
280      */
281     int32_t callId = 0;
282     /**
283      * Indicates the detailed state of call. {@link TelCallState}
284      */
285     TelCallState callState = TelCallState::CALL_STATUS_UNKNOWN;
286     /**
287      * Indicates the state of conference call. {@link TelConferenceState}
288      */
289     TelConferenceState conferenceState = TelConferenceState::TEL_CONFERENCE_IDLE;
290     /**
291      * Indicates the call beginning and ending time.
292      */
293     time_t callBeginTime = 0;
294     time_t callCreateTime = 0;
295     time_t callEndTime = 0;
296     time_t ringBeginTime = 0;
297     time_t ringEndTime = 0;
298     /**
299      * Indicates the call is MO or MT. {@link CallDirection}
300      */
301     CallDirection callDirection = CallDirection::CALL_DIRECTION_UNKNOW;
302     /**
303      * Indicates the cause when the call is answered. {@link CallAnswerType}
304      */
305     CallAnswerType answerType = CallAnswerType::CALL_ANSWER_MISSED;
306     /*
307      * Indicates the call index in cellular call
308      */
309     int32_t index = 0;
310     /**
311      * Indicates the color tone type.
312      */
313     int32_t crsType = 0;
314     /**
315      * Indicates the initial type of this call.
316      */
317     int32_t originalCallType = 0;
318     /**
319      * Indicates the VoIP call specific information
320      */
321     VoipCallReportInfo voipCallInfo;
322     /**
323      * Indicates the location of phone number.
324      */
325     char numberLocation[kMaxNumberLen + 1] = { 0 };
326     /**
327      * Indicates the mark information of the phone number.
328      */
329     NumberMarkInfo numberMarkInfo;
330     /**
331      * Indicates the reason of call blocked.
332      */
333     int32_t blockReason = 0;
334     /**
335      * Indicates the type of celia call.
336      */
337     int32_t celiaCallType = -1;
338     /**
339      * Indicates the extraParamsString information.
340      */
341     std::string extraParamsString;
342     /**
343      * Indicates the contact name.
344      */
345     char contactName[kMaxNumberLen + 1] = { 0 };
346     /**
347      * Indicates the details of call detect result.
348      */
349     char detectDetails[kMaxNumberLen + 1] = { 0 };
350     /**
351      * Indicates the type of dial call from phone or watch.
352      */
353     int32_t phoneOrWatch = 0;
354     /**
355      * Identifies the CNAP display name;
356      * - 0:Allowed
357      * - 1:Restricted
358      * - 2:Not Specified/Unknown
359      * - 3:Payphone
360      */
361     int32_t namePresentation = 0;
362     /**
363      * Indicates remote party name.
364      */
365     std::string name = "";
366     /**
367      * Indicates the AntiFraud state.
368      * - 0: AntiFraud is not started.
369      * - 1: AntiFraud is started.
370      * - 2: detect the call is fraud call.
371      * - 3: AntiFraud is finished.
372      */
373     int32_t antiFraudState = 0;
374     /**
375      * Whether to use the message box.
376      * - 0: No
377      * - 1: Yes
378      */
379     int32_t newCallUseBox = 0;
380 };
381 
382 /**
383  * @brief Indicates the detail information of call record.
384  */
385 struct CallRecordInfo {
386     /**
387      * Indicates the call index.
388      */
389     int32_t callId = 0;
390     /**
391      * Indicates the call phone number.
392      */
393     char phoneNumber[kMaxNumberLen + 1] = { 0 };
394     /**
395      * Indicates the number after formatted.
396      */
397     char formattedNumber[kMaxNumberLen + 1] = { 0 };
398     /**
399      * Indicates the phone number after formatted.
400      */
401     char formattedNumberToE164[kMaxNumberLen + 1] = { 0 };
402     /**
403      * Indicates the location of phone number.
404      */
405     char numberLocation[kMaxNumberLen + 1] = { 0 };
406     /**
407      * Indicates the type of call, includs CS, IMS, OTT, OTHER. {@link CallType}
408      */
409     CallType callType = CallType::TYPE_ERR_CALL;
410     /**
411      * Indicates the type of video state. {@link VideoStateType}
412      */
413     VideoStateType videoState = VideoStateType::TYPE_VOICE;
414     /**
415      * Indicates the call beginning time.
416      */
417     time_t callBeginTime = 0;
418     /**
419      * Indicates the call create time.
420      */
421     time_t callCreateTime = 0;
422     /**
423      * Indicates the call ending time.
424      */
425     time_t callEndTime = 0;
426     /**
427      * Indicates the call ring duration.
428      */
429     uint32_t ringDuration = 0;
430     /**
431      * Indicates the call session duration.
432      */
433     uint32_t callDuration = 0;
434     /**
435      * Indicates the call is MO or MT. {@link CallDirection}
436      */
437     CallDirection directionType = CallDirection::CALL_DIRECTION_UNKNOW;
438     /**
439      * Indicates the cause when the call is answered. {@link CallAnswerType}
440      */
441     CallAnswerType answerType = CallAnswerType::CALL_ANSWER_MISSED;
442     /**
443      * Indicates the country code of the call.
444      */
445     int32_t countryCode = 0;
446     /**
447      * Indicates the slot id.
448      */
449     int32_t slotId = 0;
450     /**
451      * Indicates the call features.
452      */
453     int32_t features = 0;
454     /**
455      * Indicates the mark information of the phone number.
456      */
457     NumberMarkInfo numberMarkInfo;
458     /**
459      * Indicates the reason of call blocked.
460      */
461     int32_t blockReason = 0;
462 
463     /**
464      * Indicates the type of celia call.
465      */
466     int32_t celiaCallType = -1;
467 
468     /**
469      * Indicates the details of call detect result.
470      */
471     char detectDetails[kMaxNumberLen + 1] = { 0 };
472     /**
473      * Indicates remote party name.
474      */
475     std::string name = "";
476     /**
477      * Identifies the CNAP display name;
478      * - 0:Allowed
479      * - 1:Restricted
480      * - 2:Not Specified/Unknown
481      * - 3:Payphone
482      */
483     int32_t namePresentation = 0;
484     /**
485      * Whether to use the message box.
486      * - 0: No
487      * - 1: Yes
488      */
489     int32_t newCallUseBox = 0;
490 
CallRecordInfoCallRecordInfo491     CallRecordInfo() {}
492 
CallRecordInfoCallRecordInfo493     CallRecordInfo(const CallRecordInfo &temp)
494     {
495         *this = temp;
496     }
497 
498     CallRecordInfo &operator=(const CallRecordInfo &temp)
499     {
500         callId = temp.callId;
501         std::copy(std::begin(temp.phoneNumber), std::end(temp.phoneNumber), std::begin(phoneNumber));
502         std::copy(std::begin(temp.formattedNumberToE164), std::end(temp.formattedNumberToE164),
503             std::begin(formattedNumberToE164));
504         std::copy(std::begin(temp.formattedNumber), std::end(temp.formattedNumber),
505             std::begin(formattedNumber));
506         std::copy(std::begin(temp.numberLocation), std::end(temp.numberLocation),
507             std::begin(numberLocation));
508         callType = temp.callType;
509         callBeginTime = temp.callBeginTime;
510         callCreateTime = temp.callCreateTime;
511         callEndTime = temp.callEndTime;
512         ringDuration = temp.ringDuration;
513         callDuration = temp.callDuration;
514         directionType = temp.directionType;
515         answerType = temp.answerType;
516         countryCode = temp.countryCode;
517         slotId = temp.slotId;
518         videoState = temp.videoState;
519         features = temp.features;
520         numberMarkInfo.markType = temp.numberMarkInfo.markType;
521         std::copy(std::begin(temp.numberMarkInfo.markContent), std::end(temp.numberMarkInfo.markContent),
522             std::begin(numberMarkInfo.markContent));
523         numberMarkInfo.markCount = temp.numberMarkInfo.markCount;
524         std::copy(std::begin(temp.numberMarkInfo.markSource), std::end(temp.numberMarkInfo.markSource),
525             std::begin(numberMarkInfo.markSource));
526         numberMarkInfo.isCloud = temp.numberMarkInfo.isCloud;
527         std::copy(std::begin(temp.numberMarkInfo.markDetails), std::end(temp.numberMarkInfo.markDetails),
528             std::begin(numberMarkInfo.markDetails));
529         blockReason = temp.blockReason;
530         celiaCallType = temp.celiaCallType;
531         std::copy(std::begin(temp.detectDetails), std::end(temp.detectDetails),
532             std::begin(detectDetails));
533         namePresentation = temp.namePresentation;
534         name = temp.name;
535         newCallUseBox = temp.newCallUseBox;
536         return *this;
537     }
538 };
539 
540 /**
541  * @brief Indicates detail information of a call.
542  */
543 struct CallDetailInfo {
544     /**
545      * Indicates the call index.
546      */
547     int32_t index = 0;
548     /**
549      * Indicates the call phone number.
550      */
551     char phoneNum[kMaxNumberLen + 1] = { 0 };
552     /**
553      * Indicates the bundle name.
554      */
555     char bundleName[kMaxBundleNameLen + 1] = { 0 };
556     /**
557      * Indicates the account id.
558      */
559     int32_t accountId = 0;
560     /**
561      * Indicates the call type, CS, IMS, ERROR
562      */
563     CallType callType = CallType::TYPE_ERR_CALL;
564     /**
565      * Indicates the call video state, 0: audio 1:video.
566      */
567     VideoStateType callMode = VideoStateType::TYPE_VOICE;
568     /**
569      * Indicates the call status.
570      */
571     TelCallState state = TelCallState::CALL_STATUS_UNKNOWN;
572     /**
573      * Indicates the voice domain. 0: CS, 1: IMS
574      */
575     int32_t voiceDomain = 0;
576     /**
577      * Indicates the Multi-party call status:
578      * 0: not a multi-party(conference) call
579      * 1: a multi-party(conference) call
580      */
581     int32_t mpty = 0;
582     /**
583      * Indicates the color tone type.
584      */
585     int32_t crsType = 0;
586     /**
587      * Indicates the initial type of this call.
588      */
589     int32_t originalCallType = 0;
590     /**
591      * Indicates the VoIP call specific information
592      */
593     VoipCallReportInfo voipCallInfo;
594     /**
595      * Indicates remote party name.
596      */
597     std::string name = "";
598     /**
599      * Identifies the CNAP display name;
600      * - 0:Allowed
601      * - 1:Restricted
602      * - 2:Not Specified/Unknown
603      * - 3:Payphone
604      */
605     int32_t namePresentation = 0;
606 
607     int32_t phoneOrWatch = 0;
608     /**
609      * Indicates the disconnect reason.
610     */
611     DisconnectedReason reason = DisconnectedReason::FAILED_UNKNOWN;
612     /**
613      * Indicates the AntiFraud state.
614      * - 0: AntiFraud is not started.
615      * - 1: AntiFraud is started.
616      * - 2: detect the call is fraud call.
617      * - 3: AntiFraud is finished.
618      */
619     int32_t antiFraudState = 0;
620     /**
621      * Indicates the detail message for the ending call reason.
622      */
623     std::string message = "";
624     /**
625      * Whether to use the message box.
626      * - 0: No
627      * - 1: Yes
628      */
629     int32_t newCallUseBox = 0;
630 
CallDetailInfoCallDetailInfo631     CallDetailInfo() {}
632 
CallDetailInfoCallDetailInfo633     CallDetailInfo(const CallDetailInfo &temp)
634     {
635         *this = temp;
636     }
637 
638     CallDetailInfo &operator=(const CallDetailInfo &temp)
639     {
640         index = temp.index;
641         std::copy(std::begin(temp.phoneNum), std::end(temp.phoneNum), std::begin(phoneNum));
642         std::copy(std::begin(temp.bundleName), std::end(temp.bundleName), std::begin(bundleName));
643         accountId = temp.accountId;
644         callType = temp.callType;
645         callMode = temp.callMode;
646         state = temp.state;
647         voiceDomain = temp.voiceDomain;
648         mpty = temp.mpty;
649         crsType = temp.crsType;
650         originalCallType = temp.originalCallType;
651         voipCallInfo.voipCallId = temp.voipCallInfo.voipCallId;
652         voipCallInfo.extensionId = temp.voipCallInfo.extensionId;
653         voipCallInfo.userName = temp.voipCallInfo.userName;
654         (voipCallInfo.userProfile).assign(
655             (temp.voipCallInfo.userProfile).begin(), (temp.voipCallInfo.userProfile).end());
656         voipCallInfo.abilityName = temp.voipCallInfo.abilityName;
657         voipCallInfo.voipBundleName = temp.voipCallInfo.voipBundleName;
658         voipCallInfo.showBannerForIncomingCall = temp.voipCallInfo.showBannerForIncomingCall;
659         voipCallInfo.isConferenceCall = temp.voipCallInfo.isConferenceCall;
660         voipCallInfo.isVoiceAnswerSupported = temp.voipCallInfo.isVoiceAnswerSupported;
661         voipCallInfo.hasMicPermission = temp.voipCallInfo.hasMicPermission;
662         voipCallInfo.isCapsuleSticky = temp.voipCallInfo.isCapsuleSticky;
663         voipCallInfo.uid = temp.voipCallInfo.uid;
664         name = temp.name;
665         namePresentation = temp.namePresentation;
666         phoneOrWatch = temp.phoneOrWatch;
667         reason = temp.reason;
668         antiFraudState = temp.antiFraudState;
669         message = temp.message;
670         newCallUseBox = temp.newCallUseBox;
671         return *this;
672     }
673 };
674 
675 /**
676  * @brief Indicates detail information of some calls.
677  */
678 struct CallDetailsInfo {
679     /**
680      * Indicates a CallDetailInfo list. {@link CallDetailInfo}
681      */
682     std::vector<CallDetailInfo> callVec {};
683     /**
684      * Indicates the slot id.
685      */
686     int32_t slotId = 0;
687     /**
688      * Indicates the bundle name.
689      */
690     char bundleName[kMaxBundleNameLen + 1] = { 0 };
691 };
692 
693 /**
694  * @brief Indicates the type of call transfer setting.
695  *
696  * 27007-430_2001 7.11	Call forwarding number and conditions +CCFC
697  * 3GPP TS 22.082 [4]
698  * <mode>:
699  * 0	disable
700  * 1	enable
701  * 3	registration
702  * 4	erasure
703  */
704 enum class CallTransferSettingType {
705     /**
706      * Indicates disable the call transfer.
707      */
708     CALL_TRANSFER_DISABLE = 0,
709     /**
710      * Indicates enable the call transfer.
711      */
712     CALL_TRANSFER_ENABLE = 1,
713     /**
714      * Indicates register the call transfer.
715      */
716     CALL_TRANSFER_REGISTRATION = 3,
717     /**
718      * Indicates erasure the call transfer.
719      */
720     CALL_TRANSFER_ERASURE = 4,
721 };
722 
723 /**
724  * @brief Indicates the Call forwarding type
725  *
726  * 27007-430_2001 7.11	Call forwarding number and conditions +CCFC
727  * 3GPP TS 22.082 [4]
728  * <reason>:
729  * 0	unconditional
730  * 1	mobile busy
731  * 2	no reply
732  * 3	not reachable
733  */
734 enum class CallTransferType {
735     /**
736      * Indicates transfer the call unconditionally.
737      */
738     TRANSFER_TYPE_UNCONDITIONAL = 0,
739     /**
740      * Indicates transfer the call when busy.
741      */
742     TRANSFER_TYPE_BUSY = 1,
743     /**
744      * Indicates transfer the call when no reply.
745      */
746     TRANSFER_TYPE_NO_REPLY = 2,
747     /**
748      * Indicates transfer the call when unreachable.
749      */
750     TRANSFER_TYPE_NOT_REACHABLE = 3,
751     /**
752      * Indicates transfer the call when all.
753      */
754     TRANSFER_TYPE_ALL = 4,
755     /**
756      * Indicates transfer the call conditionally.
757      */
758     TRANSFER_TYPE_CONDITIONAL = 5,
759 };
760 
761 /**
762  * @brief Indicates the information of call transfer.
763  */
764 struct CallTransferInfo {
765     /**
766      * Indication the phone number which will forward to.
767      */
768     char transferNum[kMaxNumberLen + 1] = { 0 };
769     /**
770      * Indicates the type of call transfer setting. {@link CallTransferSettingType}
771      */
772     CallTransferSettingType settingType = CallTransferSettingType::CALL_TRANSFER_DISABLE;
773     /**
774      * Indicates the Call forwarding type. {@link CallTransferType}
775      */
776     CallTransferType type = CallTransferType::TRANSFER_TYPE_UNCONDITIONAL;
777     /**
778      * Start time hours.
779      */
780     int32_t startHour = 0;
781     /**
782      * Start time minutes.
783      */
784     int32_t startMinute = 0;
785     /**
786      * End time hours.
787      */
788     int32_t endHour = 0;
789     /**
790      * End time minutes.
791      */
792     int32_t endMinute = 0;
793 };
794 
795 /**
796  * @brief Indicates the type of call restriction.
797  *
798  * 3GPP TS 22.030 V4.0.0 (2001-03)
799  * 3GPP TS 22.088 V4.0.0 (2001-03)
800  */
801 enum class CallRestrictionType {
802     /**
803      * Indicates restrict all incoming calls.
804      */
805     RESTRICTION_TYPE_ALL_INCOMING = 0,
806     /**
807      * Indicates restrict all outgoing calls.
808      */
809     RESTRICTION_TYPE_ALL_OUTGOING,
810     /**
811      * Indicates restrict international calls.
812      */
813     RESTRICTION_TYPE_INTERNATIONAL,
814     /**
815      * Indicates restrict international roaming calls.
816      */
817     RESTRICTION_TYPE_INTERNATIONAL_EXCLUDING_HOME,
818     /**
819      * Indicates restrict roaming calls.
820      */
821     RESTRICTION_TYPE_ROAMING_INCOMING,
822     /**
823      * Indicates restrict all calls.
824      */
825     RESTRICTION_TYPE_ALL_CALLS,
826     /**
827      * Indicates restrict all outgoing services.
828      */
829     RESTRICTION_TYPE_OUTGOING_SERVICES,
830     /**
831      * Indicates restrict all incoming services.
832      */
833     RESTRICTION_TYPE_INCOMING_SERVICES,
834 };
835 
836 /**
837  * @brief Indicates the mode of call restriction.
838  *
839  * 3GPP TS 22.088 V4.0.0 (2001-03)
840  */
841 enum class CallRestrictionMode {
842     /**
843      * Indicates call restriction is deactivated.
844      */
845     RESTRICTION_MODE_DEACTIVATION = 0,
846     /**
847      * Indicates call restriction is activated.
848      */
849     RESTRICTION_MODE_ACTIVATION = 1,
850 };
851 
852 /**
853  * @brief Indicates the information of call restriction.
854  */
855 struct CallRestrictionInfo {
856     /**
857      * Indicates the password required to set call restrictions.
858      */
859     char password[kMaxNumberLen + 1] = { 0 };
860     /**
861      * Indicates the type of call restriction.
862      */
863     CallRestrictionType fac = CallRestrictionType::RESTRICTION_TYPE_ALL_INCOMING;
864     /**
865      * Indicates the mode of call restriction.
866      */
867     CallRestrictionMode mode = CallRestrictionMode::RESTRICTION_MODE_DEACTIVATION;
868 };
869 } // namespace Telephony
870 } // namespace OHOS
871 #endif // CALL_MANAGER_INFO_H