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 25namespace OHOS { 26namespace 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 */ 33const 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 */ 39const 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 */ 45const 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 */ 52const 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 */ 58const 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 */ 64const 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 */ 70const 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 */ 76const int32_t CLIR_STATUS_TEMPORARILY_ALLOWED = 4; 77 78const int32_t SS_DISABLED = 0; 79const int32_t SS_ENABLED = 1; 80const int32_t MAX_MESSAGE_NUMBER = 500; 81const int32_t TRANSFER_REASON_TYPE_NO_REPLY = 2; 82 83const std::string TRANSFER_UNCONDITIONAL_SUCCESS = "Transfer unconditional success"; 84const std::string TRANSFER_BUSY_SUCCESS = "Transfer busy success"; 85const std::string TRANSFER_NO_REPLYL_SUCCESS = "Transfer no replay success"; 86const std::string TRANSFER_NOT_REACHABLE_SUCCESS = "Transfer not reachable success"; 87const std::string QUERY_SS_SUCCESS = "Query SS success"; 88const std::string QUERY_SS_FAILED = "Query SS failed"; 89const std::string INVALID_MMI_CODE = "Invalid MMI code"; 90const std::string GET_CALL_WAITING_SUCCESS = "Get call waiting success"; 91const std::string GET_CALL_WAITING_FAILED = "Get call waiting failed"; 92const std::string SET_CALL_WAITING_SUCCESS = "Set call waiting success"; 93const std::string SET_CALL_WAITING_FAILED = "Set call waiting failed"; 94const std::string GET_CALL_TRANSFER_SUCCESS = "Get call transfer success"; 95const std::string GET_CALL_TRANSFER_FAILED = "Get call transfer failed"; 96const std::string SET_CALL_TRANSFER_SUCCESS = "Set call transfer success"; 97const std::string SET_CALL_TRANSFER_FAILED = "Set call transfer failed"; 98const std::string GET_CALL_RESTRICTION_SUCCESS = "Get call restriction success"; 99const std::string GET_CALL_RESTRICTION_FAILED = "Get call restriction failed"; 100const std::string SET_CALL_RESTRICTION_SUCCESS = "Set call restriction success"; 101const std::string SET_SET_BARRING_PASSWORD_SUCCESS = "Set call restriction password success"; 102const std::string SET_CALL_RESTRICTION_FAILED = "Set call restriction failed"; 103const std::string SET_SET_BARRING_PASSWORD_FAILED = "Set call restriction password failed"; 104const std::string GET_CLIP_SUCCESS = "Get clip success"; 105const std::string GET_CLIP_FAILED = "Get clip failed"; 106const std::string SET_CLIP_SUCCESS = "Set clip success"; 107const std::string SET_CLIP_FAILED = "Set clip failed"; 108const std::string GET_CLIR_SUCCESS = "Get clir success"; 109const std::string GET_CLIR_FAILED = "Get clir failed"; 110const std::string SET_CLIR_SUCCESS = "Set clir success"; 111const std::string SET_CLIR_FAILED = "Set clir failed"; 112const std::string GET_COLR_SUCCESS = "Get colr success"; 113const std::string GET_COLR_FAILED = "Get colr failed"; 114const std::string SET_COLR_SUCCESS = "Set colr success"; 115const std::string SET_COLR_FAILED = "Set colr failed"; 116const std::string GET_COLP_SUCCESS = "Get colp success"; 117const std::string GET_COLP_FAILED = "Get colp failed"; 118const std::string SET_COLP_SUCCESS = "Set colp success"; 119const std::string SET_COLP_FAILED = "Set colp failed"; 120const std::string MIS_MATCH_PIN_PUK = "PIN or PUK don\'t match"; 121const std::string INVAILD_PIN_PUK = "Invaild PIN or PUK numbers"; 122const std::string SEND_USSD_SUCCESS = "Send ussd success"; 123const std::string GENERIC_FAILURE = "Generic fail, please retry"; 124const std::string SERVICE_ENABLE = "Service was enabled"; 125const std::string SERVICE_ENABLE_FOR = "Service was enabled for:"; 126const std::string SERVICE_DISABLE = "Service has been disabled"; 127const std::string SERVICE_NOT_PROVISIONED = "Service not provisioned"; 128const std::string CF_NOT_FORWARDED = "%s: Not forwarded"; 129const std::string CF_FORWARDED = "%s: %s"; 130const std::string CF_FORWARDED_TIME = "%s: %s after %d seconds"; 131const std::string CLIR_PERMANENT = "You can not change the caller ID setting"; 132const std::string CLIR_DEFAULT_ON_NEXT_ON = "Caller ID defaults to restricted. Next call: Restricted"; 133const std::string CLIR_DEFAULT_ON_NEXT_OFF = "Caller ID defaults to restricted. Next call: Not restricted"; 134const std::string CLIR_DEFAULT_OFF_NEXT_OFF = "Caller ID defaults to not restricted. Next call: Not restricted"; 135const std::string CLIR_DEFAULT_OFF_NEXT_ON = "Caller ID defaults to not restricted. Next call: Restricted"; 136 137/** 138 * Create get call waiting result message 139 * 140 * @param resultMessage the result message 141 * @param callWaitResponse the result of get callwaiting 142 * @return void. 143 */ 144void CreateGetCallWaitingResultMessage(std::string &resultMessage, CallWaitResponse response); 145 146void CreateSuppSvcQueryResultMessage(std::string &resultMessage, int32_t result, int32_t status); 147 148void CreateGetCallTransferResultMessage(std::string &resultMessage, CallTransferResponse response); 149 150void MakeCallTransferMessageEx(std::string &resultMessage, CallTransferResponse response, int32_t classex); 151 152void CreateGetClirResultMessage(std::string &resultMessage, ClirResponse response); 153 154std::string GetServiceClassName(int32_t classex); 155 156void CreateServiceClassMessage(std::string &resultMessage, int32_t classex); 157 158} // namespace Telephony 159} // namespace OHOS 160 161#endif // CELLULAR_CALL_MMICODE_MSG_H 162