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