js-apis-call.md 176.0 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 5 6

To subscribe to the call status, use [`observer.on('callStateChange')`](js-apis-observer.md#observeroncallstatechange).

S
shawn_he 已提交
7 8
>**NOTE**
>
Z
zengyawen 已提交
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 11 12

## Modules to Import

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

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

S
shawn_he 已提交
19
dialCall\(phoneNumber: string, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
20 21 22 23 24 25 26 27 28 29 30 31

Initiates a call. This API uses an asynchronous callback 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                                   |
S
shawn_he 已提交
32
| ----------- | ---------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
33
| phoneNumber | string                       | Yes  | Phone number.                             |
S
shawn_he 已提交
34
| callback    | AsyncCallback&lt;void&gt;    | Yes  | Callback used to return the result.  |
S
shawn_he 已提交
35 36

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
43
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
44 45 46 47 48 49 50 51 52
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

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


## call.dialCall<sup>9+</sup>

S
shawn_he 已提交
61
dialCall\(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
62 63 64 65 66 67 68 69 70 71 72 73

Initiates a call. You can set call options as needed. This API uses an asynchronous callback 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                                |
S
shawn_he 已提交
74
| ----------- | ----------------------------------- | ---- | ----------------------------------- |
S
shawn_he 已提交
75 76
| phoneNumber | string                              | Yes  | Phone number.                          |
| options     | [DialCallOptions](#dialcalloptions9)| Yes  | Call options, which carry other configuration information of the call.   |
S
shawn_he 已提交
77
| callback    | AsyncCallback&lt;void&gt;           | Yes  | Callback used to return the result.|
S
shawn_he 已提交
78 79

**Error codes**
S
shawn_he 已提交
80

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
86
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
87 88 89 90 91 92 93 94 95 96 97 98 99 100
| 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.dialCall("138xxxxxxxx", {
    accountId: 0,
    videoState: 0,
    dialScene: 0,
    dialType: 0,
S
shawn_he 已提交
101 102
}, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
103 104 105 106 107 108
});
```


## call.dialCall<sup>9+</sup>

S
shawn_he 已提交
109
dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise\<void\>
S
shawn_he 已提交
110 111 112 113 114 115 116 117 118 119 120 121 122 123

Initiates a call. You can set call options as needed. 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                   |
| ----------- | ----------------------------------- | ---- | -------------------------------------- |
| phoneNumber | string                              | Yes  | Phone number.                            |
S
shawn_he 已提交
124
| 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 已提交
125 126 127

**Return value**

S
shawn_he 已提交
128 129 130
| Type                  | Description                         |
| ---------------------- | ---------------------------- |
| Promise&lt;void&gt;    | Promise used to return the result.|
S
shawn_he 已提交
131 132

**Error codes**
S
shawn_he 已提交
133

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
139
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
140 141 142 143 144 145 146 147 148
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
S
shawn_he 已提交
149 150 151 152 153 154 155 156 157 158 159
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 已提交
160 161
```

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

S
shawn_he 已提交
164
dial\(phoneNumber: string, callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193

Initiates a call. This API uses an asynchronous callback to return the result.

> **NOTE**
>
> 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.

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

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

**Parameters**

| Name     | Type                        | Mandatory| Description                                   |
| ----------- | ---------------------------- | ---- | --------------------------------------- |
| phoneNumber | string                       | Yes  | Phone number.                             |
| callback    | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.<br>- **true**: success<br>- **false**: failure|

**Example**

```js
call.dial("138xxxxxxxx", (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## call.dial<sup>(deprecated)</sup>

S
shawn_he 已提交
194
dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225

Initiates a call. You can set call options as needed. This API uses an asynchronous callback to return the result.

> **NOTE**
>
> 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.

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

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

**Parameters**

| Name     | Type                        | Mandatory| Description                                   |
| ----------- | ---------------------------- | ---- | --------------------------------------- |
| 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)}`);
});
```

## call.dial<sup>(deprecated)</sup>

S
shawn_he 已提交
226
dial\(phoneNumber: string, options?: DialOptions\): Promise\<boolean\>
S
shawn_he 已提交
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262

Initiates a call. You can set call options as needed. This API uses a promise to return the result.

> **NOTE**
>
> 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.

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

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

**Parameters**

| Name     | Type                       | Mandatory| Description                                  |
| ----------- | --------------------------- | ---- | -------------------------------------- |
| phoneNumber | string                      | Yes  | Phone number.                            |
| options     | [DialOptions](#dialoptions) | No  | Call option, which indicates whether the call is a voice call or video call.|

**Return value**

| Type                  | Description                                                        |
| ---------------------- | ------------------------------------------------------------ |
| 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 已提交
263

S
shawn_he 已提交
264
## call.makeCall<sup>7+</sup>
S
shawn_he 已提交
265

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

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

S
shawn_he 已提交
270
**System capability**: SystemCapability.Applications.Contacts
S
shawn_he 已提交
271 272 273

**Parameters**

S
shawn_he 已提交
274
| Name     | Type                     | Mandatory| Description                                      |
S
shawn_he 已提交
275 276
| ----------- | ------------------------- | ---- | ------------------------------------------ |
| phoneNumber | string                    | Yes  | Phone number.                                |
S
shawn_he 已提交
277 278 279
| callback    | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|

**Error codes**
S
shawn_he 已提交
280

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
290 291 292

**Example**

S
shawn_he 已提交
293
```js
S
shawn_he 已提交
294 295
call.makeCall("138xxxxxxxx", err => {
    console.log(`makeCall callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
296 297 298 299
});
```


S
shawn_he 已提交
300
## call.makeCall<sup>7+</sup>
S
shawn_he 已提交
301

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

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

S
shawn_he 已提交
306
**System capability**: SystemCapability.Applications.Contacts
S
shawn_he 已提交
307 308 309

**Parameters**

S
shawn_he 已提交
310
| Name     | Type  | Mandatory| Description      |
S
shawn_he 已提交
311
| ----------- | ------ | ---- | ---------- |
S
shawn_he 已提交
312
| phoneNumber | string | Yes  | Phone number.|
S
shawn_he 已提交
313

S
shawn_he 已提交
314
**Return value**
S
shawn_he 已提交
315 316 317

| Type               | Description                             |
| ------------------- | --------------------------------- |
S
shawn_he 已提交
318 319 320
| Promise&lt;void&gt; | Promise used to return the result.|

**Error codes**
S
shawn_he 已提交
321

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
331 332 333

**Example**

S
shawn_he 已提交
334
```js
S
shawn_he 已提交
335 336 337 338 339
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 已提交
340 341 342
});
```

S
shawn_he 已提交
343
## call.hasCall
S
shawn_he 已提交
344

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

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

S
shawn_he 已提交
349 350
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
351
**Parameters**
S
shawn_he 已提交
352

S
shawn_he 已提交
353
| Name  | Type                        | Mandatory| Description                                                        |
S
shawn_he 已提交
354
| -------- | ---------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
355
| 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 已提交
356

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

S
shawn_he 已提交
359
```js
S
shawn_he 已提交
360 361 362 363
call.hasCall((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
364 365


S
shawn_he 已提交
366
## call.hasCall
S
shawn_he 已提交
367

S
shawn_he 已提交
368
hasCall\(\): Promise\<boolean\>
S
shawn_he 已提交
369

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

S
shawn_he 已提交
372 373
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
374
**Return value**
S
shawn_he 已提交
375

S
shawn_he 已提交
376
| Type                  | Description                                   |
S
shawn_he 已提交
377
| ---------------------- | --------------------------------------- |
S
shawn_he 已提交
378
| Promise&lt;boolean&gt; | Promise used to return the result.|
S
shawn_he 已提交
379

S
shawn_he 已提交
380
**Example**
S
shawn_he 已提交
381

S
shawn_he 已提交
382
```js
S
shawn_he 已提交
383 384 385 386 387 388 389
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 已提交
390 391


S
shawn_he 已提交
392
## call.getCallState
S
shawn_he 已提交
393

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

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

S
shawn_he 已提交
398 399
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
400
**Parameters**
S
shawn_he 已提交
401

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

S
shawn_he 已提交
406
**Example**
S
shawn_he 已提交
407

S
shawn_he 已提交
408
```js
S
shawn_he 已提交
409 410 411 412
call.getCallState((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
413 414


S
shawn_he 已提交
415
## call.getCallState
S
shawn_he 已提交
416

S
shawn_he 已提交
417
getCallState\(\): Promise\<CallState\>
S
shawn_he 已提交
418

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

S
shawn_he 已提交
421 422
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
423
**Return value**
S
shawn_he 已提交
424

S
shawn_he 已提交
425 426
| Type                                  | Description                                   |
| -------------------------------------- | --------------------------------------- |
S
shawn_he 已提交
427
| Promise&lt;[CallState](#callstate)&gt; | Promise used to return the result.|
S
shawn_he 已提交
428

S
shawn_he 已提交
429
**Example**
S
shawn_he 已提交
430

S
shawn_he 已提交
431
```js
S
shawn_he 已提交
432 433 434 435 436 437 438
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 已提交
439

S
shawn_he 已提交
440
## call.hasVoiceCapability<sup>7+</sup>
S
shawn_he 已提交
441

S
shawn_he 已提交
442
hasVoiceCapability\(\): boolean
S
shawn_he 已提交
443

S
shawn_he 已提交
444
Checks whether a device supports voice calls.
S
shawn_he 已提交
445 446 447

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

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

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

S
shawn_he 已提交
454
```js
S
shawn_he 已提交
455 456 457 458
let result = call.hasVoiceCapability(); 
console.log(`hasVoiceCapability: ${JSON.stringify(result)}`);
```

S
shawn_he 已提交
459
## call.isEmergencyPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
460

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

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

S
shawn_he 已提交
465 466
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
467
**Parameters**
S
shawn_he 已提交
468

S
shawn_he 已提交
469
| Name     | Type                        | Mandatory| Description                                                        |
S
shawn_he 已提交
470
| ----------- | ---------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
471
| phoneNumber | string                       | Yes  | Phone number.                                                  |
S
shawn_he 已提交
472 473 474
| 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.|

**Error codes**
S
shawn_he 已提交
475

S
shawn_he 已提交
476 477 478 479 480 481 482 483 484
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
485

S
shawn_he 已提交
486
**Example**
S
shawn_he 已提交
487

S
shawn_he 已提交
488
```js
S
shawn_he 已提交
489 490 491 492
call.isEmergencyPhoneNumber("138xxxxxxxx", (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
493 494


S
shawn_he 已提交
495
## call.isEmergencyPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
496

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

S
shawn_he 已提交
499
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 已提交
500

S
shawn_he 已提交
501 502
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
503
**Parameters**
S
shawn_he 已提交
504

S
shawn_he 已提交
505 506 507 508 509 510 511
| Name     | Type                                              | Mandatory| Description                                                        |
| ----------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ |
| 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.|

**Error codes**
S
shawn_he 已提交
512

S
shawn_he 已提交
513 514 515 516 517 518 519 520 521
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
522

S
shawn_he 已提交
523
**Example**
S
shawn_he 已提交
524

S
shawn_he 已提交
525
```js
S
shawn_he 已提交
526
call.isEmergencyPhoneNumber("112", {slotId: 1}, (err, data) => {
S
shawn_he 已提交
527 528 529
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
530 531


S
shawn_he 已提交
532
## call.isEmergencyPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
533

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

S
shawn_he 已提交
536
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 已提交
537

S
shawn_he 已提交
538 539
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
540
**Parameters**
S
shawn_he 已提交
541

S
shawn_he 已提交
542
| Name     | Type                                              | Mandatory| Description          |
S
shawn_he 已提交
543 544
| ----------- | -------------------------------------------------- | ---- | -------------- |
| phoneNumber | string                                             | Yes  | Phone number.    |
S
shawn_he 已提交
545
| options     | [EmergencyNumberOptions](#emergencynumberoptions7) | No  | Phone number.|
S
shawn_he 已提交
546

S
shawn_he 已提交
547
**Return value**
S
shawn_he 已提交
548

S
shawn_he 已提交
549
| Type                  | Description                                               |
S
shawn_he 已提交
550
| ---------------------- | --------------------------------------------------- |
S
shawn_he 已提交
551 552 553
| Promise&lt;boolean&gt; | Promise used to return the result.|

**Error codes**
S
shawn_he 已提交
554

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
564

S
shawn_he 已提交
565
**Example**
S
shawn_he 已提交
566

S
shawn_he 已提交
567
```js
S
shawn_he 已提交
568 569 570 571 572 573 574
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 已提交
575

S
shawn_he 已提交
576
## call.formatPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
577

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

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

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

S
shawn_he 已提交
584 585
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
586
**Parameters**
S
shawn_he 已提交
587

S
shawn_he 已提交
588
| Name     | Type                       | Mandatory| Description                                |
S
shawn_he 已提交
589
| ----------- | --------------------------- | ---- | ------------------------------------ |
S
shawn_he 已提交
590
| phoneNumber | string                      | Yes  | Phone number.                          |
S
shawn_he 已提交
591 592 593
| callback    | AsyncCallback&lt;string&gt; | Yes  | Callback used to return the result.|

**Error codes**
S
shawn_he 已提交
594

S
shawn_he 已提交
595 596 597 598 599 600 601 602 603
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
604

S
shawn_he 已提交
605
**Example**
S
shawn_he 已提交
606

S
shawn_he 已提交
607
```js
S
shawn_he 已提交
608 609 610 611
call.formatPhoneNumber("138xxxxxxxx", (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
612

S
shawn_he 已提交
613
## call.formatPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
614

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

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

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

S
shawn_he 已提交
621 622
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
623
**Parameters**
S
shawn_he 已提交
624

S
shawn_he 已提交
625
| Name     | Type                                        | Mandatory| Description                                |
S
shawn_he 已提交
626 627
| ----------- | -------------------------------------------- | ---- | ------------------------------------ |
| phoneNumber | string                                       | Yes  | Phone number.                          |
S
shawn_he 已提交
628 629 630 631
| options     | [NumberFormatOptions](#numberformatoptions7) | Yes  | Number formatting options, for example, country code.              |
| callback    | AsyncCallback&lt;string&gt;                  | Yes  | Callback used to return the result.|

**Error codes**
S
shawn_he 已提交
632

S
shawn_he 已提交
633 634 635 636 637 638 639 640 641
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
642

S
shawn_he 已提交
643
**Example**
S
shawn_he 已提交
644

S
shawn_he 已提交
645
```js
S
shawn_he 已提交
646
call.formatPhoneNumber("138xxxxxxxx", {
S
shawn_he 已提交
647 648 649 650 651
    countryCode: "CN"
}, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
652 653


S
shawn_he 已提交
654
## call.formatPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
655

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

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

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

S
shawn_he 已提交
662 663
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
664
**Parameters**
S
shawn_he 已提交
665

S
shawn_he 已提交
666
| Name     | Type                                        | Mandatory| Description                  |
S
shawn_he 已提交
667 668
| ----------- | -------------------------------------------- | ---- | ---------------------- |
| phoneNumber | string                                       | Yes  | Phone number.            |
S
shawn_he 已提交
669
| options     | [NumberFormatOptions](#numberformatoptions7) | No  | Number formatting options, for example, country code.|
S
shawn_he 已提交
670

S
shawn_he 已提交
671
**Return value**
S
shawn_he 已提交
672

S
shawn_he 已提交
673
| Type                 | Description                                       |
S
shawn_he 已提交
674
| --------------------- | ------------------------------------------- |
S
shawn_he 已提交
675 676 677
| Promise&lt;string&gt; | Promise used to return the result.|

**Error codes**
S
shawn_he 已提交
678

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
688

S
shawn_he 已提交
689
**Example**
S
shawn_he 已提交
690

S
shawn_he 已提交
691
```js
S
shawn_he 已提交
692 693 694 695 696 697 698 699 700
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 已提交
701

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

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

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

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 已提交
710 711
**System capability**: SystemCapability.Telephony.CallManager

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.                                           |
| countryCode | string                      | Yes  | Country code, for example, **CN** (China). All country codes are supported.             |
S
shawn_he 已提交
718 719 720
| callback    | AsyncCallback&lt;string&gt; | Yes  | Callback used to return the result.|

**Error codes**
S
shawn_he 已提交
721

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
731

S
shawn_he 已提交
732
**Example**
S
shawn_he 已提交
733

S
shawn_he 已提交
734
```js
S
shawn_he 已提交
735
call.formatPhoneNumberToE164("138xxxxxxxx", "CN", (err, data) => {
S
shawn_he 已提交
736 737 738
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
739 740


S
shawn_he 已提交
741
## call.formatPhoneNumberToE164<sup>7+</sup>
S
shawn_he 已提交
742

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

S
shawn_he 已提交
745
Converts a phone number into the E.164 format. This API uses a promise to return the result.
S
shawn_he 已提交
746 747 748 749 750

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.

All country codes are supported.

S
shawn_he 已提交
751 752
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
753
**Parameters**
S
shawn_he 已提交
754

S
shawn_he 已提交
755
| Name     | Type  | Mandatory| Description                                    |
S
shawn_he 已提交
756
| ----------- | ------ | ---- | ---------------------------------------- |
S
shawn_he 已提交
757
| phoneNumber | string | Yes  | Phone number.                              |
S
shawn_he 已提交
758
| countryCode | string | Yes  | Country code, for example, **CN** (China). All country codes are supported.|
S
shawn_he 已提交
759

S
shawn_he 已提交
760
**Return value**
S
shawn_he 已提交
761

S
shawn_he 已提交
762
| Type                 | Description                                                        |
S
shawn_he 已提交
763
| --------------------- | ------------------------------------------------------------ |
S
shawn_he 已提交
764 765 766
| Promise&lt;string&gt; | Promise used to return the result.|

**Error codes**
S
shawn_he 已提交
767

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
777

S
shawn_he 已提交
778
**Example**
S
shawn_he 已提交
779

S
shawn_he 已提交
780
```js
S
shawn_he 已提交
781
let promise = call.formatPhoneNumberToE164("138xxxxxxxx", "CN");
S
shawn_he 已提交
782 783 784 785 786 787
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 已提交
788

S
shawn_he 已提交
789 790
## call.muteRinger<sup>8+</sup>

S
shawn_he 已提交
791
muteRinger\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
792

S
shawn_he 已提交
793
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 已提交
794

S
shawn_he 已提交
795
**System API**: This is a system API.
S
shawn_he 已提交
796 797 798 799 800 801 802 803 804 805 806

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

**Parameters**

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

S
shawn_he 已提交
807
**Error codes**
S
shawn_he 已提交
808

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
813
| 201      | Permission denied.                           |
S
shawn_he 已提交
814
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
815 816 817 818 819 820
| 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 已提交
821 822 823
**Example**

```js
S
shawn_he 已提交
824 825
call.muteRinger((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
826 827 828 829 830 831
});
```


## call.muteRinger<sup>8+</sup>

S
shawn_he 已提交
832
muteRinger\(\): Promise\<void\>
S
shawn_he 已提交
833

S
shawn_he 已提交
834
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 已提交
835

S
shawn_he 已提交
836
**System API**: This is a system API.
S
shawn_he 已提交
837 838 839 840 841 842 843 844 845 846 847

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

**Return value**

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

S
shawn_he 已提交
848
**Error codes**
S
shawn_he 已提交
849

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
855
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
856 857 858 859
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
860 861 862
**Example**

```js
S
shawn_he 已提交
863 864 865
call.muteRinger().then(() => {
    console.log(`muteRinger success.`);
}).catch((err) => {
S
shawn_he 已提交
866 867 868 869 870
    console.error(`muteRinger fail, promise: err->${JSON.stringify(err)}`);
});
```


S
shawn_he 已提交
871
## call.answerCall<sup>9+</sup>
S
shawn_he 已提交
872

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

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

S
shawn_he 已提交
877
**System API**: This is a system API.
S
shawn_he 已提交
878 879 880 881 882 883 884 885 886 887 888 889

**Required permission**: ohos.permission.ANSWER_CALL

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

**Parameters**

| Name  | Type                     | Mandatory| Description                                           |
| -------- | ------------------------- | ---- | ----------------------------------------------- |
| 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 已提交
890
**Error codes**
S
shawn_he 已提交
891

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
897
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
898 899 900 901 902 903
| 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 已提交
904 905 906
**Example**

```js
S
shawn_he 已提交
907 908
call.answerCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
909 910 911 912
});
```


S
shawn_he 已提交
913
## call.answerCall<sup>9+</sup>
S
shawn_he 已提交
914

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

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

S
shawn_he 已提交
919
**System API**: This is a system API.
S
shawn_he 已提交
920 921 922 923 924 925 926 927 928

**Required permission**: ohos.permission.ANSWER_CALL

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

**Parameters**

| Name| Type  | Mandatory| Description                                                        |
| ------ | ------ | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
929
| 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 已提交
930 931 932 933 934 935 936

**Return value**

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
944
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
945 946 947 948 949 950
| 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 已提交
951 952 953
**Example**

```js
S
shawn_he 已提交
954 955 956
call.answerCall(1).then(() => {
    console.log(`answerCall success.`);
}).catch((err) => {
S
shawn_he 已提交
957
    console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
958 959 960 961
});
```


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

S
shawn_he 已提交
964
answerCall\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
965 966

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

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

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

S
shawn_he 已提交
972 973 974 975 976 977 978 979
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
980
**Error codes**
S
shawn_he 已提交
981

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
987
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
988 989 990 991 992 993
| 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 已提交
994 995 996
**Example**

```js
S
shawn_he 已提交
997 998
call.answerCall((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
999 1000 1001 1002
});
```


S
shawn_he 已提交
1003
## call.hangUpCall<sup>9+</sup>
S
shawn_he 已提交
1004

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

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

S
shawn_he 已提交
1009
**System API**: This is a system API.
S
shawn_he 已提交
1010

S
shawn_he 已提交
1011 1012
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1013 1014 1015 1016 1017 1018
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
1022
**Error codes**
S
shawn_he 已提交
1023

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1029
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1030 1031 1032 1033 1034 1035
| 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 已提交
1036 1037 1038
**Example**

```js
S
shawn_he 已提交
1039 1040
call.hangUpCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1041 1042 1043 1044
});
```


S
shawn_he 已提交
1045
## call.hangUpCall<sup>9+</sup>
S
shawn_he 已提交
1046

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

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

S
shawn_he 已提交
1051
**System API**: This is a system API.
S
shawn_he 已提交
1052

S
shawn_he 已提交
1053 1054
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1055 1056 1057 1058 1059 1060
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name| Type  | Mandatory| Description                                                        |
| ------ | ------ | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
1061
| 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 已提交
1062 1063 1064 1065 1066 1067 1068

**Return value**

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1076
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1077 1078 1079 1080 1081 1082
| 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 已提交
1083 1084 1085
**Example**

```js
S
shawn_he 已提交
1086 1087 1088
call.hangUpCall(1).then(() => {
    console.log(`hangUpCall success.`);
}).catch((err) => {
S
shawn_he 已提交
1089
    console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1090 1091 1092 1093
});
```


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

S
shawn_he 已提交
1096
hangUpCall\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1097

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

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

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

S
shawn_he 已提交
1104 1105 1106 1107 1108 1109 1110 1111
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
1112
**Error codes**
S
shawn_he 已提交
1113

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1119
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1120 1121 1122 1123 1124 1125 1126
| 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 已提交
1127 1128 1129
**Example**

```js
S
shawn_he 已提交
1130 1131
call.hangUpCall((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1132 1133 1134 1135
});
```


S
shawn_he 已提交
1136
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1137

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

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

S
shawn_he 已提交
1142
**System API**: This is a system API.
S
shawn_he 已提交
1143

S
shawn_he 已提交
1144 1145
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1146 1147 1148 1149 1150 1151 1152 1153 1154
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                     | Mandatory| Description                                           |
| -------- | ------------------------- | ---- | ----------------------------------------------- |
| 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 已提交
1155
**Error codes**
S
shawn_he 已提交
1156

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1162
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1163 1164 1165 1166 1167 1168
| 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 已提交
1169 1170 1171 1172

**Example**

```js
S
shawn_he 已提交
1173 1174
call.rejectCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1175 1176 1177 1178
});
```


S
shawn_he 已提交
1179
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1180

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

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

S
shawn_he 已提交
1185
**System API**: This is a system API.
S
shawn_he 已提交
1186

S
shawn_he 已提交
1187 1188
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1189 1190 1191 1192 1193 1194 1195 1196 1197 1198
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                          | Mandatory| Description                                           |
| -------- | ---------------------------------------------- | ---- | ----------------------------------------------- |
| 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 已提交
1199
**Error codes**
S
shawn_he 已提交
1200

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1206
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1207 1208 1209 1210 1211 1212
| 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 已提交
1213 1214 1215 1216 1217 1218
**Example**

```js
let rejectMessageOptions={
    messageContent: "Unknown number blocked"
}
S
shawn_he 已提交
1219 1220
call.rejectCall(1, rejectMessageOptions, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1221 1222 1223 1224
});
```


S
shawn_he 已提交
1225
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1226

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

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

S
shawn_he 已提交
1231
**System API**: This is a system API.
S
shawn_he 已提交
1232

S
shawn_he 已提交
1233 1234
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1235 1236 1237 1238 1239 1240
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name | Type                                          | Mandatory| Description                                                        |
| ------- | ---------------------------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
1241 1242
| 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 已提交
1243 1244 1245 1246 1247 1248 1249

**Return value**

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

S
shawn_he 已提交
1250
**Error codes**
S
shawn_he 已提交
1251

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1257
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1258 1259 1260 1261 1262 1263
| 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 已提交
1264 1265 1266 1267 1268 1269
**Example**

```js
let rejectMessageOptions={
    messageContent: "Unknown number blocked"
}
S
shawn_he 已提交
1270 1271 1272 1273
call.reject(1, rejectMessageOptions).then(() => {
    console.log(`reject success.`);
}).catch((err) => {
    console.error(`reject fail, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1274 1275 1276
});
```

S
shawn_he 已提交
1277

S
shawn_he 已提交
1278
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1279

S
shawn_he 已提交
1280
rejectCall\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1281 1282 1283

Rejects a call. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1284
**System API**: This is a system API.
S
shawn_he 已提交
1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295

**Required permission**: ohos.permission.ANSWER_CALL

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

**Parameters**

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

S
shawn_he 已提交
1296
**Error codes**
S
shawn_he 已提交
1297

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

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

**Example**
S
shawn_he 已提交
1311 1312

```js
S
shawn_he 已提交
1313 1314
call.rejectCall((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1315 1316 1317 1318
});
```


S
shawn_he 已提交
1319
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1320

S
shawn_he 已提交
1321
rejectCall\(options: RejectMessageOptions, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1322 1323 1324

Rejects a call. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1325
**System API**: This is a system API.
S
shawn_he 已提交
1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337

**Required permission**: ohos.permission.ANSWER_CALL

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

**Parameters**

| Name  | Type                                          | Mandatory| Description          |
| -------- | ---------------------------------------------- | ---- | -------------- |
| 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 已提交
1338
**Error codes**
S
shawn_he 已提交
1339

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1345
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1346 1347 1348 1349 1350 1351 1352
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**
S
shawn_he 已提交
1353 1354 1355 1356 1357

```js
let rejectMessageOptions={
    messageContent: "Unknown number blocked"
}
S
shawn_he 已提交
1358 1359
call.rejectCall(rejectMessageOptions, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1360 1361 1362 1363
});
```


S
shawn_he 已提交
1364 1365
## call.holdCall<sup>7+</sup>

S
shawn_he 已提交
1366
holdCall\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1367 1368 1369

Holds a call based on the specified call ID. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1370
**System API**: This is a system API.
S
shawn_he 已提交
1371

S
shawn_he 已提交
1372 1373
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1374 1375 1376 1377 1378 1379 1380 1381 1382
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
1383
**Error codes**
S
shawn_he 已提交
1384

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1390
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1391 1392 1393 1394 1395 1396
| 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 已提交
1397 1398 1399
**Example**

```js
S
shawn_he 已提交
1400 1401
call.holdCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1402 1403 1404 1405 1406 1407
});
```


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

S
shawn_he 已提交
1408
holdCall\(callId: number\): Promise\<void\>
S
shawn_he 已提交
1409 1410 1411

Holds a call based on the specified call ID. This API uses a promise to return the result.

S
shawn_he 已提交
1412
**System API**: This is a system API.
S
shawn_he 已提交
1413

S
shawn_he 已提交
1414 1415
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429
**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.|

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1437
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1438 1439 1440 1441 1442 1443
| 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 已提交
1444 1445 1446
**Example**

```js
S
shawn_he 已提交
1447 1448 1449
call.holdCall(1).then(() => {
    console.log(`holdCall success.`);
}).catch((err) => {
S
shawn_he 已提交
1450 1451 1452 1453 1454 1455
    console.error(`holdCall fail, promise: err->${JSON.stringify(err)}`);
});
```

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

S
shawn_he 已提交
1456
unHoldCall\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1457 1458 1459

Unholds a call based on the specified call ID. This API uses an asynchronous callback to return the result.

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

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

S
shawn_he 已提交
1464 1465 1466 1467 1468 1469 1470 1471 1472
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
1473
**Error codes**
S
shawn_he 已提交
1474

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1480
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1481 1482 1483 1484 1485 1486
| 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 已提交
1487 1488 1489
**Example**

```js
S
shawn_he 已提交
1490 1491
call.unHoldCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1492 1493 1494 1495 1496 1497
});
```


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

S
shawn_he 已提交
1498
unHoldCall\(callId: number\): Promise\<void\>
S
shawn_he 已提交
1499 1500 1501

Unholds a call based on the specified call ID. This API uses a promise to return the result.

S
shawn_he 已提交
1502
**System API**: This is a system API.
S
shawn_he 已提交
1503

S
shawn_he 已提交
1504 1505
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519
**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.|

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1527
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1528 1529 1530 1531 1532 1533
| 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 已提交
1534 1535 1536
**Example**

```js
S
shawn_he 已提交
1537 1538 1539
call.unHoldCall(1).then(() => {
    console.log(`unHoldCall success.`);
}).catch((err) => {
S
shawn_he 已提交
1540 1541 1542 1543 1544 1545
    console.error(`unHoldCall fail, promise: err->${JSON.stringify(err)}`);
});
```

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

S
shawn_he 已提交
1546
switchCall\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1547 1548 1549

Switches a call. This API uses an asynchronous callback to return the result.

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

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

S
shawn_he 已提交
1554 1555 1556 1557 1558 1559 1560 1561 1562
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
1563
**Error codes**
S
shawn_he 已提交
1564

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1570
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1571 1572 1573 1574 1575 1576
| 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 已提交
1577 1578 1579
**Example**

```js
S
shawn_he 已提交
1580 1581
call.switchCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1582 1583 1584 1585 1586 1587
});
```


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

S
shawn_he 已提交
1588
switchCall\(callId: number\): Promise\<void\>
S
shawn_he 已提交
1589 1590 1591

Switches a call. This API uses a promise to return the result.

S
shawn_he 已提交
1592
**System API**: This is a system API.
S
shawn_he 已提交
1593

S
shawn_he 已提交
1594 1595
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609
**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.|

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1617
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1618 1619 1620 1621 1622 1623
| 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 已提交
1624 1625 1626
**Example**

```js
S
shawn_he 已提交
1627 1628 1629
call.switchCall(1).then(() => {
    console.log(`switchCall success.`);
}).catch((err) => {
S
shawn_he 已提交
1630 1631 1632 1633 1634 1635
    console.error(`switchCall fail, promise: err->${JSON.stringify(err)}`);
});
```

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

S
shawn_he 已提交
1636
combineConference\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1637 1638 1639

Combines two calls into a conference call. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1640
**System API**: This is a system API.
S
shawn_he 已提交
1641 1642 1643 1644 1645 1646 1647 1648 1649 1650

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

**Parameters**

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

S
shawn_he 已提交
1651
**Error codes**
S
shawn_he 已提交
1652

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1657
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1658 1659 1660 1661 1662
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
1663 1664 1665
**Example**

```js
S
shawn_he 已提交
1666 1667
call.combineConference(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1668 1669 1670 1671 1672 1673
});
```


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

S
shawn_he 已提交
1674
combineConference\(callId: number\): Promise\<void\>
S
shawn_he 已提交
1675 1676 1677

Combines two calls into a conference call. This API uses a promise to return the result.

S
shawn_he 已提交
1678
**System API**: This is a system API.
S
shawn_he 已提交
1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693

**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.|

S
shawn_he 已提交
1694
**Error codes**
S
shawn_he 已提交
1695

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1700
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1701 1702 1703 1704 1705
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
1706 1707 1708
**Example**

```js
S
shawn_he 已提交
1709 1710 1711
call.combineConference(1).then(() => {
    console.log(`combineConference success.`);
}).catch((err) => {
S
shawn_he 已提交
1712 1713 1714 1715 1716 1717
    console.error(`combineConference fail, promise: err->${JSON.stringify(err)}`);
});
```

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

S
shawn_he 已提交
1718
getMainCallId\(callId: number, callback: AsyncCallback\<number\>\): void
S
shawn_he 已提交
1719 1720 1721

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

S
shawn_he 已提交
1722
**System API**: This is a system API.
S
shawn_he 已提交
1723 1724 1725 1726 1727 1728 1729 1730 1731 1732

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

**Parameters**

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

S
shawn_he 已提交
1733
**Error codes**
S
shawn_he 已提交
1734

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1739
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1740 1741 1742 1743 1744 1745
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |


S
shawn_he 已提交
1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756
**Example**

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


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

S
shawn_he 已提交
1757
getMainCallId\(callId: number\): Promise\<number\>
S
shawn_he 已提交
1758 1759 1760

Obtains the main call ID. This API uses a promise to return the result.

S
shawn_he 已提交
1761
**System API**: This is a system API.
S
shawn_he 已提交
1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776

**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.|

S
shawn_he 已提交
1777
**Error codes**
S
shawn_he 已提交
1778

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1783
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1784 1785 1786 1787
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
S
shawn_he 已提交
1788

S
shawn_he 已提交
1789

S
shawn_he 已提交
1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802
**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)}`);
});
```

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

S
shawn_he 已提交
1803
getSubCallIdList\(callId: number, callback: AsyncCallback\<Array\<string\>\>\): void
S
shawn_he 已提交
1804 1805 1806

Obtains the list of subcall IDs. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1807
**System API**: This is a system API.
S
shawn_he 已提交
1808 1809 1810 1811 1812 1813 1814 1815 1816 1817

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

**Parameters**

| Name  | Type                          | Mandatory| Description                        |
| -------- | ------------------------------ | ---- | ---------------------------- |
| callId   | number                         | Yes  | Call ID.                    |
| callback | AsyncCallback<Array<string\>\> | Yes  | Callback used to return the result.  |

S
shawn_he 已提交
1818
**Error codes**
S
shawn_he 已提交
1819

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1824
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1825 1826 1827 1828 1829
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840
**Example**

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


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

S
shawn_he 已提交
1841
getSubCallIdList\(callId: number\): Promise\<Array\<string\>\>
S
shawn_he 已提交
1842 1843 1844

Obtains the list of subcall IDs. This API uses a promise to return the result.

S
shawn_he 已提交
1845
**System API**: This is a system API.
S
shawn_he 已提交
1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860

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

**Parameters**

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

**Return value**

| Type                         | Description                               |
| ----------------------------- | ----------------------------------- |
| Promise&lt;Array<string\>&gt; | Promise used to return the result.|

S
shawn_he 已提交
1861
**Error codes**
S
shawn_he 已提交
1862

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1867
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1868 1869 1870 1871 1872
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885
**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)}`);
});
```

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

S
shawn_he 已提交
1886
getCallIdListForConference\(callId: number, callback: AsyncCallback\<Array\<string\>\>\): void
S
shawn_he 已提交
1887 1888 1889

Obtains the list of call IDs in a conference. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1890
**System API**: This is a system API.
S
shawn_he 已提交
1891 1892 1893 1894 1895 1896 1897 1898 1899 1900

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

**Parameters**

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

S
shawn_he 已提交
1901
**Error codes**
S
shawn_he 已提交
1902

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1907
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1908 1909 1910 1911 1912
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923
**Example**

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


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

S
shawn_he 已提交
1924
getCallIdListForConference\(callId: number\): Promise\<Array\<string\>\>
S
shawn_he 已提交
1925 1926 1927

Obtains the list of call IDs in a conference. This API uses a promise to return the result.

S
shawn_he 已提交
1928
**System API**: This is a system API.
S
shawn_he 已提交
1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943

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

**Parameters**

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

**Return value**

| Type                         | Description                                   |
| ----------------------------- | --------------------------------------- |
| Promise&lt;Array<string\>&gt; | Promise used to return the result.|

S
shawn_he 已提交
1944
**Error codes**
S
shawn_he 已提交
1945

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1950
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1951 1952 1953 1954 1955
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968
**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)}`);
});
```

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

S
shawn_he 已提交
1969
getCallWaitingStatus\(slotId: number, callback: AsyncCallback\<CallWaitingStatus\>\): void
S
shawn_he 已提交
1970 1971 1972

Obtains the call waiting status. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1973
**System API**: This is a system API.
S
shawn_he 已提交
1974

S
shawn_he 已提交
1975 1976
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
1977 1978 1979 1980 1981 1982
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                                       | Mandatory| Description                                                        |
| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
1983 1984 1985 1986
| 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.|

**Error codes**
S
shawn_he 已提交
1987

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1993
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1994 1995 1996 1997
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
S
shawn_he 已提交
1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009

**Example**

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


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

S
shawn_he 已提交
2010
getCallWaitingStatus\(slotId: number\): Promise\<CallWaitingStatus\>
S
shawn_he 已提交
2011 2012 2013

Obtains the call waiting status. This API uses a promise to return the result.

S
shawn_he 已提交
2014
**System API**: This is a system API.
S
shawn_he 已提交
2015

S
shawn_he 已提交
2016 2017
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031
**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|

**Return value**

| Type                                                   | Description                                                        |
| ------------------------------------------------------- | ------------------------------------------------------------ |
| 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 已提交
2032
**Error codes**
S
shawn_he 已提交
2033

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2039
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2040 2041 2042 2043 2044
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057
**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)}`);
});
```

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

S
shawn_he 已提交
2058
setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
2059 2060 2061

Sets the call waiting switch. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2062
**System API**: This is a system API.
S
shawn_he 已提交
2063

S
shawn_he 已提交
2064 2065
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2066 2067 2068 2069 2070 2071 2072 2073 2074 2075
**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                      |
| 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 已提交
2076
**Error codes**
S
shawn_he 已提交
2077

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2083
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2084 2085 2086 2087 2088
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
2089 2090 2091
**Example**

```js
S
shawn_he 已提交
2092 2093
call.setCallWaiting(0, true, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2094 2095 2096 2097 2098 2099
});
```


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

S
shawn_he 已提交
2100
setCallWaiting\(slotId: number, activate: boolean\): Promise\<void\>
S
shawn_he 已提交
2101 2102 2103

Sets the call waiting switch. This API uses a promise to return the result.

S
shawn_he 已提交
2104
**System API**: This is a system API.
S
shawn_he 已提交
2105

S
shawn_he 已提交
2106 2107
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122
**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                      |
| activate | boolean | Yes  | Whether to enable call waiting.<br>- **false**: Disable call waiting.<br>- **true**: Enable call waiting.|

**Return value**

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

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

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2130
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2131 2132 2133 2134 2135
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
2136 2137 2138
**Example**

```js
S
shawn_he 已提交
2139 2140 2141
call.setCallWaiting(0, true).then(() => {
    console.log(`setCallWaiting success.`);
}).catch((err) => {
S
shawn_he 已提交
2142 2143 2144 2145 2146 2147
    console.error(`setCallWaiting fail, promise: err->${JSON.stringify(err)}`);
});
```

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

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

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

S
shawn_he 已提交
2152
**System API**: This is a system API.
S
shawn_he 已提交
2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163

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

**Parameters**

| Name   | Type                | Mandatory| Description      |
| --------- | -------------------- | ---- | ---------- |
| callId    | number               | Yes  | Call ID.  |
| character | string               | Yes  | DTMF code.  |
| callback  | AsyncCallback<void\> | Yes  | Callback used to return the result.|

S
shawn_he 已提交
2164
**Error codes**
S
shawn_he 已提交
2165

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2170
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2171 2172 2173 2174 2175
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
2176 2177 2178
**Example**

```js
S
shawn_he 已提交
2179 2180
call.startDTMF(1, "0", (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2181 2182 2183 2184 2185 2186
});
```


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

S
shawn_he 已提交
2187
startDTMF\(callId: number, character: string\): Promise\<void\>
S
shawn_he 已提交
2188 2189 2190

Enables DTMF. This API uses a promise to return the result.

S
shawn_he 已提交
2191
**System API**: This is a system API.
S
shawn_he 已提交
2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207

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

**Parameters**

| Name   | Type  | Mandatory| Description    |
| --------- | ------ | ---- | -------- |
| callId    | number | Yes  | Call ID.|
| character | string | Yes  | DTMF code.|

**Return value**

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

S
shawn_he 已提交
2208
**Error codes**
S
shawn_he 已提交
2209

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2214
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2215 2216 2217 2218 2219
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
2220 2221 2222
**Example**

```js
S
shawn_he 已提交
2223 2224 2225
call.startDTMF(1, "0").then(() => {
    console.log(`startDTMF success.`);
}).catch((err) => {
S
shawn_he 已提交
2226 2227 2228 2229 2230 2231
    console.error(`startDTMF fail, promise: err->${JSON.stringify(err)}`);
});
```

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

S
shawn_he 已提交
2232
stopDTMF\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
2233 2234 2235

Stops DTMF. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2236
**System API**: This is a system API.
S
shawn_he 已提交
2237 2238 2239 2240 2241 2242 2243 2244 2245 2246

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

**Parameters**

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

S
shawn_he 已提交
2247
**Error codes**
S
shawn_he 已提交
2248

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2253
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2254 2255 2256 2257 2258
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
2259 2260 2261
**Example**

```js
S
shawn_he 已提交
2262 2263
call.stopDTMF(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2264 2265 2266 2267 2268 2269
});
```


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

S
shawn_he 已提交
2270
stopDTMF\(callId: number\): Promise\<void\>
S
shawn_he 已提交
2271 2272 2273

Stops DTMF. This API uses a promise to return the result.

S
shawn_he 已提交
2274
**System API**: This is a system API.
S
shawn_he 已提交
2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289

**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.|

S
shawn_he 已提交
2290
**Error codes**
S
shawn_he 已提交
2291

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2296
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2297 2298 2299 2300 2301
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
2302 2303 2304
**Example**

```js
S
shawn_he 已提交
2305 2306 2307
call.stopDTMF(1).then(() => {
    console.log(`stopDTMF success.`);
}).catch((err) => {
S
shawn_he 已提交
2308 2309 2310 2311 2312 2313
    console.error(`stopDTMF fail, promise: err->${JSON.stringify(err)}`);
});
```

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

S
shawn_he 已提交
2314
isInEmergencyCall\(callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
2315 2316 2317

Checks whether a call is an emergency call. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2318
**System API**: This is a system API.
S
shawn_he 已提交
2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

**Parameters**

| Name  | Type                        | Mandatory| Description      |
| -------- | ---------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.|

S
shawn_he 已提交
2330
**Error codes**
S
shawn_he 已提交
2331

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2337
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2338 2339 2340 2341 2342 2343
| 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 已提交
2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354
**Example**

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


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

S
shawn_he 已提交
2355
isInEmergencyCall\(\): Promise\<boolean\>
S
shawn_he 已提交
2356 2357 2358

Checks whether a call is an emergency call. This API uses a promise to return the result.

S
shawn_he 已提交
2359
**System API**: This is a system API.
S
shawn_he 已提交
2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

**Return value**

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

S
shawn_he 已提交
2371
**Error codes**
S
shawn_he 已提交
2372

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2378
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2379 2380 2381 2382
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395
**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)}`);
});
```

## call.on('callDetailsChange')<sup>7+</sup>

S
shawn_he 已提交
2396
on\(type: 'callDetailsChange', callback: Callback\<CallAttributeOptions\>\): void
S
shawn_he 已提交
2397 2398 2399

Subscribes to **callDetailsChange** events. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2400
**System API**: This is a system API.
S
shawn_he 已提交
2401

S
shawn_he 已提交
2402 2403
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2404 2405 2406 2407 2408 2409
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2413
**Error codes**
S
shawn_he 已提交
2414

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2420
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2421 2422 2423 2424 2425 2426
| 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 已提交
2427 2428 2429
**Example**

```js
S
shawn_he 已提交
2430 2431
call.on('callDetailsChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2432 2433 2434 2435 2436
});
```

## call.on('callEventChange')<sup>8+</sup>

S
shawn_he 已提交
2437
on\(type: 'callEventChange', callback: Callback\<CallEventOptions\>\): void
S
shawn_he 已提交
2438 2439 2440

Subscribes to **callEventChange** events. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2441
**System API**: This is a system API.
S
shawn_he 已提交
2442

S
shawn_he 已提交
2443 2444
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2445 2446 2447 2448 2449 2450
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2454
**Error codes**
S
shawn_he 已提交
2455

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2461
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2462 2463 2464 2465 2466 2467
| 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 已提交
2468 2469 2470
**Example**

```js
S
shawn_he 已提交
2471 2472
call.on('callEventChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2473 2474 2475 2476 2477
});
```

## call.on('callDisconnectedCause')<sup>8+</sup>

S
shawn_he 已提交
2478
on\(type: 'callDisconnectedCause', callback: Callback\<DisconnectedDetails\>\): void
S
shawn_he 已提交
2479 2480 2481

Subscribes to **callDisconnectedCause** events. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2482
**System API**: This is a system API.
S
shawn_he 已提交
2483

S
shawn_he 已提交
2484 2485
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2486 2487 2488 2489 2490 2491
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2495
**Error codes**
S
shawn_he 已提交
2496

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2502
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2503 2504 2505 2506 2507 2508
| 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 已提交
2509 2510 2511
**Example**

```js
S
shawn_he 已提交
2512 2513
call.on('callDisconnectedCause', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2514 2515 2516 2517 2518
});
```

## call.on('mmiCodeResult')<sup>9+</sup>

S
shawn_he 已提交
2519
on\(type: 'mmiCodeResult', callback: Callback\<MmiCodeResults\>\): void
S
shawn_he 已提交
2520 2521 2522

Subscribes to **mmiCodeResult** events. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2523
**System API**: This is a system API.
S
shawn_he 已提交
2524

S
shawn_he 已提交
2525 2526
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2527 2528 2529 2530 2531 2532
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2536
**Error codes**
S
shawn_he 已提交
2537

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2543
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2544 2545 2546 2547 2548 2549
| 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 已提交
2550 2551 2552
**Example**

```js
S
shawn_he 已提交
2553 2554
call.on('mmiCodeResult', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2555 2556 2557 2558 2559
});
```

## call.off('callDetailsChange')<sup>7+</sup>

S
shawn_he 已提交
2560
off\(type: 'callDetailsChange', callback?: Callback\<CallAttributeOptions\>\): void
S
shawn_he 已提交
2561 2562 2563

Unsubscribes from **callDetailsChange** events. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2564
**System API**: This is a system API.
S
shawn_he 已提交
2565

S
shawn_he 已提交
2566 2567
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2568 2569 2570 2571 2572 2573
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                                    | Mandatory| Description                              |
| -------- | -------------------------------------------------------- | ---- | ---------------------------------- |
S
shawn_he 已提交
2574
| type     | string                                                   | Yes  | Call details change. This field has a fixed value of **callDetailsChange**.|
S
shawn_he 已提交
2575
| 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 已提交
2576

S
shawn_he 已提交
2577
**Error codes**
S
shawn_he 已提交
2578

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2584
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2585 2586 2587 2588 2589 2590
| 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 已提交
2591 2592 2593
**Example**

```js
S
shawn_he 已提交
2594 2595
call.off('callDetailsChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2596 2597 2598 2599 2600
});
```

## call.off('callEventChange')<sup>8+</sup>

S
shawn_he 已提交
2601
off\(type: 'callEventChange', callback?: Callback\<CallEventOptions\>\): void
S
shawn_he 已提交
2602 2603 2604

Unsubscribes from **callEventChange** events. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2605
**System API**: This is a system API.
S
shawn_he 已提交
2606

S
shawn_he 已提交
2607 2608
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2609 2610 2611 2612 2613 2614
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                            | Mandatory| Description                              |
| -------- | ------------------------------------------------ | ---- | ---------------------------------- |
S
shawn_he 已提交
2615
| type     | string                                           | Yes  | Call event change. This field has a fixed value of **callEventChange**.|
S
shawn_he 已提交
2616
| 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 已提交
2617

S
shawn_he 已提交
2618
**Error codes**
S
shawn_he 已提交
2619

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2625
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2626 2627 2628 2629 2630 2631
| 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 已提交
2632 2633 2634
**Example**

```js
S
shawn_he 已提交
2635 2636
call.off('callEventChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2637 2638 2639 2640 2641
});
```

## call.off('callDisconnectedCause')<sup>8+</sup>

S
shawn_he 已提交
2642
off\(type: 'callDisconnectedCause', callback?: Callback\<DisconnectedDetails\>\): void
S
shawn_he 已提交
2643 2644 2645

Unsubscribes from **callDisconnectedCause** events. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2646
**System API**: This is a system API.
S
shawn_he 已提交
2647

S
shawn_he 已提交
2648 2649
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2650 2651 2652 2653 2654
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                                      | Mandatory| Description                |
S
shawn_he 已提交
2655
| -------- | ---------------------------------------------------------- | ---- | ------------------- |
S
shawn_he 已提交
2656
| type     | string                                                     | Yes  | Call disconnection cause. This field has a fixed value of **callDisconnectedCause**.|
S
shawn_he 已提交
2657
| 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 已提交
2658

S
shawn_he 已提交
2659
**Error codes**
S
shawn_he 已提交
2660

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2666
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2667 2668 2669 2670 2671 2672
| 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 已提交
2673 2674 2675
**Example**

```js
S
shawn_he 已提交
2676 2677
call.off('callDisconnectedCause', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2678 2679 2680 2681 2682
});
```

## call.off('mmiCodeResult')<sup>9+</sup>

S
shawn_he 已提交
2683
off\(type: 'mmiCodeResult', callback?: Callback\<MmiCodeResults\>\): void
S
shawn_he 已提交
2684 2685 2686

Unsubscribes from **mmiCodeResult** events. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2687
**System API**: This is a system API.
S
shawn_he 已提交
2688

S
shawn_he 已提交
2689 2690
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2691 2692 2693 2694
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

S
shawn_he 已提交
2695
| Name  | Type                                             | Mandatory| Description       |
S
shawn_he 已提交
2696
| -------- | ------------------------------------------------ | ---- | ----------- |
S
shawn_he 已提交
2697
| type     | string                                           | Yes  | MMI code result. This field has a fixed value of **mmiCodeResult**.|
S
shawn_he 已提交
2698
| 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 已提交
2699

S
shawn_he 已提交
2700
**Error codes**
S
shawn_he 已提交
2701

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2707
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2708 2709 2710 2711 2712 2713
| 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 已提交
2714 2715 2716
**Example**

```js
S
shawn_he 已提交
2717 2718
call.off('mmiCodeResult', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2719 2720 2721 2722 2723
});
```

## call.isNewCallAllowed<sup>8+</sup>

S
shawn_he 已提交
2724
isNewCallAllowed\(callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
2725 2726 2727

Checks whether a new call is allowed. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2728
**System API**: This is a system API.
S
shawn_he 已提交
2729 2730 2731 2732 2733 2734 2735 2736 2737

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

**Parameters**

| Name  | Type                        | Mandatory| Description      |
| -------- | ---------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.|

S
shawn_he 已提交
2738
**Error codes**
S
shawn_he 已提交
2739

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2744
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2745 2746 2747 2748 2749 2750
| 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 已提交
2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761
**Example**

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


## call.isNewCallAllowed<sup>8+</sup>

S
shawn_he 已提交
2762
isNewCallAllowed\(\): Promise\<boolean\>
S
shawn_he 已提交
2763 2764 2765

Checks whether a new call is allowed. This API uses a promise to return the result.

S
shawn_he 已提交
2766
**System API**: This is a system API.
S
shawn_he 已提交
2767 2768 2769 2770 2771 2772 2773 2774 2775

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

**Return value**

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

S
shawn_he 已提交
2776
**Error codes**
S
shawn_he 已提交
2777

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2782
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2783 2784 2785 2786
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799
**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)}`);
});
```

## call.separateConference<sup>8+</sup>

S
shawn_he 已提交
2800
separateConference\(callId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
2801

S
shawn_he 已提交
2802
Separates calls from a conference call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2803

S
shawn_he 已提交
2804
**System API**: This is a system API.
S
shawn_he 已提交
2805 2806 2807 2808 2809 2810 2811 2812 2813 2814

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

**Parameters**

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

S
shawn_he 已提交
2815
**Error codes**
S
shawn_he 已提交
2816

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2821
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2822 2823 2824 2825 2826 2827
| 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 已提交
2828 2829 2830
**Example**

```js
S
shawn_he 已提交
2831 2832
call.separateConference(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2833 2834 2835 2836 2837 2838
});
```


## call.separateConference<sup>8+</sup>

S
shawn_he 已提交
2839
separateConference\(callId: number\): Promise\<void\>
S
shawn_he 已提交
2840

S
shawn_he 已提交
2841
Separates calls from a conference call. This API uses a promise to return the result.
S
shawn_he 已提交
2842

S
shawn_he 已提交
2843
**System API**: This is a system API.
S
shawn_he 已提交
2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858

**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.|

S
shawn_he 已提交
2859
**Error codes**
S
shawn_he 已提交
2860

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
2865
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2866 2867 2868 2869 2870 2871
| 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 已提交
2872 2873 2874
**Example**

```js
S
shawn_he 已提交
2875 2876 2877
call.separateConference(1).then(() => {
    console.log(`separateConference success.`);
}).catch((err) => {
S
shawn_he 已提交
2878 2879 2880 2881 2882 2883
    console.error(`separateConference fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.getCallRestrictionStatus<sup>8+</sup>

S
shawn_he 已提交
2884
getCallRestrictionStatus\(slotId: number, type: CallRestrictionType, callback: AsyncCallback\<RestrictionStatus\>\): void
S
shawn_he 已提交
2885 2886 2887

Obtains the call restriction status. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2888
**System API**: This is a system API.
S
shawn_he 已提交
2889

S
shawn_he 已提交
2890 2891
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
2892 2893 2894 2895 2896 2897 2898 2899 2900 2901
**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|
| type     | [CallRestrictionType](#callrestrictiontype8)                 | Yes  | Call restriction type.                       |
| callback | AsyncCallback&lt;[RestrictionStatus](#restrictionstatus8)&gt; | Yes  | Callback used to return the result.                |

S
shawn_he 已提交
2902
**Error codes**
S
shawn_he 已提交
2903

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2909
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2910 2911 2912 2913 2914
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925
**Example**

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


## call.getCallRestrictionStatus<sup>8+</sup>

S
shawn_he 已提交
2926
getCallRestrictionStatus\(slotId: number, type: CallRestrictionType\): Promise\<RestrictionStatus\>
S
shawn_he 已提交
2927 2928 2929

Obtains the call restriction status. This API uses a promise to return the result.

S
shawn_he 已提交
2930
**System API**: This is a system API.
S
shawn_he 已提交
2931

S
shawn_he 已提交
2932 2933
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948
**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|
| type   | [CallRestrictionType](#callrestrictiontype8) | Yes  | Call restriction type.                       |

**Return value**

| Type                                                   | Description                       |
| ------------------------------------------------------- | --------------------------- |
| Promise&lt;[RestrictionStatus](#restrictionstatus8)&gt; | Promise used to return the result.|

S
shawn_he 已提交
2949
**Error codes**
S
shawn_he 已提交
2950

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2956
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2957 2958 2959 2960 2961
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974
**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)}`);
});
```

## call.setCallRestriction<sup>8+</sup>

S
shawn_he 已提交
2975
setCallRestriction\(slotId: number, info: CallRestrictionInfo, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
2976 2977 2978

Sets the call restriction status. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2979
**System API**: This is a system API.
S
shawn_he 已提交
2980

S
shawn_he 已提交
2981 2982
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2983 2984 2985 2986 2987 2988 2989 2990 2991 2992
**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|
| info     | [CallRestrictionInfo](#callrestrictioninfo8) | Yes  | Call restriction information.                        |
| callback | AsyncCallback&lt;void&gt;                   | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
2993
**Error codes**
S
shawn_he 已提交
2994

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3000
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3001 3002 3003 3004 3005
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
3006 3007 3008 3009 3010 3011 3012 3013
**Example**

```js
let callRestrictionInfo={
    type: 1,
    password: "123456",
    mode: 1
}
S
shawn_he 已提交
3014 3015
call.setCallRestriction(0, callRestrictionInfo, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3016 3017 3018 3019 3020 3021
});
```


## call.setCallRestriction<sup>8+</sup>

S
shawn_he 已提交
3022
setCallRestriction\(slotId: number, info: CallRestrictionInfo\): Promise\<void\>
S
shawn_he 已提交
3023 3024 3025

Sets the call restriction status. This API uses a promise to return the result.

S
shawn_he 已提交
3026
**System API**: This is a system API.
S
shawn_he 已提交
3027

S
shawn_he 已提交
3028 3029
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044
**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|
| info   | [CallRestrictionInfo](#callrestrictioninfo8) | Yes  | Call restriction information.                        |

**Return value**

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

S
shawn_he 已提交
3045
**Error codes**
S
shawn_he 已提交
3046

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3052
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3053 3054 3055 3056 3057
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
3058 3059 3060 3061 3062 3063 3064 3065
**Example**

```js
let callRestrictionInfo={
    type: 1,
    password: "123456",
    mode: 1
}
S
shawn_he 已提交
3066 3067 3068
call.setCallRestriction(0, callRestrictionInfo).then(() => {
    console.log(`setCallRestriction success.`);
}).catch((err) => {
S
shawn_he 已提交
3069 3070 3071 3072 3073 3074
    console.error(`setCallRestriction fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.getCallTransferInfo<sup>8+</sup>

S
shawn_he 已提交
3075
getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCallback\<CallTransferResult\>\): void
S
shawn_he 已提交
3076 3077 3078

Obtains call transfer information. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3079
**System API**: This is a system API.
S
shawn_he 已提交
3080

S
shawn_he 已提交
3081 3082
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
3083 3084 3085 3086 3087 3088 3089 3090 3091 3092
**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|
| type     | [CallTransferType](#calltransfertype8)                       | Yes  | Call transfer type.                        |
| callback | AsyncCallback&lt;[CallTransferResult](#calltransferresult8)&gt; | Yes  | Callback used to return the result.            |

S
shawn_he 已提交
3093
**Error codes**
S
shawn_he 已提交
3094

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3100
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3101 3102 3103 3104 3105
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
3106 3107 3108
**Example**

```js
S
shawn_he 已提交
3109
call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY, (err, data) => {
S
shawn_he 已提交
3110 3111 3112 3113 3114 3115 3116
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## call.getCallTransferInfo<sup>8+</sup>

S
shawn_he 已提交
3117
getCallTransferInfo\(slotId: number, type: CallTransferType\): Promise\<CallTransferResult\>
S
shawn_he 已提交
3118 3119 3120

Obtains call transfer information. This API uses a promise to return the result.

S
shawn_he 已提交
3121
**System API**: This is a system API.
S
shawn_he 已提交
3122

S
shawn_he 已提交
3123 3124
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139
**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|
| type   | [CallTransferType](#calltransfertype8) | Yes  | Call transfer type.                        |

**Return value**

| Type                                                     | Description                       |
| --------------------------------------------------------- | --------------------------- |
| Promise&lt;[CallTransferResult](#calltransferresult8)&gt; | Promise used to return the result.|

S
shawn_he 已提交
3140
**Error codes**
S
shawn_he 已提交
3141

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3147
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3148 3149 3150 3151 3152
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
3153 3154 3155
**Example**

```js
S
shawn_he 已提交
3156
let promise = call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY);
S
shawn_he 已提交
3157 3158 3159 3160 3161 3162 3163 3164 3165
promise.then(data => {
    console.log(`getCallTransferInfo success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getCallTransferInfo fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.setCallTransfer<sup>8+</sup>

S
shawn_he 已提交
3166
setCallTransfer\(slotId: number, info: CallTransferInfo, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3167 3168 3169

Sets call transfer information. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3170
**System API**: This is a system API.
S
shawn_he 已提交
3171

S
shawn_he 已提交
3172 3173
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3174 3175 3176 3177 3178 3179 3180 3181 3182 3183
**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|
| info     | [CallTransferInfo](#calltransferinfo8) | Yes  | Call transfer information.                       |
| callback | AsyncCallback&lt;void&gt;             | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
3184
**Error codes**
S
shawn_he 已提交
3185

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3191
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3192 3193 3194 3195 3196
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
3197 3198 3199 3200 3201 3202 3203 3204
**Example**

```js
let callTransferInfo={
    transferNum: "111",
    type: 1,
    settingType: 1
}
S
shawn_he 已提交
3205 3206
call.setCallTransfer(0, callTransferInfo, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3207 3208 3209 3210 3211 3212
});
```


## call.setCallTransfer<sup>8+</sup>

S
shawn_he 已提交
3213
setCallTransfer\(slotId: number, info: CallTransferInfo\): Promise\<void\>
S
shawn_he 已提交
3214 3215 3216

Sets call transfer information. This API uses a promise to return the result.

S
shawn_he 已提交
3217
**System API**: This is a system API.
S
shawn_he 已提交
3218

S
shawn_he 已提交
3219 3220
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235
**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|
| info   | [CallTransferInfo](#calltransferinfo8) | Yes  | Call transfer information.                       |

**Return value**

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

S
shawn_he 已提交
3236
**Error codes**
S
shawn_he 已提交
3237

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3243
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3244 3245 3246 3247 3248
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |

S
shawn_he 已提交
3249 3250 3251 3252 3253 3254 3255 3256
**Example**

```js
let callTransferInfo={
    transferNum: "111",
    type: 1,
    settingType: 1
}
S
shawn_he 已提交
3257 3258 3259
call.setCallTransfer(0, callTransferInfo).then(() => {
    console.log(`setCallTransfer success.`);
}).catch((err) => {
S
shawn_he 已提交
3260 3261 3262 3263 3264 3265
    console.error(`setCallTransfer fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.isRinging<sup>8+</sup>

S
shawn_he 已提交
3266
isRinging\(callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
3267 3268 3269

Checks whether the ringtone is playing. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3270
**System API**: This is a system API.
S
shawn_he 已提交
3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

**Parameters**

| Name  | Type                        | Mandatory| Description      |
| -------- | ---------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.|

S
shawn_he 已提交
3282
**Error codes**
S
shawn_he 已提交
3283

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3289
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3290 3291 3292 3293 3294 3295
| 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 已提交
3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306
**Example**

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


## call.isRinging<sup>8+</sup>

S
shawn_he 已提交
3307
isRinging\(\): Promise\<boolean\>
S
shawn_he 已提交
3308 3309 3310

Checks whether the ringtone is playing. This API uses a promise to return the result.

S
shawn_he 已提交
3311
**System API**: This is a system API.
S
shawn_he 已提交
3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

**Return value**

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

S
shawn_he 已提交
3323
**Error codes**
S
shawn_he 已提交
3324

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3330
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3331 3332 3333 3334
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347
**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)}`);
});
```

## call.setMuted<sup>8+</sup>

S
shawn_he 已提交
3348
setMuted\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3349 3350 3351

Sets call muting. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3352
**System API**: This is a system API.
S
shawn_he 已提交
3353 3354 3355 3356 3357 3358 3359 3360 3361

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

**Parameters**

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

S
shawn_he 已提交
3362
**Error codes**
S
shawn_he 已提交
3363

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3368
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3369 3370 3371 3372 3373 3374
| 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 已提交
3375 3376 3377
**Example**

```js
S
shawn_he 已提交
3378 3379
call.setMuted((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3380 3381 3382 3383 3384 3385
});
```


## call.setMuted<sup>8+</sup>

S
shawn_he 已提交
3386
setMuted\(\): Promise\<void\>
S
shawn_he 已提交
3387 3388 3389

Sets call muting. This API uses a promise to return the result.

S
shawn_he 已提交
3390
**System API**: This is a system API.
S
shawn_he 已提交
3391 3392 3393 3394 3395 3396 3397 3398 3399

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

**Return value**

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

S
shawn_he 已提交
3400
**Error codes**
S
shawn_he 已提交
3401

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3406
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3407 3408 3409 3410
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
3411 3412 3413
**Example**

```js
S
shawn_he 已提交
3414 3415 3416
call.setMuted().then(() => {
    console.log(`setMuted success.`);
}).catch((err) => {
S
shawn_he 已提交
3417 3418 3419 3420 3421 3422
    console.error(`setMuted fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.cancelMuted<sup>8+</sup>

S
shawn_he 已提交
3423
cancelMuted\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3424 3425 3426

Cancels call muting. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3427
**System API**: This is a system API.
S
shawn_he 已提交
3428 3429 3430 3431 3432 3433 3434 3435 3436

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

**Parameters**

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

S
shawn_he 已提交
3437
**Error codes**
S
shawn_he 已提交
3438

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3443
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3444 3445 3446 3447 3448 3449
| 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 已提交
3450 3451 3452
**Example**

```js
S
shawn_he 已提交
3453 3454
call.cancelMuted((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3455 3456 3457 3458 3459 3460
});
```


## call.cancelMuted<sup>8+</sup>

S
shawn_he 已提交
3461
cancelMuted\(\): Promise\<void\>
S
shawn_he 已提交
3462 3463 3464

Cancels call muting. This API uses a promise to return the result.

S
shawn_he 已提交
3465
**System API**: This is a system API.
S
shawn_he 已提交
3466 3467 3468 3469 3470 3471 3472 3473 3474

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

**Return value**

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

S
shawn_he 已提交
3475
**Error codes**
S
shawn_he 已提交
3476

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3481
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3482 3483 3484 3485
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
3486 3487 3488
**Example**

```js
S
shawn_he 已提交
3489 3490 3491
call.cancelMuted().then(() => {
    console.log(`cancelMuted success.`);
}).catch((err) => {
S
shawn_he 已提交
3492 3493 3494 3495
    console.error(`cancelMuted fail, promise: err->${JSON.stringify(err)}`);
});
```

S
shawn_he 已提交
3496
## call.setAudioDevice<sup>8+</sup>
S
shawn_he 已提交
3497

S
shawn_he 已提交
3498
setAudioDevice\(device: AudioDevice, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3499 3500 3501

Sets the audio device for a call. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3502
**System API**: This is a system API.
S
shawn_he 已提交
3503 3504 3505 3506 3507 3508 3509 3510 3511 3512

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

**Parameters**

| Name  | Type                        | Mandatory| Description      |
| -------- | ---------------------------- | ---- | ---------- |
| device   | [AudioDevice](#audiodevice8) | Yes  | Audio device.|
| callback | AsyncCallback&lt;void&gt;    | Yes  | Callback used to return the result.|

S
shawn_he 已提交
3513
**Error codes**
S
shawn_he 已提交
3514

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3519
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3520 3521 3522 3523 3524 3525
| 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 已提交
3526 3527 3528
**Example**

```js
S
shawn_he 已提交
3529 3530
call.setAudioDevice(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3531 3532 3533 3534
});
```


S
shawn_he 已提交
3535
## call.setAudioDevice<sup>9+</sup>
S
shawn_he 已提交
3536

S
shawn_he 已提交
3537
setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3538

S
shawn_he 已提交
3539
Sets the audio device for a call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
3540

S
shawn_he 已提交
3541
**System API**: This is a system API.
S
shawn_he 已提交
3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552

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

**Parameters**

| Name  | Type                                      | Mandatory| Description          |
| -------- | ------------------------------------------ | ---- | -------------- |
| device   | [AudioDevice](#audiodevice8)               | Yes  | Audio device.    |
| options  | [AudioDeviceOptions](#audiodeviceoptions9) | Yes  | Audio device parameters.|
| callback | AsyncCallback&lt;void&gt;                  | Yes  | Callback used to return the result.    |

S
shawn_he 已提交
3553
**Error codes**
S
shawn_he 已提交
3554

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3559
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3560 3561 3562 3563 3564 3565
| 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 已提交
3566 3567 3568 3569 3570 3571
**Example**

```js
let audioDeviceOptions={
    bluetoothAddress: "IEEE 802-2014"
}
S
shawn_he 已提交
3572 3573
call.setAudioDevice(1, audioDeviceOptions, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3574 3575 3576 3577
});
```


S
shawn_he 已提交
3578
## call.setAudioDevice<sup>9+</sup>
S
shawn_he 已提交
3579

S
shawn_he 已提交
3580
setAudioDevice\(device: AudioDevice, options?: AudioDeviceOptions\): Promise\<void\>
S
shawn_he 已提交
3581 3582 3583

Sets the audio device for a call based on the specified options. This API uses a promise to return the result.

S
shawn_he 已提交
3584
**System API**: This is a system API.
S
shawn_he 已提交
3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600

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

**Parameters**

| Name | Type                                      | Mandatory| Description              |
| ------- | ------------------------------------------ | ---- | ------------------ |
| device  | [AudioDevice](#audiodevice8)               | Yes  | Audio device.        |
| options | [AudioDeviceOptions](#audiodeviceoptions9) | No  | Audio device parameters.|

**Return value**

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

S
shawn_he 已提交
3601
**Error codes**
S
shawn_he 已提交
3602

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3607
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3608 3609 3610 3611 3612 3613
| 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 已提交
3614 3615 3616 3617 3618 3619
**Example**

```js
let audioDeviceOptions={
    bluetoothAddress: "IEEE 802-2014"
}
S
shawn_he 已提交
3620 3621 3622
call.setAudioDevice(1, audioDeviceOptions).then(() => {
    console.log(`setAudioDevice success.`);
}).catch((err) => {
S
shawn_he 已提交
3623 3624 3625 3626 3627 3628
    console.error(`setAudioDevice fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.joinConference<sup>8+</sup>

S
shawn_he 已提交
3629
joinConference\(mainCallId: number, callNumberList: Array\<string\>, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3630 3631 3632

Joins a conference call. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3633
**System API**: This is a system API.
S
shawn_he 已提交
3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644

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

**Parameters**

| Name        | Type                     | Mandatory| Description           |
| -------------- | ------------------------- | ---- | --------------- |
| 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 已提交
3645
**Error codes**
S
shawn_he 已提交
3646

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3651
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3652 3653 3654 3655 3656 3657
| 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 已提交
3658 3659 3660
**Example**

```js
S
shawn_he 已提交
3661 3662 3663
let callNumberList: Array<string> = [
    "138XXXXXXXX"
];
S
shawn_he 已提交
3664 3665
call.joinConference(1, callNumberList, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3666 3667 3668 3669 3670
});
```

## call.joinConference<sup>8+</sup>

S
shawn_he 已提交
3671
joinConference\(mainCallId: number, callNumberList: Array\<string\>\): Promise\<void\>
S
shawn_he 已提交
3672 3673 3674

Joins a conference call. This API uses a promise to return the result.

S
shawn_he 已提交
3675
**System API**: This is a system API.
S
shawn_he 已提交
3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691

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

**Parameters**

| Name        | Type          | Mandatory| Description           |
| -------------- | -------------- | ---- | --------------- |
| mainCallId     | number         | Yes  | Main call ID.     |
| callNumberList | Array<string\> | Yes  | List of call numbers.|

**Return value**

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

S
shawn_he 已提交
3692
**Error codes**
S
shawn_he 已提交
3693

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3698
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3699 3700 3701 3702 3703 3704
| 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 已提交
3705 3706 3707
**Example**

```js
S
shawn_he 已提交
3708 3709 3710
let callNumberList: Array<string> = [
    "138XXXXXXXX"
];
S
shawn_he 已提交
3711 3712 3713
call.joinConference(1, callNumberList).then(() => {
    console.log(`joinConference success.`);
}).catch((err) => {
S
shawn_he 已提交
3714 3715 3716 3717 3718 3719
    console.error(`joinConference fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.updateImsCallMode<sup>8+</sup>

S
shawn_he 已提交
3720
updateImsCallMode\(callId: number, mode: ImsCallMode, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3721 3722 3723

Updates the IMS call mode. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3724
**System API**: This is a system API.
S
shawn_he 已提交
3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735

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

**Parameters**

| Name  | Type                        | Mandatory| Description          |
| -------- | ---------------------------- | ---- | -------------- |
| 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 已提交
3736
**Error codes**
S
shawn_he 已提交
3737

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3742
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3743 3744 3745 3746 3747 3748
| 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 已提交
3749 3750 3751
**Example**

```js
S
shawn_he 已提交
3752 3753
call.updateImsCallMode(1, 1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3754 3755 3756 3757 3758
});
```

## call.updateImsCallMode<sup>8+</sup>

S
shawn_he 已提交
3759
updateImsCallMode\(callId: number, mode: ImsCallMode\): Promise\<void\>
S
shawn_he 已提交
3760 3761 3762

Updates the IMS call mode. This API uses a promise to return the result.

S
shawn_he 已提交
3763
**System API**: This is a system API.
S
shawn_he 已提交
3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779

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

**Parameters**

| Name| Type                        | Mandatory| Description          |
| ------ | ---------------------------- | ---- | -------------- |
| callId | number                       | Yes  | Call ID.      |
| mode   | [ImsCallMode](#imscallmode8) | Yes  | IMS call mode.|

**Return value**

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

S
shawn_he 已提交
3780
**Error codes**
S
shawn_he 已提交
3781

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
3786
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3787 3788 3789 3790 3791 3792
| 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 已提交
3793 3794 3795
**Example**

```js
S
shawn_he 已提交
3796 3797 3798
call.updateImsCallMode(1, 1).then(() => {
    console.log(`updateImsCallMode success.`);
}).catch((err) => {
S
shawn_he 已提交
3799 3800 3801 3802 3803 3804
    console.error(`updateImsCallMode fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.enableImsSwitch<sup>8+</sup>

S
shawn_he 已提交
3805
enableImsSwitch\(slotId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3806 3807 3808

Enables the IMS switch. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3809
**System API**: This is a system API.
S
shawn_he 已提交
3810

S
shawn_he 已提交
3811 3812
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3813 3814 3815 3816 3817 3818 3819 3820 3821
**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|
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
3822
**Error codes**
S
shawn_he 已提交
3823

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3829
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3830 3831 3832 3833 3834 3835
| 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 已提交
3836 3837 3838
**Example**

```js
S
shawn_he 已提交
3839 3840
call.enableImsSwitch(0, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3841 3842 3843 3844 3845
});
```

## call.enableImsSwitch<sup>8+</sup>

S
shawn_he 已提交
3846
enableImsSwitch\(slotId: number\): Promise\<void\>
S
shawn_he 已提交
3847 3848 3849

Enables the IMS switch. This API uses a promise to return the result.

S
shawn_he 已提交
3850
**System API**: This is a system API.
S
shawn_he 已提交
3851

S
shawn_he 已提交
3852 3853
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867
**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|

**Return value**

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

S
shawn_he 已提交
3868
**Error codes**
S
shawn_he 已提交
3869

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3875
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3876 3877 3878 3879 3880 3881
| 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 已提交
3882 3883 3884
**Example**

```js
S
shawn_he 已提交
3885 3886 3887
call.enableImsSwitch(0).then(() => {
    console.log(`enableImsSwitch success.`);
}).catch((err) => {
S
shawn_he 已提交
3888 3889 3890 3891 3892 3893
    console.error(`enableImsSwitch fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.disableImsSwitch<sup>8+</sup>

S
shawn_he 已提交
3894
disableImsSwitch\(slotId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
3895 3896 3897

Disables the IMS switch. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3898
**System API**: This is a system API.
S
shawn_he 已提交
3899

S
shawn_he 已提交
3900 3901
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3902 3903 3904 3905 3906 3907 3908 3909 3910
**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|
| callback | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
3911
**Error codes**
S
shawn_he 已提交
3912

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3918
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3919 3920 3921 3922 3923 3924
| 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 已提交
3925 3926 3927
**Example**

```js
S
shawn_he 已提交
3928 3929
call.disableImsSwitch(0, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3930 3931 3932 3933 3934
});
```

## call.disableImsSwitch<sup>8+</sup>

S
shawn_he 已提交
3935
disableImsSwitch\(slotId: number\): Promise\<void\>
S
shawn_he 已提交
3936 3937 3938

Disables the IMS switch. This API uses a promise to return the result.

S
shawn_he 已提交
3939
**System API**: This is a system API.
S
shawn_he 已提交
3940

S
shawn_he 已提交
3941 3942
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3943 3944 3945 3946
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

S
shawn_he 已提交
3947
| Name| Type  | Mandatory| Description                                   |
S
shawn_he 已提交
3948
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
3949
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
S
shawn_he 已提交
3950 3951 3952

**Return value**

S
shawn_he 已提交
3953
| Type               | Description                        |
S
shawn_he 已提交
3954
| ------------------- | --------------------------- |
S
shawn_he 已提交
3955
| Promise&lt;void&gt; | Promise used to return the result. |
S
shawn_he 已提交
3956

S
shawn_he 已提交
3957
**Error codes**
S
shawn_he 已提交
3958

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

S
shawn_he 已提交
3961
| ID|                  Error Message                    |
S
shawn_he 已提交
3962 3963
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
3964
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
3965 3966 3967 3968 3969 3970
| 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 已提交
3971 3972 3973
**Example**

```js
S
shawn_he 已提交
3974 3975 3976
call.disableImsSwitch(0).then(() => {
    console.log(`disableImsSwitch success.`);
}).catch((err) => {
S
shawn_he 已提交
3977 3978 3979 3980 3981 3982
    console.error(`disableImsSwitch fail, promise: err->${JSON.stringify(err)}`);
});
```

## call.isImsSwitchEnabled<sup>8+</sup>

S
shawn_he 已提交
3983
isImsSwitchEnabled\(slotId: number, callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
3984 3985 3986

Checks whether the IMS switch is enabled. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3987
**System API**: This is a system API.
S
shawn_he 已提交
3988 3989 3990 3991 3992 3993 3994 3995 3996 3997

**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|
| callback | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
3998
**Error codes**
S
shawn_he 已提交
3999

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4004
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
4005 4006 4007 4008 4009 4010
| 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 已提交
4011 4012 4013 4014 4015 4016 4017 4018 4019 4020
**Example**

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

## call.isImsSwitchEnabled<sup>8+</sup>

S
shawn_he 已提交
4021
isImsSwitchEnabled\(slotId: number\): Promise\<boolean\>
S
shawn_he 已提交
4022 4023 4024

Checks whether the IMS switch is enabled. This API uses a promise to return the result.

S
shawn_he 已提交
4025
**System API**: This is a system API.
S
shawn_he 已提交
4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040

**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|

**Return value**

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

S
shawn_he 已提交
4041
**Error codes**
S
shawn_he 已提交
4042

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

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
4047
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
4048 4049 4050 4051 4052 4053
| 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 已提交
4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064
**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 已提交
4065
## DialOptions
S
shawn_he 已提交
4066

S
shawn_he 已提交
4067
Provides an option for determining whether a call is a video call.
S
shawn_he 已提交
4068 4069 4070

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

S
shawn_he 已提交
4071 4072
|        Name             | Type                              | Mandatory| Description                                                                                            |
| ------------------------ | ---------------------------------- | ---- | ----------------------------------------------------------------------------------------------- |
S
shawn_he 已提交
4073 4074 4075 4076 4077
| 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>                                                    |
| videoState <sup>8+</sup> | [VideoStateType](#videostatetype7) | No  | Video state type.                                                                                  |
| dialScene <sup>8+</sup>  | [DialScene](#dialscene8)           | No  | Dialup scenario.                                                                                      |
| dialType <sup>8+</sup>   | [DialType](#dialtype8)             | No  | Dialup type.                                                                                      |
S
shawn_he 已提交
4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090

## DialCallOptions<sup>9+</sup>

Defines options for initiating a call.

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

|        Name             | Type                              | Mandatory| Description                                                        |
| ------------------------ | ---------------------------------- | ---- | ------------------------------------------------------------ |
| accountId <sup>9+</sup>  | number                             | No  | Account ID.<br>- **0**: card slot 1<br>- **1**: card slot 2<br>This is a system API.|
| videoState <sup>9+</sup> | [VideoStateType](#videostatetype7) | No  | Video state type. This is a system API.                            |
| dialScene <sup>9+</sup>  | [DialScene](#dialscene8)           | No  | Dialup scenario. This is a system API.                                |
| dialType <sup>9+</sup>   | [DialType](#dialtype8)             | No  | Dialup type. This is a system API.                                |
S
shawn_he 已提交
4091

S
shawn_he 已提交
4092
## CallState
S
shawn_he 已提交
4093 4094

Enumerates call states.
S
shawn_he 已提交
4095

S
shawn_he 已提交
4096 4097 4098
**System capability**: SystemCapability.Telephony.CallManager

| Name              | Value  | Description                                                        |
S
shawn_he 已提交
4099
| ------------------ | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
4100 4101 4102
| 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.                                    |
S
shawn_he 已提交
4103
| 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 已提交
4104

S
shawn_he 已提交
4105
## EmergencyNumberOptions<sup>7+</sup>
S
shawn_he 已提交
4106

S
shawn_he 已提交
4107
Provides an option for determining whether a number is an emergency number for the SIM card in the specified slot.
S
shawn_he 已提交
4108 4109 4110

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

S
shawn_he 已提交
4111
|  Name | Type  | Mandatory| Description                                          |
S
shawn_he 已提交
4112 4113
| ------ | ------ | ---- | ---------------------------------------------- |
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
4114

S
shawn_he 已提交
4115
## NumberFormatOptions<sup>7+</sup>
S
shawn_he 已提交
4116

S
shawn_he 已提交
4117
Provides an option for number formatting.
S
shawn_he 已提交
4118 4119 4120

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

S
shawn_he 已提交
4121
|    Name    | Type  | Mandatory| Description                                                      |
S
shawn_he 已提交
4122
| ----------- | ------ | ---- | ---------------------------------------------------------- |
S
shawn_he 已提交
4123
| countryCode | string | No  | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.|
S
shawn_he 已提交
4124 4125 4126 4127 4128

## ImsCallMode<sup>8+</sup>

Enumerates IMS call modes.

S
shawn_he 已提交
4129
**System API**: This is a system API.
S
shawn_he 已提交
4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144

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

| Name                  | Value  | Description              |
| ---------------------- | ---- | ------------------ |
| 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.      |

## AudioDevice<sup>8+</sup>

Enumerates audio devices.

S
shawn_he 已提交
4145
**System API**: This is a system API.
S
shawn_he 已提交
4146 4147 4148 4149 4150

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

| Name                | Value  | Description        |
| -------------------- | ---- | ------------ |
S
shawn_he 已提交
4151 4152 4153
| DEVICE_EARPIECE      | 0    | Headset device.    |
| DEVICE_SPEAKER       | 1    | Speaker device.|
| DEVICE_WIRED_HEADSET | 2    | Wired headset device.|
S
shawn_he 已提交
4154
| DEVICE_BLUETOOTH_SCO | 3    | Bluetooth SCO device. |
S
shawn_he 已提交
4155
| DEVICE_MIC           | 4    | Microphone device|
S
shawn_he 已提交
4156 4157 4158 4159 4160

## CallRestrictionType<sup>8+</sup>

Enumerates call restriction types.

S
shawn_he 已提交
4161
**System API**: This is a system API.
S
shawn_he 已提交
4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179

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

| Name                                         | Value  | Description                      |
| --------------------------------------------- | ---- | -------------------------- |
| 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.              |

## CallTransferInfo<sup>8+</sup>

Defines the call transfer information.

S
shawn_he 已提交
4180
**System API**: This is a system API.
S
shawn_he 已提交
4181 4182 4183

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

S
shawn_he 已提交
4184 4185 4186 4187 4188 4189 4190
|          Name           | Type                                                | Mandatory| Description            |
| ------------------------ | ---------------------------------------------------- | ---- | ---------------- |
| 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.|
S
shawn_he 已提交
4191
| endHour<sup>9+</sup>     | number                                               | No  | Minute in the end time.|
S
shawn_he 已提交
4192
| endMinute<sup>9+</sup>   | number                                               | No  | Minute in the end time.|
S
shawn_he 已提交
4193 4194 4195 4196 4197

## CallTransferType<sup>8+</sup>

Enumerates call transfer types.

S
shawn_he 已提交
4198
**System API**: This is a system API.
S
shawn_he 已提交
4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212

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

| Name                       | Value  | Description        |
| --------------------------- | ---- | ------------ |
| 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.|

## CallTransferSettingType<sup>8+</sup>

Enumerates call transfer setting types.

S
shawn_he 已提交
4213
**System API**: This is a system API.
S
shawn_he 已提交
4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227

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

| Name                      | Value  | Description        |
| -------------------------- | ---- | ------------ |
| 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.|

## CallAttributeOptions<sup>7+</sup>

Defines the call attribute options.

S
shawn_he 已提交
4228
**System API**: This is a system API.
S
shawn_he 已提交
4229 4230 4231

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

S
shawn_he 已提交
4232
|      Name      | Type                                    | Mandatory| Description          |
S
shawn_he 已提交
4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248
| --------------- | ---------------------------------------- | ---- | -------------- |
| 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.      |

## ConferenceState<sup>7+</sup>

Enumerates conference states.

S
shawn_he 已提交
4249
**System API**: This is a system API.
S
shawn_he 已提交
4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263

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

| Name                        | Value  | Description          |
| ---------------------------- | ---- | -------------- |
| TEL_CONFERENCE_IDLE          | 0    | Idle state.  |
| TEL_CONFERENCE_ACTIVE        | 1    | Active state.  |
| TEL_CONFERENCE_DISCONNECTING | 2    | Disconnecting state.  |
| TEL_CONFERENCE_DISCONNECTED  | 3    | Disconnected state.|

## CallType<sup>7+</sup>

Enumerates call types.

S
shawn_he 已提交
4264
**System API**: This is a system API.
S
shawn_he 已提交
4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276

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

| Name         | Value  | Description        |
| ------------- | ---- | ------------ |
| TYPE_CS       | 0    | CS call.      |
| TYPE_IMS      | 1    | IMS call.     |
| TYPE_OTT      | 2    | OTT call.     |
| TYPE_ERR_CALL | 3    | Error call type.|

## VideoStateType<sup>7+</sup>

S
shawn_he 已提交
4277
Video state type.
S
shawn_he 已提交
4278

S
shawn_he 已提交
4279
**System API**: This is a system API.
S
shawn_he 已提交
4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291

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

| Name      | Value  | Description    |
| ---------- | ---- | -------- |
| TYPE_VOICE | 0    | Voice state.|
| TYPE_VIDEO | 1    | Video state.|

## DetailedCallState<sup>7+</sup>

Enumerates detailed call states.

S
shawn_he 已提交
4292
**System API**: This is a system API.
S
shawn_he 已提交
4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311

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

| Name                     | Value  | Description          |
| ------------------------- | ---- | -------------- |
| 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.  |

## CallRestrictionInfo<sup>8+</sup>

Defines the call restriction information.

S
shawn_he 已提交
4312
**System API**: This is a system API.
S
shawn_he 已提交
4313 4314 4315

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

S
shawn_he 已提交
4316
|   Name  | Type                                        | Mandatory| Description        |
S
shawn_he 已提交
4317 4318 4319 4320 4321 4322 4323 4324 4325
| -------- | -------------------------------------------- | ---- | ------------ |
| type     | [CallRestrictionType](#callrestrictiontype8) | Yes  | Call restriction type.|
| password | string                                       | Yes  | Password.        |
| mode     | [CallRestrictionMode](#callrestrictionmode8) | Yes  | Call restriction mode.|

## CallRestrictionMode<sup>8+</sup>

Enumerates call restriction modes.

S
shawn_he 已提交
4326
**System API**: This is a system API.
S
shawn_he 已提交
4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338

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

| Name                         | Value  | Description        |
| ----------------------------- | ---- | ------------ |
| RESTRICTION_MODE_DEACTIVATION | 0    | Call restriction deactivated.|
| RESTRICTION_MODE_ACTIVATION   | 1    | Call restriction activated.|

## CallEventOptions<sup>8+</sup>

Defines the call event options.

S
shawn_he 已提交
4339
**System API**: This is a system API.
S
shawn_he 已提交
4340 4341 4342

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

S
shawn_he 已提交
4343
|   Name | Type                                      | Mandatory| Description          |
S
shawn_he 已提交
4344 4345 4346 4347 4348 4349 4350
| ------- | ------------------------------------------ | ---- | -------------- |
| eventId | [CallAbilityEventId](#callabilityeventid8) | Yes  | Call ability event ID.|

## CallAbilityEventId<sup>8+</sup>

Enumerates call ability event IDs.

S
shawn_he 已提交
4351
**System API**: This is a system API.
S
shawn_he 已提交
4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363

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

| Name                    | Value  | Description           |
| ------------------------ | ---- | --------------- |
| EVENT_DIAL_NO_CARRIER    | 1    | No available carrier during dialing. |
| EVENT_INVALID_FDN_NUMBER | 2    | Invalid FDN.|

## DialScene<sup>8+</sup>

Enumerates dialup scenarios.

S
shawn_he 已提交
4364
**System API**: This is a system API.
S
shawn_he 已提交
4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377

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

| Name           | Value  | Description        |
| --------------- | ---- | ------------ |
| CALL_NORMAL     | 0    | Common call.    |
| CALL_PRIVILEGED | 1    | Privileged call.    |
| CALL_EMERGENCY  | 2    | Emergency call.|

## DialType<sup>8+</sup>

Enumerates dialup types.

S
shawn_he 已提交
4378
**System API**: This is a system API.
S
shawn_he 已提交
4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391

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

| Name                | Value  | Description            |
| -------------------- | ---- | ---------------- |
| DIAL_CARRIER_TYPE    | 0    | Carrier.    |
| DIAL_VOICE_MAIL_TYPE | 1    | Voice mail.|
| DIAL_OTT_TYPE        | 2    | OTT.     |

## RejectMessageOptions<sup>7+</sup>

Defines options for the call rejection message.

S
shawn_he 已提交
4392
**System API**: This is a system API.
S
shawn_he 已提交
4393 4394 4395

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

S
shawn_he 已提交
4396
|     Name      | Type  | Mandatory| Description    |
S
shawn_he 已提交
4397 4398 4399 4400 4401 4402 4403
| -------------- | ------ | ---- | -------- |
| messageContent | string | Yes  | Message content.|

## CallTransferResult<sup>8+</sup>

Defines the call transfer result.

S
shawn_he 已提交
4404
**System API**: This is a system API.
S
shawn_he 已提交
4405 4406 4407

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

S
shawn_he 已提交
4408 4409 4410 4411 4412 4413
|          Name           |                 Type              | Mandatory|       Description      |
| ------------------------ | ---------------------------------- | ---- | ---------------- |
| 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.|
S
shawn_he 已提交
4414
| endHour<sup>9+</sup>     | number                             |  Yes | Minute in the end time.|
S
shawn_he 已提交
4415
| endMinute<sup>9+</sup>   | number                             |  Yes | Minute in the end time.|
S
shawn_he 已提交
4416 4417 4418 4419 4420

## CallWaitingStatus<sup>7+</sup>

Enumerates call waiting states.

S
shawn_he 已提交
4421
**System API**: This is a system API.
S
shawn_he 已提交
4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433

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

| Name                | Value  | Description        |
| -------------------- | ---- | ------------ |
| CALL_WAITING_DISABLE | 0    | Call waiting disabled.|
| CALL_WAITING_ENABLE  | 1    | Call waiting enabled.|

## RestrictionStatus<sup>8+</sup>

Enumerates call restriction states.

S
shawn_he 已提交
4434
**System API**: This is a system API.
S
shawn_he 已提交
4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446

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

| Name               | Value  | Description    |
| ------------------- | ---- | -------- |
| RESTRICTION_DISABLE | 0    | Call restriction disabled.|
| RESTRICTION_ENABLE  | 1    | Call restriction enabled.|

## TransferStatus<sup>8+</sup>

Enumerates call transfer states.

S
shawn_he 已提交
4447
**System API**: This is a system API.
S
shawn_he 已提交
4448 4449 4450 4451 4452 4453 4454 4455

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

| Name            | Value  | Description    |
| ---------------- | ---- | -------- |
| TRANSFER_DISABLE | 0    | Call transfer disabled.|
| TRANSFER_ENABLE  | 1    | Call transfer enabled.|

S
shawn_he 已提交
4456 4457
## DisconnectedDetails<sup>9+</sup>

S
shawn_he 已提交
4458
Defines the call disconnection cause.
S
shawn_he 已提交
4459

S
shawn_he 已提交
4460
**System API**: This is a system API.
S
shawn_he 已提交
4461 4462 4463 4464 4465

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

| Name   |                    Type                   | Mandatory| Description           |
| ------- | ------------------------------------------ | ---- | --------------- |
S
shawn_he 已提交
4466 4467
| reason  | [DisconnectedReason](#disconnectedreason8) | Yes  | Call disconnection cause.   |
| message | string                                     | Yes  | Call ending message.|
S
shawn_he 已提交
4468 4469

## DisconnectedReason<sup>8+</sup>
S
shawn_he 已提交
4470

S
shawn_he 已提交
4471
Enumerates call disconnection causes.
S
shawn_he 已提交
4472

S
shawn_he 已提交
4473
**System API**: This is a system API.
S
shawn_he 已提交
4474 4475 4476

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

S
shawn_he 已提交
4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557
|                              Name                           | Value  |                  Description                  |
| ------------------------------------------------------------ | ---- | --------------------------------------- |
| 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 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.                               |
S
shawn_he 已提交
4558 4559 4560 4561 4562

## MmiCodeResults<sup>9+</sup>

Defines the MMI code result.

S
shawn_he 已提交
4563
**System API**: This is a system API.
S
shawn_he 已提交
4564 4565 4566 4567 4568 4569 4570 4571 4572 4573

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

| Name   | Type                            | Mandatory| Description           |
| ------- | -------------------------------- | ---- | --------------- |
| result  | [MmiCodeResult](#mmicoderesult9) | Yes  | MMI code result.|
| message | string                           | Yes  | MMI code message.|

## MmiCodeResult<sup>9+</sup>

S
shawn_he 已提交
4574
Defines the MMI code result.
S
shawn_he 已提交
4575

S
shawn_he 已提交
4576
**System API**: This is a system API.
S
shawn_he 已提交
4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588

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

| Name            | Value  | Description         |
| ---------------- | ---- | ------------- |
| MMI_CODE_SUCCESS | 0    | Success.|
| MMI_CODE_FAILED  | 1    | Failure.|

## AudioDeviceOptions<sup>9+</sup>

Defines audio device options.

S
shawn_he 已提交
4589
**System API**: This is a system API.
S
shawn_he 已提交
4590 4591 4592 4593 4594 4595

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

| Name            | Type  | Mandatory| Description    |
| ---------------- | ------ | ---- | -------- |
| bluetoothAddress | string | No  | Bluetooth address.|