js-apis-call.md 209.5 KB
Newer Older
S
shawn_he 已提交
1
# @ohos.telephony.call (Call)
S
shawn_he 已提交
2

S
shawn_he 已提交
3
The **call** module provides call management functions, including making calls, redirecting to the dial screen, obtaining the call status, and formatting phone numbers.
S
shawn_he 已提交
4

S
shawn_he 已提交
5
To subscribe to the call status, use [`observer.on('callStateChange')`](js-apis-observer.md#observeroncallstatechange).
S
shawn_he 已提交
6

S
shawn_he 已提交
7
>**NOTE**
S
shawn_he 已提交
8
>
S
shawn_he 已提交
9
>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
S
shawn_he 已提交
10

S
shawn_he 已提交
11
## Modules to Import
S
shawn_he 已提交
12

S
shawn_he 已提交
13 14
```js
import call from '@ohos.telephony.call';
S
shawn_he 已提交
15 16
```

S
shawn_he 已提交
17
## call.dialCall<sup>9+</sup>
S
shawn_he 已提交
18

S
shawn_he 已提交
19
dialCall\(phoneNumber: string, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
20

S
shawn_he 已提交
21
Initiates a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
22

S
shawn_he 已提交
23
**System API**: This is a system API.
S
shawn_he 已提交
24

S
shawn_he 已提交
25
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
26

S
shawn_he 已提交
27
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
28

S
shawn_he 已提交
29
**Parameters**
S
shawn_he 已提交
30

S
shawn_he 已提交
31
| Name     | Type                        | Mandatory| Description                                   |
S
shawn_he 已提交
32
| ----------- | ---------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
33 34
| phoneNumber | string                       | Yes  | Phone number.                             |
| callback    | AsyncCallback&lt;void&gt;    | Yes  | Callback used to return the result.  |
S
shawn_he 已提交
35

S
shawn_he 已提交
36
**Error codes**
S
shawn_he 已提交
37

S
shawn_he 已提交
38
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
39

S
shawn_he 已提交
40
| ID| Error Message                                    |
S
shawn_he 已提交
41
| -------- | -------------------------------------------- |
S
shawn_he 已提交
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300005  | Airplane mode is on.                         |
| 8300006  | Network not in service.                      |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.dialCall("138xxxxxxxx", (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
58 59 60
```


S
shawn_he 已提交
61
## call.dialCall<sup>9+</sup>
S
shawn_he 已提交
62

S
shawn_he 已提交
63
dialCall\(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
64

S
shawn_he 已提交
65
Initiates a call. You can set call options as needed. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
66

S
shawn_he 已提交
67
**System API**: This is a system API.
S
shawn_he 已提交
68

S
shawn_he 已提交
69
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
70

S
shawn_he 已提交
71
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
72

S
shawn_he 已提交
73
**Parameters**
S
shawn_he 已提交
74

S
shawn_he 已提交
75
| Name     |                    Type            | Mandatory| Description                                |
S
shawn_he 已提交
76
| ----------- | ----------------------------------- | ---- | ----------------------------------- |
S
shawn_he 已提交
77 78 79
| phoneNumber | string                              | Yes  | Phone number.                          |
| options     | [DialCallOptions](#dialcalloptions9)| Yes  | Call options, which carry other configuration information of the call.   |
| callback    | AsyncCallback&lt;void&gt;           | Yes  | Callback used to return the result.|
S
shawn_he 已提交
80

S
shawn_he 已提交
81
**Error codes**
S
shawn_he 已提交
82

S
shawn_he 已提交
83
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
84

S
shawn_he 已提交
85
| ID| Error Message                                    |
S
shawn_he 已提交
86
| -------- | -------------------------------------------- |
S
shawn_he 已提交
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300005  | Airplane mode is on.                         |
| 8300006  | Network not in service.                      |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.dialCall("138xxxxxxxx", {
    accountId: 0,
    videoState: 0,
    dialScene: 0,
    dialType: 0,
}, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
108 109 110
```


S
shawn_he 已提交
111
## call.dialCall<sup>9+</sup>
S
shawn_he 已提交
112

S
shawn_he 已提交
113
dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise\<void\>
S
shawn_he 已提交
114

S
shawn_he 已提交
115
Initiates a call. You can set call options as needed. This API uses a promise to return the result.
S
shawn_he 已提交
116

S
shawn_he 已提交
117
**System API**: This is a system API.
S
shawn_he 已提交
118

S
shawn_he 已提交
119
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
120

S
shawn_he 已提交
121
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
122

S
shawn_he 已提交
123
**Parameters**
S
shawn_he 已提交
124

S
shawn_he 已提交
125
| Name     |                 Type               | Mandatory|                Description                   |
S
shawn_he 已提交
126
| ----------- | ----------------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
127 128
| phoneNumber | string                              | Yes  | Phone number.                            |
| options     | [DialCallOptions](#dialcalloptions9)| No  | Call options, which carry other configuration information of the call.<br>If this parameter is not set, the following configuration is used by default. For details, see [DialCallOptions](#dialcalloptions9).<br>- **accountId**: 0 (card slot 1)<br>- **videoState**: voice call<br>- **dialScene**: common call<br>- **dialType**: carrier call |
S
shawn_he 已提交
129

S
shawn_he 已提交
130
**Return value**
S
shawn_he 已提交
131

S
shawn_he 已提交
132
| Type                  | Description                         |
S
shawn_he 已提交
133
| ---------------------- | ---------------------------- |
S
shawn_he 已提交
134
| Promise&lt;void&gt;    | Promise used to return the result.|
S
shawn_he 已提交
135

S
shawn_he 已提交
136
**Error codes**
S
shawn_he 已提交
137

S
shawn_he 已提交
138
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
139

S
shawn_he 已提交
140
| ID| Error Message                                    |
S
shawn_he 已提交
141
| -------- | -------------------------------------------- |
S
shawn_he 已提交
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300005  | Airplane mode is on.                         |
| 8300006  | Network not in service.                      |
| 8300999  | Unknown error code.                          |

**Example**

```js
let promise = call.dialCall("138xxxxxxxx", {
    accountId: 0,
    videoState: 0,
    dialScene: 0,
    dialType: 0,
});
promise.then(() => {
    console.log(`dialCall success.`);
}).catch((err) => {
    console.error(`dialCall fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
166 167
```

S
shawn_he 已提交
168
## call.dial<sup>(deprecated)</sup>
S
shawn_he 已提交
169

S
shawn_he 已提交
170
dial\(phoneNumber: string, callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
171

S
shawn_he 已提交
172
Initiates a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
173

S
shawn_he 已提交
174
> **NOTE**
S
shawn_he 已提交
175
>
S
shawn_he 已提交
176
> This API is supported since API version 6 and deprecated since API version 9. You are advised to use [dialCall](#calldialcall9). The substitute API is available only for system applications.
S
shawn_he 已提交
177

S
shawn_he 已提交
178
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
179

S
shawn_he 已提交
180
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
181

S
shawn_he 已提交
182
**Parameters**
S
shawn_he 已提交
183

S
shawn_he 已提交
184
| Name     | Type                        | Mandatory| Description                                   |
S
shawn_he 已提交
185
| ----------- | ---------------------------- | ---- | --------------------------------------- |
S
shawn_he 已提交
186 187
| phoneNumber | string                       | Yes  | Phone number.                             |
| callback    | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.<br>- **true**: success<br>- **false**: failure|
S
shawn_he 已提交
188

S
shawn_he 已提交
189
**Example**
S
shawn_he 已提交
190

S
shawn_he 已提交
191 192 193 194
```js
call.dial("138xxxxxxxx", (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
195 196 197
```


S
shawn_he 已提交
198
## call.dial<sup>(deprecated)</sup>
S
shawn_he 已提交
199

S
shawn_he 已提交
200
dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
201

S
shawn_he 已提交
202
Initiates a call. You can set call options as needed. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
203

S
shawn_he 已提交
204
> **NOTE**
S
shawn_he 已提交
205
>
S
shawn_he 已提交
206
> This API is supported since API version 6 and deprecated since API version 9. You are advised to use [dialCall](#calldialcall9). The substitute API is available only for system applications.
S
shawn_he 已提交
207

S
shawn_he 已提交
208
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
209

S
shawn_he 已提交
210
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
211

S
shawn_he 已提交
212
**Parameters**
S
shawn_he 已提交
213

S
shawn_he 已提交
214
| Name     | Type                        | Mandatory| Description                                   |
S
shawn_he 已提交
215
| ----------- | ---------------------------- | ---- | --------------------------------------- |
S
shawn_he 已提交
216 217 218 219 220 221 222 223 224 225 226 227
| phoneNumber | string                       | Yes  | Phone number.                             |
| options     | [DialOptions](#dialoptions)  | Yes  | Call option, which indicates whether the call is a voice call or video call. |
| callback    | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.<br>- **true**: success<br>- **false**: failure|

**Example**

```js
call.dial("138xxxxxxxx", {
    extras: false
}, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
228 229
```

S
shawn_he 已提交
230
## call.dial<sup>(deprecated)</sup>
S
shawn_he 已提交
231

S
shawn_he 已提交
232
dial\(phoneNumber: string, options?: DialOptions\): Promise\<boolean\>
S
shawn_he 已提交
233

S
shawn_he 已提交
234
Initiates a call. You can set call options as needed. This API uses a promise to return the result.
S
shawn_he 已提交
235

S
shawn_he 已提交
236
> **NOTE**
S
shawn_he 已提交
237
>
S
shawn_he 已提交
238
> This API is supported since API version 6 and deprecated since API version 9. You are advised to use [dialCall](#calldialcall9). The substitute API is available only for system applications.
S
shawn_he 已提交
239

S
shawn_he 已提交
240
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
241

S
shawn_he 已提交
242
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
243

S
shawn_he 已提交
244
**Parameters**
S
shawn_he 已提交
245

S
shawn_he 已提交
246
| Name     | Type                       | Mandatory| Description                                  |
S
shawn_he 已提交
247
| ----------- | --------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
248 249
| phoneNumber | string                      | Yes  | Phone number.                            |
| options     | [DialOptions](#dialoptions) | No  | Call option, which indicates whether the call is a voice call or video call.|
S
shawn_he 已提交
250

S
shawn_he 已提交
251
**Return value**
S
shawn_he 已提交
252

S
shawn_he 已提交
253
| Type                  | Description                                                        |
S
shawn_he 已提交
254
| ---------------------- | ------------------------------------------------------------ |
S
shawn_he 已提交
255 256 257 258 259 260 261 262 263 264 265 266 267
| Promise&lt;boolean&gt; | Promise used to return the result.<br>- **true**: success<br>- **false**: failure|

**Example**

```js
let promise = call.dial("138xxxxxxxx", {
    extras: false
});
promise.then(data => {
    console.log(`dial success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`dial fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
268
```
S
shawn_he 已提交
269

S
shawn_he 已提交
270
## call.makeCall<sup>7+</sup>
S
shawn_he 已提交
271

S
shawn_he 已提交
272
makeCall\(phoneNumber: string, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
273

S
shawn_he 已提交
274
Launches the call screen and displays the dialed number. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
275

S
shawn_he 已提交
276
**System capability**: SystemCapability.Applications.Contacts
S
shawn_he 已提交
277

S
shawn_he 已提交
278
**Parameters**
S
shawn_he 已提交
279

S
shawn_he 已提交
280
| Name     | Type                     | Mandatory| Description                                      |
S
shawn_he 已提交
281
| ----------- | ------------------------- | ---- | ------------------------------------------ |
S
shawn_he 已提交
282 283
| phoneNumber | string                    | Yes  | Phone number.                                |
| callback    | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
284

S
shawn_he 已提交
285
**Error codes**
S
shawn_he 已提交
286

S
shawn_he 已提交
287
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
288

S
shawn_he 已提交
289
| ID| Error Message                                    |
S
shawn_he 已提交
290
| -------- | -------------------------------------------- |
S
shawn_he 已提交
291 292 293 294 295 296 297 298 299 300 301 302
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.makeCall("138xxxxxxxx", err => {
    console.log(`makeCall callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
303 304 305
```


S
shawn_he 已提交
306
## call.makeCall<sup>7+</sup>
S
shawn_he 已提交
307

S
shawn_he 已提交
308
makeCall\(phoneNumber: string\): Promise\<void\>
S
shawn_he 已提交
309

S
shawn_he 已提交
310
Launches the call screen and displays the dialed number. This API uses a promise to return the result.
S
shawn_he 已提交
311

S
shawn_he 已提交
312
**System capability**: SystemCapability.Applications.Contacts
S
shawn_he 已提交
313

S
shawn_he 已提交
314
**Parameters**
S
shawn_he 已提交
315

S
shawn_he 已提交
316
| Name     | Type  | Mandatory| Description      |
S
shawn_he 已提交
317
| ----------- | ------ | ---- | ---------- |
S
shawn_he 已提交
318
| phoneNumber | string | Yes  | Phone number.|
S
shawn_he 已提交
319

S
shawn_he 已提交
320
**Return value**
S
shawn_he 已提交
321

S
shawn_he 已提交
322
| Type               | Description                             |
S
shawn_he 已提交
323
| ------------------- | --------------------------------- |
S
shawn_he 已提交
324
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
325

S
shawn_he 已提交
326
**Error codes**
S
shawn_he 已提交
327

S
shawn_he 已提交
328
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
329

S
shawn_he 已提交
330
| ID| Error Message                                    |
S
shawn_he 已提交
331
| -------- | -------------------------------------------- |
S
shawn_he 已提交
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let promise = call.makeCall("138xxxxxxxx");
promise.then(() => {
    console.log(`makeCall success`);
}).catch(err => {
    console.error(`makeCall fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
347 348
```

S
shawn_he 已提交
349
## call.hasCall
S
shawn_he 已提交
350

S
shawn_he 已提交
351
hasCall\(callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
352

S
shawn_he 已提交
353
Checks whether a call is in progress. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
354

S
shawn_he 已提交
355
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
356

S
shawn_he 已提交
357
**Parameters**
S
shawn_he 已提交
358

S
shawn_he 已提交
359
| Name  | Type                        | Mandatory| Description                                                        |
S
shawn_he 已提交
360
| -------- | ---------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
361
| callback | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result. Callback used to return the result.<br>- **true**: A call is in progress.<br>- **false**: No call is in progress.|
S
shawn_he 已提交
362

S
shawn_he 已提交
363
**Example**
S
shawn_he 已提交
364

S
shawn_he 已提交
365 366 367 368
```js
call.hasCall((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
369
```
S
shawn_he 已提交
370 371


S
shawn_he 已提交
372
## call.hasCall
S
shawn_he 已提交
373

S
shawn_he 已提交
374
hasCall\(\): Promise\<boolean\>
S
shawn_he 已提交
375

S
shawn_he 已提交
376
Checks whether a call is in progress. This API uses a promise to return the result.
S
shawn_he 已提交
377

S
shawn_he 已提交
378
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
379

S
shawn_he 已提交
380
**Return value**
S
shawn_he 已提交
381

S
shawn_he 已提交
382
| Type                  | Description                                   |
S
shawn_he 已提交
383
| ---------------------- | --------------------------------------- |
S
shawn_he 已提交
384
| Promise&lt;boolean&gt; | Promise used to return the result.|
S
shawn_he 已提交
385

S
shawn_he 已提交
386
**Example**
S
shawn_he 已提交
387

S
shawn_he 已提交
388 389 390 391 392 393 394
```js
let promise = call.hasCall();
promise.then(data => {
    console.log(`hasCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`hasCall fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
395
```
S
shawn_he 已提交
396

S
shawn_he 已提交
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417
## call.hasCallSync<sup>10+</sup>

hasCallSync\(\): boolean

Checks whether a call is in progress.

**System capability**: SystemCapability.Telephony.CallManager

**Return value**

| Type                  | Description         |
| ---------------------- |-------------|
| boolean | Promise used to return the result.|

**Example**

```js
let hasCall = call.hasCallSync();
console.log(`hasCallSync success, has call is ' + hasCall);
```

S
shawn_he 已提交
418

S
shawn_he 已提交
419
## call.getCallState
S
shawn_he 已提交
420

S
shawn_he 已提交
421
getCallState\(callback: AsyncCallback\<CallState\>\): void
S
shawn_he 已提交
422

S
shawn_he 已提交
423
Obtains the call status. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
424

S
shawn_he 已提交
425
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
426

S
shawn_he 已提交
427
**Parameters**
S
shawn_he 已提交
428

S
shawn_he 已提交
429
| Name  | Type                                        | Mandatory| Description                                |
S
shawn_he 已提交
430
| -------- | -------------------------------------------- | ---- | ------------------------------------ |
S
shawn_he 已提交
431
| callback | AsyncCallback&lt;[CallState](#callstate)&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
432

S
shawn_he 已提交
433
**Example**
S
shawn_he 已提交
434

S
shawn_he 已提交
435 436 437 438
```js
call.getCallState((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
439
```
S
shawn_he 已提交
440 441


S
shawn_he 已提交
442
## call.getCallState
S
shawn_he 已提交
443

S
shawn_he 已提交
444
getCallState\(\): Promise\<CallState\>
S
shawn_he 已提交
445

S
shawn_he 已提交
446
Obtains the call status. This API uses a promise to return the result.
S
shawn_he 已提交
447

S
shawn_he 已提交
448
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
449

S
shawn_he 已提交
450
**Return value**
S
shawn_he 已提交
451

S
shawn_he 已提交
452
| Type                                  | Description                                   |
S
shawn_he 已提交
453
| -------------------------------------- | --------------------------------------- |
S
shawn_he 已提交
454
| Promise&lt;[CallState](#callstate)&gt; | Promise used to return the result.|
S
shawn_he 已提交
455

S
shawn_he 已提交
456
**Example**
S
shawn_he 已提交
457

S
shawn_he 已提交
458 459 460 461 462 463 464
```js
let promise = call.getCallState();
promise.then(data => {
    console.log(`getCallState success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getCallState fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
465
```
S
shawn_he 已提交
466

S
shawn_he 已提交
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487
## call.getCallStateSync<sup>10+</sup>

getCallStateSync\(\): CallState

Obtains the call status.

**System capability**: SystemCapability.Telephony.CallManager

**Return value**

| Type                                 | Description         |
| ------------------------------------- |-------------|
| [CallState](#callstate) | Promise used to return the result.|

**Example**

```js
let callState = call.getCallStateSync();
console.log(`the call state is:` + callState);
```

S
shawn_he 已提交
488
## call.hasVoiceCapability<sup>7+</sup>
S
shawn_he 已提交
489

S
shawn_he 已提交
490
hasVoiceCapability\(\): boolean
S
shawn_he 已提交
491

S
shawn_he 已提交
492
Checks whether a device supports voice calls.
S
shawn_he 已提交
493

S
shawn_he 已提交
494
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
495

S
shawn_he 已提交
496
**Return value**
S
shawn_he 已提交
497

S
shawn_he 已提交
498
| Type   | Description                                                        |
S
shawn_he 已提交
499
| ------- | ------------------------------------------------------------ |
S
shawn_he 已提交
500
| boolean | - **true**: The device supports voice calls.<br>- **false**: The device does not support voice calls.|
S
shawn_he 已提交
501

S
shawn_he 已提交
502 503 504
```js
let result = call.hasVoiceCapability(); 
console.log(`hasVoiceCapability: ${JSON.stringify(result)}`);
S
shawn_he 已提交
505 506
```

S
shawn_he 已提交
507
## call.isEmergencyPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
508

S
shawn_he 已提交
509
isEmergencyPhoneNumber\(phoneNumber: string, callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
510

S
shawn_he 已提交
511
Checks whether the called number is an emergency number. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
512

S
shawn_he 已提交
513
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
514

S
shawn_he 已提交
515
**Parameters**
S
shawn_he 已提交
516

S
shawn_he 已提交
517
| Name     | Type                        | Mandatory| Description                                                        |
S
shawn_he 已提交
518
| ----------- | ---------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
519 520
| phoneNumber | string                       | Yes  | Phone number.                                                  |
| callback    | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result. - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.|
S
shawn_he 已提交
521

S
shawn_he 已提交
522
**Error codes**
S
shawn_he 已提交
523

S
shawn_he 已提交
524
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
525

S
shawn_he 已提交
526
| ID| Error Message                                    |
S
shawn_he 已提交
527
| -------- | -------------------------------------------- |
S
shawn_he 已提交
528 529 530 531 532 533 534 535 536 537 538 539
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.isEmergencyPhoneNumber("138xxxxxxxx", (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
540
```
S
shawn_he 已提交
541 542


S
shawn_he 已提交
543
## call.isEmergencyPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
544

S
shawn_he 已提交
545
isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
546

S
shawn_he 已提交
547
Checks whether the called number is an emergency number based on the phone number. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
548

S
shawn_he 已提交
549
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
550

S
shawn_he 已提交
551
**Parameters**
S
shawn_he 已提交
552

S
shawn_he 已提交
553
| Name     | Type                                              | Mandatory| Description                                                        |
S
shawn_he 已提交
554
| ----------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
555 556 557
| phoneNumber | string                                             | Yes  | Phone number.                                                  |
| options     | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes  | Phone number.                                              |
| callback    | AsyncCallback&lt;boolean&gt;                       | Yes  | Callback used to return the result. - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.|
S
shawn_he 已提交
558

S
shawn_he 已提交
559
**Error codes**
S
shawn_he 已提交
560

S
shawn_he 已提交
561
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
562

S
shawn_he 已提交
563
| ID| Error Message                                    |
S
shawn_he 已提交
564
| -------- | -------------------------------------------- |
S
shawn_he 已提交
565 566 567 568 569 570 571 572 573 574 575 576
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.isEmergencyPhoneNumber("112", {slotId: 1}, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
577
```
S
shawn_he 已提交
578 579


S
shawn_he 已提交
580
## call.isEmergencyPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
581

S
shawn_he 已提交
582
isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\): Promise\<boolean\>
S
shawn_he 已提交
583

S
shawn_he 已提交
584
Checks whether the called number is an emergency number based on the phone number. This API uses a promise to return the result.
S
shawn_he 已提交
585

S
shawn_he 已提交
586
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
587

S
shawn_he 已提交
588
**Parameters**
S
shawn_he 已提交
589

S
shawn_he 已提交
590
| Name     | Type                                              | Mandatory| Description          |
S
shawn_he 已提交
591
| ----------- | -------------------------------------------------- | ---- | -------------- |
S
shawn_he 已提交
592 593
| phoneNumber | string                                             | Yes  | Phone number.    |
| options     | [EmergencyNumberOptions](#emergencynumberoptions7) | No  | Phone number.|
S
shawn_he 已提交
594

S
shawn_he 已提交
595
**Return value**
S
shawn_he 已提交
596

S
shawn_he 已提交
597
| Type                  | Description                                               |
S
shawn_he 已提交
598
| ---------------------- | --------------------------------------------------- |
S
shawn_he 已提交
599
| Promise&lt;boolean&gt; | Promise used to return the result.|
S
shawn_he 已提交
600

S
shawn_he 已提交
601
**Error codes**
S
shawn_he 已提交
602

S
shawn_he 已提交
603
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
604

S
shawn_he 已提交
605
| ID| Error Message                                    |
S
shawn_he 已提交
606
| -------- | -------------------------------------------- |
S
shawn_he 已提交
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let promise = call.isEmergencyPhoneNumber("138xxxxxxxx", {slotId: 1});
promise.then(data => {
    console.log(`isEmergencyPhoneNumber success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`isEmergencyPhoneNumber fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
622
```
S
shawn_he 已提交
623

S
shawn_he 已提交
624
## call.formatPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
625

S
shawn_he 已提交
626
formatPhoneNumber\(phoneNumber: string, callback: AsyncCallback\<string\>\): void
S
shawn_he 已提交
627

S
shawn_he 已提交
628
Formats a phone number. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
629

S
shawn_he 已提交
630
A formatted phone number is a standard numeric string, for example, 555 0100.
S
shawn_he 已提交
631

S
shawn_he 已提交
632
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
633

S
shawn_he 已提交
634
**Parameters**
S
shawn_he 已提交
635

S
shawn_he 已提交
636
| Name     | Type                       | Mandatory| Description                                |
S
shawn_he 已提交
637
| ----------- | --------------------------- | ---- | ------------------------------------ |
S
shawn_he 已提交
638 639
| phoneNumber | string                      | Yes  | Phone number.                          |
| callback    | AsyncCallback&lt;string&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
640

S
shawn_he 已提交
641
**Error codes**
S
shawn_he 已提交
642

S
shawn_he 已提交
643
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
644

S
shawn_he 已提交
645
| ID| Error Message                                    |
S
shawn_he 已提交
646
| -------- | -------------------------------------------- |
S
shawn_he 已提交
647 648 649 650 651 652 653 654 655 656 657 658
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.formatPhoneNumber("138xxxxxxxx", (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
659
```
S
shawn_he 已提交
660

S
shawn_he 已提交
661
## call.formatPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
662

S
shawn_he 已提交
663
formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback\<string\>\): void
S
shawn_he 已提交
664

S
shawn_he 已提交
665
Formats a phone number based on specified formatting options. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
666

S
shawn_he 已提交
667
A formatted phone number is a standard numeric string, for example, 555 0100.
S
shawn_he 已提交
668

S
shawn_he 已提交
669
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
670

S
shawn_he 已提交
671
**Parameters**
S
shawn_he 已提交
672

S
shawn_he 已提交
673
| Name     | Type                                        | Mandatory| Description                                |
S
shawn_he 已提交
674
| ----------- | -------------------------------------------- | ---- | ------------------------------------ |
S
shawn_he 已提交
675 676 677
| phoneNumber | string                                       | Yes  | Phone number.                          |
| options     | [NumberFormatOptions](#numberformatoptions7) | Yes  | Number formatting options, for example, country code.              |
| callback    | AsyncCallback&lt;string&gt;                  | Yes  | Callback used to return the result.|
S
shawn_he 已提交
678

S
shawn_he 已提交
679
**Error codes**
S
shawn_he 已提交
680

S
shawn_he 已提交
681
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
682

S
shawn_he 已提交
683
| ID| Error Message                                    |
S
shawn_he 已提交
684
| -------- | -------------------------------------------- |
S
shawn_he 已提交
685 686 687 688 689 690 691 692 693 694 695 696 697 698
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.formatPhoneNumber("138xxxxxxxx", {
    countryCode: "CN"
}, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
699
```
S
shawn_he 已提交
700 701


S
shawn_he 已提交
702
## call.formatPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
703

S
shawn_he 已提交
704
formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise\<string\>
S
shawn_he 已提交
705

S
shawn_he 已提交
706
Formats a phone number based on specified formatting options. This API uses a promise to return the result.
S
shawn_he 已提交
707

S
shawn_he 已提交
708
A formatted phone number is a standard numeric string, for example, 555 0100.
S
shawn_he 已提交
709

S
shawn_he 已提交
710
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
711

S
shawn_he 已提交
712
**Parameters**
S
shawn_he 已提交
713

S
shawn_he 已提交
714
| Name     | Type                                        | Mandatory| Description                  |
S
shawn_he 已提交
715
| ----------- | -------------------------------------------- | ---- | ---------------------- |
S
shawn_he 已提交
716 717
| phoneNumber | string                                       | Yes  | Phone number.            |
| options     | [NumberFormatOptions](#numberformatoptions7) | No  | Number formatting options, for example, country code.|
S
shawn_he 已提交
718

S
shawn_he 已提交
719
**Return value**
S
shawn_he 已提交
720

S
shawn_he 已提交
721
| Type                 | Description                                       |
S
shawn_he 已提交
722
| --------------------- | ------------------------------------------- |
S
shawn_he 已提交
723
| Promise&lt;string&gt; | Promise used to return the result.|
S
shawn_he 已提交
724

S
shawn_he 已提交
725
**Error codes**
S
shawn_he 已提交
726

S
shawn_he 已提交
727
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
728

S
shawn_he 已提交
729
| ID| Error Message                                    |
S
shawn_he 已提交
730
| -------- | -------------------------------------------- |
S
shawn_he 已提交
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let promise = call.formatPhoneNumber("138xxxxxxxx", {
    countryCode: "CN"
});
promise.then(data => {
    console.log(`formatPhoneNumber success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`formatPhoneNumber fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
748
```
S
shawn_he 已提交
749

S
shawn_he 已提交
750
## call.formatPhoneNumberToE164<sup>7+</sup>
S
shawn_he 已提交
751

S
shawn_he 已提交
752
formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: AsyncCallback\<string\>\): void
S
shawn_he 已提交
753

S
shawn_he 已提交
754
Converts a phone number into the E.164 format. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
755

S
shawn_he 已提交
756
The phone number must match the specified country code. For example, for a China phone number, the country code must be **CN**. Otherwise, **null** will be returned.
S
shawn_he 已提交
757

S
shawn_he 已提交
758
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
759

S
shawn_he 已提交
760
**Parameters**
S
shawn_he 已提交
761

S
shawn_he 已提交
762
| Name     | Type                       | Mandatory| Description                                                 |
S
shawn_he 已提交
763
| ----------- | --------------------------- | ---- | ----------------------------------------------------- |
S
shawn_he 已提交
764 765 766
| phoneNumber | string                      | Yes  | Phone number.                                           |
| countryCode | string                      | Yes  | Country code, for example, **CN** (China). All country codes are supported.             |
| callback    | AsyncCallback&lt;string&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
767

S
shawn_he 已提交
768
**Error codes**
S
shawn_he 已提交
769

S
shawn_he 已提交
770
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
771

S
shawn_he 已提交
772
| ID| Error Message                                    |
S
shawn_he 已提交
773
| -------- | -------------------------------------------- |
S
shawn_he 已提交
774 775 776 777 778 779 780 781 782 783 784 785
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.formatPhoneNumberToE164("138xxxxxxxx", "CN", (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
786
```
S
shawn_he 已提交
787 788


S
shawn_he 已提交
789
## call.formatPhoneNumberToE164<sup>7+</sup>
S
shawn_he 已提交
790

S
shawn_he 已提交
791
formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise\<string\>
S
shawn_he 已提交
792

S
shawn_he 已提交
793
Converts a phone number into the E.164 format. This API uses a promise to return the result.
S
shawn_he 已提交
794

S
shawn_he 已提交
795
The phone number must match the specified country code. For example, for a China phone number, the country code must be **CN**. Otherwise, **null** will be returned.
S
shawn_he 已提交
796

S
shawn_he 已提交
797
All country codes are supported.
S
shawn_he 已提交
798

S
shawn_he 已提交
799
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
800

S
shawn_he 已提交
801
**Parameters**
S
shawn_he 已提交
802

S
shawn_he 已提交
803
| Name     | Type  | Mandatory| Description                                    |
S
shawn_he 已提交
804
| ----------- | ------ | ---- | ---------------------------------------- |
S
shawn_he 已提交
805 806
| phoneNumber | string | Yes  | Phone number.                              |
| countryCode | string | Yes  | Country code, for example, **CN** (China). All country codes are supported.|
S
shawn_he 已提交
807

S
shawn_he 已提交
808
**Return value**
S
shawn_he 已提交
809

S
shawn_he 已提交
810
| Type                 | Description                                                        |
S
shawn_he 已提交
811
| --------------------- | ------------------------------------------------------------ |
S
shawn_he 已提交
812
| Promise&lt;string&gt; | Promise used to return the result.|
S
shawn_he 已提交
813

S
shawn_he 已提交
814
**Error codes**
S
shawn_he 已提交
815

S
shawn_he 已提交
816
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
817

S
shawn_he 已提交
818
| ID| Error Message                                    |
S
shawn_he 已提交
819
| -------- | -------------------------------------------- |
S
shawn_he 已提交
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let promise = call.formatPhoneNumberToE164("138xxxxxxxx", "CN");
promise.then(data => {
    console.log(`formatPhoneNumberToE164 success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`formatPhoneNumberToE164 fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
835
```
S
shawn_he 已提交
836

S
shawn_he 已提交
837
## call.muteRinger<sup>8+</sup>
S
shawn_he 已提交
838

S
shawn_he 已提交
839
muteRinger\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
840

S
shawn_he 已提交
841
Mutes the ringtone while it is playing. It does not work if the ringtone has been muted. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
842

S
shawn_he 已提交
843
**System API**: This is a system API.
S
shawn_he 已提交
844

S
shawn_he 已提交
845
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
846

S
shawn_he 已提交
847
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
848

S
shawn_he 已提交
849
**Parameters**
S
shawn_he 已提交
850

S
shawn_he 已提交
851
| Name     | Type                     | Mandatory| Description      |
S
shawn_he 已提交
852
| ----------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
853
| callback    | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
854

S
shawn_he 已提交
855
**Error codes**
S
shawn_he 已提交
856

S
shawn_he 已提交
857
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
858

S
shawn_he 已提交
859
| ID| Error Message                                    |
S
shawn_he 已提交
860
| -------- | -------------------------------------------- |
S
shawn_he 已提交
861 862 863 864 865 866 867 868 869 870 871 872 873 874
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.muteRinger((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
875 876 877
```


S
shawn_he 已提交
878
## call.muteRinger<sup>8+</sup>
S
shawn_he 已提交
879

S
shawn_he 已提交
880
muteRinger\(\): Promise\<void\>
S
shawn_he 已提交
881

S
shawn_he 已提交
882
Mutes the ringtone while it is playing. It does not work if the ringtone has been muted. This API uses a promise to return the result.
S
shawn_he 已提交
883

S
shawn_he 已提交
884
**System API**: This is a system API.
S
shawn_he 已提交
885

S
shawn_he 已提交
886
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
887

S
shawn_he 已提交
888
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
889

S
shawn_he 已提交
890
**Return value**
S
shawn_he 已提交
891

S
shawn_he 已提交
892
| Type               | Description                       |
S
shawn_he 已提交
893
| ------------------- | --------------------------- |
S
shawn_he 已提交
894
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
895

S
shawn_he 已提交
896
**Error codes**
S
shawn_he 已提交
897

S
shawn_he 已提交
898
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
899

S
shawn_he 已提交
900
| ID| Error Message                                    |
S
shawn_he 已提交
901
| -------- | -------------------------------------------- |
S
shawn_he 已提交
902 903 904 905 906 907 908 909 910 911 912 913 914 915
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.muteRinger().then(() => {
    console.log(`muteRinger success.`);
}).catch((err) => {
    console.error(`muteRinger fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
916 917 918
```


S
shawn_he 已提交
919
## call.answerCall<sup>9+</sup>
S
shawn_he 已提交
920

S
shawn_he 已提交
921
answerCall\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
922

S
shawn_he 已提交
923
Answers a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
924

S
shawn_he 已提交
925
**System API**: This is a system API.
S
shawn_he 已提交
926

S
shawn_he 已提交
927
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
928

S
shawn_he 已提交
929
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
930

S
shawn_he 已提交
931
**Parameters**
S
shawn_he 已提交
932

S
shawn_he 已提交
933
| Name  | Type                     | Mandatory| Description                                           |
S
shawn_he 已提交
934
| -------- | ------------------------- | ---- | ----------------------------------------------- |
S
shawn_he 已提交
935 936
| callId   | number                    | Yes  | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.|
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.                                     |
S
shawn_he 已提交
937

S
shawn_he 已提交
938
**Error codes**
S
shawn_he 已提交
939

S
shawn_he 已提交
940
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
941

S
shawn_he 已提交
942
| ID| Error Message                                    |
S
shawn_he 已提交
943
| -------- | -------------------------------------------- |
S
shawn_he 已提交
944 945 946 947 948 949 950 951 952 953 954 955 956 957
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.answerCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
958 959 960
```


S
shawn_he 已提交
961
## call.answerCall<sup>9+</sup>
S
shawn_he 已提交
962

S
shawn_he 已提交
963
answerCall(callId?: number\): Promise\<void\>
S
shawn_he 已提交
964

S
shawn_he 已提交
965
Answers a call. This API uses a promise to return the result.
S
shawn_he 已提交
966

S
shawn_he 已提交
967
**System API**: This is a system API.
S
shawn_he 已提交
968

S
shawn_he 已提交
969
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
970

S
shawn_he 已提交
971
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
972

S
shawn_he 已提交
973
**Parameters**
S
shawn_he 已提交
974

S
shawn_he 已提交
975
| Name| Type  | Mandatory| Description                                                        |
S
shawn_he 已提交
976
| ------ | ------ | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
977
| callId | number | No  | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.<br>If this parameter is not set, the latest ringing call will be connected.|
S
shawn_he 已提交
978

S
shawn_he 已提交
979
**Return value**
S
shawn_he 已提交
980

S
shawn_he 已提交
981
| Type               | Description                       |
S
shawn_he 已提交
982
| ------------------- | --------------------------- |
S
shawn_he 已提交
983
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
984

S
shawn_he 已提交
985
**Error codes**
S
shawn_he 已提交
986

S
shawn_he 已提交
987
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
988

S
shawn_he 已提交
989
| ID| Error Message                                    |
S
shawn_he 已提交
990
| -------- | -------------------------------------------- |
S
shawn_he 已提交
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.answerCall(1).then(() => {
    console.log(`answerCall success.`);
}).catch((err) => {
    console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1007 1008 1009
```


S
shawn_he 已提交
1010
## call.answerCall<sup>9+</sup>
S
shawn_he 已提交
1011

S
shawn_he 已提交
1012
answerCall\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1013

S
shawn_he 已提交
1014
Answers a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1015

S
shawn_he 已提交
1016
**System API**: This is a system API.
S
shawn_he 已提交
1017

S
shawn_he 已提交
1018
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1019

S
shawn_he 已提交
1020
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1021

S
shawn_he 已提交
1022
**Parameters**
S
shawn_he 已提交
1023

S
shawn_he 已提交
1024
| Name  | Type                     | Mandatory| Description      |
S
shawn_he 已提交
1025
| -------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
1026
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
1027

S
shawn_he 已提交
1028
**Error codes**
S
shawn_he 已提交
1029

S
shawn_he 已提交
1030
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1031

S
shawn_he 已提交
1032
| ID| Error Message                                    |
S
shawn_he 已提交
1033
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.answerCall((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1048 1049 1050
```


S
shawn_he 已提交
1051
## call.hangUpCall<sup>9+</sup>
S
shawn_he 已提交
1052

S
shawn_he 已提交
1053
hangUpCall\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1054

S
shawn_he 已提交
1055
Ends a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1056

S
shawn_he 已提交
1057
**System API**: This is a system API.
S
shawn_he 已提交
1058

S
shawn_he 已提交
1059
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1060

S
shawn_he 已提交
1061
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1062

S
shawn_he 已提交
1063
**Parameters**
S
shawn_he 已提交
1064

S
shawn_he 已提交
1065
| Name  | Type                     | Mandatory| Description                                           |
S
shawn_he 已提交
1066
| -------- | ------------------------- | ---- | ----------------------------------------------- |
S
shawn_he 已提交
1067 1068
| callId   | number                    | Yes  | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.|
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.                                     |
S
shawn_he 已提交
1069

S
shawn_he 已提交
1070
**Error codes**
S
shawn_he 已提交
1071

S
shawn_he 已提交
1072
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1073

S
shawn_he 已提交
1074
| ID| Error Message                                    |
S
shawn_he 已提交
1075
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.hangUpCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1090 1091 1092
```


S
shawn_he 已提交
1093
## call.hangUpCall<sup>9+</sup>
S
shawn_he 已提交
1094

S
shawn_he 已提交
1095
hangUpCall\(callId?: number\): Promise\<void\>
S
shawn_he 已提交
1096

S
shawn_he 已提交
1097
Ends a call. This API uses a promise to return the result.
S
shawn_he 已提交
1098

S
shawn_he 已提交
1099
**System API**: This is a system API.
S
shawn_he 已提交
1100

S
shawn_he 已提交
1101
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1102

S
shawn_he 已提交
1103
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1104

S
shawn_he 已提交
1105
**Parameters**
S
shawn_he 已提交
1106

S
shawn_he 已提交
1107
| Name| Type  | Mandatory| Description                                                        |
S
shawn_he 已提交
1108
| ------ | ------ | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
1109
| callId | number | No  | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.<br>If this parameter is not set, the latest ongoing, dialed, or connected call will be ended.|
S
shawn_he 已提交
1110

S
shawn_he 已提交
1111
**Return value**
S
shawn_he 已提交
1112

S
shawn_he 已提交
1113
| Type               | Description                       |
S
shawn_he 已提交
1114
| ------------------- | --------------------------- |
S
shawn_he 已提交
1115
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
1116

S
shawn_he 已提交
1117
**Error codes**
S
shawn_he 已提交
1118

S
shawn_he 已提交
1119
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1120

S
shawn_he 已提交
1121
| ID| Error Message                                    |
S
shawn_he 已提交
1122
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.hangUpCall(1).then(() => {
    console.log(`hangUpCall success.`);
}).catch((err) => {
    console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1139 1140 1141
```


S
shawn_he 已提交
1142
## call.hangUpCall<sup>9+</sup>
S
shawn_he 已提交
1143

S
shawn_he 已提交
1144
hangUpCall\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1145

S
shawn_he 已提交
1146
Ends a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1147

S
shawn_he 已提交
1148
**System API**: This is a system API.
S
shawn_he 已提交
1149

S
shawn_he 已提交
1150
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1151

S
shawn_he 已提交
1152
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1153

S
shawn_he 已提交
1154
**Parameters**
S
shawn_he 已提交
1155

S
shawn_he 已提交
1156
| Name  | Type                     | Mandatory| Description      |
S
shawn_he 已提交
1157
| -------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
1158
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
1159

S
shawn_he 已提交
1160
**Error codes**
S
shawn_he 已提交
1161

S
shawn_he 已提交
1162
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1163

S
shawn_he 已提交
1164
| ID| Error Message                                    |
S
shawn_he 已提交
1165
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1166 1167 1168 1169 1170 1171 1172
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
1173 1174


S
shawn_he 已提交
1175
**Example**
S
shawn_he 已提交
1176

S
shawn_he 已提交
1177 1178 1179 1180
```js
call.hangUpCall((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1181 1182 1183
```


S
shawn_he 已提交
1184
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1185

S
shawn_he 已提交
1186
rejectCall\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1187

S
shawn_he 已提交
1188
Rejects a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1189

S
shawn_he 已提交
1190
**System API**: This is a system API.
S
shawn_he 已提交
1191

S
shawn_he 已提交
1192
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1193

S
shawn_he 已提交
1194
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1195

S
shawn_he 已提交
1196
**Parameters**
S
shawn_he 已提交
1197

S
shawn_he 已提交
1198
| Name  | Type                     | Mandatory| Description                                           |
S
shawn_he 已提交
1199
| -------- | ------------------------- | ---- | ----------------------------------------------- |
S
shawn_he 已提交
1200 1201
| callId   | number                    | Yes  | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.|
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.                                     |
S
shawn_he 已提交
1202

S
shawn_he 已提交
1203
**Error codes**
S
shawn_he 已提交
1204

S
shawn_he 已提交
1205
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1206

S
shawn_he 已提交
1207
| ID| Error Message                                    |
S
shawn_he 已提交
1208
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1209 1210 1211 1212 1213 1214 1215
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
1216

S
shawn_he 已提交
1217

S
shawn_he 已提交
1218
**Example**
S
shawn_he 已提交
1219

S
shawn_he 已提交
1220 1221 1222 1223
```js
call.rejectCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1224 1225 1226
```


S
shawn_he 已提交
1227
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1228

S
shawn_he 已提交
1229
rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1230

S
shawn_he 已提交
1231
Rejects a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1232

S
shawn_he 已提交
1233
**System API**: This is a system API.
S
shawn_he 已提交
1234

S
shawn_he 已提交
1235
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1236

S
shawn_he 已提交
1237
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1238

S
shawn_he 已提交
1239
**Parameters**
S
shawn_he 已提交
1240

S
shawn_he 已提交
1241
| Name  | Type                                          | Mandatory| Description                                           |
S
shawn_he 已提交
1242
| -------- | ---------------------------------------------- | ---- | ----------------------------------------------- |
S
shawn_he 已提交
1243 1244 1245
| callId   | number                                         | Yes  | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.|
| options  | [RejectMessageOptions](#rejectmessageoptions7) | Yes  | Options for the call rejection message.                                 |
| callback | AsyncCallback&lt;void&gt;                      | Yes  | Callback used to return the result.                                     |
S
shawn_he 已提交
1246

S
shawn_he 已提交
1247
**Error codes**
S
shawn_he 已提交
1248

S
shawn_he 已提交
1249
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1250

S
shawn_he 已提交
1251
| ID| Error Message                                    |
S
shawn_he 已提交
1252
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let rejectMessageOptions={
    messageContent: "Unknown number blocked"
S
shawn_he 已提交
1266
}
S
shawn_he 已提交
1267 1268 1269
call.rejectCall(1, rejectMessageOptions, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1270 1271 1272
```


S
shawn_he 已提交
1273
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1274

S
shawn_he 已提交
1275
rejectCall\(callId?: number, options?: RejectMessageOptions\): Promise\<void\>
S
shawn_he 已提交
1276

S
shawn_he 已提交
1277
Rejects a call. This API uses a promise to return the result.
S
shawn_he 已提交
1278

S
shawn_he 已提交
1279
**System API**: This is a system API.
S
shawn_he 已提交
1280

S
shawn_he 已提交
1281
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1282

S
shawn_he 已提交
1283
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1284

S
shawn_he 已提交
1285
**Parameters**
S
shawn_he 已提交
1286

S
shawn_he 已提交
1287
| Name | Type                                          | Mandatory| Description                                                        |
S
shawn_he 已提交
1288
| ------- | ---------------------------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
1289 1290
| callId  | number                                         | No  | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.<br>If this parameter is not set, the latest ringing call will be rejected.|
| options | [RejectMessageOptions](#rejectmessageoptions7) | No  | Options for the call rejection message. If this parameter is not set, no call rejection message will be sent.|
S
shawn_he 已提交
1291

S
shawn_he 已提交
1292
**Return value**
S
shawn_he 已提交
1293

S
shawn_he 已提交
1294
| Type               | Description                       |
S
shawn_he 已提交
1295
| ------------------- | --------------------------- |
S
shawn_he 已提交
1296
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
1297

S
shawn_he 已提交
1298
**Error codes**
S
shawn_he 已提交
1299

S
shawn_he 已提交
1300
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1301

S
shawn_he 已提交
1302
| ID| Error Message                                    |
S
shawn_he 已提交
1303
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let rejectMessageOptions={
    messageContent: "Unknown number blocked"
S
shawn_he 已提交
1317
}
S
shawn_he 已提交
1318 1319 1320 1321 1322
call.rejectCall(1, rejectMessageOptions).then(() => {
    console.log(`rejectCall success.`);
}).catch((err) => {
    console.error(`rejectCall fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1323 1324
```

S
shawn_he 已提交
1325

S
shawn_he 已提交
1326
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1327

S
shawn_he 已提交
1328
rejectCall\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1329

S
shawn_he 已提交
1330
Rejects a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1331

S
shawn_he 已提交
1332
**System API**: This is a system API.
S
shawn_he 已提交
1333

S
shawn_he 已提交
1334
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1335

S
shawn_he 已提交
1336
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1337

S
shawn_he 已提交
1338
**Parameters**
S
shawn_he 已提交
1339

S
shawn_he 已提交
1340
| Name  | Type                     | Mandatory| Description      |
S
shawn_he 已提交
1341
| -------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
1342
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
1343

S
shawn_he 已提交
1344
**Error codes**
S
shawn_he 已提交
1345

S
shawn_he 已提交
1346
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1347

S
shawn_he 已提交
1348
| ID| Error Message                                    |
S
shawn_he 已提交
1349
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.rejectCall((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1364 1365 1366
```


S
shawn_he 已提交
1367
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1368

S
shawn_he 已提交
1369
rejectCall\(options: RejectMessageOptions, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1370

S
shawn_he 已提交
1371
Rejects a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1372

S
shawn_he 已提交
1373
**System API**: This is a system API.
S
shawn_he 已提交
1374

S
shawn_he 已提交
1375
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1376

S
shawn_he 已提交
1377
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1378

S
shawn_he 已提交
1379
**Parameters**
S
shawn_he 已提交
1380

S
shawn_he 已提交
1381
| Name  | Type                                          | Mandatory| Description          |
S
shawn_he 已提交
1382
| -------- | ---------------------------------------------- | ---- | -------------- |
S
shawn_he 已提交
1383 1384
| options  | [RejectMessageOptions](#rejectmessageoptions7) | Yes  | Options for the call rejection message.|
| callback | AsyncCallback&lt;void&gt;                      | Yes  | Callback used to return the result.    |
S
shawn_he 已提交
1385

S
shawn_he 已提交
1386
**Error codes**
S
shawn_he 已提交
1387

S
shawn_he 已提交
1388
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1389

S
shawn_he 已提交
1390
| ID| Error Message                                    |
S
shawn_he 已提交
1391
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let rejectMessageOptions={
    messageContent: "Unknown number blocked"
S
shawn_he 已提交
1405
}
S
shawn_he 已提交
1406 1407 1408
call.rejectCall(rejectMessageOptions, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1409 1410 1411
```


S
shawn_he 已提交
1412
## call.holdCall<sup>7+</sup>
S
shawn_he 已提交
1413

S
shawn_he 已提交
1414
holdCall\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1415

S
shawn_he 已提交
1416
Holds a call based on the specified call ID. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1417

S
shawn_he 已提交
1418
**System API**: This is a system API.
S
shawn_he 已提交
1419

S
shawn_he 已提交
1420
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1421

S
shawn_he 已提交
1422
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1423

S
shawn_he 已提交
1424
**Parameters**
S
shawn_he 已提交
1425

S
shawn_he 已提交
1426
| Name  | Type                     | Mandatory| Description      |
S
shawn_he 已提交
1427
| -------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
1428 1429
| callId   | number                    | Yes  | Call ID.  |
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
1430

S
shawn_he 已提交
1431
**Error codes**
S
shawn_he 已提交
1432

S
shawn_he 已提交
1433
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1434

S
shawn_he 已提交
1435
| ID| Error Message                                    |
S
shawn_he 已提交
1436
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.holdCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1451 1452 1453
```


S
shawn_he 已提交
1454
## call.holdCall<sup>7+</sup>
S
shawn_he 已提交
1455

S
shawn_he 已提交
1456
holdCall\(callId: number\): Promise\<void\>
S
shawn_he 已提交
1457

S
shawn_he 已提交
1458
Holds a call based on the specified call ID. This API uses a promise to return the result.
S
shawn_he 已提交
1459

S
shawn_he 已提交
1460
**System API**: This is a system API.
S
shawn_he 已提交
1461

S
shawn_he 已提交
1462
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1463

S
shawn_he 已提交
1464
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1465

S
shawn_he 已提交
1466
**Parameters**
S
shawn_he 已提交
1467

S
shawn_he 已提交
1468
| Name| Type  | Mandatory| Description    |
S
shawn_he 已提交
1469
| ------ | ------ | ---- | -------- |
S
shawn_he 已提交
1470
| callId | number | Yes  | Call ID.|
S
shawn_he 已提交
1471

S
shawn_he 已提交
1472
**Return value**
S
shawn_he 已提交
1473

S
shawn_he 已提交
1474
| Type               | Description                       |
S
shawn_he 已提交
1475
| ------------------- | --------------------------- |
S
shawn_he 已提交
1476
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
1477

S
shawn_he 已提交
1478
**Error codes**
S
shawn_he 已提交
1479

S
shawn_he 已提交
1480
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1481

S
shawn_he 已提交
1482
| ID| Error Message                                    |
S
shawn_he 已提交
1483
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.holdCall(1).then(() => {
    console.log(`holdCall success.`);
}).catch((err) => {
    console.error(`holdCall fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1500 1501
```

S
shawn_he 已提交
1502
## call.unHoldCall<sup>7+</sup>
S
shawn_he 已提交
1503

S
shawn_he 已提交
1504
unHoldCall\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1505

S
shawn_he 已提交
1506
Unholds a call based on the specified call ID. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1507

S
shawn_he 已提交
1508
**System API**: This is a system API.
S
shawn_he 已提交
1509

S
shawn_he 已提交
1510
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1511

S
shawn_he 已提交
1512
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1513

S
shawn_he 已提交
1514
**Parameters**
S
shawn_he 已提交
1515

S
shawn_he 已提交
1516
| Name  | Type                     | Mandatory| Description      |
S
shawn_he 已提交
1517
| -------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
1518 1519
| callId   | number                    | Yes  | Call ID.  |
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
1520

S
shawn_he 已提交
1521
**Error codes**
S
shawn_he 已提交
1522

S
shawn_he 已提交
1523
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1524

S
shawn_he 已提交
1525
| ID| Error Message                                    |
S
shawn_he 已提交
1526
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.unHoldCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1541 1542 1543
```


S
shawn_he 已提交
1544
## call.unHoldCall<sup>7+</sup>
S
shawn_he 已提交
1545

S
shawn_he 已提交
1546
unHoldCall\(callId: number\): Promise\<void\>
S
shawn_he 已提交
1547

S
shawn_he 已提交
1548
Unholds a call based on the specified call ID. This API uses a promise to return the result.
S
shawn_he 已提交
1549

S
shawn_he 已提交
1550
**System API**: This is a system API.
S
shawn_he 已提交
1551

S
shawn_he 已提交
1552
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1553

S
shawn_he 已提交
1554
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1555

S
shawn_he 已提交
1556
**Parameters**
S
shawn_he 已提交
1557

S
shawn_he 已提交
1558
| Name| Type  | Mandatory| Description    |
S
shawn_he 已提交
1559
| ------ | ------ | ---- | -------- |
S
shawn_he 已提交
1560
| callId | number | Yes  | Call ID.|
S
shawn_he 已提交
1561

S
shawn_he 已提交
1562
**Return value**
S
shawn_he 已提交
1563

S
shawn_he 已提交
1564
| Type               | Description                       |
S
shawn_he 已提交
1565
| ------------------- | --------------------------- |
S
shawn_he 已提交
1566
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
1567

S
shawn_he 已提交
1568
**Error codes**
S
shawn_he 已提交
1569

S
shawn_he 已提交
1570
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1571

S
shawn_he 已提交
1572
| ID| Error Message                                    |
S
shawn_he 已提交
1573
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.unHoldCall(1).then(() => {
    console.log(`unHoldCall success.`);
}).catch((err) => {
    console.error(`unHoldCall fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1590 1591
```

S
shawn_he 已提交
1592
## call.switchCall<sup>7+</sup>
S
shawn_he 已提交
1593

S
shawn_he 已提交
1594
switchCall\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1595

S
shawn_he 已提交
1596
Switches a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1597

S
shawn_he 已提交
1598
**System API**: This is a system API.
S
shawn_he 已提交
1599

S
shawn_he 已提交
1600
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1601

S
shawn_he 已提交
1602
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1603

S
shawn_he 已提交
1604
**Parameters**
S
shawn_he 已提交
1605

S
shawn_he 已提交
1606
| Name  | Type                     | Mandatory| Description      |
S
shawn_he 已提交
1607
| -------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
1608 1609
| callId   | number                    | Yes  | Call ID.  |
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
1610

S
shawn_he 已提交
1611
**Error codes**
S
shawn_he 已提交
1612

S
shawn_he 已提交
1613
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1614

S
shawn_he 已提交
1615
| ID| Error Message                                    |
S
shawn_he 已提交
1616
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.switchCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1631 1632 1633
```


S
shawn_he 已提交
1634
## call.switchCall<sup>7+</sup>
S
shawn_he 已提交
1635

S
shawn_he 已提交
1636
switchCall\(callId: number\): Promise\<void\>
S
shawn_he 已提交
1637

S
shawn_he 已提交
1638
Switches a call. This API uses a promise to return the result.
S
shawn_he 已提交
1639

S
shawn_he 已提交
1640
**System API**: This is a system API.
S
shawn_he 已提交
1641

S
shawn_he 已提交
1642
**Required permission**: ohos.permission.ANSWER_CALL
S
shawn_he 已提交
1643

S
shawn_he 已提交
1644
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1645

S
shawn_he 已提交
1646
**Parameters**
S
shawn_he 已提交
1647

S
shawn_he 已提交
1648
| Name| Type  | Mandatory| Description    |
S
shawn_he 已提交
1649
| ------ | ------ | ---- | -------- |
S
shawn_he 已提交
1650
| callId | number | Yes  | Call ID.|
S
shawn_he 已提交
1651

S
shawn_he 已提交
1652
**Return value**
S
shawn_he 已提交
1653

S
shawn_he 已提交
1654
| Type               | Description                       |
S
shawn_he 已提交
1655
| ------------------- | --------------------------- |
S
shawn_he 已提交
1656
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
1657

S
shawn_he 已提交
1658
**Error codes**
S
shawn_he 已提交
1659

S
shawn_he 已提交
1660
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1661

S
shawn_he 已提交
1662
| ID| Error Message                                    |
S
shawn_he 已提交
1663
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.switchCall(1).then(() => {
    console.log(`switchCall success.`);
}).catch((err) => {
    console.error(`switchCall fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1680 1681
```

S
shawn_he 已提交
1682
## call.combineConference<sup>7+</sup>
S
shawn_he 已提交
1683

S
shawn_he 已提交
1684
combineConference\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1685

S
shawn_he 已提交
1686
Combines two calls into a conference call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1687

S
shawn_he 已提交
1688
**System API**: This is a system API.
S
shawn_he 已提交
1689

S
shawn_he 已提交
1690
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1691

S
shawn_he 已提交
1692
**Parameters**
S
shawn_he 已提交
1693

S
shawn_he 已提交
1694
| Name  | Type                     | Mandatory| Description      |
S
shawn_he 已提交
1695
| -------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
1696 1697
| callId   | number                    | Yes  | Call ID.  |
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
1698

S
shawn_he 已提交
1699
**Error codes**
S
shawn_he 已提交
1700

S
shawn_he 已提交
1701
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1702

S
shawn_he 已提交
1703
| ID|                 Error Message                    |
S
shawn_he 已提交
1704
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.combineConference(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1717 1718 1719
```


S
shawn_he 已提交
1720
## call.combineConference<sup>7+</sup>
S
shawn_he 已提交
1721

S
shawn_he 已提交
1722
combineConference\(callId: number\): Promise\<void\>
S
shawn_he 已提交
1723

S
shawn_he 已提交
1724
Combines two calls into a conference call. This API uses a promise to return the result.
S
shawn_he 已提交
1725

S
shawn_he 已提交
1726
**System API**: This is a system API.
S
shawn_he 已提交
1727

S
shawn_he 已提交
1728
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1729

S
shawn_he 已提交
1730
**Parameters**
S
shawn_he 已提交
1731

S
shawn_he 已提交
1732
| Name| Type  | Mandatory| Description    |
S
shawn_he 已提交
1733
| ------ | ------ | ---- | -------- |
S
shawn_he 已提交
1734
| callId | number | Yes  | Call ID.|
S
shawn_he 已提交
1735

S
shawn_he 已提交
1736
**Return value**
S
shawn_he 已提交
1737

S
shawn_he 已提交
1738
| Type               | Description                       |
S
shawn_he 已提交
1739
| ------------------- | --------------------------- |
S
shawn_he 已提交
1740
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
1741

S
shawn_he 已提交
1742
**Error codes**
S
shawn_he 已提交
1743

S
shawn_he 已提交
1744
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1745

S
shawn_he 已提交
1746
| ID|                 Error Message                    |
S
shawn_he 已提交
1747
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.combineConference(1).then(() => {
    console.log(`combineConference success.`);
}).catch((err) => {
    console.error(`combineConference fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1762 1763
```

S
shawn_he 已提交
1764
## call.kickOutFromConference<sup>10+</sup>
S
shawn_he 已提交
1765

S
shawn_he 已提交
1766
kickOutFromConference\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1767

S
shawn_he 已提交
1768
Removes a specified call from a conference call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1769

S
shawn_he 已提交
1770
**System API**: This is a system API.
S
shawn_he 已提交
1771

S
shawn_he 已提交
1772
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
1773

S
shawn_he 已提交
1774
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1775

S
shawn_he 已提交
1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794
**Parameters**

| Name  | Type                     | Mandatory| Description      |
| -------- | ------------------------- | ---- | ---------- |
| callId   | number                    | Yes  | Call ID.  |
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
S
shawn_he 已提交
1795
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840

**Example**

```js
call.kickOutFromConference(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
```

## call.kickOutFromConference<sup>10+</sup>

kickOutFromConference\(callId: number\): Promise\<void\>

Removes a specified call from a conference call. This API uses a promise to return the result.

**System API**: This is a system API.

**Required Permissions**: ohos.permission.PLACE_CALL

**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name| Type  | Mandatory| Description    |
| ------ | ------ | ---- | -------- |
| callId | number | Yes  | Call ID.|

**Return value**

| Type               | Description                       |
| ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
S
shawn_he 已提交
1841
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865

**Example**

```js
call.kickOutFromConference(1).then(() => {
    console.log(`kickOutFromConference success.`);
}).catch((err) => {
    console.error(`kickOutFromConference fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.getMainCallId<sup>7+</sup>

getMainCallId\(callId: number, callback: AsyncCallback\<number\>\): void

Obtains the main call ID. This API uses an asynchronous callback to return the result.

**System API**: This is a system API.

**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                       | Mandatory| Description                    |
S
shawn_he 已提交
1866
| -------- | --------------------------- | ---- | ------------------------ |
S
shawn_he 已提交
1867 1868
| callId   | number                      | Yes  | Call ID.                |
| callback | AsyncCallback&lt;number&gt; | Yes  | Callback used to return the result.  |
S
shawn_he 已提交
1869

S
shawn_he 已提交
1870
**Error codes**
S
shawn_he 已提交
1871

S
shawn_he 已提交
1872
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1873

S
shawn_he 已提交
1874
| ID|                 Error Message                    |
S
shawn_he 已提交
1875
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1876 1877 1878 1879 1880
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
S
shawn_he 已提交
1881 1882


S
shawn_he 已提交
1883
**Example**
S
shawn_he 已提交
1884

S
shawn_he 已提交
1885 1886 1887 1888
```js
call.getMainCallId(1, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
1889 1890 1891
```


S
shawn_he 已提交
1892
## call.getMainCallId<sup>7+</sup>
S
shawn_he 已提交
1893

S
shawn_he 已提交
1894
getMainCallId\(callId: number\): Promise\<number\>
S
shawn_he 已提交
1895

S
shawn_he 已提交
1896
Obtains the main call ID. This API uses a promise to return the result.
S
shawn_he 已提交
1897

S
shawn_he 已提交
1898
**System API**: This is a system API.
S
shawn_he 已提交
1899

S
shawn_he 已提交
1900
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1901

S
shawn_he 已提交
1902
**Parameters**
S
shawn_he 已提交
1903

S
shawn_he 已提交
1904
| Name| Type  | Mandatory| Description    |
S
shawn_he 已提交
1905
| ------ | ------ | ---- | -------- |
S
shawn_he 已提交
1906
| callId | number | Yes  | Call ID.|
S
shawn_he 已提交
1907

S
shawn_he 已提交
1908
**Return value**
S
shawn_he 已提交
1909

S
shawn_he 已提交
1910
| Type               | Description                           |
S
shawn_he 已提交
1911
| ------------------- | ------------------------------- |
S
shawn_he 已提交
1912
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
1913

S
shawn_he 已提交
1914
**Error codes**
S
shawn_he 已提交
1915

S
shawn_he 已提交
1916
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1917

S
shawn_he 已提交
1918
| ID|                 Error Message                    |
S
shawn_he 已提交
1919
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |


**Example**

```js
let promise = call.getMainCallId(1);
promise.then(data => {
    console.log(`getMainCallId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getMainCallId fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
1936 1937
```

S
shawn_he 已提交
1938
## call.getSubCallIdList<sup>7+</sup>
S
shawn_he 已提交
1939

S
shawn_he 已提交
1940
getSubCallIdList\(callId: number, callback: AsyncCallback\<Array\<string\>\>\): void
S
shawn_he 已提交
1941

S
shawn_he 已提交
1942
Obtains the list of subcall IDs. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1943

S
shawn_he 已提交
1944
**System API**: This is a system API.
S
shawn_he 已提交
1945

S
shawn_he 已提交
1946
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1947

S
shawn_he 已提交
1948
**Parameters**
S
shawn_he 已提交
1949

S
shawn_he 已提交
1950
| Name  | Type                          | Mandatory| Description                        |
S
shawn_he 已提交
1951
| -------- | ------------------------------ | ---- | ---------------------------- |
S
shawn_he 已提交
1952 1953
| callId   | number                         | Yes  | Call ID.                    |
| callback | AsyncCallback<Array<string\>\> | Yes  | Callback used to return the result.  |
S
shawn_he 已提交
1954

S
shawn_he 已提交
1955
**Error codes**
S
shawn_he 已提交
1956

S
shawn_he 已提交
1957
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
1958

S
shawn_he 已提交
1959
| ID|                 Error Message                    |
S
shawn_he 已提交
1960
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.getSubCallIdList(1, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
1973 1974 1975
```


S
shawn_he 已提交
1976
## call.getSubCallIdList<sup>7+</sup>
S
shawn_he 已提交
1977

S
shawn_he 已提交
1978
getSubCallIdList\(callId: number\): Promise\<Array\<string\>\>
S
shawn_he 已提交
1979

S
shawn_he 已提交
1980
Obtains the list of subcall IDs. This API uses a promise to return the result.
S
shawn_he 已提交
1981

S
shawn_he 已提交
1982
**System API**: This is a system API.
S
shawn_he 已提交
1983

S
shawn_he 已提交
1984
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
1985

S
shawn_he 已提交
1986
**Parameters**
S
shawn_he 已提交
1987

S
shawn_he 已提交
1988
| Name| Type  | Mandatory| Description    |
S
shawn_he 已提交
1989
| ------ | ------ | ---- | -------- |
S
shawn_he 已提交
1990
| callId | number | Yes  | Call ID.|
S
shawn_he 已提交
1991

S
shawn_he 已提交
1992
**Return value**
S
shawn_he 已提交
1993

S
shawn_he 已提交
1994
| Type                         | Description                               |
S
shawn_he 已提交
1995
| ----------------------------- | ----------------------------------- |
S
shawn_he 已提交
1996
| Promise&lt;Array<string\>&gt; | Promise used to return the result.|
S
shawn_he 已提交
1997

S
shawn_he 已提交
1998
**Error codes**
S
shawn_he 已提交
1999

S
shawn_he 已提交
2000
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2001

S
shawn_he 已提交
2002
| ID|                 Error Message                    |
S
shawn_he 已提交
2003
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
let promise = call.getSubCallIdList(1);
promise.then(data => {
    console.log(`getSubCallIdList success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getSubCallIdList fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
2019 2020
```

S
shawn_he 已提交
2021
## call.getCallIdListForConference<sup>7+</sup>
S
shawn_he 已提交
2022

S
shawn_he 已提交
2023
getCallIdListForConference\(callId: number, callback: AsyncCallback\<Array\<string\>\>\): void
S
shawn_he 已提交
2024

S
shawn_he 已提交
2025
Obtains the list of call IDs in a conference. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2026

S
shawn_he 已提交
2027
**System API**: This is a system API.
S
shawn_he 已提交
2028

S
shawn_he 已提交
2029
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2030

S
shawn_he 已提交
2031
**Parameters**
S
shawn_he 已提交
2032

S
shawn_he 已提交
2033
| Name  | Type                               | Mandatory| Description                            |
S
shawn_he 已提交
2034
| -------- | ----------------------------------- | ---- | -------------------------------- |
S
shawn_he 已提交
2035 2036
| callId   | number                              | Yes  | Call ID.                        |
| callback | AsyncCallback&lt;Array<string\>&gt; | Yes  | Callback used to return the result.  |
S
shawn_he 已提交
2037

S
shawn_he 已提交
2038
**Error codes**
S
shawn_he 已提交
2039

S
shawn_he 已提交
2040
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2041

S
shawn_he 已提交
2042
| ID|                 Error Message                    |
S
shawn_he 已提交
2043
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.getCallIdListForConference(1, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2056 2057 2058
```


S
shawn_he 已提交
2059
## call.getCallIdListForConference<sup>7+</sup>
S
shawn_he 已提交
2060

S
shawn_he 已提交
2061
getCallIdListForConference\(callId: number\): Promise\<Array\<string\>\>
S
shawn_he 已提交
2062

S
shawn_he 已提交
2063
Obtains the list of call IDs in a conference. This API uses a promise to return the result.
S
shawn_he 已提交
2064

S
shawn_he 已提交
2065
**System API**: This is a system API.
S
shawn_he 已提交
2066

S
shawn_he 已提交
2067
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2068

S
shawn_he 已提交
2069
**Parameters**
S
shawn_he 已提交
2070

S
shawn_he 已提交
2071
| Name| Type  | Mandatory| Description    |
S
shawn_he 已提交
2072
| ------ | ------ | ---- | -------- |
S
shawn_he 已提交
2073
| callId | number | Yes  | Call ID.|
S
shawn_he 已提交
2074

S
shawn_he 已提交
2075
**Return value**
S
shawn_he 已提交
2076

S
shawn_he 已提交
2077
| Type                         | Description                                   |
S
shawn_he 已提交
2078
| ----------------------------- | --------------------------------------- |
S
shawn_he 已提交
2079
| Promise&lt;Array<string\>&gt; | Promise used to return the result.|
S
shawn_he 已提交
2080

S
shawn_he 已提交
2081
**Error codes**
S
shawn_he 已提交
2082

S
shawn_he 已提交
2083
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2084

S
shawn_he 已提交
2085
| ID|                 Error Message                    |
S
shawn_he 已提交
2086
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
let promise = call.getCallIdListForConference(1);
promise.then(data => {
    console.log(`getCallIdListForConference success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getCallIdListForConference fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
2102 2103
```

S
shawn_he 已提交
2104
## call.getCallWaitingStatus<sup>7+</sup>
S
shawn_he 已提交
2105

S
shawn_he 已提交
2106
getCallWaitingStatus\(slotId: number, callback: AsyncCallback\<CallWaitingStatus\>\): void
S
shawn_he 已提交
2107

S
shawn_he 已提交
2108
Obtains the call waiting status. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2109

S
shawn_he 已提交
2110
**System API**: This is a system API.
S
shawn_he 已提交
2111

S
shawn_he 已提交
2112
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
S
shawn_he 已提交
2113

S
shawn_he 已提交
2114
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2115

S
shawn_he 已提交
2116
**Parameters**
S
shawn_he 已提交
2117

S
shawn_he 已提交
2118
| Name  | Type                                                       | Mandatory| Description                                                        |
S
shawn_he 已提交
2119
| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
2120 2121
| slotId   | number                                                      | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2                      |
| callback | AsyncCallback&lt;[CallWaitingStatus](#callwaitingstatus7)\> | Yes  | Callback used to return the result.<br> <br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.|
S
shawn_he 已提交
2122

S
shawn_he 已提交
2123
**Error codes**
S
shawn_he 已提交
2124

S
shawn_he 已提交
2125
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2126

S
shawn_he 已提交
2127
| ID|                  Error Message                   |
S
shawn_he 已提交
2128
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.getCallWaitingStatus(0, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2143 2144 2145
```


S
shawn_he 已提交
2146
## call.getCallWaitingStatus<sup>7+</sup>
S
shawn_he 已提交
2147

S
shawn_he 已提交
2148
getCallWaitingStatus\(slotId: number\): Promise\<CallWaitingStatus\>
S
shawn_he 已提交
2149

S
shawn_he 已提交
2150
Obtains the call waiting status. This API uses a promise to return the result.
S
shawn_he 已提交
2151

S
shawn_he 已提交
2152
**System API**: This is a system API.
S
shawn_he 已提交
2153

S
shawn_he 已提交
2154
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
S
shawn_he 已提交
2155

S
shawn_he 已提交
2156
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2157

S
shawn_he 已提交
2158
**Parameters**
S
shawn_he 已提交
2159

S
shawn_he 已提交
2160
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
2161
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
2162
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
2163

S
shawn_he 已提交
2164
**Return value**
S
shawn_he 已提交
2165

S
shawn_he 已提交
2166
| Type                                                   | Description                                                        |
S
shawn_he 已提交
2167
| ------------------------------------------------------- | ------------------------------------------------------------ |
S
shawn_he 已提交
2168
| Promise&lt;[CallWaitingStatus](#callwaitingstatus7)&gt; | Promise used to return the result.<br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.|
S
shawn_he 已提交
2169

S
shawn_he 已提交
2170
**Error codes**
S
shawn_he 已提交
2171

S
shawn_he 已提交
2172
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2173

S
shawn_he 已提交
2174
| ID|                  Error Message                   |
S
shawn_he 已提交
2175
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
let promise = call.getCallWaitingStatus(0);
promise.then(data => {
    console.log(`getCallWaitingStatus success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getCallWaitingStatus fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
2193 2194
```

S
shawn_he 已提交
2195
## call.setCallWaiting<sup>7+</sup>
S
shawn_he 已提交
2196

S
shawn_he 已提交
2197
setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
2198

S
shawn_he 已提交
2199
Specifies whether to enable the call waiting service. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2200

S
shawn_he 已提交
2201
**System API**: This is a system API.
S
shawn_he 已提交
2202

S
shawn_he 已提交
2203
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2204

S
shawn_he 已提交
2205
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2206

S
shawn_he 已提交
2207
**Parameters**
S
shawn_he 已提交
2208

S
shawn_he 已提交
2209
| Name  | Type                | Mandatory| Description                                                        |
S
shawn_he 已提交
2210
| -------- | -------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
2211 2212 2213
| slotId   | number               | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2                      |
| activate | boolean              | Yes  | Whether to enable call waiting.<br>- **false**: Disable call waiting.<br>- **true**: Enable call waiting.|
| callback | AsyncCallback<void\> | Yes  | Callback used to return the result.                                                  |
S
shawn_he 已提交
2214

S
shawn_he 已提交
2215
**Error codes**
S
shawn_he 已提交
2216

S
shawn_he 已提交
2217
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2218

S
shawn_he 已提交
2219
| ID|                  Error Message                   |
S
shawn_he 已提交
2220
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.setCallWaiting(0, true, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
2235 2236 2237
```


S
shawn_he 已提交
2238
## call.setCallWaiting<sup>7+</sup>
S
shawn_he 已提交
2239

S
shawn_he 已提交
2240
setCallWaiting\(slotId: number, activate: boolean\): Promise\<void\>
S
shawn_he 已提交
2241

S
shawn_he 已提交
2242
Specifies whether to enable the call waiting service. This API uses a promise to return the result.
S
shawn_he 已提交
2243

S
shawn_he 已提交
2244
**System API**: This is a system API.
S
shawn_he 已提交
2245

S
shawn_he 已提交
2246
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2247

S
shawn_he 已提交
2248
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2249

S
shawn_he 已提交
2250
**Parameters**
S
shawn_he 已提交
2251

S
shawn_he 已提交
2252
| Name  | Type   | Mandatory| Description                                                        |
S
shawn_he 已提交
2253
| -------- | ------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
2254 2255
| slotId   | number  | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2                      |
| activate | boolean | Yes  | Whether to enable call waiting.<br>- **false**: Disable call waiting.<br>- **true**: Enable call waiting.|
S
shawn_he 已提交
2256

S
shawn_he 已提交
2257
**Return value**
S
shawn_he 已提交
2258

S
shawn_he 已提交
2259
| Type               | Description                       |
S
shawn_he 已提交
2260
| ------------------- | --------------------------- |
S
shawn_he 已提交
2261
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
2262

S
shawn_he 已提交
2263
**Error codes**
S
shawn_he 已提交
2264

S
shawn_he 已提交
2265
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2266

S
shawn_he 已提交
2267
| ID|                  Error Message                   |
S
shawn_he 已提交
2268
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.setCallWaiting(0, true).then(() => {
    console.log(`setCallWaiting success.`);
}).catch((err) => {
    console.error(`setCallWaiting fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
2285 2286
```

S
shawn_he 已提交
2287
## call.startDTMF<sup>7+</sup>
S
shawn_he 已提交
2288

S
shawn_he 已提交
2289
startDTMF\(callId: number, character: string, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
2290

S
shawn_he 已提交
2291
Enables DTMF. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2292

S
shawn_he 已提交
2293
**System API**: This is a system API.
S
shawn_he 已提交
2294

S
shawn_he 已提交
2295
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2296

S
shawn_he 已提交
2297
**Parameters**
S
shawn_he 已提交
2298

S
shawn_he 已提交
2299
| Name   | Type                | Mandatory| Description      |
S
shawn_he 已提交
2300
| --------- | -------------------- | ---- | ---------- |
S
shawn_he 已提交
2301 2302 2303
| callId    | number               | Yes  | Call ID.  |
| character | string               | Yes  | DTMF code.  |
| callback  | AsyncCallback<void\> | Yes  | Callback used to return the result.|
S
shawn_he 已提交
2304

S
shawn_he 已提交
2305
**Error codes**
S
shawn_he 已提交
2306

S
shawn_he 已提交
2307
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2308

S
shawn_he 已提交
2309
| ID|                 Error Message                    |
S
shawn_he 已提交
2310
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.startDTMF(1, "0", (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
2323 2324 2325
```


S
shawn_he 已提交
2326
## call.startDTMF<sup>7+</sup>
S
shawn_he 已提交
2327

S
shawn_he 已提交
2328
startDTMF\(callId: number, character: string\): Promise\<void\>
S
shawn_he 已提交
2329

S
shawn_he 已提交
2330
Enables DTMF. This API uses a promise to return the result.
S
shawn_he 已提交
2331

S
shawn_he 已提交
2332
**System API**: This is a system API.
S
shawn_he 已提交
2333

S
shawn_he 已提交
2334
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2335

S
shawn_he 已提交
2336
**Parameters**
S
shawn_he 已提交
2337

S
shawn_he 已提交
2338
| Name   | Type  | Mandatory| Description    |
S
shawn_he 已提交
2339
| --------- | ------ | ---- | -------- |
S
shawn_he 已提交
2340 2341
| callId    | number | Yes  | Call ID.|
| character | string | Yes  | DTMF code.|
S
shawn_he 已提交
2342

S
shawn_he 已提交
2343
**Return value**
S
shawn_he 已提交
2344

S
shawn_he 已提交
2345
| Type               | Description                   |
S
shawn_he 已提交
2346
| ------------------- | ----------------------- |
S
shawn_he 已提交
2347
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
2348

S
shawn_he 已提交
2349
**Error codes**
S
shawn_he 已提交
2350

S
shawn_he 已提交
2351
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2352

S
shawn_he 已提交
2353
| ID|                 Error Message                    |
S
shawn_he 已提交
2354
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.startDTMF(1, "0").then(() => {
    console.log(`startDTMF success.`);
}).catch((err) => {
    console.error(`startDTMF fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
2369 2370
```

S
shawn_he 已提交
2371
## call.stopDTMF<sup>7+</sup>
S
shawn_he 已提交
2372

S
shawn_he 已提交
2373
stopDTMF\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
2374

S
shawn_he 已提交
2375
Stops DTMF. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2376

S
shawn_he 已提交
2377
**System API**: This is a system API.
S
shawn_he 已提交
2378

S
shawn_he 已提交
2379
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2380

S
shawn_he 已提交
2381
**Parameters**
S
shawn_he 已提交
2382

S
shawn_he 已提交
2383
| Name  | Type                     | Mandatory| Description      |
S
shawn_he 已提交
2384
| -------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
2385 2386
| callId   | number                    | Yes  | Call ID.  |
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
2387

S
shawn_he 已提交
2388
**Error codes**
S
shawn_he 已提交
2389

S
shawn_he 已提交
2390
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2391

S
shawn_he 已提交
2392
| ID|                 Error Message                    |
S
shawn_he 已提交
2393
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.stopDTMF(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
2406 2407 2408
```


S
shawn_he 已提交
2409
## call.stopDTMF<sup>7+</sup>
S
shawn_he 已提交
2410

S
shawn_he 已提交
2411
stopDTMF\(callId: number\): Promise\<void\>
S
shawn_he 已提交
2412

S
shawn_he 已提交
2413
Stops DTMF. This API uses a promise to return the result.
S
shawn_he 已提交
2414

S
shawn_he 已提交
2415
**System API**: This is a system API.
S
shawn_he 已提交
2416

S
shawn_he 已提交
2417
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2418

S
shawn_he 已提交
2419
**Parameters**
S
shawn_he 已提交
2420

S
shawn_he 已提交
2421
| Name| Type  | Mandatory| Description    |
S
shawn_he 已提交
2422
| ------ | ------ | ---- | -------- |
S
shawn_he 已提交
2423
| callId | number | Yes  | Call ID.|
S
shawn_he 已提交
2424

S
shawn_he 已提交
2425
**Return value**
S
shawn_he 已提交
2426

S
shawn_he 已提交
2427
| Type               | Description                       |
S
shawn_he 已提交
2428
| ------------------- | --------------------------- |
S
shawn_he 已提交
2429
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
2430

S
shawn_he 已提交
2431
**Error codes**
S
shawn_he 已提交
2432

S
shawn_he 已提交
2433
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2434

S
shawn_he 已提交
2435
| ID|                 Error Message                    |
S
shawn_he 已提交
2436
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.stopDTMF(1).then(() => {
    console.log(`stopDTMF success.`);
}).catch((err) => {
    console.error(`stopDTMF fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
2451 2452
```

S
shawn_he 已提交
2453
## call.isInEmergencyCall<sup>7+</sup>
S
shawn_he 已提交
2454

S
shawn_he 已提交
2455
isInEmergencyCall\(callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
2456

S
shawn_he 已提交
2457
Checks whether a call is an emergency call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2458

S
shawn_he 已提交
2459
**System API**: This is a system API.
S
shawn_he 已提交
2460

S
shawn_he 已提交
2461
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2462

S
shawn_he 已提交
2463
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2464

S
shawn_he 已提交
2465
**Parameters**
S
shawn_he 已提交
2466

S
shawn_he 已提交
2467
| Name  | Type                        | Mandatory| Description      |
S
shawn_he 已提交
2468
| -------- | ---------------------------- | ---- | ---------- |
S
shawn_he 已提交
2469
| callback | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
2470

S
shawn_he 已提交
2471
**Error codes**
S
shawn_he 已提交
2472

S
shawn_he 已提交
2473
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2474

S
shawn_he 已提交
2475
| ID|                  Error Message                   |
S
shawn_he 已提交
2476
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.isInEmergencyCall((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2491 2492 2493
```


S
shawn_he 已提交
2494
## call.isInEmergencyCall<sup>7+</sup>
S
shawn_he 已提交
2495

S
shawn_he 已提交
2496
isInEmergencyCall\(\): Promise\<boolean\>
S
shawn_he 已提交
2497

S
shawn_he 已提交
2498
Checks whether a call is an emergency call. This API uses a promise to return the result.
S
shawn_he 已提交
2499

S
shawn_he 已提交
2500
**System API**: This is a system API.
S
shawn_he 已提交
2501

S
shawn_he 已提交
2502
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2503

S
shawn_he 已提交
2504
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2505

S
shawn_he 已提交
2506
**Return value**
S
shawn_he 已提交
2507

S
shawn_he 已提交
2508
| Type                  | Description                       |
S
shawn_he 已提交
2509
| ---------------------- | --------------------------- |
S
shawn_he 已提交
2510
| Promise&lt;boolean&gt; | Promise used to return the result.|
S
shawn_he 已提交
2511

S
shawn_he 已提交
2512
**Error codes**
S
shawn_he 已提交
2513

S
shawn_he 已提交
2514
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2515

S
shawn_he 已提交
2516
| ID|                  Error Message                   |
S
shawn_he 已提交
2517
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let promise = call.isInEmergencyCall();
promise.then(data => {
    console.log(`isInEmergencyCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`isInEmergencyCall fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
2533 2534
```

S
shawn_he 已提交
2535
## call.on('callDetailsChange')<sup>7+</sup>
S
shawn_he 已提交
2536

S
shawn_he 已提交
2537
on\(type: 'callDetailsChange', callback: Callback\<CallAttributeOptions\>\): void
S
shawn_he 已提交
2538

S
shawn_he 已提交
2539
Subscribes to **callDetailsChange** events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2540

S
shawn_he 已提交
2541
**System API**: This is a system API.
S
shawn_he 已提交
2542

S
shawn_he 已提交
2543
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2544

S
shawn_he 已提交
2545
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2546

S
shawn_he 已提交
2547
**Parameters**
S
shawn_he 已提交
2548

S
shawn_he 已提交
2549
| Name  | Type                                                   | Mandatory| Description                      |
S
shawn_he 已提交
2550
| -------- | ------------------------------------------------------- | ---- | -------------------------- |
S
shawn_he 已提交
2551 2552
| type     | string                                                  | Yes  | Call event change. This field has a fixed value of **callDetailsChange**.|
| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | Yes | Callback used to return the result.                |
S
shawn_he 已提交
2553

S
shawn_he 已提交
2554
**Error codes**
S
shawn_he 已提交
2555

S
shawn_he 已提交
2556
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2557

S
shawn_he 已提交
2558
| ID|                  Error Message                   |
S
shawn_he 已提交
2559
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.on('callDetailsChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2574 2575
```

S
shawn_he 已提交
2576
## call.on('callEventChange')<sup>8+</sup>
S
shawn_he 已提交
2577

S
shawn_he 已提交
2578
on\(type: 'callEventChange', callback: Callback\<CallEventOptions\>\): void
S
shawn_he 已提交
2579

S
shawn_he 已提交
2580
Subscribes to **callEventChange** events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2581

S
shawn_he 已提交
2582
**System API**: This is a system API.
S
shawn_he 已提交
2583

S
shawn_he 已提交
2584
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2585

S
shawn_he 已提交
2586
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2587

S
shawn_he 已提交
2588
**Parameters**
S
shawn_he 已提交
2589

S
shawn_he 已提交
2590
| Name  | Type                                            | Mandatory| Description                      |
S
shawn_he 已提交
2591
| -------- | ------------------------------------------------ | ---- | -------------------------- |
S
shawn_he 已提交
2592 2593
| type     | string                                           | Yes  | Call event change. This field has a fixed value of **callEventChange**.|
| callback | Callback<[CallEventOptions](#calleventoptions8)> | Yes  | Callback used to return the result.                |
S
shawn_he 已提交
2594

S
shawn_he 已提交
2595
**Error codes**
S
shawn_he 已提交
2596

S
shawn_he 已提交
2597
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2598

S
shawn_he 已提交
2599
| ID|                  Error Message                   |
S
shawn_he 已提交
2600
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.on('callEventChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2615 2616
```

S
shawn_he 已提交
2617
## call.on('callDisconnectedCause')<sup>8+</sup>
S
shawn_he 已提交
2618

S
shawn_he 已提交
2619
on\(type: 'callDisconnectedCause', callback: Callback\<DisconnectedDetails\>\): void
S
shawn_he 已提交
2620

S
shawn_he 已提交
2621
Subscribes to **callDisconnectedCause** events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2622

S
shawn_he 已提交
2623
**System API**: This is a system API.
S
shawn_he 已提交
2624

S
shawn_he 已提交
2625
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2626

S
shawn_he 已提交
2627
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2628

S
shawn_he 已提交
2629
**Parameters**
S
shawn_he 已提交
2630

S
shawn_he 已提交
2631
| Name  | Type                                                  | Mandatory| Description                      |
S
shawn_he 已提交
2632
| -------- | ------------------------------------------------------ | ---- | -------------------------- |
S
shawn_he 已提交
2633 2634
| type     | string                                                 | Yes  | Call disconnection cause. This field has a fixed value of **callDisconnectedCause**.|
| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | Yes  | Callback used to return the result.                |
S
shawn_he 已提交
2635

S
shawn_he 已提交
2636
**Error codes**
S
shawn_he 已提交
2637

S
shawn_he 已提交
2638
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2639

S
shawn_he 已提交
2640
| ID|                  Error Message                   |
S
shawn_he 已提交
2641
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.on('callDisconnectedCause', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2656 2657
```

S
shawn_he 已提交
2658
## call.on('mmiCodeResult')<sup>9+</sup>
S
shawn_he 已提交
2659

S
shawn_he 已提交
2660
on\(type: 'mmiCodeResult', callback: Callback\<MmiCodeResults\>\): void
S
shawn_he 已提交
2661

S
shawn_he 已提交
2662
Subscribes to **mmiCodeResult** events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2663

S
shawn_he 已提交
2664
**System API**: This is a system API.
S
shawn_he 已提交
2665

S
shawn_he 已提交
2666
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2667

S
shawn_he 已提交
2668
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2669

S
shawn_he 已提交
2670
**Parameters**
S
shawn_he 已提交
2671

S
shawn_he 已提交
2672
| Name  | Type                                        | Mandatory| Description                 |
S
shawn_he 已提交
2673
| -------- | -------------------------------------------- | ---- | --------------------- |
S
shawn_he 已提交
2674 2675
| type     | string                                       | Yes  | MMI code result. This field has a fixed value of **mmiCodeResult**.|
| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | Yes  | Callback used to return the result.           |
S
shawn_he 已提交
2676

S
shawn_he 已提交
2677
**Error codes**
S
shawn_he 已提交
2678

S
shawn_he 已提交
2679
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2680

S
shawn_he 已提交
2681
| ID|                  Error Message                   |
S
shawn_he 已提交
2682
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.on('mmiCodeResult', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2697 2698
```

S
shawn_he 已提交
2699
## call.off('callDetailsChange')<sup>7+</sup>
S
shawn_he 已提交
2700

S
shawn_he 已提交
2701
off\(type: 'callDetailsChange', callback?: Callback\<CallAttributeOptions\>\): void
S
shawn_he 已提交
2702

S
shawn_he 已提交
2703
Unsubscribes from **callDetailsChange** events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2704

S
shawn_he 已提交
2705
**System API**: This is a system API.
S
shawn_he 已提交
2706

S
shawn_he 已提交
2707
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2708

S
shawn_he 已提交
2709
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2710

S
shawn_he 已提交
2711
**Parameters**
S
shawn_he 已提交
2712

S
shawn_he 已提交
2713
| Name  | Type                                                    | Mandatory| Description                              |
S
shawn_he 已提交
2714
| -------- | -------------------------------------------------------- | ---- | ---------------------------------- |
S
shawn_he 已提交
2715 2716
| type     | string                                                   | Yes  | Call details change. This field has a fixed value of **callDetailsChange**.|
| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | No  | Callback used to return the result. If this parameter is not set, no subscription cancellation result will be received.|
S
shawn_he 已提交
2717

S
shawn_he 已提交
2718
**Error codes**
S
shawn_he 已提交
2719

S
shawn_he 已提交
2720
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2721

S
shawn_he 已提交
2722
| ID|                  Error Message                   |
S
shawn_he 已提交
2723
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.off('callDetailsChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2738 2739
```

S
shawn_he 已提交
2740
## call.off('callEventChange')<sup>8+</sup>
S
shawn_he 已提交
2741

S
shawn_he 已提交
2742
off\(type: 'callEventChange', callback?: Callback\<CallEventOptions\>\): void
S
shawn_he 已提交
2743

S
shawn_he 已提交
2744
Unsubscribes from **callEventChange** events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2745

S
shawn_he 已提交
2746
**System API**: This is a system API.
S
shawn_he 已提交
2747

S
shawn_he 已提交
2748
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2749

S
shawn_he 已提交
2750
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2751

S
shawn_he 已提交
2752
**Parameters**
S
shawn_he 已提交
2753

S
shawn_he 已提交
2754
| Name  | Type                                            | Mandatory| Description                              |
S
shawn_he 已提交
2755
| -------- | ------------------------------------------------ | ---- | ---------------------------------- |
S
shawn_he 已提交
2756 2757
| type     | string                                           | Yes  | Call event change. This field has a fixed value of **callEventChange**.|
| callback | Callback<[CallEventOptions](#calleventoptions8)> | No  | Callback used to return the result. If this parameter is not set, no subscription cancellation result will be received.|
S
shawn_he 已提交
2758

S
shawn_he 已提交
2759
**Error codes**
S
shawn_he 已提交
2760

S
shawn_he 已提交
2761
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2762

S
shawn_he 已提交
2763
| ID|                  Error Message                   |
S
shawn_he 已提交
2764
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.off('callEventChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2779 2780
```

S
shawn_he 已提交
2781
## call.off('callDisconnectedCause')<sup>8+</sup>
S
shawn_he 已提交
2782

S
shawn_he 已提交
2783
off\(type: 'callDisconnectedCause', callback?: Callback\<DisconnectedDetails\>\): void
S
shawn_he 已提交
2784

S
shawn_he 已提交
2785
Unsubscribes from **callDisconnectedCause** events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2786

S
shawn_he 已提交
2787
**System API**: This is a system API.
S
shawn_he 已提交
2788

S
shawn_he 已提交
2789
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2790

S
shawn_he 已提交
2791
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2792

S
shawn_he 已提交
2793
**Parameters**
S
shawn_he 已提交
2794

S
shawn_he 已提交
2795
| Name  | Type                                                      | Mandatory| Description                |
S
shawn_he 已提交
2796
| -------- | ---------------------------------------------------------- | ---- | ------------------- |
S
shawn_he 已提交
2797 2798
| type     | string                                                     | Yes  | Call disconnection cause. This field has a fixed value of **callDisconnectedCause**.|
| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)>     | No  | Callback used to return the result. If this parameter is not set, no subscription cancellation result will be received.|
S
shawn_he 已提交
2799

S
shawn_he 已提交
2800
**Error codes**
S
shawn_he 已提交
2801

S
shawn_he 已提交
2802
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2803

S
shawn_he 已提交
2804
| ID|                  Error Message                   |
S
shawn_he 已提交
2805
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.off('callDisconnectedCause', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2820 2821
```

S
shawn_he 已提交
2822
## call.off('mmiCodeResult')<sup>9+</sup>
S
shawn_he 已提交
2823

S
shawn_he 已提交
2824
off\(type: 'mmiCodeResult', callback?: Callback\<MmiCodeResults\>\): void
S
shawn_he 已提交
2825

S
shawn_he 已提交
2826
Unsubscribes from **mmiCodeResult** events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2827

S
shawn_he 已提交
2828
**System API**: This is a system API.
S
shawn_he 已提交
2829

S
shawn_he 已提交
2830
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2831

S
shawn_he 已提交
2832
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2833

S
shawn_he 已提交
2834
**Parameters**
S
shawn_he 已提交
2835

S
shawn_he 已提交
2836
| Name  | Type                                             | Mandatory| Description       |
S
shawn_he 已提交
2837
| -------- | ------------------------------------------------ | ---- | ----------- |
S
shawn_he 已提交
2838 2839
| type     | string                                           | Yes  | MMI code result. This field has a fixed value of **mmiCodeResult**.|
| callback | Callback<[MmiCodeResults](#mmicoderesults9)>     | No  | Callback used to return the result. If this parameter is not set, no subscription cancellation result will be received.|
S
shawn_he 已提交
2840

S
shawn_he 已提交
2841
**Error codes**
S
shawn_he 已提交
2842

S
shawn_he 已提交
2843
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2844

S
shawn_he 已提交
2845
| ID|                  Error Message                   |
S
shawn_he 已提交
2846
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.off('mmiCodeResult', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2861 2862
```

S
shawn_he 已提交
2863

S
shawn_he 已提交
2864
## call.on('audioDeviceChange')<sup>10+</sup>
S
shawn_he 已提交
2865

S
shawn_he 已提交
2866
on\(type: 'audioDeviceChange', callback: Callback\<AudioDeviceCallbackInfo\>\): void
S
shawn_he 已提交
2867

S
shawn_he 已提交
2868
Subscribes to audio device change events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2869

S
shawn_he 已提交
2870
**System API**: This is a system API.
S
shawn_he 已提交
2871

S
shawn_he 已提交
2872
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2873

S
shawn_he 已提交
2874
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2875

S
shawn_he 已提交
2876
**Parameters**
S
shawn_he 已提交
2877

S
shawn_he 已提交
2878
| Name  | Type                                            | Mandatory| Description                                               |
S
shawn_he 已提交
2879
| -------- | ----------------------------------------------- | ---- | --------------------------------------------------- |
S
shawn_he 已提交
2880
| type     | string                                          | Yes  | Audio device change. This field has a fixed value of **audioDeviceChange**.|
S
shawn_he 已提交
2881
| callback | Callback<[AudioDeviceCallbackInfo](#audiodevicecallbackinfo10)> | Yes  | Callback used to return the result.                                          |
S
shawn_he 已提交
2882

S
shawn_he 已提交
2883
**Error codes**
S
shawn_he 已提交
2884

S
shawn_he 已提交
2885
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2886

S
shawn_he 已提交
2887
| ID|                  Error Message                   |
S
shawn_he 已提交
2888
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.on('audioDeviceChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2903 2904 2905
```


S
shawn_he 已提交
2906
## call.off('audioDeviceChange')<sup>10+</sup>
S
shawn_he 已提交
2907

S
shawn_he 已提交
2908
off\(type: 'audioDeviceChange', callback?: Callback\<AudioDeviceCallbackInfo\>\): void
S
shawn_he 已提交
2909

S
shawn_he 已提交
2910
Unsubscribes from **audioDeviceChange** events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2911

S
shawn_he 已提交
2912
**System API**: This is a system API.
S
shawn_he 已提交
2913

S
shawn_he 已提交
2914
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
2915

S
shawn_he 已提交
2916
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2917

S
shawn_he 已提交
2918
**Parameters**
S
shawn_he 已提交
2919

S
shawn_he 已提交
2920
| Name  | Type                                                      | Mandatory |                           Description                     |
S
shawn_he 已提交
2921
| -------- | ---------------------------------------------------------- | ---- | --------------------------------------------------- |
S
shawn_he 已提交
2922
| type     | string                                                     | Yes  | Audio device change. This field has a fixed value of **audioDeviceChange**.|
S
shawn_he 已提交
2923
| callback | Callback<[AudioDeviceCallbackInfo](#audiodevicecallbackinfo10)>            | No  | Callback used to return the result. If this parameter is not set, no subscription cancellation result will be received.    |
S
shawn_he 已提交
2924

S
shawn_he 已提交
2925
**Error codes**
S
shawn_he 已提交
2926

S
shawn_he 已提交
2927
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2928

S
shawn_he 已提交
2929
| ID|                  Error Message                   |
S
shawn_he 已提交
2930
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.off('audioDeviceChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2945 2946 2947
```


S
shawn_he 已提交
2948
## call.isNewCallAllowed<sup>8+</sup>
S
shawn_he 已提交
2949

S
shawn_he 已提交
2950
isNewCallAllowed\(callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
2951

S
shawn_he 已提交
2952
Checks whether a new call is allowed. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2953

S
shawn_he 已提交
2954
**System API**: This is a system API.
S
shawn_he 已提交
2955

S
shawn_he 已提交
2956
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2957

S
shawn_he 已提交
2958
**Parameters**
S
shawn_he 已提交
2959

S
shawn_he 已提交
2960
| Name  | Type                        | Mandatory| Description      |
S
shawn_he 已提交
2961
| -------- | ---------------------------- | ---- | ---------- |
S
shawn_he 已提交
2962
| callback | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
2963

S
shawn_he 已提交
2964
**Error codes**
S
shawn_he 已提交
2965

S
shawn_he 已提交
2966
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
2967

S
shawn_he 已提交
2968
| ID|                  Error Message                   |
S
shawn_he 已提交
2969
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.isNewCallAllowed((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
2983 2984 2985
```


S
shawn_he 已提交
2986
## call.isNewCallAllowed<sup>8+</sup>
S
shawn_he 已提交
2987

S
shawn_he 已提交
2988
isNewCallAllowed\(\): Promise\<boolean\>
S
shawn_he 已提交
2989

S
shawn_he 已提交
2990
Checks whether a new call is allowed. This API uses a promise to return the result.
S
shawn_he 已提交
2991

S
shawn_he 已提交
2992
**System API**: This is a system API.
S
shawn_he 已提交
2993

S
shawn_he 已提交
2994
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
2995

S
shawn_he 已提交
2996
**Return value**
S
shawn_he 已提交
2997

S
shawn_he 已提交
2998
| Type                  | Description                       |
S
shawn_he 已提交
2999
| ---------------------- | --------------------------- |
S
shawn_he 已提交
3000
| Promise&lt;boolean&gt; | Promise used to return the result.|
S
shawn_he 已提交
3001

S
shawn_he 已提交
3002
**Error codes**
S
shawn_he 已提交
3003

S
shawn_he 已提交
3004
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3005

S
shawn_he 已提交
3006
| ID|                  Error Message                   |
S
shawn_he 已提交
3007
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021
| 202      | Non-system applications use system APIs.     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let promise = call.isNewCallAllowed();
promise.then(data => {
    console.log(`isNewCallAllowed success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`isNewCallAllowed fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3022 3023
```

S
shawn_he 已提交
3024
## call.separateConference<sup>8+</sup>
S
shawn_he 已提交
3025

S
shawn_he 已提交
3026
separateConference\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3027

S
shawn_he 已提交
3028
Separates calls from a conference call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
3029

S
shawn_he 已提交
3030
**System API**: This is a system API.
S
shawn_he 已提交
3031

S
shawn_he 已提交
3032
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3033

S
shawn_he 已提交
3034
**Parameters**
S
shawn_he 已提交
3035

S
shawn_he 已提交
3036
| Name  | Type                     | Mandatory| Description      |
S
shawn_he 已提交
3037
| -------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
3038 3039
| callId   | number                    | Yes  | Call ID.  |
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
3040

S
shawn_he 已提交
3041
**Error codes**
S
shawn_he 已提交
3042

S
shawn_he 已提交
3043
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3044

S
shawn_he 已提交
3045
| ID|                 Error Message                    |
S
shawn_he 已提交
3046
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.separateConference(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3060 3061 3062
```


S
shawn_he 已提交
3063
## call.separateConference<sup>8+</sup>
S
shawn_he 已提交
3064

S
shawn_he 已提交
3065
separateConference\(callId: number\): Promise\<void\>
S
shawn_he 已提交
3066

S
shawn_he 已提交
3067
Separates calls from a conference call. This API uses a promise to return the result.
S
shawn_he 已提交
3068

S
shawn_he 已提交
3069
**System API**: This is a system API.
S
shawn_he 已提交
3070

S
shawn_he 已提交
3071
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3072

S
shawn_he 已提交
3073
**Parameters**
S
shawn_he 已提交
3074

S
shawn_he 已提交
3075
| Name| Type  | Mandatory| Description    |
S
shawn_he 已提交
3076
| ------ | ------ | ---- | -------- |
S
shawn_he 已提交
3077
| callId | number | Yes  | Call ID.|
S
shawn_he 已提交
3078

S
shawn_he 已提交
3079
**Return value**
S
shawn_he 已提交
3080

S
shawn_he 已提交
3081
| Type               | Description                       |
S
shawn_he 已提交
3082
| ------------------- | --------------------------- |
S
shawn_he 已提交
3083
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
3084

S
shawn_he 已提交
3085
**Error codes**
S
shawn_he 已提交
3086

S
shawn_he 已提交
3087
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3088

S
shawn_he 已提交
3089
| ID|                 Error Message                    |
S
shawn_he 已提交
3090
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.separateConference(1).then(() => {
    console.log(`separateConference success.`);
}).catch((err) => {
    console.error(`separateConference fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3106 3107
```

S
shawn_he 已提交
3108
## call.getCallRestrictionStatus<sup>8+</sup>
S
shawn_he 已提交
3109

S
shawn_he 已提交
3110
getCallRestrictionStatus\(slotId: number, type: CallRestrictionType, callback: AsyncCallback\<RestrictionStatus\>\): void
S
shawn_he 已提交
3111

S
shawn_he 已提交
3112
Obtains the call restriction status. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
3113

S
shawn_he 已提交
3114
**System API**: This is a system API.
S
shawn_he 已提交
3115

S
shawn_he 已提交
3116
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
S
shawn_he 已提交
3117

S
shawn_he 已提交
3118
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3119

S
shawn_he 已提交
3120
**Parameters**
S
shawn_he 已提交
3121

S
shawn_he 已提交
3122
| Name  | Type                                                        | Mandatory| Description                                  |
S
shawn_he 已提交
3123
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
S
shawn_he 已提交
3124 3125 3126
| slotId   | number                                                       | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| type     | [CallRestrictionType](#callrestrictiontype8)                 | Yes  | Call restriction type.                       |
| callback | AsyncCallback&lt;[RestrictionStatus](#restrictionstatus8)&gt; | Yes  | Callback used to return the result.                |
S
shawn_he 已提交
3127

S
shawn_he 已提交
3128
**Error codes**
S
shawn_he 已提交
3129

S
shawn_he 已提交
3130
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3131

S
shawn_he 已提交
3132
| ID|                  Error Message                   |
S
shawn_he 已提交
3133
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.getCallRestrictionStatus(0, 1, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
3148 3149 3150
```


S
shawn_he 已提交
3151
## call.getCallRestrictionStatus<sup>8+</sup>
S
shawn_he 已提交
3152

S
shawn_he 已提交
3153
getCallRestrictionStatus\(slotId: number, type: CallRestrictionType\): Promise\<RestrictionStatus\>
S
shawn_he 已提交
3154

S
shawn_he 已提交
3155
Obtains the call restriction status. This API uses a promise to return the result.
S
shawn_he 已提交
3156

S
shawn_he 已提交
3157
**System API**: This is a system API.
S
shawn_he 已提交
3158

S
shawn_he 已提交
3159
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
S
shawn_he 已提交
3160

S
shawn_he 已提交
3161
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3162

S
shawn_he 已提交
3163
**Parameters**
S
shawn_he 已提交
3164

S
shawn_he 已提交
3165
| Name| Type                                        | Mandatory| Description                                  |
S
shawn_he 已提交
3166
| ------ | -------------------------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
3167 3168
| slotId | number                                       | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| type   | [CallRestrictionType](#callrestrictiontype8) | Yes  | Call restriction type.                       |
S
shawn_he 已提交
3169

S
shawn_he 已提交
3170
**Return value**
S
shawn_he 已提交
3171

S
shawn_he 已提交
3172
| Type                                                   | Description                       |
S
shawn_he 已提交
3173
| ------------------------------------------------------- | --------------------------- |
S
shawn_he 已提交
3174
| Promise&lt;[RestrictionStatus](#restrictionstatus8)&gt; | Promise used to return the result.|
S
shawn_he 已提交
3175

S
shawn_he 已提交
3176
**Error codes**
S
shawn_he 已提交
3177

S
shawn_he 已提交
3178
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3179

S
shawn_he 已提交
3180
| ID|                  Error Message                   |
S
shawn_he 已提交
3181
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
let promise = call.getCallRestrictionStatus(0, 1);
promise.then(data => {
    console.log(`getCallRestrictionStatus success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getCallRestrictionStatus fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3199 3200
```

S
shawn_he 已提交
3201
## call.setCallRestriction<sup>8+</sup>
S
shawn_he 已提交
3202

S
shawn_he 已提交
3203
setCallRestriction\(slotId: number, info: CallRestrictionInfo, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3204

S
shawn_he 已提交
3205
Sets the call restriction status. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
3206

S
shawn_he 已提交
3207
**System API**: This is a system API.
S
shawn_he 已提交
3208

S
shawn_he 已提交
3209
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
3210

S
shawn_he 已提交
3211
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3212

S
shawn_he 已提交
3213
**Parameters**
S
shawn_he 已提交
3214

S
shawn_he 已提交
3215
| Name  | Type                                       | Mandatory| Description                                  |
S
shawn_he 已提交
3216
| -------- | ------------------------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
3217 3218 3219
| slotId   | number                                      | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| info     | [CallRestrictionInfo](#callrestrictioninfo8) | Yes  | Call restriction information.                        |
| callback | AsyncCallback&lt;void&gt;                   | Yes  | Callback used to return the result.                            |
S
shawn_he 已提交
3220

S
shawn_he 已提交
3221
**Error codes**
S
shawn_he 已提交
3222

S
shawn_he 已提交
3223
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3224

S
shawn_he 已提交
3225
| ID|                  Error Message                   |
S
shawn_he 已提交
3226
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
let callRestrictionInfo={
    type: 1,
    password: "123456",
    mode: 1
S
shawn_he 已提交
3242
}
S
shawn_he 已提交
3243 3244 3245
call.setCallRestriction(0, callRestrictionInfo, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3246 3247 3248
```


S
shawn_he 已提交
3249
## call.setCallRestriction<sup>8+</sup>
S
shawn_he 已提交
3250

S
shawn_he 已提交
3251
setCallRestriction\(slotId: number, info: CallRestrictionInfo\): Promise\<void\>
S
shawn_he 已提交
3252

S
shawn_he 已提交
3253
Sets the call restriction status. This API uses a promise to return the result.
S
shawn_he 已提交
3254

S
shawn_he 已提交
3255
**System API**: This is a system API.
S
shawn_he 已提交
3256

S
shawn_he 已提交
3257
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
3258

S
shawn_he 已提交
3259
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3260

S
shawn_he 已提交
3261
**Parameters**
S
shawn_he 已提交
3262

S
shawn_he 已提交
3263
| Name| Type                                        | Mandatory| Description                                  |
S
shawn_he 已提交
3264
| ------ | -------------------------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
3265 3266
| slotId | number                                       | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| info   | [CallRestrictionInfo](#callrestrictioninfo8) | Yes  | Call restriction information.                        |
S
shawn_he 已提交
3267

S
shawn_he 已提交
3268
**Return value**
S
shawn_he 已提交
3269

S
shawn_he 已提交
3270
| Type               | Description                       |
S
shawn_he 已提交
3271
| ------------------- | --------------------------- |
S
shawn_he 已提交
3272
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
3273

S
shawn_he 已提交
3274
**Error codes**
S
shawn_he 已提交
3275

S
shawn_he 已提交
3276
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3277

S
shawn_he 已提交
3278
| ID|                  Error Message                   |
S
shawn_he 已提交
3279
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
let callRestrictionInfo={
    type: 1,
    password: "123456",
    mode: 1
S
shawn_he 已提交
3295
}
S
shawn_he 已提交
3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343
call.setCallRestriction(0, callRestrictionInfo).then(() => {
    console.log(`setCallRestriction success.`);
}).catch((err) => {
    console.error(`setCallRestriction fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.setCallRestrictionPassword<sup>10+</sup>

setCallRestrictionPassword\(slotId: number, oldPassword: string, newPassword: string, callback: AsyncCallback\<void\>\): void

Changes the call barring password. This API uses an asynchronous callback to return the result.

**System API**: This is a system API.

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name         | Type                                       | Mandatory| Description                                  |
| --------------- | ------------------------------------------- | ---- | ------------------------------------ |
| slotId          | number                                      | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| oldPassword     | string                                      | Yes  | Old password for call barring.                      |
| newPassword     | string                                      | Yes  | New password for call barring.                      |
| callback        | AsyncCallback&lt;void&gt;                   | Yes  | Callback used to return the result.                            |

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.setCallRestrictionPassword(0, "123456", "654321", (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3344 3345
```

S
shawn_he 已提交
3346 3347 3348
## call.setCallRestrictionPassword<sup>10+</sup>

setCallRestrictionPassword\(slotId: number, oldPassword: string, newPassword: string\): Promise\<void\>
S
shawn_he 已提交
3349

S
shawn_he 已提交
3350
Changes the call barring password. This API uses a promise to return the result.
S
shawn_he 已提交
3351

S
shawn_he 已提交
3352
**System API**: This is a system API.
S
shawn_he 已提交
3353

S
shawn_he 已提交
3354
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
3355

S
shawn_he 已提交
3356
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3357

S
shawn_he 已提交
3358
**Parameters**
S
shawn_he 已提交
3359

S
shawn_he 已提交
3360 3361 3362 3363 3364
| Name         | Type                                       | Mandatory| Description                                  |
| --------------- | ------------------------------------------- | ---- | ------------------------------------ |
| slotId          | number                                      | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| oldPassword     | string                                      | Yes  | Old password for call barring.                      |
| newPassword     | string                                      | Yes  | New password for call barring.                      |
S
shawn_he 已提交
3365

S
shawn_he 已提交
3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410
**Return value**

| Type               | Description                       |
| ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.setCallRestrictionPassword(0, "123456", "654321").then(() => {
    console.log(`setCallRestrictionPassword success.`);
}).catch((err) => {
    console.error(`setCallRestrictionPassword fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.getCallTransferInfo<sup>8+</sup>

getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCallback\<CallTransferResult\>\): void

Obtains call transfer information. This API uses an asynchronous callback to return the result.

**System API**: This is a system API.

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                                        | Mandatory| Description                                  |
S
shawn_he 已提交
3411
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
S
shawn_he 已提交
3412 3413 3414
| slotId   | number                                                       | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| type     | [CallTransferType](#calltransfertype8)                       | Yes  | Call transfer type.                        |
| callback | AsyncCallback&lt;[CallTransferResult](#calltransferresult8)&gt; | Yes  | Callback used to return the result.            |
S
shawn_he 已提交
3415

S
shawn_he 已提交
3416
**Error codes**
S
shawn_he 已提交
3417

S
shawn_he 已提交
3418
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3419

S
shawn_he 已提交
3420
| ID|                  Error Message                   |
S
shawn_he 已提交
3421
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
3436 3437 3438
```


S
shawn_he 已提交
3439
## call.getCallTransferInfo<sup>8+</sup>
S
shawn_he 已提交
3440

S
shawn_he 已提交
3441
getCallTransferInfo\(slotId: number, type: CallTransferType\): Promise\<CallTransferResult\>
S
shawn_he 已提交
3442

S
shawn_he 已提交
3443
Obtains call transfer information. This API uses a promise to return the result.
S
shawn_he 已提交
3444

S
shawn_he 已提交
3445
**System API**: This is a system API.
S
shawn_he 已提交
3446

S
shawn_he 已提交
3447
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
S
shawn_he 已提交
3448

S
shawn_he 已提交
3449
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3450

S
shawn_he 已提交
3451
**Parameters**
S
shawn_he 已提交
3452

S
shawn_he 已提交
3453
| Name| Type                                  | Mandatory| Description                                  |
S
shawn_he 已提交
3454
| ------ | -------------------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
3455 3456
| slotId | number                                 | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| type   | [CallTransferType](#calltransfertype8) | Yes  | Call transfer type.                        |
S
shawn_he 已提交
3457

S
shawn_he 已提交
3458
**Return value**
S
shawn_he 已提交
3459

S
shawn_he 已提交
3460
| Type                                                     | Description                       |
S
shawn_he 已提交
3461
| --------------------------------------------------------- | --------------------------- |
S
shawn_he 已提交
3462
| Promise&lt;[CallTransferResult](#calltransferresult8)&gt; | Promise used to return the result.|
S
shawn_he 已提交
3463

S
shawn_he 已提交
3464
**Error codes**
S
shawn_he 已提交
3465

S
shawn_he 已提交
3466
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3467

S
shawn_he 已提交
3468
| ID|                  Error Message                   |
S
shawn_he 已提交
3469
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
let promise = call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY);
promise.then(data => {
    console.log(`getCallTransferInfo success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getCallTransferInfo fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3487 3488
```

S
shawn_he 已提交
3489
## call.setCallTransfer<sup>8+</sup>
S
shawn_he 已提交
3490

S
shawn_he 已提交
3491
setCallTransfer\(slotId: number, info: CallTransferInfo, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3492

S
shawn_he 已提交
3493
Sets call transfer information. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
3494

S
shawn_he 已提交
3495
**System API**: This is a system API.
S
shawn_he 已提交
3496

S
shawn_he 已提交
3497
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
3498

S
shawn_he 已提交
3499
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3500

S
shawn_he 已提交
3501
**Parameters**
S
shawn_he 已提交
3502

S
shawn_he 已提交
3503
| Name  | Type                                 | Mandatory| Description                                  |
S
shawn_he 已提交
3504
| -------- | ------------------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
3505 3506 3507
| slotId   | number                                | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| info     | [CallTransferInfo](#calltransferinfo8) | Yes  | Call transfer information.                       |
| callback | AsyncCallback&lt;void&gt;             | Yes  | Callback used to return the result.                            |
S
shawn_he 已提交
3508

S
shawn_he 已提交
3509
**Error codes**
S
shawn_he 已提交
3510

S
shawn_he 已提交
3511
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3512

S
shawn_he 已提交
3513
| ID|                  Error Message                   |
S
shawn_he 已提交
3514
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
let callTransferInfo={
    transferNum: "111",
    type: 1,
    settingType: 1
S
shawn_he 已提交
3530
}
S
shawn_he 已提交
3531 3532 3533
call.setCallTransfer(0, callTransferInfo, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3534 3535 3536
```


S
shawn_he 已提交
3537
## call.setCallTransfer<sup>8+</sup>
S
shawn_he 已提交
3538

S
shawn_he 已提交
3539
setCallTransfer\(slotId: number, info: CallTransferInfo\): Promise\<void\>
S
shawn_he 已提交
3540

S
shawn_he 已提交
3541
Sets call transfer information. This API uses a promise to return the result.
S
shawn_he 已提交
3542

S
shawn_he 已提交
3543
**System API**: This is a system API.
S
shawn_he 已提交
3544

S
shawn_he 已提交
3545
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
3546

S
shawn_he 已提交
3547
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3548

S
shawn_he 已提交
3549
**Parameters**
S
shawn_he 已提交
3550

S
shawn_he 已提交
3551
| Name| Type                                 | Mandatory| Description                                  |
S
shawn_he 已提交
3552
| ------ | ------------------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
3553 3554
| slotId | number                                | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| info   | [CallTransferInfo](#calltransferinfo8) | Yes  | Call transfer information.                       |
S
shawn_he 已提交
3555

S
shawn_he 已提交
3556
**Return value**
S
shawn_he 已提交
3557

S
shawn_he 已提交
3558
| Type               | Description                       |
S
shawn_he 已提交
3559
| ------------------- | --------------------------- |
S
shawn_he 已提交
3560
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
3561

S
shawn_he 已提交
3562
**Error codes**
S
shawn_he 已提交
3563

S
shawn_he 已提交
3564
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3565

S
shawn_he 已提交
3566
| ID|                  Error Message                   |
S
shawn_he 已提交
3567
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 801      | Capability not supported.                    |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
let callTransferInfo={
    transferNum: "111",
    type: 1,
    settingType: 1
S
shawn_he 已提交
3583
}
S
shawn_he 已提交
3584 3585 3586 3587 3588
call.setCallTransfer(0, callTransferInfo).then(() => {
    console.log(`setCallTransfer success.`);
}).catch((err) => {
    console.error(`setCallTransfer fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3589 3590
```

S
shawn_he 已提交
3591
## call.isRinging<sup>8+</sup>
S
shawn_he 已提交
3592

S
shawn_he 已提交
3593
isRinging\(callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
3594

S
shawn_he 已提交
3595
Checks whether the ringtone is playing. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
3596

S
shawn_he 已提交
3597
**System API**: This is a system API.
S
shawn_he 已提交
3598

S
shawn_he 已提交
3599
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
3600

S
shawn_he 已提交
3601
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3602

S
shawn_he 已提交
3603
**Parameters**
S
shawn_he 已提交
3604

S
shawn_he 已提交
3605
| Name  | Type                        | Mandatory| Description      |
S
shawn_he 已提交
3606
| -------- | ---------------------------- | ---- | ---------- |
S
shawn_he 已提交
3607
| callback | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
3608

S
shawn_he 已提交
3609
**Error codes**
S
shawn_he 已提交
3610

S
shawn_he 已提交
3611
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3612

S
shawn_he 已提交
3613
| ID|                  Error Message                   |
S
shawn_he 已提交
3614
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.isRinging((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
3629 3630 3631
```


S
shawn_he 已提交
3632
## call.isRinging<sup>8+</sup>
S
shawn_he 已提交
3633

S
shawn_he 已提交
3634
isRinging\(\): Promise\<boolean\>
S
shawn_he 已提交
3635

S
shawn_he 已提交
3636
Checks whether the ringtone is playing. This API uses a promise to return the result.
S
shawn_he 已提交
3637

S
shawn_he 已提交
3638
**System API**: This is a system API.
S
shawn_he 已提交
3639

S
shawn_he 已提交
3640
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
3641

S
shawn_he 已提交
3642
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3643

S
shawn_he 已提交
3644
**Return value**
S
shawn_he 已提交
3645

S
shawn_he 已提交
3646
| Type                  | Description                       |
S
shawn_he 已提交
3647
| ---------------------- | --------------------------- |
S
shawn_he 已提交
3648
| Promise&lt;boolean&gt; | Promise used to return the result.|
S
shawn_he 已提交
3649

S
shawn_he 已提交
3650
**Error codes**
S
shawn_he 已提交
3651

S
shawn_he 已提交
3652
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3653

S
shawn_he 已提交
3654
| ID|                  Error Message                   |
S
shawn_he 已提交
3655
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let promise = call.isRinging();
promise.then(data => {
    console.log(`isRinging success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`isRinging fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3671 3672
```

S
shawn_he 已提交
3673
## call.setMuted<sup>8+</sup>
S
shawn_he 已提交
3674

S
shawn_he 已提交
3675
setMuted\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3676

S
shawn_he 已提交
3677
Sets call muting. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
3678

S
shawn_he 已提交
3679
**System API**: This is a system API.
S
shawn_he 已提交
3680

S
shawn_he 已提交
3681
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3682

S
shawn_he 已提交
3683
**Parameters**
S
shawn_he 已提交
3684

S
shawn_he 已提交
3685
| Name  | Type                     | Mandatory| Description      |
S
shawn_he 已提交
3686
| -------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
3687
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
3688

S
shawn_he 已提交
3689
**Error codes**
S
shawn_he 已提交
3690

S
shawn_he 已提交
3691
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3692

S
shawn_he 已提交
3693
| ID|                 Error Message                    |
S
shawn_he 已提交
3694
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.setMuted((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3708 3709 3710
```


S
shawn_he 已提交
3711
## call.setMuted<sup>8+</sup>
S
shawn_he 已提交
3712

S
shawn_he 已提交
3713
setMuted\(\): Promise\<void\>
S
shawn_he 已提交
3714

S
shawn_he 已提交
3715
Sets call muting. This API uses a promise to return the result.
S
shawn_he 已提交
3716

S
shawn_he 已提交
3717
**System API**: This is a system API.
S
shawn_he 已提交
3718

S
shawn_he 已提交
3719
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3720

S
shawn_he 已提交
3721
**Return value**
S
shawn_he 已提交
3722

S
shawn_he 已提交
3723
| Type               | Description                       |
S
shawn_he 已提交
3724
| ------------------- | --------------------------- |
S
shawn_he 已提交
3725
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
3726

S
shawn_he 已提交
3727
**Error codes**
S
shawn_he 已提交
3728

S
shawn_he 已提交
3729
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3730

S
shawn_he 已提交
3731
| ID|                 Error Message                    |
S
shawn_he 已提交
3732
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745
| 202      | Non-system applications use system APIs.     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.setMuted().then(() => {
    console.log(`setMuted success.`);
}).catch((err) => {
    console.error(`setMuted fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3746 3747
```

S
shawn_he 已提交
3748
## call.cancelMuted<sup>8+</sup>
S
shawn_he 已提交
3749

S
shawn_he 已提交
3750
cancelMuted\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3751

S
shawn_he 已提交
3752
Cancels call muting. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
3753

S
shawn_he 已提交
3754
**System API**: This is a system API.
S
shawn_he 已提交
3755

S
shawn_he 已提交
3756
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3757

S
shawn_he 已提交
3758
**Parameters**
S
shawn_he 已提交
3759

S
shawn_he 已提交
3760
| Name  | Type                     | Mandatory| Description      |
S
shawn_he 已提交
3761
| -------- | ------------------------- | ---- | ---------- |
S
shawn_he 已提交
3762
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|
S
shawn_he 已提交
3763

S
shawn_he 已提交
3764
**Error codes**
S
shawn_he 已提交
3765

S
shawn_he 已提交
3766
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3767

S
shawn_he 已提交
3768
| ID|                 Error Message                    |
S
shawn_he 已提交
3769
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.cancelMuted((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3783 3784 3785
```


S
shawn_he 已提交
3786
## call.cancelMuted<sup>8+</sup>
S
shawn_he 已提交
3787

S
shawn_he 已提交
3788
cancelMuted\(\): Promise\<void\>
S
shawn_he 已提交
3789

S
shawn_he 已提交
3790
Cancels call muting. This API uses a promise to return the result.
S
shawn_he 已提交
3791

S
shawn_he 已提交
3792
**System API**: This is a system API.
S
shawn_he 已提交
3793

S
shawn_he 已提交
3794
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3795

S
shawn_he 已提交
3796
**Return value**
S
shawn_he 已提交
3797

S
shawn_he 已提交
3798
| Type               | Description                       |
S
shawn_he 已提交
3799
| ------------------- | --------------------------- |
S
shawn_he 已提交
3800
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
3801

S
shawn_he 已提交
3802
**Error codes**
S
shawn_he 已提交
3803

S
shawn_he 已提交
3804
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3805

S
shawn_he 已提交
3806
| ID|                 Error Message                    |
S
shawn_he 已提交
3807
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820
| 202      | Non-system applications use system APIs.     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.cancelMuted().then(() => {
    console.log(`cancelMuted success.`);
}).catch((err) => {
    console.error(`cancelMuted fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3821 3822
```

S
shawn_he 已提交
3823
## call.setAudioDevice<sup>8+</sup>
S
shawn_he 已提交
3824

S
shawn_he 已提交
3825
setAudioDevice\(device: AudioDevice, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3826

S
shawn_he 已提交
3827
Sets the audio device for a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
3828

S
shawn_he 已提交
3829
**System API**: This is a system API.
S
shawn_he 已提交
3830

S
shawn_he 已提交
3831
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
3832

S
shawn_he 已提交
3833
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3834

S
shawn_he 已提交
3835
**Parameters**
S
shawn_he 已提交
3836

S
shawn_he 已提交
3837
| Name  | Type                        | Mandatory| Description      |
S
shawn_he 已提交
3838
| -------- | ---------------------------- | ---- | ---------- |
S
shawn_he 已提交
3839 3840
| device   | [AudioDevice](#audiodevice10)| Yes  | Audio device.|
| callback | AsyncCallback&lt;void&gt;    | Yes  | Callback used to return the result.|
S
shawn_he 已提交
3841

S
shawn_he 已提交
3842
**Error codes**
S
shawn_he 已提交
3843

S
shawn_he 已提交
3844
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3845

S
shawn_he 已提交
3846
| ID|                 Error Message                    |
S
shawn_he 已提交
3847
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let audioDevice={
    deviceType: 1
S
shawn_he 已提交
3861
}
S
shawn_he 已提交
3862 3863 3864
call.setAudioDevice(audioDevice, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3865 3866
```

S
shawn_he 已提交
3867
## call.setAudioDevice<sup>10+</sup>
S
shawn_he 已提交
3868

S
shawn_he 已提交
3869
setAudioDevice\(device: AudioDevice): Promise\<void\>
S
shawn_he 已提交
3870

S
shawn_he 已提交
3871
Sets the audio device for a call. This API uses a promise to return the result.
S
shawn_he 已提交
3872

S
shawn_he 已提交
3873
**System API**: This is a system API.
S
shawn_he 已提交
3874

S
shawn_he 已提交
3875
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
3876

S
shawn_he 已提交
3877
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3878

S
shawn_he 已提交
3879
**Parameters**
S
shawn_he 已提交
3880

S
shawn_he 已提交
3881
| Name  | Type                        | Mandatory| Description      |
S
shawn_he 已提交
3882
| -------- | ---------------------------- | ---- | ---------- |
S
shawn_he 已提交
3883
| device   | [AudioDevice](#audiodevice10)| Yes  | Audio device.|
S
shawn_he 已提交
3884

S
shawn_he 已提交
3885
**Return value**
S
shawn_he 已提交
3886

S
shawn_he 已提交
3887
| Type               | Description                       |
S
shawn_he 已提交
3888
| ------------------- | --------------------------- |
S
shawn_he 已提交
3889
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
3890

S
shawn_he 已提交
3891
**Error codes**
S
shawn_he 已提交
3892

S
shawn_he 已提交
3893
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3894

S
shawn_he 已提交
3895
| ID|                 Error Message                    |
S
shawn_he 已提交
3896
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let audioDevice={
    deviceType: 1
S
shawn_he 已提交
3910
}
S
shawn_he 已提交
3911 3912 3913 3914 3915
call.setAudioDevice(audioDevice).then(() => {
    console.log(`setAudioDevice success.`);
}).catch((err) => {
    console.error(`setAudioDevice fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3916 3917
```

S
shawn_he 已提交
3918
## call.joinConference<sup>8+</sup>
S
shawn_he 已提交
3919

S
shawn_he 已提交
3920
joinConference\(mainCallId: number, callNumberList: Array\<string\>, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3921

S
shawn_he 已提交
3922
Joins a conference call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
3923

S
shawn_he 已提交
3924
**System API**: This is a system API.
S
shawn_he 已提交
3925

S
shawn_he 已提交
3926
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3927

S
shawn_he 已提交
3928
**Parameters**
S
shawn_he 已提交
3929

S
shawn_he 已提交
3930
| Name        | Type                     | Mandatory| Description           |
S
shawn_he 已提交
3931
| -------------- | ------------------------- | ---- | --------------- |
S
shawn_he 已提交
3932 3933 3934
| mainCallId     | number                    | Yes  | Main call ID.     |
| callNumberList | Array<string\>            | Yes  | List of call numbers.|
| callback       | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.     |
S
shawn_he 已提交
3935

S
shawn_he 已提交
3936
**Error codes**
S
shawn_he 已提交
3937

S
shawn_he 已提交
3938
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3939

S
shawn_he 已提交
3940
| ID|                 Error Message                    |
S
shawn_he 已提交
3941
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let callNumberList: Array<string> = [
    "138XXXXXXXX"
];
call.joinConference(1, callNumberList, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
3958 3959
```

S
shawn_he 已提交
3960
## call.joinConference<sup>8+</sup>
S
shawn_he 已提交
3961

S
shawn_he 已提交
3962
joinConference\(mainCallId: number, callNumberList: Array\<string\>\): Promise\<void\>
S
shawn_he 已提交
3963

S
shawn_he 已提交
3964
Joins a conference call. This API uses a promise to return the result.
S
shawn_he 已提交
3965

S
shawn_he 已提交
3966
**System API**: This is a system API.
S
shawn_he 已提交
3967

S
shawn_he 已提交
3968
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
3969

S
shawn_he 已提交
3970
**Parameters**
S
shawn_he 已提交
3971

S
shawn_he 已提交
3972
| Name        | Type          | Mandatory| Description           |
S
shawn_he 已提交
3973
| -------------- | -------------- | ---- | --------------- |
S
shawn_he 已提交
3974 3975
| mainCallId     | number         | Yes  | Main call ID.     |
| callNumberList | Array<string\> | Yes  | List of call numbers.|
S
shawn_he 已提交
3976

S
shawn_he 已提交
3977
**Return value**
S
shawn_he 已提交
3978

S
shawn_he 已提交
3979
| Type               | Description                       |
S
shawn_he 已提交
3980
| ------------------- | --------------------------- |
S
shawn_he 已提交
3981
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
3982

S
shawn_he 已提交
3983
**Error codes**
S
shawn_he 已提交
3984

S
shawn_he 已提交
3985
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
3986

S
shawn_he 已提交
3987
| ID|                 Error Message                    |
S
shawn_he 已提交
3988
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let callNumberList: Array<string> = [
    "138XXXXXXXX"
];
call.joinConference(1, callNumberList).then(() => {
    console.log(`joinConference success.`);
}).catch((err) => {
    console.error(`joinConference fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4007 4008
```

S
shawn_he 已提交
4009
## call.updateImsCallMode<sup>8+</sup>
S
shawn_he 已提交
4010

S
shawn_he 已提交
4011
updateImsCallMode\(callId: number, mode: ImsCallMode, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
4012

S
shawn_he 已提交
4013
Updates the IMS call mode. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
4014

S
shawn_he 已提交
4015
**System API**: This is a system API.
S
shawn_he 已提交
4016

S
shawn_he 已提交
4017
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4018

S
shawn_he 已提交
4019
**Parameters**
S
shawn_he 已提交
4020

S
shawn_he 已提交
4021
| Name  | Type                        | Mandatory| Description          |
S
shawn_he 已提交
4022
| -------- | ---------------------------- | ---- | -------------- |
S
shawn_he 已提交
4023 4024 4025
| callId   | number                       | Yes  | Call ID.      |
| mode     | [ImsCallMode](#imscallmode8) | Yes  | IMS call mode.|
| callback | AsyncCallback&lt;void&gt;    | Yes  | Callback used to return the result.    |
S
shawn_he 已提交
4026

S
shawn_he 已提交
4027
**Error codes**
S
shawn_he 已提交
4028

S
shawn_he 已提交
4029
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4030

S
shawn_he 已提交
4031
| ID|                 Error Message                    |
S
shawn_he 已提交
4032
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.updateImsCallMode(1, 1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4046 4047
```

S
shawn_he 已提交
4048
## call.updateImsCallMode<sup>8+</sup>
S
shawn_he 已提交
4049

S
shawn_he 已提交
4050
updateImsCallMode\(callId: number, mode: ImsCallMode\): Promise\<void\>
S
shawn_he 已提交
4051

S
shawn_he 已提交
4052
Updates the IMS call mode. This API uses a promise to return the result.
S
shawn_he 已提交
4053

S
shawn_he 已提交
4054
**System API**: This is a system API.
S
shawn_he 已提交
4055

S
shawn_he 已提交
4056
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4057

S
shawn_he 已提交
4058
**Parameters**
S
shawn_he 已提交
4059

S
shawn_he 已提交
4060
| Name| Type                        | Mandatory| Description          |
S
shawn_he 已提交
4061
| ------ | ---------------------------- | ---- | -------------- |
S
shawn_he 已提交
4062 4063
| callId | number                       | Yes  | Call ID.      |
| mode   | [ImsCallMode](#imscallmode8) | Yes  | IMS call mode.|
S
shawn_he 已提交
4064

S
shawn_he 已提交
4065
**Return value**
S
shawn_he 已提交
4066

S
shawn_he 已提交
4067
| Type               | Description                       |
S
shawn_he 已提交
4068
| ------------------- | --------------------------- |
S
shawn_he 已提交
4069
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
4070

S
shawn_he 已提交
4071
**Error codes**
S
shawn_he 已提交
4072

S
shawn_he 已提交
4073
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4074

S
shawn_he 已提交
4075
| ID|                 Error Message                    |
S
shawn_he 已提交
4076
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.updateImsCallMode(1, 1).then(() => {
    console.log(`updateImsCallMode success.`);
}).catch((err) => {
    console.error(`updateImsCallMode fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4092 4093
```

S
shawn_he 已提交
4094
## call.enableImsSwitch<sup>8+</sup>
S
shawn_he 已提交
4095

S
shawn_he 已提交
4096
enableImsSwitch\(slotId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
4097

S
shawn_he 已提交
4098
Enables the IMS service. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
4099

S
shawn_he 已提交
4100
**System API**: This is a system API.
S
shawn_he 已提交
4101

S
shawn_he 已提交
4102
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
4103

S
shawn_he 已提交
4104
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4105

S
shawn_he 已提交
4106
**Parameters**
S
shawn_he 已提交
4107

S
shawn_he 已提交
4108
| Name  | Type                     | Mandatory| Description                                  |
S
shawn_he 已提交
4109
| -------- | ------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
4110 4111
| slotId   | number                    | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.                            |
S
shawn_he 已提交
4112

S
shawn_he 已提交
4113
**Error codes**
S
shawn_he 已提交
4114

S
shawn_he 已提交
4115
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4116

S
shawn_he 已提交
4117
| ID|                  Error Message                   |
S
shawn_he 已提交
4118
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.enableImsSwitch(0, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4133 4134
```

S
shawn_he 已提交
4135
## call.enableImsSwitch<sup>8+</sup>
S
shawn_he 已提交
4136

S
shawn_he 已提交
4137
enableImsSwitch\(slotId: number\): Promise\<void\>
S
shawn_he 已提交
4138

S
shawn_he 已提交
4139
Enables the IMS service. This API uses a promise to return the result.
S
shawn_he 已提交
4140

S
shawn_he 已提交
4141
**System API**: This is a system API.
S
shawn_he 已提交
4142

S
shawn_he 已提交
4143
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
4144

S
shawn_he 已提交
4145
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4146

S
shawn_he 已提交
4147
**Parameters**
S
shawn_he 已提交
4148

S
shawn_he 已提交
4149
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
4150
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
4151
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
4152

S
shawn_he 已提交
4153
**Return value**
S
shawn_he 已提交
4154

S
shawn_he 已提交
4155
| Type               | Description                       |
S
shawn_he 已提交
4156
| ------------------- | --------------------------- |
S
shawn_he 已提交
4157
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
4158

S
shawn_he 已提交
4159
**Error codes**
S
shawn_he 已提交
4160

S
shawn_he 已提交
4161
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4162

S
shawn_he 已提交
4163
| ID|                  Error Message                   |
S
shawn_he 已提交
4164
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.enableImsSwitch(0).then(() => {
    console.log(`enableImsSwitch success.`);
}).catch((err) => {
    console.error(`enableImsSwitch fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4181 4182
```

S
shawn_he 已提交
4183
## call.disableImsSwitch<sup>8+</sup>
S
shawn_he 已提交
4184

S
shawn_he 已提交
4185
disableImsSwitch\(slotId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
4186

S
shawn_he 已提交
4187
Disables the IMS service. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
4188

S
shawn_he 已提交
4189
**System API**: This is a system API.
S
shawn_he 已提交
4190

S
shawn_he 已提交
4191
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
4192

S
shawn_he 已提交
4193
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4194

S
shawn_he 已提交
4195
**Parameters**
S
shawn_he 已提交
4196

S
shawn_he 已提交
4197
| Name  | Type                     | Mandatory| Description                                  |
S
shawn_he 已提交
4198
| -------- | ------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
4199 4200
| slotId   | number                    | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.                            |
S
shawn_he 已提交
4201

S
shawn_he 已提交
4202
**Error codes**
S
shawn_he 已提交
4203

S
shawn_he 已提交
4204
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4205

S
shawn_he 已提交
4206
| ID|                  Error Message                   |
S
shawn_he 已提交
4207
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.disableImsSwitch(0, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4222 4223
```

S
shawn_he 已提交
4224
## call.disableImsSwitch<sup>8+</sup>
S
shawn_he 已提交
4225

S
shawn_he 已提交
4226
disableImsSwitch\(slotId: number\): Promise\<void\>
S
shawn_he 已提交
4227

S
shawn_he 已提交
4228
Disables the IMS service. This API uses a promise to return the result.
S
shawn_he 已提交
4229

S
shawn_he 已提交
4230
**System API**: This is a system API.
S
shawn_he 已提交
4231

S
shawn_he 已提交
4232
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
4233

S
shawn_he 已提交
4234
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4235

S
shawn_he 已提交
4236
**Parameters**
S
shawn_he 已提交
4237

S
shawn_he 已提交
4238
| Name| Type  | Mandatory| Description                                   |
S
shawn_he 已提交
4239
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
4240
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
S
shawn_he 已提交
4241

S
shawn_he 已提交
4242
**Return value**
S
shawn_he 已提交
4243

S
shawn_he 已提交
4244
| Type               | Description                        |
S
shawn_he 已提交
4245
| ------------------- | --------------------------- |
S
shawn_he 已提交
4246
| Promise&lt;void&gt; | Promise used to return the result. |
S
shawn_he 已提交
4247

S
shawn_he 已提交
4248
**Error codes**
S
shawn_he 已提交
4249

S
shawn_he 已提交
4250
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4251

S
shawn_he 已提交
4252
| ID|                  Error Message                    |
S
shawn_he 已提交
4253
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.disableImsSwitch(0).then(() => {
    console.log(`disableImsSwitch success.`);
}).catch((err) => {
    console.error(`disableImsSwitch fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4270 4271
```

S
shawn_he 已提交
4272
## call.isImsSwitchEnabled<sup>8+</sup>
S
shawn_he 已提交
4273

S
shawn_he 已提交
4274
isImsSwitchEnabled\(slotId: number, callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
4275

S
shawn_he 已提交
4276
Checks whether the IMS service is enabled. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
4277

S
shawn_he 已提交
4278
**System API**: This is a system API.
S
shawn_he 已提交
4279

S
shawn_he 已提交
4280
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4281

S
shawn_he 已提交
4282
**Parameters**
S
shawn_he 已提交
4283

S
shawn_he 已提交
4284
| Name  | Type                        | Mandatory| Description                                  |
S
shawn_he 已提交
4285
| -------- | ---------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
4286 4287
| slotId   | number                       | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.                            |
S
shawn_he 已提交
4288

S
shawn_he 已提交
4289
**Error codes**
S
shawn_he 已提交
4290

S
shawn_he 已提交
4291
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4292

S
shawn_he 已提交
4293
| ID|                 Error Message                    |
S
shawn_he 已提交
4294
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.isImsSwitchEnabled(0, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
4308 4309
```

S
shawn_he 已提交
4310
## call.isImsSwitchEnabled<sup>8+</sup>
S
shawn_he 已提交
4311

S
shawn_he 已提交
4312
isImsSwitchEnabled\(slotId: number\): Promise\<boolean\>
S
shawn_he 已提交
4313

S
shawn_he 已提交
4314
Checks whether the IMS service is enabled. This API uses a promise to return the result.
S
shawn_he 已提交
4315

S
shawn_he 已提交
4316
**System API**: This is a system API.
S
shawn_he 已提交
4317

S
shawn_he 已提交
4318
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4319

S
shawn_he 已提交
4320
**Parameters**
S
shawn_he 已提交
4321

S
shawn_he 已提交
4322
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
4323
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
4324
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
4325

S
shawn_he 已提交
4326
**Return value**
S
shawn_he 已提交
4327

S
shawn_he 已提交
4328
| Type               | Description                       |
S
shawn_he 已提交
4329
| ------------------- | --------------------------- |
S
shawn_he 已提交
4330
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
4331

S
shawn_he 已提交
4332
**Error codes**
S
shawn_he 已提交
4333

S
shawn_he 已提交
4334
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4335

S
shawn_he 已提交
4336
| ID|                 Error Message                    |
S
shawn_he 已提交
4337
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let promise = call.isImsSwitchEnabled(0);
promise.then(data => {
    console.log(`isImsSwitchEnabled success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`isImsSwitchEnabled fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4354 4355
```

S
shawn_he 已提交
4356

S
shawn_he 已提交
4357
## call.closeUnfinishedUssd<sup>10+</sup>
S
shawn_he 已提交
4358

S
shawn_he 已提交
4359
closeUnfinishedUssd\(slotId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
4360

S
shawn_he 已提交
4361
Cancels the unfinished USSD services. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
4362

S
shawn_he 已提交
4363
**System API**: This is a system API.
S
shawn_he 已提交
4364

S
shawn_he 已提交
4365
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
4366

S
shawn_he 已提交
4367
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4368

S
shawn_he 已提交
4369
**Parameters**
S
shawn_he 已提交
4370

S
shawn_he 已提交
4371
| Name  | Type                     | Mandatory| Description                                   |
S
shawn_he 已提交
4372
| -------- | ------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
4373 4374
| slotId   | number                    | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.                             |
S
shawn_he 已提交
4375

S
shawn_he 已提交
4376
**Error codes**
S
shawn_he 已提交
4377

S
shawn_he 已提交
4378
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4379

S
shawn_he 已提交
4380
| ID|                  Error Message                   |
S
shawn_he 已提交
4381
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let slotId = 0;
call.closeUnfinishedUssd(slotId, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4397 4398
```

S
shawn_he 已提交
4399
## call.closeUnfinishedUssd<sup>10+</sup>
S
shawn_he 已提交
4400

S
shawn_he 已提交
4401
closeUnfinishedUssd\(slotId: number\): Promise\<void\>
S
shawn_he 已提交
4402

S
shawn_he 已提交
4403
Cancels the unfinished USSD services. This API uses a promise to return the result.
S
shawn_he 已提交
4404

S
shawn_he 已提交
4405
**System API**: This is a system API.
S
shawn_he 已提交
4406

S
shawn_he 已提交
4407
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
4408

S
shawn_he 已提交
4409
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4410

S
shawn_he 已提交
4411
**Parameters**
S
shawn_he 已提交
4412

S
shawn_he 已提交
4413
| Name| Type  | Mandatory| Description                                   |
S
shawn_he 已提交
4414
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
4415
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
S
shawn_he 已提交
4416

S
shawn_he 已提交
4417
**Return value**
S
shawn_he 已提交
4418

S
shawn_he 已提交
4419
| Type               | Description                        |
S
shawn_he 已提交
4420
| ------------------- | --------------------------- |
S
shawn_he 已提交
4421
| Promise&lt;void&gt; | Promise used to return the result. |
S
shawn_he 已提交
4422

S
shawn_he 已提交
4423
**Error codes**
S
shawn_he 已提交
4424

S
shawn_he 已提交
4425
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4426

S
shawn_he 已提交
4427
| ID|                  Error Message                    |
S
shawn_he 已提交
4428
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let slotId = 0;
call.closeUnfinishedUssd(slotId).then(() => {
    console.log(`closeUnfinishedUssd success.`);
}).catch((err) => {
    console.error(`closeUnfinishedUssd fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4446 4447 4448
```


S
shawn_he 已提交
4449
## call.setVoNRState<sup>10+</sup>
S
shawn_he 已提交
4450

S
shawn_he 已提交
4451
setVoNRState\(slotId: number, state: VoNRState, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
4452

S
shawn_he 已提交
4453
Sets the status of the VoNR switch. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
4454

S
shawn_he 已提交
4455
**System API**: This is a system API.
S
shawn_he 已提交
4456

S
shawn_he 已提交
4457
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
4458

S
shawn_he 已提交
4459
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4460

S
shawn_he 已提交
4461
**Parameters**
S
shawn_he 已提交
4462

S
shawn_he 已提交
4463
| Name     | Type                          | Mandatory| Description                                                |
S
shawn_he 已提交
4464
| ----------- | ----------------------------- | ---- | ---------------------------------------------------- |
S
shawn_he 已提交
4465 4466 4467
| slotId      | number                        | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2               |
| state       | [VoNRState](#vonrstate10)     | Yes  | Status of the VoNR switch.                                           |
| callback    | AsyncCallback&lt;void&gt;  | Yes  | Callback used to return the result.|
S
shawn_he 已提交
4468

S
shawn_he 已提交
4469
**Error codes**
S
shawn_he 已提交
4470

S
shawn_he 已提交
4471
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4472

S
shawn_he 已提交
4473
| ID|                  Error Message                    |
S
shawn_he 已提交
4474
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let slotId = 0;
let state = 1;
call.setVoNRState(slotId, state, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
4491 4492 4493
```


S
shawn_he 已提交
4494
## call.setVoNRState<sup>10+</sup>
S
shawn_he 已提交
4495

S
shawn_he 已提交
4496
setVoNRState\(slotId: number, state: VoNRState\): Promise\<void\>
S
shawn_he 已提交
4497

S
shawn_he 已提交
4498
Sets the status of the VoNR switch. This API uses a promise to return the result.
S
shawn_he 已提交
4499

S
shawn_he 已提交
4500
**System API**: This is a system API.
S
shawn_he 已提交
4501

S
shawn_he 已提交
4502
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
S
shawn_he 已提交
4503

S
shawn_he 已提交
4504
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4505

S
shawn_he 已提交
4506
**Parameters**
S
shawn_he 已提交
4507

S
shawn_he 已提交
4508
| Name     | Type                          | Mandatory| Description                                       |
S
shawn_he 已提交
4509
| ----------- | ----------------------------- | ---- | ------------------------------------------- |
S
shawn_he 已提交
4510 4511
| slotId      | number                        | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2    |
| state       | [VoNRState](#vonrstate10)     | Yes  | Status of the VoNR switch.                                  |
S
shawn_he 已提交
4512

S
shawn_he 已提交
4513
**Return value**
S
shawn_he 已提交
4514

S
shawn_he 已提交
4515
| Type                  | Description                                         |
S
shawn_he 已提交
4516
| ---------------------- | --------------------------------------------- |
S
shawn_he 已提交
4517
| Promise&lt;void&gt; | Promise used to return the result.    |
S
shawn_he 已提交
4518

S
shawn_he 已提交
4519
**Error codes**
S
shawn_he 已提交
4520

S
shawn_he 已提交
4521
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4522

S
shawn_he 已提交
4523
| ID|                  Error Message                    |
S
shawn_he 已提交
4524
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let slotId = 0;
let state = 1;
call.setVoNRState(slotId, state).then((data) => {
    console.log(`setVoNRState success, promise: data->${JSON.stringify(data)}`);
}).catch((err) => {
    console.error(`setVoNRState fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4543 4544 4545
```


S
shawn_he 已提交
4546
## call.getVoNRState<sup>10+</sup>
S
shawn_he 已提交
4547

S
shawn_he 已提交
4548
getVoNRState\(slotId: number, callback: AsyncCallback\<VoNRState\>\): void
S
shawn_he 已提交
4549

S
shawn_he 已提交
4550
Obtains the status of the VoNR switch. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
4551

S
shawn_he 已提交
4552
**System API**: This is a system API.
S
shawn_he 已提交
4553

S
shawn_he 已提交
4554
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
S
shawn_he 已提交
4555

S
shawn_he 已提交
4556
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4557

S
shawn_he 已提交
4558
**Parameters**
S
shawn_he 已提交
4559

S
shawn_he 已提交
4560
| Name     |                     Type                     | Mandatory | Description                                                  |
S
shawn_he 已提交
4561
| ----------- | --------------------------------------------- | ---- | ------------------------------------------------------ |
S
shawn_he 已提交
4562 4563
| slotId      | number                                        | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2                 |
| callback    | AsyncCallback&lt;[VoNRState](#vonrstate10)&gt;| Yes  | Callback used to return the result.                          |
S
shawn_he 已提交
4564

S
shawn_he 已提交
4565
**Error codes**
S
shawn_he 已提交
4566

S
shawn_he 已提交
4567
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4568

S
shawn_he 已提交
4569
| ID|                  Error Message                    |
S
shawn_he 已提交
4570
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let slotId = 0;
call.getVoNRState(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
4586 4587 4588
```


S
shawn_he 已提交
4589
## call.getVoNRState<sup>10+</sup>
S
shawn_he 已提交
4590

S
shawn_he 已提交
4591
getVoNRState\(slotId: number\): Promise\<VoNRState\>
S
shawn_he 已提交
4592

S
shawn_he 已提交
4593
Obtains the status of the VoNR switch. This API uses a promise to return the result.
S
shawn_he 已提交
4594

S
shawn_he 已提交
4595
**System API**: This is a system API.
S
shawn_he 已提交
4596

S
shawn_he 已提交
4597
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
S
shawn_he 已提交
4598

S
shawn_he 已提交
4599
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4600

S
shawn_he 已提交
4601
**Parameters**
S
shawn_he 已提交
4602

S
shawn_he 已提交
4603
| Name     | Type                          | Mandatory| Description                                       |
S
shawn_he 已提交
4604
| ----------- | ----------------------------- | ---- | ------------------------------------------- |
S
shawn_he 已提交
4605
| slotId      | number                        | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2    |
S
shawn_he 已提交
4606

S
shawn_he 已提交
4607
**Return value**
S
shawn_he 已提交
4608

S
shawn_he 已提交
4609
|                 Type                    | Description                                       |
S
shawn_he 已提交
4610
| ---------------------------------------- | ------------------------------------------- |
S
shawn_he 已提交
4611
| Promise&lt;[VoNRState](#vonrstate10)&gt; | Promise used to return the result.             |
S
shawn_he 已提交
4612

S
shawn_he 已提交
4613
**Error codes**
S
shawn_he 已提交
4614

S
shawn_he 已提交
4615
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4616

S
shawn_he 已提交
4617
| ID|                  Error Message                    |
S
shawn_he 已提交
4618
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let slotId = 0;
let promise = call.getVoNRState(slotId);
promise.then(data => {
    console.log(`getVoNRState success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getVoNRState fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4637 4638 4639
```


S
shawn_he 已提交
4640
## call.canSetCallTransferTime<sup>10+</sup>
S
shawn_he 已提交
4641

S
shawn_he 已提交
4642
canSetCallTransferTime\(slotId: number, callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
4643

S
shawn_he 已提交
4644
Checks whether the call forwarding time can be set. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
4645

S
shawn_he 已提交
4646
**System API**: This is a system API.
S
shawn_he 已提交
4647

S
shawn_he 已提交
4648
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
S
shawn_he 已提交
4649

S
shawn_he 已提交
4650
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4651

S
shawn_he 已提交
4652
**Parameters**
S
shawn_he 已提交
4653

S
shawn_he 已提交
4654
| Name     | Type                          | Mandatory| Description                                                 |
S
shawn_he 已提交
4655
| ----------- | ----------------------------- | ---- | ----------------------------------------------------- |
S
shawn_he 已提交
4656 4657
| slotId      | number                        | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2                |
| callback    | AsyncCallback&lt;boolean&gt;  | Yes  | Callback used to return the result. Callback used to return the result. The value **true** indicates that the call forwarding time can be set, and the value **false** indicates the opposite.|
S
shawn_he 已提交
4658

S
shawn_he 已提交
4659
**Error codes**
S
shawn_he 已提交
4660

S
shawn_he 已提交
4661
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4662

S
shawn_he 已提交
4663
| ID|                  Error Message                    |
S
shawn_he 已提交
4664
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let slotId = 0;
call.canSetCallTransferTime(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
S
shawn_he 已提交
4680 4681 4682
```


S
shawn_he 已提交
4683
## call.canSetCallTransferTime<sup>10+</sup>
S
shawn_he 已提交
4684

S
shawn_he 已提交
4685
canSetCallTransferTime\(slotId: number\): Promise\<boolean\>
S
shawn_he 已提交
4686

S
shawn_he 已提交
4687
Checks whether the call forwarding time can be set. This API uses a promise to return the result.
S
shawn_he 已提交
4688

S
shawn_he 已提交
4689
**System API**: This is a system API.
S
shawn_he 已提交
4690

S
shawn_he 已提交
4691
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
S
shawn_he 已提交
4692

S
shawn_he 已提交
4693
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4694

S
shawn_he 已提交
4695
**Parameters**
S
shawn_he 已提交
4696

S
shawn_he 已提交
4697
| Name     | Type                          | Mandatory| Description                                       |
S
shawn_he 已提交
4698
| ----------- | ----------------------------- | ---- | ------------------------------------------- |
S
shawn_he 已提交
4699
| slotId      | number                        | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2    |
S
shawn_he 已提交
4700

S
shawn_he 已提交
4701
**Return value**
S
shawn_he 已提交
4702

S
shawn_he 已提交
4703
| Type                  | Description                                         |
S
shawn_he 已提交
4704
| ---------------------- | --------------------------------------------- |
S
shawn_he 已提交
4705
| Promise&lt;boolean&gt; | Promise used to return the result.|
S
shawn_he 已提交
4706

S
shawn_he 已提交
4707
**Error codes**
S
shawn_he 已提交
4708

S
shawn_he 已提交
4709
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4710

S
shawn_he 已提交
4711
| ID|                  Error Message                    |
S
shawn_he 已提交
4712
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let slotId = 0;
call.canSetCallTransferTime(slotId).then((data) => {
    console.log(`canSetCallTransferTime success, promise: data->${JSON.stringify(data)}`);
}).catch((err) => {
    console.error(`canSetCallTransferTime fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4730 4731 4732
```


S
shawn_he 已提交
4733
## call.inputDialerSpecialCode<sup>10+</sup>
S
shawn_he 已提交
4734

S
shawn_he 已提交
4735
inputDialerSpecialCode\(inputCode: string, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
4736

S
shawn_he 已提交
4737
Performs a secret code broadcast. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
4738

S
shawn_he 已提交
4739
**System API**: This is a system API.
S
shawn_he 已提交
4740

S
shawn_he 已提交
4741
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
4742

S
shawn_he 已提交
4743
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4744

S
shawn_he 已提交
4745
**Parameters**
S
shawn_he 已提交
4746

S
shawn_he 已提交
4747
| Name     | Type                        | Mandatory| Description                                      |
S
shawn_he 已提交
4748
| ----------- | ---------------------------- | ---- | ----------------------------------------- |
S
shawn_he 已提交
4749 4750
| inputCode   | string                       | Yes  | Secret code, for example, **2846579** (project menu).|
| callback    | AsyncCallback&lt;void&gt;    | Yes  | Callback used to return the result.                                  |
S
shawn_he 已提交
4751

S
shawn_he 已提交
4752
**Error codes**
S
shawn_he 已提交
4753

S
shawn_he 已提交
4754
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4755

S
shawn_he 已提交
4756
| ID| Error Message                                    |
S
shawn_he 已提交
4757
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
call.inputDialerSpecialCode('2846579', (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
4771 4772
```

S
shawn_he 已提交
4773
## call.inputDialerSpecialCode<sup>10+</sup>
S
shawn_he 已提交
4774

S
shawn_he 已提交
4775
inputDialerSpecialCode\(inputCode: string\): Promise\<void\>
S
shawn_he 已提交
4776

S
shawn_he 已提交
4777
Performs a secret code broadcast. This API uses a promise to return the result.
S
shawn_he 已提交
4778

S
shawn_he 已提交
4779
**System API**: This is a system API.
S
shawn_he 已提交
4780

S
shawn_he 已提交
4781
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
4782

S
shawn_he 已提交
4783
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4784

S
shawn_he 已提交
4785
**Parameters**
S
shawn_he 已提交
4786

S
shawn_he 已提交
4787
| Name     | Type                        | Mandatory| Description                                      |
S
shawn_he 已提交
4788
| ----------- | ---------------------------- | ---- | ----------------------------------------- |
S
shawn_he 已提交
4789
| inputCode   | string                       | Yes  | Secret code, for example, **2846579** (project menu).|
S
shawn_he 已提交
4790

S
shawn_he 已提交
4791
**Return value**
S
shawn_he 已提交
4792

S
shawn_he 已提交
4793
| Type               | Description                       |
S
shawn_he 已提交
4794
| ------------------- | --------------------------- |
S
shawn_he 已提交
4795
| Promise&lt;void&gt; | Promise used to return the result.|
S
shawn_he 已提交
4796

S
shawn_he 已提交
4797
**Error codes**
S
shawn_he 已提交
4798

S
shawn_he 已提交
4799
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
S
shawn_he 已提交
4800

S
shawn_he 已提交
4801
| ID| Error Message                                    |
S
shawn_he 已提交
4802
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

**Example**

```js
try {
    call.inputDialerSpecialCode('2846579');
    console.log(`inputDialerSpecialCode success`);
} catch (error) {
    console.log(`inputDialerSpecialCode fail, promise: err->${JSON.stringify(error)}`);
S
shawn_he 已提交
4818 4819 4820 4821
}
```


S
shawn_he 已提交
4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904
## call.removeMissedIncomingCallNotification<sup>10+</sup>

removeMissedIncomingCallNotification\(callback: AsyncCallback\<void\>\): void

Removes missed call notifications. This API uses an asynchronous callback to return the result.

**System API**: This is a system API.

**Required permissions**: ohos.permission.SET_TELEPHONY_STATE, ohos.permission.READ_CALL_LOG, and ohos.permission.WRITE_CALL_LOG

**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name     | Type                        | Mandatory| Description                                     |
| ----------- | ---------------------------- | ---- | ---------------------------------------   |
| callback    | AsyncCallback&lt;void&gt;    | Yes  | Callback used to return the result.                                 |

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 401      | Parameter error.                             |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
call.removeMissedIncomingCallNotification((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
```


## call.removeMissedIncomingCallNotification<sup>10+</sup>

removeMissedIncomingCallNotification\(\): Promise\<void\>

Removes missed call notifications. This API uses a promise to return the result.

**System API**: This is a system API.

**Required permissions**: ohos.permission.SET_TELEPHONY_STATE, ohos.permission.READ_CALL_LOG, and ohos.permission.WRITE_CALL_LOG

**System capability**: SystemCapability.Telephony.CallManager

**Return value**

| Type               | Description                       |
| ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 202      | Non-system applications use system APIs.     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
let promise = call.removeMissedIncomingCallNotification();
promise.then(data => {
    console.log(`removeMissedIncomingCallNotification success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.log(`removeMissedIncomingCallNotification failed, promise: err->${JSON.stringify(err)}`);
});
```


## DialOptions
S
shawn_he 已提交
4905

S
shawn_he 已提交
4906
Provides an option for determining whether a call is a video call.
S
shawn_he 已提交
4907

S
shawn_he 已提交
4908
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4909

S
shawn_he 已提交
4910
|        Name             | Type                              | Mandatory| Description                                                                                            |
S
shawn_he 已提交
4911
| ------------------------ | ---------------------------------- | ---- | ----------------------------------------------------------------------------------------------- |
S
shawn_he 已提交
4912 4913 4914 4915 4916
| extras                   | boolean                            | No  | Indication of a video call. <br>- **true**: video call<br>- **false** (default): voice call  |
| accountId <sup>8+</sup>  | number                             | No  | Account ID.<br>- **0**: card slot 1<br>- **1**: card slot 2<br> This is a system API.                                  |
| videoState <sup>8+</sup> | [VideoStateType](#videostatetype7) | No  | Video state type. This is a system API.                                                                 |
| dialScene <sup>8+</sup>  | [DialScene](#dialscene8)           | No  | Dialup scenario. This is a system API.                                                                     |
| dialType <sup>8+</sup>   | [DialType](#dialtype8)             | No  | Dialup type. This is a system API.                                                                     |
S
shawn_he 已提交
4917

S
shawn_he 已提交
4918
## DialCallOptions<sup>9+</sup>
S
shawn_he 已提交
4919

S
shawn_he 已提交
4920
Provides an option for determining whether a call is a video call.
S
shawn_he 已提交
4921

S
shawn_he 已提交
4922
**System API**: This is a system API.
S
shawn_he 已提交
4923

S
shawn_he 已提交
4924
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4925

S
shawn_he 已提交
4926
|        Name             | Type                              | Mandatory| Description                                        |
S
shawn_he 已提交
4927
| ------------------------ | ---------------------------------- | ---- | ------------------------------------------- |
S
shawn_he 已提交
4928 4929 4930 4931
| accountId <sup>9+</sup>  | number                             | No  | Account ID.<br>- **0**: card slot 1<br>- **1**: card slot 2<br> |
| videoState <sup>9+</sup> | [VideoStateType](#videostatetype7) | No  | Video state type.                              |
| dialScene <sup>9+</sup>  | [DialScene](#dialscene8)           | No  | Dialup scenario.                                  |
| dialType <sup>9+</sup>   | [DialType](#dialtype8)             | No  | Dialup type.                                  |
S
shawn_he 已提交
4932

S
shawn_he 已提交
4933
## CallState
S
shawn_he 已提交
4934

S
shawn_he 已提交
4935
Enumerates call states.
S
shawn_he 已提交
4936

S
shawn_he 已提交
4937
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4938

S
shawn_he 已提交
4939
| Name              | Value  | Description                                                        |
S
shawn_he 已提交
4940
| ------------------ | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
4941 4942 4943 4944
| CALL_STATE_UNKNOWN | -1   | The call status fails to be obtained and is unknown.                        |
| CALL_STATE_IDLE    | 0    | No call is in progress.                                    |
| CALL_STATE_RINGING | 1    | The call is in the ringing or waiting state.                                    |
| CALL_STATE_OFFHOOK | 2    | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting.|
S
shawn_he 已提交
4945

S
shawn_he 已提交
4946
## EmergencyNumberOptions<sup>7+</sup>
S
shawn_he 已提交
4947

S
shawn_he 已提交
4948
Provides an option for determining whether a number is an emergency number for the SIM card in the specified slot.
S
shawn_he 已提交
4949

S
shawn_he 已提交
4950
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4951

S
shawn_he 已提交
4952
|  Name | Type  | Mandatory| Description                                          |
S
shawn_he 已提交
4953
| ------ | ------ | ---- | ---------------------------------------------- |
S
shawn_he 已提交
4954
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
4955

S
shawn_he 已提交
4956
## NumberFormatOptions<sup>7+</sup>
S
shawn_he 已提交
4957

S
shawn_he 已提交
4958
Provides an option for number formatting.
S
shawn_he 已提交
4959

S
shawn_he 已提交
4960
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4961

S
shawn_he 已提交
4962
|    Name    | Type  | Mandatory| Description                                                      |
S
shawn_he 已提交
4963
| ----------- | ------ | ---- | ---------------------------------------------------------- |
S
shawn_he 已提交
4964
| countryCode | string | No  | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.|
S
shawn_he 已提交
4965

S
shawn_he 已提交
4966
## ImsCallMode<sup>8+</sup>
S
shawn_he 已提交
4967

S
shawn_he 已提交
4968
Enumerates IMS call modes.
S
shawn_he 已提交
4969

S
shawn_he 已提交
4970
**System API**: This is a system API.
S
shawn_he 已提交
4971

S
shawn_he 已提交
4972
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4973

S
shawn_he 已提交
4974
| Name                  | Value  | Description              |
S
shawn_he 已提交
4975
| ---------------------- | ---- | ------------------ |
S
shawn_he 已提交
4976 4977 4978 4979 4980
| CALL_MODE_AUDIO_ONLY   | 0    | Audio call only.      |
| CALL_MODE_SEND_ONLY    | 1    | Sending calls only.        |
| CALL_MODE_RECEIVE_ONLY | 2    | Receiving calls only.        |
| CALL_MODE_SEND_RECEIVE | 3    | Sending and receiving calls.|
| CALL_MODE_VIDEO_PAUSED | 4    | Pausing video calls.      |
S
shawn_he 已提交
4981

S
shawn_he 已提交
4982
## VoNRState<sup>10+</sup>
S
shawn_he 已提交
4983

S
shawn_he 已提交
4984
Enumerates VoNR switch states.
S
shawn_he 已提交
4985

S
shawn_he 已提交
4986
**System API**: This is a system API.
S
shawn_he 已提交
4987

S
shawn_he 已提交
4988
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
4989

S
shawn_he 已提交
4990
| Name                  | Value  | Description              |
S
shawn_he 已提交
4991
| ---------------------- | ---- | ----------------- |
S
shawn_he 已提交
4992 4993
| VONR_STATE_OFF         | 0    | Disabled.          |
| VONR_STATE_ON          | 1    | Enabled.          |
S
shawn_he 已提交
4994

S
shawn_he 已提交
4995
## AudioDevice<sup>10+</sup>
S
shawn_he 已提交
4996

S
shawn_he 已提交
4997
Enumerates audio devices.
S
shawn_he 已提交
4998

S
shawn_he 已提交
4999
**System API**: This is a system API.
S
shawn_he 已提交
5000

S
shawn_he 已提交
5001
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5002

S
shawn_he 已提交
5003
|                Name              |                  Type                | Mandatory |        Description     |
S
shawn_he 已提交
5004
| --------------------------------- | ------------------------------------- | ---- | ---------------- |
S
shawn_he 已提交
5005 5006
| deviceType <sup>10+</sup>         | [AudioDeviceType](#audiodevicetype10) | Yes  | Audio device type.    |
| address <sup>10+</sup>            | string                                | No  | Audio device address.    |
S
shawn_he 已提交
5007

S
shawn_he 已提交
5008
## AudioDeviceType<sup>10+</sup>
S
shawn_he 已提交
5009

S
shawn_he 已提交
5010
Enumerates audio device types.
S
shawn_he 已提交
5011

S
shawn_he 已提交
5012
**System API**: This is a system API.
S
shawn_he 已提交
5013

S
shawn_he 已提交
5014
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5015

S
shawn_he 已提交
5016
| Name                | Value  | Description        |
S
shawn_he 已提交
5017
| -------------------- | ---- | ----------- |
S
shawn_he 已提交
5018 5019 5020 5021
| DEVICE_EARPIECE      | 0    | Headset device.    |
| DEVICE_SPEAKER       | 1    | Speaker device.  |
| DEVICE_WIRED_HEADSET | 2    | Wired headset device.|
| DEVICE_BLUETOOTH_SCO | 3    | Bluetooth SCO device. |
S
shawn_he 已提交
5022

S
shawn_he 已提交
5023
## AudioDeviceCallbackInfo<sup>10+</sup>
S
shawn_he 已提交
5024

S
shawn_he 已提交
5025
Defines the audio device information.
S
shawn_he 已提交
5026

S
shawn_he 已提交
5027
**System API**: This is a system API.
S
shawn_he 已提交
5028

S
shawn_he 已提交
5029
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5030

S
shawn_he 已提交
5031
|                Name              |                  Type                | Mandatory |        Description     |
S
shawn_he 已提交
5032
| --------------------------------- | ------------------------------------- | ---- | ---------------- |
S
shawn_he 已提交
5033 5034 5035
| audioDeviceList <sup>10+</sup>    | [Array\<AudioDevice\>](#audiodevice10) | Yes  | Audio device list.   |
| currentAudioDevice <sup>10+</sup> | [AudioDevice](#audiodevice10)          | Yes  | Current audio device.   |
| isMuted <sup>10+</sup>            | boolean                               | Yes  | Whether the audio device is muted.       |
S
shawn_he 已提交
5036 5037


S
shawn_he 已提交
5038
## CallRestrictionType<sup>8+</sup>
S
shawn_he 已提交
5039

S
shawn_he 已提交
5040
Enumerates call restriction types.
S
shawn_he 已提交
5041

S
shawn_he 已提交
5042
**System API**: This is a system API.
S
shawn_he 已提交
5043

S
shawn_he 已提交
5044
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5045

S
shawn_he 已提交
5046
| Name                                         | Value  | Description                      |
S
shawn_he 已提交
5047
| --------------------------------------------- | ---- | -------------------------- |
S
shawn_he 已提交
5048 5049 5050 5051 5052 5053 5054 5055
| RESTRICTION_TYPE_ALL_INCOMING                 | 0    | Barring of all incoming calls.              |
| RESTRICTION_TYPE_ALL_OUTGOING                 | 1    | Barring of all outgoing calls.              |
| RESTRICTION_TYPE_INTERNATIONAL                | 2    | Barring of international calls.              |
| RESTRICTION_TYPE_INTERNATIONAL_EXCLUDING_HOME | 3    | Barring of international calls except those in the home country.|
| RESTRICTION_TYPE_ROAMING_INCOMING             | 4    | Barring of incoming roaming calls.              |
| RESTRICTION_TYPE_ALL_CALLS                    | 5    | Barring of all calls.              |
| RESTRICTION_TYPE_OUTGOING_SERVICES            | 6    | Barring of outgoing services.              |
| RESTRICTION_TYPE_INCOMING_SERVICES            | 7    | Barring of incoming services.              |
S
shawn_he 已提交
5056

S
shawn_he 已提交
5057
## CallTransferInfo<sup>8+</sup>
S
shawn_he 已提交
5058

S
shawn_he 已提交
5059
Defines the call transfer information.
S
shawn_he 已提交
5060

S
shawn_he 已提交
5061
**System API**: This is a system API.
S
shawn_he 已提交
5062

S
shawn_he 已提交
5063
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5064

S
shawn_he 已提交
5065
|          Name           | Type                                                | Mandatory| Description            |
S
shawn_he 已提交
5066
| ------------------------ | ---------------------------------------------------- | ---- | ---------------- |
S
shawn_he 已提交
5067 5068 5069 5070 5071 5072 5073
| transferNum              | string                                               | Yes  | Call transfer number.        |
| type                     | [CallTransferType](#calltransfertype8)               | Yes  | Call transfer type.    |
| settingType              | [CallTransferSettingType](#calltransfersettingtype8) | Yes  | Call transfer setting type.|
| startHour<sup>9+</sup>   | number                                               | No  | Hour in the start time.|
| startMinute<sup>9+</sup> | number                                               | No  | Minute in the start time.|
| endHour<sup>9+</sup>     | number                                               | No  | Minute in the end time.|
| endMinute<sup>9+</sup>   | number                                               | No  | Minute in the end time.|
S
shawn_he 已提交
5074

S
shawn_he 已提交
5075
## CallTransferType<sup>8+</sup>
S
shawn_he 已提交
5076

S
shawn_he 已提交
5077
Enumerates call transfer types.
S
shawn_he 已提交
5078

S
shawn_he 已提交
5079
**System API**: This is a system API.
S
shawn_he 已提交
5080

S
shawn_he 已提交
5081
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5082

S
shawn_he 已提交
5083
| Name                       | Value  | Description        |
S
shawn_he 已提交
5084
| --------------------------- | ---- | ------------ |
S
shawn_he 已提交
5085 5086 5087 5088
| TRANSFER_TYPE_UNCONDITIONAL | 0    | Call forwarding unconditional.  |
| TRANSFER_TYPE_BUSY          | 1    | Call forwarding busy.    |
| TRANSFER_TYPE_NO_REPLY      | 2    | Call forwarding on no reply.  |
| TRANSFER_TYPE_NOT_REACHABLE | 3    | Call forwarding on no user not reachable.|
S
shawn_he 已提交
5089

S
shawn_he 已提交
5090
## CallTransferSettingType<sup>8+</sup>
S
shawn_he 已提交
5091

S
shawn_he 已提交
5092
Enumerates call transfer setting types.
S
shawn_he 已提交
5093

S
shawn_he 已提交
5094
**System API**: This is a system API.
S
shawn_he 已提交
5095

S
shawn_he 已提交
5096
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5097

S
shawn_he 已提交
5098
| Name                      | Value  | Description        |
S
shawn_he 已提交
5099
| -------------------------- | ---- | ------------ |
S
shawn_he 已提交
5100 5101 5102 5103
| CALL_TRANSFER_DISABLE      | 0    | Disabling of call transfer.|
| CALL_TRANSFER_ENABLE       | 1    | Enabling of call transfer.|
| CALL_TRANSFER_REGISTRATION | 3    | Registration of call transfer.|
| CALL_TRANSFER_ERASURE      | 4    | Erasing of call transfer.|
S
shawn_he 已提交
5104

S
shawn_he 已提交
5105
## CallAttributeOptions<sup>7+</sup>
S
shawn_he 已提交
5106

S
shawn_he 已提交
5107
Defines the call attribute options.
S
shawn_he 已提交
5108

S
shawn_he 已提交
5109
**System API**: This is a system API.
S
shawn_he 已提交
5110

S
shawn_he 已提交
5111
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5112

S
shawn_he 已提交
5113
|      Name      | Type                                    | Mandatory| Description          |
S
shawn_he 已提交
5114
| --------------- | ---------------------------------------- | ---- | -------------- |
S
shawn_he 已提交
5115 5116 5117 5118 5119 5120 5121 5122 5123 5124
| accountNumber   | string                                   | Yes  | Account number.      |
| speakerphoneOn  | boolean                                  | Yes  | Speakerphone on.|
| accountId       | number                                   | Yes  | Account ID.        |
| videoState      | [VideoStateType](#videostatetype7)       | Yes  | Video state type.  |
| startTime       | number                                   | Yes  | Start time.      |
| isEcc           | boolean                                  | Yes  | Whether the call is an ECC.     |
| callType        | [CallType](#calltype7)                   | Yes  | Call type.      |
| callId          | number                                   | Yes  | Call ID.        |
| callState       | [DetailedCallState](#detailedcallstate7) | Yes  | Detailed call state.  |
| conferenceState | [ConferenceState](#conferencestate7)     | Yes  | Conference state.      |
S
shawn_he 已提交
5125

S
shawn_he 已提交
5126
## ConferenceState<sup>7+</sup>
S
shawn_he 已提交
5127

S
shawn_he 已提交
5128
Enumerates conference states.
S
shawn_he 已提交
5129

S
shawn_he 已提交
5130
**System API**: This is a system API.
S
shawn_he 已提交
5131

S
shawn_he 已提交
5132
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5133

S
shawn_he 已提交
5134
| Name                        | Value  | Description          |
S
shawn_he 已提交
5135
| ---------------------------- | ---- | -------------- |
S
shawn_he 已提交
5136 5137 5138 5139
| TEL_CONFERENCE_IDLE          | 0    | Idle state.  |
| TEL_CONFERENCE_ACTIVE        | 1    | Active state.  |
| TEL_CONFERENCE_DISCONNECTING | 2    | Disconnecting state.  |
| TEL_CONFERENCE_DISCONNECTED  | 3    | Disconnected state.|
S
shawn_he 已提交
5140

S
shawn_he 已提交
5141
## CallType<sup>7+</sup>
S
shawn_he 已提交
5142

S
shawn_he 已提交
5143
Enumerates call types.
S
shawn_he 已提交
5144

S
shawn_he 已提交
5145
**System API**: This is a system API.
S
shawn_he 已提交
5146

S
shawn_he 已提交
5147
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5148

S
shawn_he 已提交
5149
| Name         | Value  | Description        |
S
shawn_he 已提交
5150
| ------------- | ---- | ------------ |
S
shawn_he 已提交
5151 5152 5153 5154
| TYPE_CS       | 0    | CS call.      |
| TYPE_IMS      | 1    | IMS call.     |
| TYPE_OTT      | 2    | OTT call.     |
| TYPE_ERR_CALL | 3    | Error call type.|
S
shawn_he 已提交
5155

S
shawn_he 已提交
5156
## VideoStateType<sup>7+</sup>
S
shawn_he 已提交
5157

S
shawn_he 已提交
5158
Video state type.
S
shawn_he 已提交
5159

S
shawn_he 已提交
5160
**System API**: This is a system API.
S
shawn_he 已提交
5161

S
shawn_he 已提交
5162
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5163

S
shawn_he 已提交
5164
| Name      | Value  | Description    |
S
shawn_he 已提交
5165
| ---------- | ---- | -------- |
S
shawn_he 已提交
5166 5167
| TYPE_VOICE | 0    | Voice state.|
| TYPE_VIDEO | 1    | Video state.|
S
shawn_he 已提交
5168

S
shawn_he 已提交
5169
## DetailedCallState<sup>7+</sup>
S
shawn_he 已提交
5170

S
shawn_he 已提交
5171
Enumerates detailed call states.
S
shawn_he 已提交
5172

S
shawn_he 已提交
5173
**System API**: This is a system API.
S
shawn_he 已提交
5174

S
shawn_he 已提交
5175
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5176

S
shawn_he 已提交
5177
| Name                     | Value  | Description          |
S
shawn_he 已提交
5178
| ------------------------- | ---- | -------------- |
S
shawn_he 已提交
5179 5180 5181 5182 5183 5184 5185 5186 5187
| CALL_STATUS_ACTIVE        | 0    | Active state.  |
| CALL_STATUS_HOLDING       | 1    | Hold state.  |
| CALL_STATUS_DIALING       | 2    | Dialing state.  |
| CALL_STATUS_ALERTING      | 3    | Alerting state.  |
| CALL_STATUS_INCOMING      | 4    | Incoming state.  |
| CALL_STATUS_WAITING       | 5    | Waiting state.  |
| CALL_STATUS_DISCONNECTED  | 6    | Disconnected state.|
| CALL_STATUS_DISCONNECTING | 7    | Disconnecting state.  |
| CALL_STATUS_IDLE          | 8    | Idle state.  |
S
shawn_he 已提交
5188

S
shawn_he 已提交
5189
## CallRestrictionInfo<sup>8+</sup>
S
shawn_he 已提交
5190

S
shawn_he 已提交
5191
Defines the call restriction information.
S
shawn_he 已提交
5192

S
shawn_he 已提交
5193
**System API**: This is a system API.
S
shawn_he 已提交
5194

S
shawn_he 已提交
5195
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5196

S
shawn_he 已提交
5197
|   Name  | Type                                        | Mandatory| Description        |
S
shawn_he 已提交
5198
| -------- | -------------------------------------------- | ---- | ------------ |
S
shawn_he 已提交
5199 5200 5201
| type     | [CallRestrictionType](#callrestrictiontype8) | Yes  | Call restriction type.|
| password | string                                       | Yes  | Password.        |
| mode     | [CallRestrictionMode](#callrestrictionmode8) | Yes  | Call restriction mode.|
S
shawn_he 已提交
5202

S
shawn_he 已提交
5203
## CallRestrictionMode<sup>8+</sup>
S
shawn_he 已提交
5204

S
shawn_he 已提交
5205
Enumerates call restriction modes.
S
shawn_he 已提交
5206

S
shawn_he 已提交
5207
**System API**: This is a system API.
S
shawn_he 已提交
5208

S
shawn_he 已提交
5209
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5210

S
shawn_he 已提交
5211
| Name                         | Value  | Description        |
S
shawn_he 已提交
5212
| ----------------------------- | ---- | ------------ |
S
shawn_he 已提交
5213 5214
| RESTRICTION_MODE_DEACTIVATION | 0    | Call restriction deactivated.|
| RESTRICTION_MODE_ACTIVATION   | 1    | Call restriction activated.|
S
shawn_he 已提交
5215

S
shawn_he 已提交
5216
## CallEventOptions<sup>8+</sup>
S
shawn_he 已提交
5217

S
shawn_he 已提交
5218
Defines the call event options.
S
shawn_he 已提交
5219

S
shawn_he 已提交
5220
**System API**: This is a system API.
S
shawn_he 已提交
5221

S
shawn_he 已提交
5222
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5223

S
shawn_he 已提交
5224
|   Name | Type                                      | Mandatory| Description          |
S
shawn_he 已提交
5225
| ------- | ------------------------------------------ | ---- | -------------- |
S
shawn_he 已提交
5226
| eventId | [CallAbilityEventId](#callabilityeventid8) | Yes  | Call ability event ID.|
S
shawn_he 已提交
5227

S
shawn_he 已提交
5228
## CallAbilityEventId<sup>8+</sup>
S
shawn_he 已提交
5229

S
shawn_he 已提交
5230
Enumerates call ability event IDs.
S
shawn_he 已提交
5231

S
shawn_he 已提交
5232
**System API**: This is a system API.
S
shawn_he 已提交
5233

S
shawn_he 已提交
5234
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5235

S
shawn_he 已提交
5236 5237 5238 5239 5240 5241
| Name                                 | Value  | Description           |
| ------------------------------------- | ---- | --------------- |
| EVENT_DIAL_NO_CARRIER                 | 1    | No available carrier during dialing. |
| EVENT_INVALID_FDN_NUMBER              | 2    | Invalid FDN.|
| EVENT_HOLD_CALL_FAILED<sup>11+</sup>  | 3    | Failed to place the call on hold.|
| EVENT_SWAP_CALL_FAILED<sup>11+</sup>  | 4    | Failed to place the current call on hold and answer the waiting call.|
S
shawn_he 已提交
5242

S
shawn_he 已提交
5243
## DialScene<sup>8+</sup>
S
shawn_he 已提交
5244

S
shawn_he 已提交
5245
Enumerates dialup scenarios.
S
shawn_he 已提交
5246

S
shawn_he 已提交
5247
**System API**: This is a system API.
S
shawn_he 已提交
5248

S
shawn_he 已提交
5249
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5250

S
shawn_he 已提交
5251
| Name           | Value  | Description        |
S
shawn_he 已提交
5252
| --------------- | ---- | ------------ |
S
shawn_he 已提交
5253 5254 5255
| CALL_NORMAL     | 0    | Common call.    |
| CALL_PRIVILEGED | 1    | Privileged call.    |
| CALL_EMERGENCY  | 2    | Emergency call.|
S
shawn_he 已提交
5256

S
shawn_he 已提交
5257
## DialType<sup>8+</sup>
S
shawn_he 已提交
5258

S
shawn_he 已提交
5259
Enumerates dialup types.
S
shawn_he 已提交
5260

S
shawn_he 已提交
5261
**System API**: This is a system API.
S
shawn_he 已提交
5262

S
shawn_he 已提交
5263
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5264

S
shawn_he 已提交
5265
| Name                | Value  | Description            |
S
shawn_he 已提交
5266
| -------------------- | ---- | ---------------- |
S
shawn_he 已提交
5267 5268 5269
| DIAL_CARRIER_TYPE    | 0    | Carrier.    |
| DIAL_VOICE_MAIL_TYPE | 1    | Voice mail.|
| DIAL_OTT_TYPE        | 2    | OTT.     |
S
shawn_he 已提交
5270

S
shawn_he 已提交
5271
## RejectMessageOptions<sup>7+</sup>
S
shawn_he 已提交
5272

S
shawn_he 已提交
5273
Defines options for the call rejection message.
S
shawn_he 已提交
5274

S
shawn_he 已提交
5275
**System API**: This is a system API.
S
shawn_he 已提交
5276

S
shawn_he 已提交
5277
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5278

S
shawn_he 已提交
5279
|     Name      | Type  | Mandatory| Description    |
S
shawn_he 已提交
5280
| -------------- | ------ | ---- | -------- |
S
shawn_he 已提交
5281
| messageContent | string | Yes  | Message content.|
S
shawn_he 已提交
5282

S
shawn_he 已提交
5283
## CallTransferResult<sup>8+</sup>
S
shawn_he 已提交
5284

S
shawn_he 已提交
5285
Defines the call transfer result.
S
shawn_he 已提交
5286

S
shawn_he 已提交
5287
**System API**: This is a system API.
S
shawn_he 已提交
5288

S
shawn_he 已提交
5289
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5290

S
shawn_he 已提交
5291
|          Name           |                 Type              | Mandatory|       Description      |
S
shawn_he 已提交
5292
| ------------------------ | ---------------------------------- | ---- | ---------------- |
S
shawn_he 已提交
5293 5294 5295 5296 5297 5298
| status                   | [TransferStatus](#transferstatus8) |  Yes | Call transfer status.        |
| number                   | string                             |  Yes | Call transfer number.            |
| startHour<sup>9+</sup>   | number                             |  Yes | Hour in the start time.|
| startMinute<sup>9+</sup> | number                             |  Yes | Minute in the start time.|
| endHour<sup>9+</sup>     | number                             |  Yes | Minute in the end time.|
| endMinute<sup>9+</sup>   | number                             |  Yes | Minute in the end time.|
S
shawn_he 已提交
5299

S
shawn_he 已提交
5300
## CallWaitingStatus<sup>7+</sup>
S
shawn_he 已提交
5301

S
shawn_he 已提交
5302
Enumerates call waiting states.
S
shawn_he 已提交
5303

S
shawn_he 已提交
5304
**System API**: This is a system API.
S
shawn_he 已提交
5305

S
shawn_he 已提交
5306
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5307

S
shawn_he 已提交
5308
| Name                | Value  | Description        |
S
shawn_he 已提交
5309
| -------------------- | ---- | ------------ |
S
shawn_he 已提交
5310 5311
| CALL_WAITING_DISABLE | 0    | Call waiting disabled.|
| CALL_WAITING_ENABLE  | 1    | Call waiting enabled.|
S
shawn_he 已提交
5312

S
shawn_he 已提交
5313
## RestrictionStatus<sup>8+</sup>
S
shawn_he 已提交
5314

S
shawn_he 已提交
5315
Enumerates call restriction states.
S
shawn_he 已提交
5316

S
shawn_he 已提交
5317
**System API**: This is a system API.
S
shawn_he 已提交
5318

S
shawn_he 已提交
5319
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5320

S
shawn_he 已提交
5321
| Name               | Value  | Description    |
S
shawn_he 已提交
5322
| ------------------- | ---- | -------- |
S
shawn_he 已提交
5323 5324
| RESTRICTION_DISABLE | 0    | Call restriction disabled.|
| RESTRICTION_ENABLE  | 1    | Call restriction enabled.|
S
shawn_he 已提交
5325

S
shawn_he 已提交
5326
## TransferStatus<sup>8+</sup>
S
shawn_he 已提交
5327

S
shawn_he 已提交
5328
Enumerates call transfer states.
S
shawn_he 已提交
5329

S
shawn_he 已提交
5330
**System API**: This is a system API.
S
shawn_he 已提交
5331

S
shawn_he 已提交
5332
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5333

S
shawn_he 已提交
5334
| Name            | Value  | Description    |
S
shawn_he 已提交
5335
| ---------------- | ---- | -------- |
S
shawn_he 已提交
5336 5337
| TRANSFER_DISABLE | 0    | Call transfer disabled.|
| TRANSFER_ENABLE  | 1    | Call transfer enabled.|
S
shawn_he 已提交
5338

S
shawn_he 已提交
5339
## DisconnectedDetails<sup>9+</sup>
S
shawn_he 已提交
5340

S
shawn_he 已提交
5341
Defines the call disconnection cause.
S
shawn_he 已提交
5342

S
shawn_he 已提交
5343
**System API**: This is a system API.
S
shawn_he 已提交
5344

S
shawn_he 已提交
5345
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5346

S
shawn_he 已提交
5347
| Name   |                    Type                   | Mandatory| Description           |
S
shawn_he 已提交
5348
| ------- | ------------------------------------------ | ---- | --------------- |
S
shawn_he 已提交
5349 5350
| reason  | [DisconnectedReason](#disconnectedreason8) | Yes  | Call disconnection cause.   |
| message | string                                     | Yes  | Call ending message.|
S
shawn_he 已提交
5351

S
shawn_he 已提交
5352
## DisconnectedReason<sup>8+</sup>
S
shawn_he 已提交
5353

S
shawn_he 已提交
5354
Enumerates call disconnection causes.
S
shawn_he 已提交
5355

S
shawn_he 已提交
5356
**System API**: This is a system API.
S
shawn_he 已提交
5357

S
shawn_he 已提交
5358
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5359

S
shawn_he 已提交
5360
|                              Name                           | Value  |                  Description                  |
S
shawn_he 已提交
5361
| ------------------------------------------------------------ | ---- | --------------------------------------- |
S
shawn_he 已提交
5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450
| UNASSIGNED_NUMBER                                            | 1    | Unallocated (unassigned) number.                     |
| NO_ROUTE_TO_DESTINATION                                      | 3    | No route to destination.                       |
| CHANNEL_UNACCEPTABLE                                         | 6    | Channel unacceptable.                         |
| OPERATOR_DETERMINED_BARRING                                  | 8    | Operator determined barring (ODB).                             |
| CALL_COMPLETED_ELSEWHERE<sup>9+</sup>                        | 13   | Call completed elsewhere.                     |
| NORMAL_CALL_CLEARING                                         | 16   | Normal call clearing.                           |
| USER_BUSY                                                    | 17   | User busy.                                 |
| NO_USER_RESPONDING                                           | 18   | No user responding.                             |
| USER_ALERTING_NO_ANSWER                                      | 19   | User alerting, no answer.                 |
| CALL_REJECTED                                                | 21   | Call rejected.                               |
| NUMBER_CHANGED                                               | 22   | Number changed.                               |
| CALL_REJECTED_DUE_TO_FEATURE_AT_THE_DESTINATION<sup>9+</sup> | 24   | Call rejected due to feature at the destination.|
| FAILED_PRE_EMPTION<sup>9+</sup>                              | 25   | Failed preemption.                               |
| NON_SELECTED_USER_CLEARING<sup>9+</sup>                      | 26   | Non-selected user clearing.                         |
| DESTINATION_OUT_OF_ORDER                                     | 27   | Destination out of order.                               |
| INVALID_NUMBER_FORMAT                                        | 28   | Invalid number format (incomplete number).                           |
| FACILITY_REJECTED<sup>9+</sup>                               | 29   | Facility rejected.                           |
| RESPONSE_TO_STATUS_ENQUIRY<sup>9+</sup>                      | 30   | Response to status enquiry.                       |
| NORMAL_UNSPECIFIED<sup>9+</sup>                              | 31   | Normal, unspecified.                           |
| NO_CIRCUIT_CHANNEL_AVAILABLE<sup>9+</sup>                    | 34   | No circuit/channel available.                        |
| NETWORK_OUT_OF_ORDER                                         | 38   | Network fault.                               |
| TEMPORARY_FAILURE                                            | 41   | Temporary failure.                               |
| SWITCHING_EQUIPMENT_CONGESTION<sup>9+</sup>                  | 42   | Switching equipment congestion.                           |
| ACCESS_INFORMATION_DISCARDED<sup>9+</sup>                    | 43   | Access information discarded.                         |
| REQUEST_CIRCUIT_CHANNEL_NOT_AVAILABLE<sup>9+</sup>           | 44   | Requested circuit/channel unavailable                  |
| RESOURCES_UNAVAILABLE_UNSPECIFIED<sup>9+</sup>               | 47   | Resources unavailable, unspecified.                       |
| QUALITY_OF_SERVICE_UNAVAILABLE<sup>9+</sup>                  | 49   | QoS unavailable.                         |
| REQUESTED_FACILITY_NOT_SUBSCRIBED<sup>9+</sup>               | 50   | Requested facility not subscribed.                       |
| INCOMING_CALLS_BARRED_WITHIN_THE_CUG<sup>9+</sup>            | 55   | Incoming calls barred within the CUG.                          |
| BEARER_CAPABILITY_NOT_AUTHORIZED<sup>9+</sup>                | 57   | Bearer capability not authorized.                         |
| BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE<sup>9+</sup>       | 58   | Bearer capability presently available.                     |
| SERVICE_OR_OPTION_NOT_AVAILABLE_UNSPECIFIED<sup>9+</sup>     | 63   | Service or option not available, unspecified.               |
| BEARER_SERVICE_NOT_IMPLEMENTED<sup>9+</sup>                  | 65   | Bearer service not implemented.                         |
| ACM_EQUALTO_OR_GREATER_THAN_THE_MAXIMUM_VALUE<sup>9+</sup>   | 68   | ACM greater than or equal to the maximum value.                    |
| REQUESTED_FACILITY_NOT_IMPLEMENTED<sup>9+</sup>              | 69   | Requested facility not implemented.                       |
| ONLY_RESTRICTED_DIGITAL_INFO_BEARER_CAPABILITY_IS_AVAILABLE<sup>9+</sup> | 70   | Only restricted digital information bearer capability available.     |
| SERVICE_OR_OPTION_NOT_IMPLEMENTED_UNSPECIFIED<sup>9+</sup>   | 79   | Service or option not implemented, unspecified.               |
| INVALID_TRANSACTION_IDENTIFIER_VALUE<sup>9+</sup>            | 81   | Invalid transaction identifier value.                     |
| USER_NOT_MEMBER_OF_CUG<sup>9+</sup>                          | 87   | User not member of CUG.                        |
| INCOMPATIBLE_DESTINATION<sup>9+</sup>                        | 88   | Incompatible destination.                             |
| INVALID_TRANSIT_NETWORK_SELECTION<sup>9+</sup>               | 91   | Invalid transit network selection.                     |
| SEMANTICALLY_INCORRECT_MESSAGE<sup>9+</sup>                  | 95   | Semantically incorrect message.                         |
| INVALID_MANDATORY_INFORMATION<sup>9+</sup>                   | 96   | Invalid mandatory information.                         |
| MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED<sup>9+</sup>    | 97   | Message type non-existent or not implemented.                 |
| MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE<sup>9+</sup> | 98   | Message type not compatible with protocol state.               |
| INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED<sup>9+</sup>    | 99   | IE non-existent or not implemented.                |
| CONDITIONAL_IE_ERROR<sup>9+</sup>                            | 100  | Conditional IE error.                             |
| MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE<sup>9+</sup>      | 101  | Message not compatible with protocol state.                   |
| RECOVERY_ON_TIMER_EXPIRED<sup>9+</sup>                       | 102  | Recovery on timer expiry.             |
| PROTOCOL_ERROR_UNSPECIFIED<sup>9+</sup>                      | 111  | Protocol error, unspecified.                       |
| INTERWORKING_UNSPECIFIED<sup>9+</sup>                        | 127  | Interworking, unspecified.                           |
| CALL_BARRED<sup>9+</sup>                                     | 240  | Call barred.                             |
| FDN_BLOCKED<sup>9+</sup>                                     | 241  | FDN blocked.                                |
| IMSI_UNKNOWN_IN_VLR<sup>9+</sup>                             | 242  | IMSI unknown in VLR.                        |
| IMEI_NOT_ACCEPTED<sup>9+</sup>                               | 243  | IMEI not accepted.                           |
| DIAL_MODIFIED_TO_USSD<sup>9+</sup>                           | 244  | Dial request modified to USSD request.                         |
| DIAL_MODIFIED_TO_SS<sup>9+</sup>                             | 245  | Dial request modified to SS request.                       |
| DIAL_MODIFIED_TO_DIAL<sup>9+</sup>                           | 246  | Dial request modified to dial with different number.                       |
| RADIO_OFF<sup>9+</sup>                                       | 247  | Radio off.                       |
| OUT_OF_SERVICE<sup>9+</sup>                                  | 248  | Out of service.                               |
| NO_VALID_SIM<sup>9+</sup>                                    | 249  | No valid SIM.                              |
| RADIO_INTERNAL_ERROR<sup>9+</sup>                            | 250  | Radio internal error.                     |
| NETWORK_RESP_TIMEOUT<sup>9+</sup>                            | 251  | Network response timeout.                           |
| NETWORK_REJECT<sup>9+</sup>                                  | 252  | Request rejected by network.                               |
| RADIO_ACCESS_FAILURE<sup>9+</sup>                            | 253  | Radio access failure.                         |
| RADIO_LINK_FAILURE<sup>9+</sup>                              | 254  | Radio link failure.                         |
| RADIO_LINK_LOST<sup>9+</sup>                                 | 255  | Radio link lost.                         |
| RADIO_UPLINK_FAILURE<sup>9+</sup>                            | 256  | Radio uplink failure.                     |
| RADIO_SETUP_FAILURE<sup>9+</sup>                             | 257  | Radio setup failure.                     |
| RADIO_RELEASE_NORMAL<sup>9+</sup>                            | 258  | Radio release normal.                         |
| RADIO_RELEASE_ABNORMAL<sup>9+</sup>                          | 259  | Radio release abnormal.                         |
| ACCESS_CLASS_BLOCKED<sup>9+</sup>                            | 260  | Access class blocked.                           |
| NETWORK_DETACH<sup>9+</sup>                                  | 261  | Network detached.                               |
| INVALID_PARAMETER                                            | 1025 | Invalid parameter.                               |
| SIM_NOT_EXIT                                                 | 1026 | SIM not exit.                            |
| SIM_PIN_NEED                                                 | 1027 | SIM PIN needed.                         |
| CALL_NOT_ALLOW                                               | 1029 | Call not allowed.                             |
| SIM_INVALID                                                  | 1045 | No valid SIM.                              |
| UNKNOWN                                                      | 1279 | Unknown reason.                               |

## MmiCodeResults<sup>9+</sup>

Defines the MMI code result.

**System API**: This is a system API.

**System capability**: SystemCapability.Telephony.CallManager

| Name   | Type                            | Mandatory| Description           |
S
shawn_he 已提交
5451
| ------- | -------------------------------- | ---- | --------------- |
S
shawn_he 已提交
5452 5453
| result  | [MmiCodeResult](#mmicoderesult9) | Yes  | MMI code result.|
| message | string                           | Yes  | MMI code message.|
S
shawn_he 已提交
5454

S
shawn_he 已提交
5455
## MmiCodeResult<sup>9+</sup>
S
shawn_he 已提交
5456

S
shawn_he 已提交
5457
Defines the MMI code result.
S
shawn_he 已提交
5458

S
shawn_he 已提交
5459
**System API**: This is a system API.
S
shawn_he 已提交
5460

S
shawn_he 已提交
5461
**System capability**: SystemCapability.Telephony.CallManager
S
shawn_he 已提交
5462

S
shawn_he 已提交
5463
| Name            | Value  | Description         |
S
shawn_he 已提交
5464
| ---------------- | ---- | ------------- |
S
shawn_he 已提交
5465 5466
| MMI_CODE_SUCCESS | 0    | Success.|
| MMI_CODE_FAILED  | 1    | Failure.|