同步操作将从 OpenHarmony/telephony_call_manager 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The Call Manager module mainly manages three types of calls: circuit switched (CS), IP multimedia subsystem (IMS), and over the top (OTT) calls. It is responsible for applying for the audio and video resources required for a call and resolving conflicts in a multi-channel call. The module consists of six parts: UI interaction (CallServiceAbility), service management (CallManagerService), call management (Call Manager), audio management (Audio Manager), video management (Video Manager), and Bluetooth management (Bluetooth Manager).
The following figure shows the architecture of the Call Manager module.
Figure 1 Architecture of the Call Manager module
/base/telephony/call_manager
├─ interfaces # External APIs
│ └─ kits # JS APIs and NAPIs
├─ sa_profile # SA profile
├─ services # Service code
│ ├─ audio # Audio Manager code
│ ├─ bluetooth # Bluetooth Manager code
│ ├─ call # Call Manager code
│ ├─ call_manager_service # CallManagerService code
│ ├─ call_setting # CallSetting code
│ ├─ telephony_interaction # Telephony core service code
│ └─ call_ui_interaction # CallServiceAbility code
├─ test # Unit test code
└─ utils # Utilities
Table 1 External API provided by the Call Manager module
function dial(phoneNumber: string, options: DialOptions, callback: AsyncCallback<boolean>): void; |
Table 2 Parameters of the Dial API
Asynchronous execution result. Value true indicates that the dialup is successful, and value false indicates that the dialup has failed. |
Table 3 Parameter description of options: DialOptions
Construct the phoneNumber and options parameters.
Call the Dial API in callback or Promise mode.
Obtain the dialup result. The Dial API works in asynchronous mode. The dialup result is returned through the callback.
import call from "@ohos.telephony.call";
let phoneNumber = "12312312312";
// Call the API in callback mode.
call.dial(phoneNumber, {extras: false}, (err, value) => {
if (err) {
// If the API call failed, err is not empty.
console.error(`failed to dial because ${err.message}`);
return;
}
// If the API call succeeded, err is empty.
console.log(`success to dial: ${value}`);
});
// Call the API in Promise mode.
let promise = call.dial(phoneNumber, {extras: false});
promise.then((value) => {
// The API call succeeded.
console.log(`success to dial: ${value}`);
}).catch((err) => {
// The API call failed.
console.error(`failed to dial because ${err.message}`);
});
telephony_call_manager
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。