js-apis-call.md 174.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
## call.dial<sup>(deprecated)</sup>
S
shawn_he 已提交
18 19 20

dial\(phoneNumber: string, callback: AsyncCallback<boolean\>\): void

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

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

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

S
shawn_he 已提交
27
**Parameters**
S
shawn_he 已提交
28

S
shawn_he 已提交
29 30 31 32
| 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|
S
shawn_he 已提交
33 34 35

**Example**

S
shawn_he 已提交
36
```js
S
shawn_he 已提交
37 38 39 40
call.dial("138xxxxxxxx", (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
41 42


S
shawn_he 已提交
43
## call.dial<sup>(deprecated)</sup>
S
shawn_he 已提交
44 45 46

dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback<boolean\>\): void

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

S
shawn_he 已提交
49
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
50 51

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

S
shawn_he 已提交
53
**Parameters**
S
shawn_he 已提交
54

S
shawn_he 已提交
55
| Name     | Type                        | Mandatory| Description                                   |
S
shawn_he 已提交
56
| ----------- | ---------------------------- | ---- | --------------------------------------- |
S
shawn_he 已提交
57 58 59
| 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|
S
shawn_he 已提交
60

S
shawn_he 已提交
61
**Example**
S
shawn_he 已提交
62

S
shawn_he 已提交
63
```js
S
shawn_he 已提交
64 65 66 67 68 69
call.dial("138xxxxxxxx", {
    extras: false
}, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
70 71


S
shawn_he 已提交
72
## call.dial<sup>(deprecated)</sup>
S
shawn_he 已提交
73 74 75

dial\(phoneNumber: string, options?: DialOptions\): Promise<boolean\>

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

S
shawn_he 已提交
78
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
79 80

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

S
shawn_he 已提交
82
**Parameters**
S
shawn_he 已提交
83

S
shawn_he 已提交
84
| Name     | Type                       | Mandatory| Description                                  |
S
shawn_he 已提交
85
| ----------- | --------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
86 87
| phoneNumber | string                      | Yes  | Phone number.                            |
| options     | [DialOptions](#dialoptions) | No  | Call option, which indicates whether the call is a voice call or video call.|
S
shawn_he 已提交
88

S
shawn_he 已提交
89
**Return value**
S
shawn_he 已提交
90

S
shawn_he 已提交
91 92 93
| Type                  | Description                                                        |
| ---------------------- | ------------------------------------------------------------ |
| Promise&lt;boolean&gt; | Promise used to return the result.<br>- **true**: success<br>- **false**: failure|
S
shawn_he 已提交
94

S
shawn_he 已提交
95
**Example**
S
shawn_he 已提交
96

S
shawn_he 已提交
97
```js
S
shawn_he 已提交
98 99 100 101 102 103 104 105 106
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 已提交
107

S
shawn_he 已提交
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 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 194 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 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243

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

dialCall\(phoneNumber: string, callback: AsyncCallback<void\>\): void

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                                   |
| ----------- | ---------------------------- | ---- | --------------------------------------- |
| phoneNumber | string                       | Yes  | Phone number.                             |
| callback    | AsyncCallback&lt;void&gt;    | Yes  | Callback used to return the result.                             |

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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", (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


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

dialCall\(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback<void\>\): void

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                                |
| ----------- | ----------------------------------- | ---- | ------------------------------------ |
| phoneNumber | string                              | Yes  | Phone number.                          |
| options     | [DialCallOptions](#dialcalloptions9)| Yes  | Call options, which carry other configuration information of the call.   |
| callback    | AsyncCallback&lt;void&gt;           | Yes  | Callback used to return the result.                          |

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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,
}, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


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

dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise<void\>

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.                            |
| options     | [DialCallOptions](#dialcalloptions9)| No  | Call option, which indicates whether the call is a voice call or video call.|

**Return value**

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

**Example**

```js
try {
    call.dialCall('138xxxxxxxx');
    console.log(`dialCall success, promise: data->${JSON.stringify(data)}`);
} catch (error) {
    console.log(`dialCall fail, promise: err->${JSON.stringify(error)}`);
}
```


S
shawn_he 已提交
244
## call.makeCall<sup>7+</sup>
S
shawn_he 已提交
245

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

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

S
shawn_he 已提交
250
**System capability**: SystemCapability.Applications.Contacts
S
shawn_he 已提交
251 252 253

**Parameters**

S
shawn_he 已提交
254
| Name     | Type                     | Mandatory| Description                                      |
S
shawn_he 已提交
255 256
| ----------- | ------------------------- | ---- | ------------------------------------------ |
| phoneNumber | string                    | Yes  | Phone number.                                |
S
shawn_he 已提交
257 258 259 260 261 262 263 264 265 266 267 268
| callback    | AsyncCallback&lt;void&gt; | Yes  | Callback used to return the result.|

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
269 270 271

**Example**

S
shawn_he 已提交
272
```js
S
shawn_he 已提交
273 274
call.makeCall("138xxxxxxxx", err => {
    console.log(`makeCall callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
275 276 277 278
});
```


S
shawn_he 已提交
279
## call.makeCall<sup>7+</sup>
S
shawn_he 已提交
280

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

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

S
shawn_he 已提交
285
**System capability**: SystemCapability.Applications.Contacts
S
shawn_he 已提交
286 287 288

**Parameters**

S
shawn_he 已提交
289
| Name     | Type  | Mandatory| Description      |
S
shawn_he 已提交
290
| ----------- | ------ | ---- | ---------- |
S
shawn_he 已提交
291
| phoneNumber | string | Yes  | Phone number.|
S
shawn_he 已提交
292

S
shawn_he 已提交
293
**Return value**
S
shawn_he 已提交
294 295 296

| Type               | Description                             |
| ------------------- | --------------------------------- |
S
shawn_he 已提交
297 298 299 300 301 302 303 304 305 306 307 308
| Promise&lt;void&gt; | Promise used to return the result.|

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 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 已提交
309 310 311

**Example**

S
shawn_he 已提交
312
```js
S
shawn_he 已提交
313 314 315 316 317
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 已提交
318 319 320
});
```

S
shawn_he 已提交
321
## call.hasCall
S
shawn_he 已提交
322 323 324

hasCall\(callback: AsyncCallback<boolean\>\): void

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

S
shawn_he 已提交
327 328
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
329
**Parameters**
S
shawn_he 已提交
330

S
shawn_he 已提交
331
| Name  | Type                        | Mandatory| Description                                                        |
S
shawn_he 已提交
332
| -------- | ---------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
333
| 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 已提交
334

S
shawn_he 已提交
335
**Example**
S
shawn_he 已提交
336

S
shawn_he 已提交
337
```js
S
shawn_he 已提交
338 339 340 341
call.hasCall((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
342 343


S
shawn_he 已提交
344
## call.hasCall
S
shawn_he 已提交
345 346 347

hasCall\(\): Promise<boolean\>

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

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

S
shawn_he 已提交
352
**Return value**
S
shawn_he 已提交
353

S
shawn_he 已提交
354
| Type                  | Description                                   |
S
shawn_he 已提交
355
| ---------------------- | --------------------------------------- |
S
shawn_he 已提交
356
| Promise&lt;boolean&gt; | Promise used to return the result.|
S
shawn_he 已提交
357

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

S
shawn_he 已提交
360
```js
S
shawn_he 已提交
361 362 363 364 365 366 367
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 已提交
368 369


S
shawn_he 已提交
370
## call.getCallState
S
shawn_he 已提交
371 372 373

getCallState\(callback: AsyncCallback<CallState\>\): void

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

S
shawn_he 已提交
376 377
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
378
**Parameters**
S
shawn_he 已提交
379

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

S
shawn_he 已提交
384
**Example**
S
shawn_he 已提交
385

S
shawn_he 已提交
386
```js
S
shawn_he 已提交
387 388 389 390
call.getCallState((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
391 392


S
shawn_he 已提交
393
## call.getCallState
S
shawn_he 已提交
394 395 396

getCallState\(\): Promise<CallState\>

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

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

S
shawn_he 已提交
401
**Return value**
S
shawn_he 已提交
402

S
shawn_he 已提交
403 404
| Type                                  | Description                                   |
| -------------------------------------- | --------------------------------------- |
S
shawn_he 已提交
405
| Promise&lt;[CallState](#callstate)&gt; | Promise used to return the result.|
S
shawn_he 已提交
406

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

S
shawn_he 已提交
409
```js
S
shawn_he 已提交
410 411 412 413 414 415 416
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 已提交
417

S
shawn_he 已提交
418
## call.hasVoiceCapability<sup>7+</sup>
S
shawn_he 已提交
419 420 421

hasVoiceCapability(): boolean

S
shawn_he 已提交
422
Checks whether a device supports voice calls.
S
shawn_he 已提交
423 424 425

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

S
shawn_he 已提交
426
**Return value**
S
shawn_he 已提交
427 428 429

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

S
shawn_he 已提交
432
```js
S
shawn_he 已提交
433 434 435 436
let result = call.hasVoiceCapability(); 
console.log(`hasVoiceCapability: ${JSON.stringify(result)}`);
```

S
shawn_he 已提交
437
## call.isEmergencyPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
438 439 440

isEmergencyPhoneNumber\(phoneNumber: string, callback: AsyncCallback<boolean\>\): void

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

S
shawn_he 已提交
443 444
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
445
**Parameters**
S
shawn_he 已提交
446

S
shawn_he 已提交
447
| Name     | Type                        | Mandatory| Description                                                        |
S
shawn_he 已提交
448
| ----------- | ---------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
449
| phoneNumber | string                       | Yes  | Phone number.                                                  |
S
shawn_he 已提交
450 451 452 453 454 455 456 457 458 459 460 461
| 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**
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 已提交
462

S
shawn_he 已提交
463
**Example**
S
shawn_he 已提交
464

S
shawn_he 已提交
465
```js
S
shawn_he 已提交
466 467 468 469
call.isEmergencyPhoneNumber("138xxxxxxxx", (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
470 471


S
shawn_he 已提交
472
## call.isEmergencyPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
473 474 475

isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback<boolean\>\): void

S
shawn_he 已提交
476
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 已提交
477

S
shawn_he 已提交
478 479
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
480
**Parameters**
S
shawn_he 已提交
481

S
shawn_he 已提交
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
| 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**
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 已提交
498

S
shawn_he 已提交
499
**Example**
S
shawn_he 已提交
500

S
shawn_he 已提交
501
```js
S
shawn_he 已提交
502
call.isEmergencyPhoneNumber("112", {slotId: 1}, (err, data) => {
S
shawn_he 已提交
503 504 505
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
506 507


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

isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\): Promise<boolean\>

S
shawn_he 已提交
512
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 已提交
513

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

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

S
shawn_he 已提交
518
| Name     | Type                                              | Mandatory| Description          |
S
shawn_he 已提交
519 520
| ----------- | -------------------------------------------------- | ---- | -------------- |
| phoneNumber | string                                             | Yes  | Phone number.    |
S
shawn_he 已提交
521
| options     | [EmergencyNumberOptions](#emergencynumberoptions7) | No  | Phone number.|
S
shawn_he 已提交
522

S
shawn_he 已提交
523
**Return value**
S
shawn_he 已提交
524

S
shawn_he 已提交
525
| Type                  | Description                                               |
S
shawn_he 已提交
526
| ---------------------- | --------------------------------------------------- |
S
shawn_he 已提交
527 528 529 530 531 532 533 534 535 536 537 538
| Promise&lt;boolean&gt; | Promise used to return the result.|

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

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

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

S
shawn_he 已提交
542
```js
S
shawn_he 已提交
543 544 545 546 547 548 549
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 已提交
550

S
shawn_he 已提交
551
## call.formatPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
552 553 554

formatPhoneNumber\(phoneNumber: string, callback: AsyncCallback<string\>\): void

S
shawn_he 已提交
555 556 557
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 已提交
558

S
shawn_he 已提交
559 560
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
561
**Parameters**
S
shawn_he 已提交
562

S
shawn_he 已提交
563
| Name     | Type                       | Mandatory| Description                                |
S
shawn_he 已提交
564
| ----------- | --------------------------- | ---- | ------------------------------------ |
S
shawn_he 已提交
565
| phoneNumber | string                      | Yes  | Phone number.                          |
S
shawn_he 已提交
566 567 568 569 570 571 572 573 574 575 576 577
| callback    | AsyncCallback&lt;string&gt; | Yes  | Callback used to return the result.|

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

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

S
shawn_he 已提交
579
**Example**
S
shawn_he 已提交
580

S
shawn_he 已提交
581
```js
S
shawn_he 已提交
582 583 584 585
call.formatPhoneNumber("138xxxxxxxx", (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
586

S
shawn_he 已提交
587
## call.formatPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
588 589 590

formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback<string\>\): void

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

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

S
shawn_he 已提交
595 596
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
597
**Parameters**
S
shawn_he 已提交
598

S
shawn_he 已提交
599
| Name     | Type                                        | Mandatory| Description                                |
S
shawn_he 已提交
600 601
| ----------- | -------------------------------------------- | ---- | ------------------------------------ |
| phoneNumber | string                                       | Yes  | Phone number.                          |
S
shawn_he 已提交
602 603 604 605 606 607 608 609 610 611 612 613 614
| 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**
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 已提交
615

S
shawn_he 已提交
616
**Example**
S
shawn_he 已提交
617

S
shawn_he 已提交
618
```js
S
shawn_he 已提交
619
call.formatPhoneNumber("138xxxxxxxx", {
S
shawn_he 已提交
620 621 622 623 624
    countryCode: "CN"
}, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
625 626


S
shawn_he 已提交
627
## call.formatPhoneNumber<sup>7+</sup>
S
shawn_he 已提交
628 629 630

formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise<string\>

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

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

S
shawn_he 已提交
635 636
**System capability**: SystemCapability.Telephony.CallManager

S
shawn_he 已提交
637
**Parameters**
S
shawn_he 已提交
638

S
shawn_he 已提交
639
| Name     | Type                                        | Mandatory| Description                  |
S
shawn_he 已提交
640 641
| ----------- | -------------------------------------------- | ---- | ---------------------- |
| phoneNumber | string                                       | Yes  | Phone number.            |
S
shawn_he 已提交
642
| options     | [NumberFormatOptions](#numberformatoptions7) | No  | Number formatting options, for example, country code.|
S
shawn_he 已提交
643

S
shawn_he 已提交
644
**Return value**
S
shawn_he 已提交
645

S
shawn_he 已提交
646
| Type                 | Description                                       |
S
shawn_he 已提交
647
| --------------------- | ------------------------------------------- |
S
shawn_he 已提交
648 649 650 651 652 653 654 655 656 657 658 659
| Promise&lt;string&gt; | Promise used to return the result.|

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

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

S
shawn_he 已提交
661
**Example**
S
shawn_he 已提交
662

S
shawn_he 已提交
663
```js
S
shawn_he 已提交
664 665 666 667 668 669 670 671 672
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 已提交
673

S
shawn_he 已提交
674
## call.formatPhoneNumberToE164<sup>7+</sup>
S
shawn_he 已提交
675 676 677

formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: AsyncCallback<string\>\): void

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

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

S
shawn_he 已提交
684
**Parameters**
S
shawn_he 已提交
685

S
shawn_he 已提交
686
| Name     | Type                       | Mandatory| Description                                                 |
S
shawn_he 已提交
687
| ----------- | --------------------------- | ---- | ----------------------------------------------------- |
S
shawn_he 已提交
688 689
| phoneNumber | string                      | Yes  | Phone number.                                           |
| countryCode | string                      | Yes  | Country code, for example, **CN** (China). All country codes are supported.             |
S
shawn_he 已提交
690 691 692 693 694 695 696 697 698 699 700 701
| callback    | AsyncCallback&lt;string&gt; | Yes  | Callback used to return the result.|

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

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

S
shawn_he 已提交
703
**Example**
S
shawn_he 已提交
704

S
shawn_he 已提交
705
```js
S
shawn_he 已提交
706
call.formatPhoneNumberToE164("138xxxxxxxx", "CN", (err, data) => {
S
shawn_he 已提交
707 708 709
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
710 711


S
shawn_he 已提交
712
## call.formatPhoneNumberToE164<sup>7+</sup>
S
shawn_he 已提交
713 714 715

formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise<string\>

S
shawn_he 已提交
716
Converts a phone number into the E.164 format. This API uses a promise to return the result.
S
shawn_he 已提交
717 718 719 720 721

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

S
shawn_he 已提交
724
**Parameters**
S
shawn_he 已提交
725

S
shawn_he 已提交
726
| Name     | Type  | Mandatory| Description                                    |
S
shawn_he 已提交
727
| ----------- | ------ | ---- | ---------------------------------------- |
S
shawn_he 已提交
728
| phoneNumber | string | Yes  | Phone number.                              |
S
shawn_he 已提交
729
| countryCode | string | Yes  | Country code, for example, **CN** (China). All country codes are supported.|
S
shawn_he 已提交
730

S
shawn_he 已提交
731
**Return value**
S
shawn_he 已提交
732

S
shawn_he 已提交
733
| Type                 | Description                                                        |
S
shawn_he 已提交
734
| --------------------- | ------------------------------------------------------------ |
S
shawn_he 已提交
735 736 737 738 739 740 741 742 743 744 745 746
| Promise&lt;string&gt; | Promise used to return the result.|

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

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

S
shawn_he 已提交
748
**Example**
S
shawn_he 已提交
749

S
shawn_he 已提交
750
```js
S
shawn_he 已提交
751
let promise = call.formatPhoneNumberToE164("138xxxxxxxx", "CN");
S
shawn_he 已提交
752 753 754 755 756 757
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 已提交
758

S
shawn_he 已提交
759 760 761 762
## call.muteRinger<sup>8+</sup>

muteRinger\(callback: AsyncCallback<void\>\): void

S
shawn_he 已提交
763
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 已提交
764

S
shawn_he 已提交
765
**System API**: This is a system API.
S
shawn_he 已提交
766 767 768 769 770 771 772 773 774 775 776

**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 已提交
777 778 779 780 781 782 783 784 785 786 787
**Error codes**
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 已提交
788 789 790 791 792 793 794 795 796 797 798 799 800
**Example**

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


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

muteRinger\(\): Promise<void\>

S
shawn_he 已提交
801
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 已提交
802

S
shawn_he 已提交
803
**System API**: This is a system API.
S
shawn_he 已提交
804 805 806 807 808 809 810 811 812 813 814

**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 已提交
815 816 817 818 819 820 821 822 823 824 825 826
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
827 828 829 830 831 832 833 834 835 836 837 838
**Example**

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


S
shawn_he 已提交
839 840 841
## call.answerCall<sup>7+</sup>

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

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

S
shawn_he 已提交
845
**System API**: This is a system API.
S
shawn_he 已提交
846 847 848 849 850 851 852 853 854 855 856 857

**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 已提交
858 859 860 861 862 863 864 865 866 867 868 869
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
870 871 872
**Example**

```js
S
shawn_he 已提交
873
call.answerCall(1, (err, data) => {
S
shawn_he 已提交
874 875 876 877 878
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
879
## call.answerCall<sup>7+</sup>
S
shawn_he 已提交
880

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

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

S
shawn_he 已提交
885
**System API**: This is a system API.
S
shawn_he 已提交
886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902

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

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

**Parameters**

| Name| Type  | Mandatory| Description                                                        |
| ------ | ------ | ---- | ------------------------------------------------------------ |
| callId | number | No  | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.|

**Return value**

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

S
shawn_he 已提交
903 904 905 906 907 908 909 910 911 912 913 914
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
915 916 917
**Example**

```js
S
shawn_he 已提交
918
let promise = call.answerCall(1);
S
shawn_he 已提交
919
promise.then(data => {
S
shawn_he 已提交
920
    console.log(`answerCall success, promise: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
921
}).catch(err => {
S
shawn_he 已提交
922
    console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
923 924 925 926
});
```


S
shawn_he 已提交
927
## call.answerCall<sup>9+</sup>
S
shawn_he 已提交
928

S
shawn_he 已提交
929 930 931
answerCall\(callback: AsyncCallback<void\>\): void

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

S
shawn_he 已提交
933
**System API**: This is a system API.
S
shawn_he 已提交
934

S
shawn_he 已提交
935 936
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
937 938 939 940 941 942 943 944
**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 已提交
945 946 947 948 949 950 951 952 953 954 955 956
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
957 958 959
**Example**

```js
S
shawn_he 已提交
960
call.answerCall((err, data) => {
S
shawn_he 已提交
961 962 963 964 965
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
966
## call.hangUpCall<sup>7+</sup>
S
shawn_he 已提交
967

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

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

S
shawn_he 已提交
972
**System API**: This is a system API.
S
shawn_he 已提交
973

S
shawn_he 已提交
974 975
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
976 977 978 979 980 981
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
985 986 987 988 989 990 991 992 993 994 995 996
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
997 998 999
**Example**

```js
S
shawn_he 已提交
1000
call.hangUpCall(1, (err, data) => {
S
shawn_he 已提交
1001 1002 1003 1004 1005
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
1006
## call.hangUpCall<sup>7+</sup>
S
shawn_he 已提交
1007

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

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

S
shawn_he 已提交
1012
**System API**: This is a system API.
S
shawn_he 已提交
1013

S
shawn_he 已提交
1014 1015
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name| Type  | Mandatory| Description                                                        |
| ------ | ------ | ---- | ------------------------------------------------------------ |
| callId | number | No  | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.|

**Return value**

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

S
shawn_he 已提交
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1042 1043 1044
**Example**

```js
S
shawn_he 已提交
1045
let promise = call.hangUpCall(1);
S
shawn_he 已提交
1046
promise.then(data => {
S
shawn_he 已提交
1047
    console.log(`hangUpCall success, promise: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
1048
}).catch(err => {
S
shawn_he 已提交
1049
    console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1050 1051 1052 1053
});
```


S
shawn_he 已提交
1054 1055 1056
## call.hangUpCall<sup>9+</sup>

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

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

S
shawn_he 已提交
1060
**System API**: This is a system API.
S
shawn_he 已提交
1061

S
shawn_he 已提交
1062 1063
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1064 1065 1066 1067 1068 1069 1070 1071
**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 已提交
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1085 1086 1087
**Example**

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


S
shawn_he 已提交
1094
## call.rejectCall<sup>7+</sup>
S
shawn_he 已提交
1095

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

S
shawn_he 已提交
1098
Rejects 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 1112
**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 已提交
1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1125 1126 1127 1128

**Example**

```js
S
shawn_he 已提交
1129
call.rejectCall(1, (err, data) => {
W
sms  
w00636648 已提交
1130
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
S
shawn_he 已提交
1131 1132 1133 1134
});
```


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

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

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

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

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

S
shawn_he 已提交
1145 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.|
| 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 已提交
1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1167 1168 1169 1170 1171 1172
**Example**

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


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

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

S
shawn_he 已提交
1183
Rejects a call. This API uses a promise 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 1199 1200 1201 1202 1203
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name | Type                                          | Mandatory| Description                                                        |
| ------- | ---------------------------------------------- | ---- | ------------------------------------------------------------ |
| callId  | number                                         | No  | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.|
| options | [RejectMessageOptions](#rejectmessageoptions7) | No  | Options for the call rejection message.                                              |

**Return value**

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

S
shawn_he 已提交
1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1216 1217 1218 1219 1220 1221
**Example**

```js
let rejectMessageOptions={
    messageContent: "Unknown number blocked"
}
S
shawn_he 已提交
1222
let promise = call.rejectCall(1, rejectMessageOptions);
S
shawn_he 已提交
1223
promise.then(data => {
S
shawn_he 已提交
1224
    console.log(`rejectCall success, promise: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
1225
}).catch(err => {
S
shawn_he 已提交
1226
    console.error(`rejectCall fail, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1227 1228 1229
});
```

S
shawn_he 已提交
1230

S
shawn_he 已提交
1231
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1232

S
shawn_he 已提交
1233
rejectCall\(callback: AsyncCallback<void\>\): void
S
shawn_he 已提交
1234 1235 1236

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

S
shawn_he 已提交
1237
**System API**: This is a system API.
S
shawn_he 已提交
1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248

**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 已提交
1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1262 1263

```js
S
shawn_he 已提交
1264
call.rejectCall((err, data) => {
S
shawn_he 已提交
1265 1266 1267 1268 1269
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
1270
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1271

S
shawn_he 已提交
1272
rejectCall\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): void
S
shawn_he 已提交
1273 1274 1275

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

S
shawn_he 已提交
1276
**System API**: This is a system API.
S
shawn_he 已提交
1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288

**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 已提交
1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1302 1303 1304 1305 1306

```js
let rejectMessageOptions={
    messageContent: "Unknown number blocked"
}
S
shawn_he 已提交
1307
call.rejectCall(rejectMessageOptions, (err, data) => {
S
shawn_he 已提交
1308 1309 1310 1311 1312
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
1313 1314 1315 1316 1317 1318
## call.holdCall<sup>7+</sup>

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

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

S
shawn_he 已提交
1319
**System API**: This is a system API.
S
shawn_he 已提交
1320

S
shawn_he 已提交
1321 1322
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1323 1324 1325 1326 1327 1328 1329 1330 1331
**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 已提交
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358
**Example**

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


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

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

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

S
shawn_he 已提交
1359
**System API**: This is a system API.
S
shawn_he 已提交
1360

S
shawn_he 已提交
1361 1362
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376
**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 已提交
1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405
**Example**

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

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

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

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

S
shawn_he 已提交
1406
**System API**: This is a system API.
S
shawn_he 已提交
1407

S
shawn_he 已提交
1408 1409
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1410 1411 1412 1413 1414 1415 1416 1417 1418
**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 已提交
1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445
**Example**

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


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

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

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

S
shawn_he 已提交
1446
**System API**: This is a system API.
S
shawn_he 已提交
1447

S
shawn_he 已提交
1448 1449
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463
**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 已提交
1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492
**Example**

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

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

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

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

S
shawn_he 已提交
1493
**System API**: This is a system API.
S
shawn_he 已提交
1494

S
shawn_he 已提交
1495 1496
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1497 1498 1499 1500 1501 1502 1503 1504 1505
**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 已提交
1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532
**Example**

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


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

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

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

S
shawn_he 已提交
1533
**System API**: This is a system API.
S
shawn_he 已提交
1534

S
shawn_he 已提交
1535 1536
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550
**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 已提交
1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579
**Example**

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

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

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

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

S
shawn_he 已提交
1580
**System API**: This is a system API.
S
shawn_he 已提交
1581 1582 1583 1584 1585 1586 1587 1588 1589 1590

**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 已提交
1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601
**Error codes**
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 已提交
1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616
**Example**

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


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

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

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

S
shawn_he 已提交
1617
**System API**: This is a system API.
S
shawn_he 已提交
1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632

**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 已提交
1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643
**Error codes**
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 已提交
1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660
**Example**

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

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

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

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

S
shawn_he 已提交
1661
**System API**: This is a system API.
S
shawn_he 已提交
1662 1663 1664 1665 1666 1667 1668 1669 1670 1671

**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 已提交
1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683
**Error codes**
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 已提交
1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698
**Example**

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


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

getMainCallId\(callId: number\): Promise<number\>

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

S
shawn_he 已提交
1699
**System API**: This is a system API.
S
shawn_he 已提交
1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714

**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 已提交
1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725
**Error codes**
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 已提交
1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742
**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>

getSubCallIdList\(callId: number, callback: AsyncCallback<Array<string\>\>\): void

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

S
shawn_he 已提交
1743
**System API**: This is a system API.
S
shawn_he 已提交
1744 1745 1746 1747 1748 1749 1750 1751 1752 1753

**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 已提交
1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764
**Error codes**
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 已提交
1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779
**Example**

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


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

getSubCallIdList\(callId: number\): Promise<Array<string\>\>

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

S
shawn_he 已提交
1780
**System API**: This is a system API.
S
shawn_he 已提交
1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795

**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 已提交
1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806
**Error codes**
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 已提交
1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823
**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>

getCallIdListForConference\(callId: number, callback: AsyncCallback<Array<string\>>\): void

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

S
shawn_he 已提交
1824
**System API**: This is a system API.
S
shawn_he 已提交
1825 1826 1827 1828 1829 1830 1831 1832 1833 1834

**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 已提交
1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845
**Error codes**
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 已提交
1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860
**Example**

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


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

getCallIdListForConference\(callId: number\): Promise<Array<string\>\>

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

S
shawn_he 已提交
1861
**System API**: This is a system API.
S
shawn_he 已提交
1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876

**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 已提交
1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887
**Error codes**
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 已提交
1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904
**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>

getCallWaitingStatus\(slotId: number, callback: AsyncCallback<CallWaitingStatus\>\): void

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

S
shawn_he 已提交
1905
**System API**: This is a system API.
S
shawn_he 已提交
1906

S
shawn_he 已提交
1907 1908
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
1909 1910 1911 1912 1913 1914
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                                       | Mandatory| Description                                                        |
| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928
| 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**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944

**Example**

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


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

getCallWaitingStatus\(slotId: number\): Promise<CallWaitingStatus\>

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

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

S
shawn_he 已提交
1947 1948
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962
**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 已提交
1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991
**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>

setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback<void\>\): void

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

S
shawn_he 已提交
1992
**System API**: This is a system API.
S
shawn_he 已提交
1993

S
shawn_he 已提交
1994 1995
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
**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 已提交
2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032
**Example**

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


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

setCallWaiting\(slotId: number, activate: boolean\): Promise<void\>

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

S
shawn_he 已提交
2033
**System API**: This is a system API.
S
shawn_he 已提交
2034

S
shawn_he 已提交
2035 2036
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051
**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 已提交
2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078
**Example**

```js
let promise = call.setCallWaiting(0, true);
promise.then(data => {
    console.log(`setCallWaiting success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`setCallWaiting fail, promise: err->${JSON.stringify(err)}`);
});
```

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

startDTMF\(callId: number, character: string, callback: AsyncCallback<void\>\): void

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

S
shawn_he 已提交
2081
**System API**: This is a system API.
S
shawn_he 已提交
2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092

**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 已提交
2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103
**Error codes**
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 已提交
2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118
**Example**

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


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

startDTMF\(callId: number, character: string\): Promise<void\>

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

S
shawn_he 已提交
2119
**System API**: This is a system API.
S
shawn_he 已提交
2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135

**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 已提交
2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146
**Error codes**
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 已提交
2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163
**Example**

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

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

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

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

S
shawn_he 已提交
2164
**System API**: This is a system API.
S
shawn_he 已提交
2165 2166 2167 2168 2169 2170 2171 2172 2173 2174

**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 已提交
2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185
**Error codes**
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 已提交
2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200
**Example**

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


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

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

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

S
shawn_he 已提交
2201
**System API**: This is a system API.
S
shawn_he 已提交
2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216

**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 已提交
2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227
**Error codes**
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 已提交
2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244
**Example**

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

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

isInEmergencyCall\(callback: AsyncCallback<boolean\>\): void

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

S
shawn_he 已提交
2245
**System API**: This is a system API.
S
shawn_he 已提交
2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256

**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 已提交
2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283
**Example**

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


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

isInEmergencyCall\(\): Promise<boolean\>

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

S
shawn_he 已提交
2284
**System API**: This is a system API.
S
shawn_he 已提交
2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295

**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 已提交
2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324
**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>

on\(type: 'callDetailsChange', callback: Callback<CallAttributeOptions\>\): void

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

S
shawn_he 已提交
2325
**System API**: This is a system API.
S
shawn_he 已提交
2326

S
shawn_he 已提交
2327 2328
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2329 2330 2331 2332 2333 2334 2335 2336 2337
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                                   | Mandatory| Description                      |
| -------- | ------------------------------------------------------- | ---- | -------------------------- |
| type     | string                                                  | Yes  | Call details change during a call.|
| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | Yes  | Callback used to return the result.                |

S
shawn_he 已提交
2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2350 2351 2352
**Example**

```js
S
shawn_he 已提交
2353 2354
call.on('callDetailsChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2355 2356 2357 2358 2359 2360 2361 2362 2363
});
```

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

on\(type: 'callEventChange', callback: Callback<CallEventOptions\>\): void

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

S
shawn_he 已提交
2364
**System API**: This is a system API.
S
shawn_he 已提交
2365

S
shawn_he 已提交
2366 2367
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2368 2369 2370 2371 2372 2373 2374 2375 2376
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                            | Mandatory| Description                      |
| -------- | ------------------------------------------------ | ---- | -------------------------- |
| type     | string                                           | Yes  | Call event change during a call.|
| callback | Callback<[CallEventOptions](#calleventoptions8)> | Yes  | Callback used to return the result.                |

S
shawn_he 已提交
2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2389 2390 2391
**Example**

```js
S
shawn_he 已提交
2392 2393
call.on('callEventChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2394 2395 2396 2397 2398 2399 2400 2401 2402
});
```

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

on\(type: 'callDisconnectedCause', callback: Callback<DisconnectedDetails\>): void

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

S
shawn_he 已提交
2403
**System API**: This is a system API.
S
shawn_he 已提交
2404

S
shawn_he 已提交
2405 2406
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2407 2408 2409 2410 2411 2412 2413
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                                  | Mandatory| Description                      |
| -------- | ------------------------------------------------------ | ---- | -------------------------- |
| type     | string                                                 | Yes  | Cause of the call disconnection.|
S
shawn_he 已提交
2414
| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | Yes  | Callback used to return the result.                |
S
shawn_he 已提交
2415

S
shawn_he 已提交
2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2428 2429 2430
**Example**

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

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

on\(type: 'mmiCodeResult', callback: Callback<MmiCodeResults\>\): void

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

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

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

S
shawn_he 已提交
2446 2447 2448 2449 2450 2451 2452 2453 2454
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                        | Mandatory| Description                 |
| -------- | -------------------------------------------- | ---- | --------------------- |
| type     | string                                       | Yes  | Man-machine interface (MMI) code result.|
| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | Yes  | Callback used to return the result.           |

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2467 2468 2469
**Example**

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

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

off\(type: 'callDetailsChange', callback?: Callback<CallAttributeOptions\>\): void

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

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

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

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

**Parameters**

| Name  | Type                                                    | Mandatory| Description                              |
| -------- | -------------------------------------------------------- | ---- | ---------------------------------- |
S
shawn_he 已提交
2491
| type     | string                                                   | Yes  | IMS registration status changes.|
S
shawn_he 已提交
2492 2493
| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | No  | Callback used to return the result.                        |

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2506 2507 2508
**Example**

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

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

off\(type: 'callEventChange', callback?: Callback<CallEventOptions\>\): void

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

S
shawn_he 已提交
2520
**System API**: This is a system API.
S
shawn_he 已提交
2521

S
shawn_he 已提交
2522 2523
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

**Parameters**

| Name  | Type                                            | Mandatory| Description                              |
| -------- | ------------------------------------------------ | ---- | ---------------------------------- |
| type     | string                                           | Yes  | Unsubscription from call event changes when a call ends.|
| callback | Callback<[CallEventOptions](#calleventoptions8)> | No  | Callback used to return the result.                        |

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2545 2546 2547
**Example**

```js
S
shawn_he 已提交
2548 2549
call.off('callEventChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2550 2551 2552 2553 2554 2555 2556 2557 2558
});
```

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

off\(type: 'callDisconnectedCause', callback?: Callback<DisconnectedDetails\>\): void

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

S
shawn_he 已提交
2559
**System API**: This is a system API.
S
shawn_he 已提交
2560

S
shawn_he 已提交
2561 2562
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2563 2564 2565 2566 2567 2568 2569
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                                      | Mandatory| Description                |
| -------- | ---------------------------------------------------------- | ---- | -------------------- |
| type     | 'callDisconnectedCause'                                    | Yes  | Unsubscription from the call disconnection cause when a call ends.|
S
shawn_he 已提交
2570
| callback | Callback**<**[DisconnectedDetails](#disconnecteddetails9)> | No  | Callback used to return the result.          |
S
shawn_he 已提交
2571

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

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2584 2585 2586
**Example**

```js
S
shawn_he 已提交
2587 2588
call.off('callDisconnectedCause', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2589 2590 2591 2592 2593 2594 2595 2596 2597
});
```

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

off\(type: 'mmiCodeResult', callback?: Callback<MmiCodeResults\>\): void

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

S
shawn_he 已提交
2598
**System API**: This is a system API.
S
shawn_he 已提交
2599

S
shawn_he 已提交
2600 2601
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2602 2603 2604 2605 2606 2607 2608 2609 2610
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                            | Mandatory| Description       |
| -------- | ------------------------------------------------ | ---- | ----------- |
| type     | 'mmiCodeResult'                                  | Yes  | MMI code result.|
| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | No  | Callback used to return the result. |

S
shawn_he 已提交
2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2623 2624 2625
**Example**

```js
S
shawn_he 已提交
2626 2627
call.off('mmiCodeResult', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2628 2629 2630 2631 2632 2633 2634 2635 2636
});
```

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

isNewCallAllowed\(callback: AsyncCallback<boolean\>\): void

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

S
shawn_he 已提交
2637
**System API**: This is a system API.
S
shawn_he 已提交
2638 2639 2640 2641 2642 2643 2644 2645 2646

**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 已提交
2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657
**Error codes**
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 已提交
2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672
**Example**

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


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

isNewCallAllowed\(\): Promise<boolean\>

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

S
shawn_he 已提交
2673
**System API**: This is a system API.
S
shawn_he 已提交
2674 2675 2676 2677 2678 2679 2680 2681 2682

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

**Return value**

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

S
shawn_he 已提交
2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693
**Error codes**
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 已提交
2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708
**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>

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

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

S
shawn_he 已提交
2711
**System API**: This is a system API.
S
shawn_he 已提交
2712 2713 2714 2715 2716 2717 2718 2719 2720 2721

**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 已提交
2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732
**Error codes**
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 已提交
2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745
**Example**

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


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

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

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

S
shawn_he 已提交
2748
**System API**: This is a system API.
S
shawn_he 已提交
2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763

**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 已提交
2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774
**Error codes**
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 已提交
2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791
**Example**

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

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

getCallRestrictionStatus\(slotId: number, type: CallRestrictionType, callback: AsyncCallback<RestrictionStatus\>\): void

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

S
shawn_he 已提交
2792
**System API**: This is a system API.
S
shawn_he 已提交
2793

S
shawn_he 已提交
2794 2795
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
2796 2797 2798 2799 2800 2801 2802 2803 2804 2805
**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 已提交
2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832
**Example**

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


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

getCallRestrictionStatus\(slotId: number, type: CallRestrictionType\): Promise<RestrictionStatus\>

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

S
shawn_he 已提交
2833
**System API**: This is a system API.
S
shawn_he 已提交
2834

S
shawn_he 已提交
2835 2836
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851
**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 已提交
2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880
**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>

setCallRestriction\(slotId: number, info: CallRestrictionInfo, callback: AsyncCallback<void\>\): void

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

S
shawn_he 已提交
2881
**System API**: This is a system API.
S
shawn_he 已提交
2882

S
shawn_he 已提交
2883 2884
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2885 2886 2887 2888 2889 2890 2891 2892 2893 2894
**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 已提交
2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926
**Example**

```js
let callRestrictionInfo={
    type: 1,
    password: "123456",
    mode: 1
}
call.setCallRestriction(0, callRestrictionInfo, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


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

setCallRestriction\(slotId: number, info: CallRestrictionInfo\): Promise<void\>

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

S
shawn_he 已提交
2927
**System API**: This is a system API.
S
shawn_he 已提交
2928

S
shawn_he 已提交
2929 2930
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945
**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 已提交
2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979
**Example**

```js
let callRestrictionInfo={
    type: 1,
    password: "123456",
    mode: 1
}
let promise = call.setCallRestriction(0, callRestrictionInfo);
promise.then(data => {
    console.log(`setCallRestriction success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`setCallRestriction fail, promise: err->${JSON.stringify(err)}`);
});
```

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

getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCallback<CallTransferResult\>\): void

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

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

S
shawn_he 已提交
2982 2983
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
2984 2985 2986 2987 2988 2989 2990 2991 2992 2993
**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 已提交
2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
3006 3007 3008
**Example**

```js
S
shawn_he 已提交
3009
call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY, (err, data) => {
S
shawn_he 已提交
3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


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

getCallTransferInfo\(slotId: number, type: CallTransferType): Promise<CallTransferResult\>

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

S
shawn_he 已提交
3021
**System API**: This is a system API.
S
shawn_he 已提交
3022

S
shawn_he 已提交
3023 3024
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039
**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 已提交
3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
3052 3053 3054
**Example**

```js
S
shawn_he 已提交
3055
let promise = call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY);
S
shawn_he 已提交
3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068
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>

setCallTransfer\(slotId: number, info: CallTransferInfo, callback: AsyncCallback<void\>\): void

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

S
shawn_he 已提交
3069
**System API**: This is a system API.
S
shawn_he 已提交
3070

S
shawn_he 已提交
3071 3072
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3073 3074 3075 3076 3077 3078 3079 3080 3081 3082
**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 已提交
3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114
**Example**

```js
let callTransferInfo={
    transferNum: "111",
    type: 1,
    settingType: 1
}
call.setCallTransfer(0, callTransferInfo, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


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

setCallTransfer\(slotId: number, info: CallTransferInfo): Promise<void\>

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

S
shawn_he 已提交
3115
**System API**: This is a system API.
S
shawn_he 已提交
3116

S
shawn_he 已提交
3117 3118
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133
**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 已提交
3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167
**Example**

```js
let callTransferInfo={
    transferNum: "111",
    type: 1,
    settingType: 1
}
let promise = call.setCallTransfer(0, callTransferInfo);
promise.then(data => {
    console.log(`setCallTransfer success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`setCallTransfer fail, promise: err->${JSON.stringify(err)}`);
});
```

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

isRinging\(callback: AsyncCallback<boolean\>\): void

Checks whether the ringtone is playing. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3168
**System API**: This is a system API.
S
shawn_he 已提交
3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179

**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 已提交
3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206
**Example**

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


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

isRinging\(\): Promise<boolean\>

Checks whether the ringtone is playing. This API uses a promise to return the result.

S
shawn_he 已提交
3207
**System API**: This is a system API.
S
shawn_he 已提交
3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218

**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 已提交
3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247
**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>

setMuted\(callback: AsyncCallback<void\>\): void

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

S
shawn_he 已提交
3248
**System API**: This is a system API.
S
shawn_he 已提交
3249 3250 3251 3252 3253 3254 3255 3256 3257

**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 已提交
3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268
**Error codes**
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 已提交
3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283
**Example**

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


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

setMuted\(\): Promise<void\>

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

S
shawn_he 已提交
3284
**System API**: This is a system API.
S
shawn_he 已提交
3285 3286 3287 3288 3289 3290 3291 3292 3293

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

**Return value**

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

S
shawn_he 已提交
3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304
**Error codes**
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 已提交
3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321
**Example**

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

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

cancelMuted(callback: AsyncCallback<void\>): void

Cancels call muting. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3322
**System API**: This is a system API.
S
shawn_he 已提交
3323 3324 3325 3326 3327 3328 3329 3330 3331

**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 已提交
3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342
**Error codes**
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 已提交
3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357
**Example**

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


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

cancelMuted(): Promise<void\>

Cancels call muting. This API uses a promise to return the result.

S
shawn_he 已提交
3358
**System API**: This is a system API.
S
shawn_he 已提交
3359 3360 3361 3362 3363 3364 3365 3366 3367

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

**Return value**

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

S
shawn_he 已提交
3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378
**Error codes**
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 已提交
3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389
**Example**

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

S
shawn_he 已提交
3390
## call.setAudioDevice<sup>8+</sup>
S
shawn_he 已提交
3391 3392 3393 3394 3395

setAudioDevice\(device: AudioDevice, callback: AsyncCallback<void\>\): void

Sets the audio device for a call. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3396
**System API**: This is a system API.
S
shawn_he 已提交
3397 3398 3399 3400 3401 3402 3403 3404 3405 3406

**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 已提交
3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417
**Error codes**
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 已提交
3418 3419 3420 3421 3422 3423 3424 3425 3426
**Example**

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


S
shawn_he 已提交
3427
## call.setAudioDevice<sup>9+</sup>
S
shawn_he 已提交
3428 3429 3430 3431 3432

setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: AsyncCallback<void\>\): void

Sets the audio device for a call based on the specified options. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3433
**System API**: This is a system API.
S
shawn_he 已提交
3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444

**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 已提交
3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455
**Error codes**
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 已提交
3456 3457 3458 3459 3460 3461
**Example**

```js
let audioDeviceOptions={
    bluetoothAddress: "IEEE 802-2014"
}
S
shawn_he 已提交
3462
call.setAudioDevice(1, audioDeviceOptions, (err, data) => {
S
shawn_he 已提交
3463 3464 3465 3466 3467
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
3468
## call.setAudioDevice<sup>9+</sup>
S
shawn_he 已提交
3469 3470 3471 3472 3473

setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise<void\>

Sets the audio device for a call based on the specified options. This API uses a promise to return the result.

S
shawn_he 已提交
3474
**System API**: This is a system API.
S
shawn_he 已提交
3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490

**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 已提交
3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501
**Error codes**
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 已提交
3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521
**Example**

```js
let audioDeviceOptions={
    bluetoothAddress: "IEEE 802-2014"
}
let promise = call.setAudioDevice(1, audioDeviceOptions);
promise.then(data => {
    console.log(`setAudioDevice success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`setAudioDevice fail, promise: err->${JSON.stringify(err)}`);
});
```

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

joinConference(mainCallId: number, callNumberList: Array<string\>, callback: AsyncCallback<void\>): void

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

S
shawn_he 已提交
3522
**System API**: This is a system API.
S
shawn_he 已提交
3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533

**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 已提交
3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544
**Error codes**
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 已提交
3545 3546 3547
**Example**

```js
S
shawn_he 已提交
3548 3549 3550 3551
let callNumberList: Array<string> = [
    "138XXXXXXXX"
];
call.joinConference(1, callNumberList, (err, data) => {
S
shawn_he 已提交
3552 3553 3554 3555 3556 3557 3558 3559 3560 3561
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

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

joinConference(mainCallId: number, callNumberList: Array<string\>): Promise<void\>

Joins a conference call. This API uses a promise to return the result.

S
shawn_he 已提交
3562
**System API**: This is a system API.
S
shawn_he 已提交
3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578

**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 已提交
3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589
**Error codes**
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 已提交
3590 3591 3592
**Example**

```js
S
shawn_he 已提交
3593 3594 3595 3596
let callNumberList: Array<string> = [
    "138XXXXXXXX"
];
let promise = call.joinConference(1, callNumberList);
S
shawn_he 已提交
3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609
promise.then(data => {
    console.log(`joinConference success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`joinConference fail, promise: err->${JSON.stringify(err)}`);
});
```

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

updateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback<void\>): void

Updates the IMS call mode. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3610
**System API**: This is a system API.
S
shawn_he 已提交
3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621

**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 已提交
3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632
**Error codes**
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 已提交
3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646
**Example**

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

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

updateImsCallMode(callId: number, mode: ImsCallMode): Promise<void\>

Updates the IMS call mode. This API uses a promise to return the result.

S
shawn_he 已提交
3647
**System API**: This is a system API.
S
shawn_he 已提交
3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663

**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 已提交
3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674
**Error codes**
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 已提交
3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691
**Example**

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

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

enableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void

Enables the IMS switch. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3692
**System API**: This is a system API.
S
shawn_he 已提交
3693

S
shawn_he 已提交
3694 3695
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3696 3697 3698 3699 3700 3701 3702 3703 3704
**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 已提交
3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730
**Example**

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

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

enableImsSwitch(slotId: number): Promise<void\>

Enables the IMS switch. This API uses a promise to return the result.

S
shawn_he 已提交
3731
**System API**: This is a system API.
S
shawn_he 已提交
3732

S
shawn_he 已提交
3733 3734
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748
**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 已提交
3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777
**Example**

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

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

disableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void

Disables the IMS switch. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3778
**System API**: This is a system API.
S
shawn_he 已提交
3779

S
shawn_he 已提交
3780 3781
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3782 3783 3784 3785 3786 3787 3788 3789 3790
**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 已提交
3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816
**Example**

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

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

disableImsSwitch(slotId: number): Promise<void\>

Disables the IMS switch. This API uses a promise to return the result.

S
shawn_he 已提交
3817
**System API**: This is a system API.
S
shawn_he 已提交
3818

S
shawn_he 已提交
3819 3820
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834
**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 已提交
3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863
**Example**

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

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

isImsSwitchEnabled(slotId: number, callback: AsyncCallback<boolean\>): void

Checks whether the IMS switch is enabled. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
3864
**System API**: This is a system API.
S
shawn_he 已提交
3865 3866 3867 3868 3869 3870 3871 3872 3873 3874

**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 已提交
3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885
**Error codes**
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 已提交
3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899
**Example**

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

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

isImsSwitchEnabled(slotId: number): Promise<boolean\>

Checks whether the IMS switch is enabled. This API uses a promise to return the result.

S
shawn_he 已提交
3900
**System API**: This is a system API.
S
shawn_he 已提交
3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915

**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 已提交
3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926
**Error codes**
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 已提交
3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937
**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 已提交
3938
## DialOptions
S
shawn_he 已提交
3939

S
shawn_he 已提交
3940
Provides an option for determining whether a call is a video call.
S
shawn_he 已提交
3941 3942 3943

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

S
shawn_he 已提交
3944 3945
|        Name             | Type                              | Mandatory| Description                                                                                            |
| ------------------------ | ---------------------------------- | ---- | ----------------------------------------------------------------------------------------------- |
S
shawn_he 已提交
3946
| extras                   | boolean                            | No  | Indication of a video call. <br>- **true**: video call<br>- **false** (default): voice call|
S
shawn_he 已提交
3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963
| accountId <sup>8+</sup>  | number                             | No  | Account ID.<br>- **0**: card slot 1<br>- **1**: card slot 2<br>This is a system API.                                   |
| videoState <sup>8+</sup> | [VideoStateType](#videostatetype7) | No  | Video state type. This is a system API.                                                                |
| dialScene <sup>8+</sup>  | [DialScene](#dialscene8)           | No  | Dialup scenario. This is a system API.                                                                    |
| dialType <sup>8+</sup>   | [DialType](#dialtype8)             | No  | Dialup type. This is a system API.                                                                    |

## 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 已提交
3964

S
shawn_he 已提交
3965
## CallState
S
shawn_he 已提交
3966 3967

Enumerates call states.
S
shawn_he 已提交
3968

S
shawn_he 已提交
3969 3970 3971
**System capability**: SystemCapability.Telephony.CallManager

| Name              | Value  | Description                                                        |
S
shawn_he 已提交
3972
| ------------------ | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
3973 3974 3975
| 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 已提交
3976
| 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 已提交
3977

S
shawn_he 已提交
3978
## EmergencyNumberOptions<sup>7+</sup>
S
shawn_he 已提交
3979

S
shawn_he 已提交
3980
Provides an option for determining whether a number is an emergency number for the SIM card in the specified slot.
S
shawn_he 已提交
3981 3982 3983

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

S
shawn_he 已提交
3984
|  Name | Type  | Mandatory| Description                                          |
S
shawn_he 已提交
3985 3986
| ------ | ------ | ---- | ---------------------------------------------- |
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
3987

S
shawn_he 已提交
3988
## NumberFormatOptions<sup>7+</sup>
S
shawn_he 已提交
3989

S
shawn_he 已提交
3990
Provides an option for number formatting.
S
shawn_he 已提交
3991 3992 3993

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

S
shawn_he 已提交
3994
|    Name    | Type  | Mandatory| Description                                                      |
S
shawn_he 已提交
3995
| ----------- | ------ | ---- | ---------------------------------------------------------- |
S
shawn_he 已提交
3996
| countryCode | string | No  | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.|
S
shawn_he 已提交
3997 3998 3999 4000 4001

## ImsCallMode<sup>8+</sup>

Enumerates IMS call modes.

S
shawn_he 已提交
4002
**System API**: This is a system API.
S
shawn_he 已提交
4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017

**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 已提交
4018
**System API**: This is a system API.
S
shawn_he 已提交
4019 4020 4021 4022 4023

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

| Name                | Value  | Description        |
| -------------------- | ---- | ------------ |
S
shawn_he 已提交
4024 4025 4026
| DEVICE_EARPIECE      | 0    | Headset device.    |
| DEVICE_SPEAKER       | 1    | Speaker device.|
| DEVICE_WIRED_HEADSET | 2    | Wired headset device.|
S
shawn_he 已提交
4027
| DEVICE_BLUETOOTH_SCO | 3    | Bluetooth SCO device. |
S
shawn_he 已提交
4028
| DEVICE_MIC           | 4    | Microphone device|
S
shawn_he 已提交
4029 4030 4031 4032 4033

## CallRestrictionType<sup>8+</sup>

Enumerates call restriction types.

S
shawn_he 已提交
4034
**System API**: This is a system API.
S
shawn_he 已提交
4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052

**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 已提交
4053
**System API**: This is a system API.
S
shawn_he 已提交
4054 4055 4056

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

S
shawn_he 已提交
4057 4058 4059 4060 4061 4062 4063
|          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 已提交
4064
| endHour<sup>9+</sup>     | number                                               | No  | Minute in the end time.|
S
shawn_he 已提交
4065
| endMinute<sup>9+</sup>   | number                                               | No  | Minute in the end time.|
S
shawn_he 已提交
4066 4067 4068 4069 4070

## CallTransferType<sup>8+</sup>

Enumerates call transfer types.

S
shawn_he 已提交
4071
**System API**: This is a system API.
S
shawn_he 已提交
4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085

**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 已提交
4086
**System API**: This is a system API.
S
shawn_he 已提交
4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100

**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 已提交
4101
**System API**: This is a system API.
S
shawn_he 已提交
4102 4103 4104

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

S
shawn_he 已提交
4105
|      Name      | Type                                    | Mandatory| Description          |
S
shawn_he 已提交
4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121
| --------------- | ---------------------------------------- | ---- | -------------- |
| 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 已提交
4122
**System API**: This is a system API.
S
shawn_he 已提交
4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136

**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 已提交
4137
**System API**: This is a system API.
S
shawn_he 已提交
4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149

**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 已提交
4150
Video state type.
S
shawn_he 已提交
4151

S
shawn_he 已提交
4152
**System API**: This is a system API.
S
shawn_he 已提交
4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164

**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 已提交
4165
**System API**: This is a system API.
S
shawn_he 已提交
4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184

**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 已提交
4185
**System API**: This is a system API.
S
shawn_he 已提交
4186 4187 4188

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

S
shawn_he 已提交
4189
|   Name  | Type                                        | Mandatory| Description        |
S
shawn_he 已提交
4190 4191 4192 4193 4194 4195 4196 4197 4198
| -------- | -------------------------------------------- | ---- | ------------ |
| 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 已提交
4199
**System API**: This is a system API.
S
shawn_he 已提交
4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211

**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 已提交
4212
**System API**: This is a system API.
S
shawn_he 已提交
4213 4214 4215

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

S
shawn_he 已提交
4216
|   Name | Type                                      | Mandatory| Description          |
S
shawn_he 已提交
4217 4218 4219 4220 4221 4222 4223
| ------- | ------------------------------------------ | ---- | -------------- |
| eventId | [CallAbilityEventId](#callabilityeventid8) | Yes  | Call ability event ID.|

## CallAbilityEventId<sup>8+</sup>

Enumerates call ability event IDs.

S
shawn_he 已提交
4224
**System API**: This is a system API.
S
shawn_he 已提交
4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236

**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 已提交
4237
**System API**: This is a system API.
S
shawn_he 已提交
4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250

**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 已提交
4251
**System API**: This is a system API.
S
shawn_he 已提交
4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264

**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 已提交
4265
**System API**: This is a system API.
S
shawn_he 已提交
4266 4267 4268

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

S
shawn_he 已提交
4269
|     Name      | Type  | Mandatory| Description    |
S
shawn_he 已提交
4270 4271 4272 4273 4274 4275 4276
| -------------- | ------ | ---- | -------- |
| messageContent | string | Yes  | Message content.|

## CallTransferResult<sup>8+</sup>

Defines the call transfer result.

S
shawn_he 已提交
4277
**System API**: This is a system API.
S
shawn_he 已提交
4278 4279 4280

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

S
shawn_he 已提交
4281 4282 4283 4284 4285 4286
|          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 已提交
4287
| endHour<sup>9+</sup>     | number                             |  Yes | Minute in the end time.|
S
shawn_he 已提交
4288
| endMinute<sup>9+</sup>   | number                             |  Yes | Minute in the end time.|
S
shawn_he 已提交
4289 4290 4291 4292 4293

## CallWaitingStatus<sup>7+</sup>

Enumerates call waiting states.

S
shawn_he 已提交
4294
**System API**: This is a system API.
S
shawn_he 已提交
4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306

**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 已提交
4307
**System API**: This is a system API.
S
shawn_he 已提交
4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319

**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 已提交
4320
**System API**: This is a system API.
S
shawn_he 已提交
4321 4322 4323 4324 4325 4326 4327 4328

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

| Name            | Value  | Description    |
| ---------------- | ---- | -------- |
| TRANSFER_DISABLE | 0    | Call transfer disabled.|
| TRANSFER_ENABLE  | 1    | Call transfer enabled.|

S
shawn_he 已提交
4329 4330 4331 4332
## DisconnectedDetails<sup>9+</sup>

Defines the cause of a call disconnection.

S
shawn_he 已提交
4333
**System API**: This is a system API.
S
shawn_he 已提交
4334 4335 4336 4337 4338 4339 4340 4341 4342

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

| Name   |                    Type                   | Mandatory| Description           |
| ------- | ------------------------------------------ | ---- | --------------- |
| reason  | [DisconnectedReason](#disconnectedreason8) | Yes  | Cause of the call disconnection.   |
| message | string                                     | Yes  | Message indicating the call disconnection.|

## DisconnectedReason<sup>8+</sup>
S
shawn_he 已提交
4343 4344 4345

Enumerates causes of call disconnection.

S
shawn_he 已提交
4346
**System API**: This is a system API.
S
shawn_he 已提交
4347 4348 4349

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

S
shawn_he 已提交
4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430
|                              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 已提交
4431 4432 4433 4434 4435

## MmiCodeResults<sup>9+</sup>

Defines the MMI code result.

S
shawn_he 已提交
4436
**System API**: This is a system API.
S
shawn_he 已提交
4437 4438 4439 4440 4441 4442 4443 4444 4445 4446

**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 已提交
4447
Defines the MMI code result.
S
shawn_he 已提交
4448

S
shawn_he 已提交
4449
**System API**: This is a system API.
S
shawn_he 已提交
4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461

**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 已提交
4462
**System API**: This is a system API.
S
shawn_he 已提交
4463 4464 4465 4466 4467 4468

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

| Name            | Type  | Mandatory| Description    |
| ---------------- | ------ | ---- | -------- |
| bluetoothAddress | string | No  | Bluetooth address.|