• 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 CELLULAR_CALL_MMICODE_MSG_H
17 #define CELLULAR_CALL_MMICODE_MSG_H
18 
19 #include "cellular_call_data_struct.h"
20 #include "ims_error.h"
21 #include "telephony_types.h"
22 #include <stdlib.h>
23 #include <string>
24 
25 namespace OHOS {
26 namespace Telephony {
27 /**
28  * Calling line identification restriction (CLIR) is set to the default according to the
29  * subscription of the CLIR service.
30  *
31  * See TS 27.007, section 7.7 for more information.
32  */
33 const int32_t CLIR_OUTGOING_DEFAULT = 0;
34 /**
35  * Activate Calling line identification restriction for outgoing calls.
36  *
37  * See TS 27.007, section 7.7 for more information.
38  */
39 const int32_t CLIR_OUTGOING_INVOCATION = 1;
40 /**
41  * Deactivate Calling line identification restriction for outgoing calls.
42  *
43  * See TS 27.007, section 7.7 for more information.
44  */
45 const int32_t CLIR_OUTGOING_SUPPRESSION = 2;
46 
47 /**
48  * Calling line identification restriction is currently not provisioned.
49  *
50  * See TS 27.007, section 7.7 for more information.
51  */
52 const int32_t CLIR_STATUS_NOT_PROVISIONED = 0;
53 /**
54  * Calling line identification restriction is currently provisioned in permanent mode.
55  *
56  * See TS 27.007, section 7.7 for more information.
57  */
58 const int32_t CLIR_STATUS_PROVISIONED_PERMANENT = 1;
59 /**
60  * Calling line identification restriction is currently unknown, e.g. no network, etc.
61  *
62  * See TS 27.007, section 7.7 for more information.
63  */
64 const int32_t CLIR_STATUS_UNKNOWN = 2;
65 /**
66  * Calling line identification restriction temporary mode, temporarily restricted.
67  *
68  * See TS 27.007, section 7.7 for more information.
69  */
70 const int32_t CLIR_STATUS_TEMPORARILY_RESTRICTED = 3;
71 /**
72  * Calling line identification restriction temporary mode, temporarily allowed.
73  *
74  * See TS 27.007, section 7.7 for more information.
75  */
76 const int32_t CLIR_STATUS_TEMPORARILY_ALLOWED = 4;
77 
78 const int32_t SS_DISABLED = 0;
79 const int32_t SS_ENABLED = 1;
80 const int32_t MAX_MESSAGE_NUMBER = 500;
81 const int32_t TRANSFER_REASON_TYPE_NO_REPLY = 2;
82 
83 const std::string TRANSFER_UNCONDITIONAL_SUCCESS = "Transfer unconditional success";
84 const std::string TRANSFER_BUSY_SUCCESS = "Transfer busy success";
85 const std::string TRANSFER_NO_REPLYL_SUCCESS = "Transfer no replay success";
86 const std::string TRANSFER_NOT_REACHABLE_SUCCESS = "Transfer not reachable success";
87 const std::string QUERY_SS_SUCCESS = "Query SS success";
88 const std::string QUERY_SS_FAILED = "Query SS failed";
89 const std::string INVALID_MMI_CODE = "Invalid MMI code";
90 const std::string GET_CALL_WAITING_SUCCESS = "Get call waiting success";
91 const std::string GET_CALL_WAITING_FAILED = "Get call waiting failed";
92 const std::string SET_CALL_WAITING_SUCCESS = "Set call waiting success";
93 const std::string SET_CALL_WAITING_FAILED = "Set call waiting failed";
94 const std::string GET_CALL_TRANSFER_SUCCESS = "Get call transfer success";
95 const std::string GET_CALL_TRANSFER_FAILED = "Get call transfer failed";
96 const std::string SET_CALL_TRANSFER_SUCCESS = "Set call transfer success";
97 const std::string SET_CALL_TRANSFER_FAILED = "Set call transfer failed";
98 const std::string GET_CALL_RESTRICTION_SUCCESS = "Get call restriction success";
99 const std::string GET_CALL_RESTRICTION_FAILED = "Get call restriction failed";
100 const std::string SET_CALL_RESTRICTION_SUCCESS = "Set call restriction success";
101 const std::string SET_SET_BARRING_PASSWORD_SUCCESS = "Set call restriction password success";
102 const std::string SET_CALL_RESTRICTION_FAILED = "Set call restriction failed";
103 const std::string SET_SET_BARRING_PASSWORD_FAILED = "Set call restriction password failed";
104 const std::string GET_CLIP_SUCCESS = "Get clip success";
105 const std::string GET_CLIP_FAILED = "Get clip failed";
106 const std::string SET_CLIP_SUCCESS = "Set clip success";
107 const std::string SET_CLIP_FAILED = "Set clip failed";
108 const std::string GET_CLIR_SUCCESS = "Get clir success";
109 const std::string GET_CLIR_FAILED = "Get clir failed";
110 const std::string SET_CLIR_SUCCESS = "Set clir success";
111 const std::string SET_CLIR_FAILED = "Set clir failed";
112 const std::string GET_COLR_SUCCESS = "Get colr success";
113 const std::string GET_COLR_FAILED = "Get colr failed";
114 const std::string SET_COLR_SUCCESS = "Set colr success";
115 const std::string SET_COLR_FAILED = "Set colr failed";
116 const std::string GET_COLP_SUCCESS = "Get colp success";
117 const std::string GET_COLP_FAILED = "Get colp failed";
118 const std::string SET_COLP_SUCCESS = "Set colp success";
119 const std::string SET_COLP_FAILED = "Set colp failed";
120 const std::string MIS_MATCH_PIN_PUK = "PIN or PUK don\'t match";
121 const std::string INVAILD_PIN_PUK = "Invaild PIN or PUK numbers";
122 const std::string SEND_USSD_SUCCESS = "Send ussd success";
123 const std::string GENERIC_FAILURE = "Generic fail, please retry";
124 const std::string SERVICE_ENABLE = "Service was enabled";
125 const std::string SERVICE_ENABLE_FOR = "Service was enabled for:";
126 const std::string SERVICE_DISABLE = "Service has been disabled";
127 const std::string SERVICE_NOT_PROVISIONED = "Service not provisioned";
128 const std::string CF_NOT_FORWARDED = "%s: Not forwarded";
129 const std::string CF_FORWARDED = "%s: %s";
130 const std::string CF_FORWARDED_TIME = "%s: %s after %d seconds";
131 const std::string CLIR_PERMANENT = "You can not change the caller ID setting";
132 const std::string CLIR_DEFAULT_ON_NEXT_ON = "Caller ID defaults to restricted. Next call: Restricted";
133 const std::string CLIR_DEFAULT_ON_NEXT_OFF = "Caller ID defaults to restricted. Next call: Not restricted";
134 const std::string CLIR_DEFAULT_OFF_NEXT_OFF = "Caller ID defaults to not restricted. Next call: Not restricted";
135 const std::string CLIR_DEFAULT_OFF_NEXT_ON = "Caller ID defaults to not restricted. Next call: Restricted";
136 
137 const int32_t SUB_TYPE_QUERY = 0;
138 const int32_t SUB_TYPE_ACTIVE = 1;
139 const int32_t SUB_TYPE_DEACTIVE = 2;
140 
141 // Call waiting
142 const int32_t SC_WAIT = 43;
143 
144 // Call transfer
145 const int32_t SC_CFU = 21;
146 const int32_t SC_CFB = 67;
147 const int32_t SC_CFNRy = 61;
148 const int32_t SC_CFNR = 62;
149 
150 // Call Barring
151 const int32_t SC_BAOC = 33;
152 const int32_t SC_BAOIC = 331;
153 const int32_t SC_BAOICxH = 332;
154 const int32_t SC_BAIC = 35;
155 const int32_t SC_BAICr = 351;
156 
157 // Called line presention
158 const int32_t SC_CLIP = 30;
159 const int32_t SC_CLIR = 31;
160 const int32_t SC_COLP = 76;
161 const int32_t SC_COLR = 77;
162 
163 // called USSD
164 const int32_t SC_USSD = 10001;
165 
166 /**
167  * Create get call waiting result message
168  *
169  * @param resultMessage  the result message
170  * @param callWaitResponse  the result of get callwaiting
171  * @return void.
172  */
173 void CreateGetCallWaitingResultMessage(std::string &resultMessage, CallWaitResponse response);
174 
175 void CreateSuppSvcQueryResultMessage(std::string &resultMessage, int32_t result, int32_t status);
176 
177 void CreateGetCallTransferResultMessage(std::string &resultMessage, CallTransferResponse response);
178 
179 void MakeCallTransferMessageEx(std::string &resultMessage, CallTransferResponse response, int32_t classex);
180 
181 void CreateGetClirResultMessage(std::string &resultMessage, ClirResponse response);
182 
183 std::string GetServiceClassName(int32_t classex);
184 
185 void CreateServiceClassMessage(std::string &resultMessage, int32_t classex);
186 
187 } // namespace Telephony
188 } // namespace OHOS
189 
190 #endif // CELLULAR_CALL_MMICODE_MSG_H
191