1e1c44949Sopenharmony_ci/* 2e1c44949Sopenharmony_ci * Copyright (C) 2021-2024 Huawei Device Co., Ltd. 3e1c44949Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4e1c44949Sopenharmony_ci * you may not use this file except in compliance with the License. 5e1c44949Sopenharmony_ci * You may obtain a copy of the License at 6e1c44949Sopenharmony_ci * 7e1c44949Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8e1c44949Sopenharmony_ci * 9e1c44949Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10e1c44949Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11e1c44949Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12e1c44949Sopenharmony_ci * See the License for the specific language governing permissions and 13e1c44949Sopenharmony_ci * limitations under the License. 14e1c44949Sopenharmony_ci */ 15e1c44949Sopenharmony_ci 16e1c44949Sopenharmony_ci#ifndef CALL_REQUEST_HANDLER_H 17e1c44949Sopenharmony_ci#define CALL_REQUEST_HANDLER_H 18e1c44949Sopenharmony_ci 19e1c44949Sopenharmony_ci#include <map> 20e1c44949Sopenharmony_ci#include <memory> 21e1c44949Sopenharmony_ci#include <mutex> 22e1c44949Sopenharmony_ci 23e1c44949Sopenharmony_ci#include "call_request_process.h" 24e1c44949Sopenharmony_ci#include "common_type.h" 25e1c44949Sopenharmony_ci#include "event_handler.h" 26e1c44949Sopenharmony_ci#include "event_runner.h" 27e1c44949Sopenharmony_ci 28e1c44949Sopenharmony_cinamespace OHOS { 29e1c44949Sopenharmony_cinamespace Telephony { 30e1c44949Sopenharmony_cistruct AnswerCallPara { 31e1c44949Sopenharmony_ci int32_t callId = 0; 32e1c44949Sopenharmony_ci int32_t videoState = 0; 33e1c44949Sopenharmony_ci}; 34e1c44949Sopenharmony_ci 35e1c44949Sopenharmony_cistruct RejectCallPara { 36e1c44949Sopenharmony_ci int32_t callId = 0; 37e1c44949Sopenharmony_ci bool isSendSms = 0; 38e1c44949Sopenharmony_ci char content[REJECT_CALL_MSG_MAX_LEN + 1] = { 0 }; 39e1c44949Sopenharmony_ci}; 40e1c44949Sopenharmony_ci 41e1c44949Sopenharmony_cistruct StartRttPara { 42e1c44949Sopenharmony_ci int32_t callId = 0; 43e1c44949Sopenharmony_ci std::u16string msg = u""; 44e1c44949Sopenharmony_ci}; 45e1c44949Sopenharmony_ci 46e1c44949Sopenharmony_cistruct CallMediaUpdatePara { 47e1c44949Sopenharmony_ci int32_t callId = 0; 48e1c44949Sopenharmony_ci ImsCallMode mode = ImsCallMode::CALL_MODE_AUDIO_ONLY; 49e1c44949Sopenharmony_ci}; 50e1c44949Sopenharmony_ci 51e1c44949Sopenharmony_cistruct JoinConferencePara { 52e1c44949Sopenharmony_ci int32_t callId = 0; 53e1c44949Sopenharmony_ci std::vector<std::string> numberList {}; 54e1c44949Sopenharmony_ci}; 55e1c44949Sopenharmony_ci 56e1c44949Sopenharmony_ci/** 57e1c44949Sopenharmony_ci * @ClassName: CallRequestHandler 58e1c44949Sopenharmony_ci * @Description: inner event-handle mechanism on harmony platform, used by callcontrolmanager 59e1c44949Sopenharmony_ci * to handle downflowed telephone business, factually act as work thread. 60e1c44949Sopenharmony_ci */ 61e1c44949Sopenharmony_ciclass CallRequestHandler { 62e1c44949Sopenharmony_cipublic: 63e1c44949Sopenharmony_ci CallRequestHandler(); 64e1c44949Sopenharmony_ci ~CallRequestHandler(); 65e1c44949Sopenharmony_ci void Init(); 66e1c44949Sopenharmony_ci int32_t DialCall(); 67e1c44949Sopenharmony_ci int32_t AnswerCall(int32_t callId, int32_t videoState); 68e1c44949Sopenharmony_ci int32_t RejectCall(int32_t callId, bool isSendSms, std::string &content); 69e1c44949Sopenharmony_ci int32_t HangUpCall(int32_t callId); 70e1c44949Sopenharmony_ci int32_t HoldCall(int32_t callId); 71e1c44949Sopenharmony_ci int32_t UnHoldCall(int32_t callId); 72e1c44949Sopenharmony_ci int32_t SwitchCall(int32_t callId); 73e1c44949Sopenharmony_ci int32_t CombineConference(int32_t mainCallId); 74e1c44949Sopenharmony_ci int32_t SeparateConference(int32_t callId); 75e1c44949Sopenharmony_ci int32_t KickOutFromConference(int32_t callId); 76e1c44949Sopenharmony_ci int32_t StartRtt(int32_t callId, std::u16string &msg); 77e1c44949Sopenharmony_ci int32_t StopRtt(int32_t callId); 78e1c44949Sopenharmony_ci int32_t JoinConference(int32_t callId, std::vector<std::string> &numberList); 79e1c44949Sopenharmony_ci 80e1c44949Sopenharmony_ciprivate: 81e1c44949Sopenharmony_ci std::shared_ptr<CallRequestProcess> callRequestProcessPtr_; 82e1c44949Sopenharmony_ci}; 83e1c44949Sopenharmony_ci} // namespace Telephony 84e1c44949Sopenharmony_ci} // namespace OHOS 85e1c44949Sopenharmony_ci#endif // CALL_REQUEST_HANDLER_H 86