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

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

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

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

## Modules to Import

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

S
shawn_he 已提交
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
## 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                                   |
S
shawn_he 已提交
32
| ----------- | ---------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
33
| phoneNumber | string                       | Yes  | Phone number.                             |
S
shawn_he 已提交
34
| callback    | AsyncCallback&lt;void&gt;    | Yes  | Callback used to return the result.  |
S
shawn_he 已提交
35 36

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

S
shawn_he 已提交
38 39 40 41 42 43 44 45 46 47 48 49 50 51
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
S
shawn_he 已提交
52 53
call.dialCall("138xxxxxxxx", (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
});
```


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

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

S
shawn_he 已提交
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
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,
S
shawn_he 已提交
99 100
}, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
});
```


## 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.                            |
S
shawn_he 已提交
122
| options     | [DialCallOptions](#dialcalloptions9)| No  | Call options, which carry other configuration information of the call.|
S
shawn_he 已提交
123 124 125

**Return value**

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

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

S
shawn_he 已提交
132 133 134 135 136 137 138 139 140 141 142 143 144 145
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
S
shawn_he 已提交
146 147 148 149 150 151 152 153 154 155 156
let promise = call.dialCall("138xxxxxxxx", {
    accountId: 0,
    videoState: 0,
    dialScene: 0,
    dialType: 0,
});
promise.then(() => {
    console.log(`dialCall success.`);
}).catch((err) => {
    console.error(`dialCall fail, promise: err->${JSON.stringify(err)}`);
});
S
shawn_he 已提交
157 158
```

S
shawn_he 已提交
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 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
## call.dial<sup>(deprecated)</sup>

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

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

> **NOTE**
>
> This API is supported since API version 6 and deprecated since API version 9. You are advised to use [dialCall](#calldialcall9). The substitute API is available only for system applications.

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

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

**Parameters**

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

**Example**

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


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

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

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

> **NOTE**
>
> This API is supported since API version 6 and deprecated since API version 9. You are advised to use [dialCall](#calldialcall9). The substitute API is available only for system applications.

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

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

**Parameters**

| Name     | Type                        | Mandatory| Description                                   |
| ----------- | ---------------------------- | ---- | --------------------------------------- |
| phoneNumber | string                       | Yes  | Phone number.                             |
| options     | [DialOptions](#dialoptions)  | Yes  | Call option, which indicates whether the call is a voice call or video call. |
| callback    | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.<br>- **true**: success<br>- **false**: failure|

**Example**

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

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

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

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

> **NOTE**
>
> This API is supported since API version 6 and deprecated since API version 9. You are advised to use [dialCall](#calldialcall9). The substitute API is available only for system applications.

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

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

**Parameters**

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

**Return value**

| Type                  | Description                                                        |
| ---------------------- | ------------------------------------------------------------ |
| Promise&lt;boolean&gt; | Promise used to return the result.<br>- **true**: success<br>- **false**: failure|

**Example**

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

S
shawn_he 已提交
261
## call.makeCall<sup>7+</sup>
S
shawn_he 已提交
262

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

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

S
shawn_he 已提交
267
**System capability**: SystemCapability.Applications.Contacts
S
shawn_he 已提交
268 269 270

**Parameters**

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

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

S
shawn_he 已提交
278 279 280 281 282 283 284 285 286
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 已提交
287 288 289

**Example**

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


S
shawn_he 已提交
297
## call.makeCall<sup>7+</sup>
S
shawn_he 已提交
298

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

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

S
shawn_he 已提交
303
**System capability**: SystemCapability.Applications.Contacts
S
shawn_he 已提交
304 305 306

**Parameters**

S
shawn_he 已提交
307
| Name     | Type  | Mandatory| Description      |
S
shawn_he 已提交
308
| ----------- | ------ | ---- | ---------- |
S
shawn_he 已提交
309
| phoneNumber | string | Yes  | Phone number.|
S
shawn_he 已提交
310

S
shawn_he 已提交
311
**Return value**
S
shawn_he 已提交
312 313 314

| Type               | Description                             |
| ------------------- | --------------------------------- |
S
shawn_he 已提交
315 316 317
| Promise&lt;void&gt; | Promise used to return the result.|

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

S
shawn_he 已提交
319 320 321 322 323 324 325 326 327
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 已提交
328 329 330

**Example**

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

S
shawn_he 已提交
340
## call.hasCall
S
shawn_he 已提交
341 342 343

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

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

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

S
shawn_he 已提交
348
**Parameters**
S
shawn_he 已提交
349

S
shawn_he 已提交
350
| Name  | Type                        | Mandatory| Description                                                        |
S
shawn_he 已提交
351
| -------- | ---------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
352
| 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 已提交
353

S
shawn_he 已提交
354
**Example**
S
shawn_he 已提交
355

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


S
shawn_he 已提交
363
## call.hasCall
S
shawn_he 已提交
364 365 366

hasCall\(\): Promise<boolean\>

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

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

S
shawn_he 已提交
371
**Return value**
S
shawn_he 已提交
372

S
shawn_he 已提交
373
| Type                  | Description                                   |
S
shawn_he 已提交
374
| ---------------------- | --------------------------------------- |
S
shawn_he 已提交
375
| Promise&lt;boolean&gt; | Promise used to return the result.|
S
shawn_he 已提交
376

S
shawn_he 已提交
377
**Example**
S
shawn_he 已提交
378

S
shawn_he 已提交
379
```js
S
shawn_he 已提交
380 381 382 383 384 385 386
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 已提交
387 388


S
shawn_he 已提交
389
## call.getCallState
S
shawn_he 已提交
390 391 392

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

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

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

S
shawn_he 已提交
397
**Parameters**
S
shawn_he 已提交
398

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

S
shawn_he 已提交
403
**Example**
S
shawn_he 已提交
404

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


S
shawn_he 已提交
412
## call.getCallState
S
shawn_he 已提交
413 414 415

getCallState\(\): Promise<CallState\>

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

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

S
shawn_he 已提交
420
**Return value**
S
shawn_he 已提交
421

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

S
shawn_he 已提交
426
**Example**
S
shawn_he 已提交
427

S
shawn_he 已提交
428
```js
S
shawn_he 已提交
429 430 431 432 433 434 435
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 已提交
436

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

hasVoiceCapability(): boolean

S
shawn_he 已提交
441
Checks whether a device supports voice calls.
S
shawn_he 已提交
442 443 444

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

S
shawn_he 已提交
445
**Return value**
S
shawn_he 已提交
446 447 448

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

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

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

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

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

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

S
shawn_he 已提交
464
**Parameters**
S
shawn_he 已提交
465

S
shawn_he 已提交
466
| Name     | Type                        | Mandatory| Description                                                        |
S
shawn_he 已提交
467
| ----------- | ---------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
468
| phoneNumber | string                       | Yes  | Phone number.                                                  |
S
shawn_he 已提交
469 470 471
| callback    | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result. - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.|

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

S
shawn_he 已提交
473 474 475 476 477 478 479 480 481
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 已提交
482

S
shawn_he 已提交
483
**Example**
S
shawn_he 已提交
484

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


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

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

S
shawn_he 已提交
496
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 已提交
497

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

S
shawn_he 已提交
500
**Parameters**
S
shawn_he 已提交
501

S
shawn_he 已提交
502 503 504 505 506 507 508
| Name     | Type                                              | Mandatory| Description                                                        |
| ----------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ |
| phoneNumber | string                                             | Yes  | Phone number.                                                  |
| options     | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes  | Phone number.                                              |
| callback    | AsyncCallback&lt;boolean&gt;                       | Yes  | Callback used to return the result. - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.|

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

S
shawn_he 已提交
510 511 512 513 514 515 516 517 518
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 已提交
519

S
shawn_he 已提交
520
**Example**
S
shawn_he 已提交
521

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


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

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

S
shawn_he 已提交
533
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 已提交
534

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

S
shawn_he 已提交
537
**Parameters**
S
shawn_he 已提交
538

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

S
shawn_he 已提交
544
**Return value**
S
shawn_he 已提交
545

S
shawn_he 已提交
546
| Type                  | Description                                               |
S
shawn_he 已提交
547
| ---------------------- | --------------------------------------------------- |
S
shawn_he 已提交
548 549 550
| Promise&lt;boolean&gt; | Promise used to return the result.|

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

S
shawn_he 已提交
552 553 554 555 556 557 558 559 560
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 已提交
561

S
shawn_he 已提交
562
**Example**
S
shawn_he 已提交
563

S
shawn_he 已提交
564
```js
S
shawn_he 已提交
565 566 567 568 569 570 571
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 已提交
572

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

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

S
shawn_he 已提交
577 578 579
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 已提交
580

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

S
shawn_he 已提交
583
**Parameters**
S
shawn_he 已提交
584

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

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

S
shawn_he 已提交
592 593 594 595 596 597 598 599 600
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 已提交
601

S
shawn_he 已提交
602
**Example**
S
shawn_he 已提交
603

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

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

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

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

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

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

S
shawn_he 已提交
620
**Parameters**
S
shawn_he 已提交
621

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

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

S
shawn_he 已提交
630 631 632 633 634 635 636 637 638
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 已提交
639

S
shawn_he 已提交
640
**Example**
S
shawn_he 已提交
641

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


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

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

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

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

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

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

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

S
shawn_he 已提交
668
**Return value**
S
shawn_he 已提交
669

S
shawn_he 已提交
670
| Type                 | Description                                       |
S
shawn_he 已提交
671
| --------------------- | ------------------------------------------- |
S
shawn_he 已提交
672 673 674
| Promise&lt;string&gt; | Promise used to return the result.|

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

S
shawn_he 已提交
676 677 678 679 680 681 682 683 684
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 已提交
685

S
shawn_he 已提交
686
**Example**
S
shawn_he 已提交
687

S
shawn_he 已提交
688
```js
S
shawn_he 已提交
689 690 691 692 693 694 695 696 697
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 已提交
698

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

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

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

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

S
shawn_he 已提交
709
**Parameters**
S
shawn_he 已提交
710

S
shawn_he 已提交
711
| Name     | Type                       | Mandatory| Description                                                 |
S
shawn_he 已提交
712
| ----------- | --------------------------- | ---- | ----------------------------------------------------- |
S
shawn_he 已提交
713 714
| phoneNumber | string                      | Yes  | Phone number.                                           |
| countryCode | string                      | Yes  | Country code, for example, **CN** (China). All country codes are supported.             |
S
shawn_he 已提交
715 716 717
| callback    | AsyncCallback&lt;string&gt; | Yes  | Callback used to return the result.|

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

S
shawn_he 已提交
719 720 721 722 723 724 725 726 727
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 已提交
728

S
shawn_he 已提交
729
**Example**
S
shawn_he 已提交
730

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


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

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

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

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

S
shawn_he 已提交
750
**Parameters**
S
shawn_he 已提交
751

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

S
shawn_he 已提交
757
**Return value**
S
shawn_he 已提交
758

S
shawn_he 已提交
759
| Type                 | Description                                                        |
S
shawn_he 已提交
760
| --------------------- | ------------------------------------------------------------ |
S
shawn_he 已提交
761 762 763
| Promise&lt;string&gt; | Promise used to return the result.|

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

S
shawn_he 已提交
765 766 767 768 769 770 771 772 773
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 已提交
774

S
shawn_he 已提交
775
**Example**
S
shawn_he 已提交
776

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

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

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

S
shawn_he 已提交
790
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 已提交
791

S
shawn_he 已提交
792
**System API**: This is a system API.
S
shawn_he 已提交
793 794 795 796 797 798 799 800 801 802 803

**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 已提交
804
**Error codes**
S
shawn_he 已提交
805

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
810
| 201      | Permission denied.                           |
S
shawn_he 已提交
811 812 813 814 815 816
| 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 已提交
817 818 819
**Example**

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


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

muteRinger\(\): Promise<void\>

S
shawn_he 已提交
830
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 已提交
831

S
shawn_he 已提交
832
**System API**: This is a system API.
S
shawn_he 已提交
833 834 835 836 837 838 839 840 841 842 843

**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 已提交
844
**Error codes**
S
shawn_he 已提交
845

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
855 856 857
**Example**

```js
S
shawn_he 已提交
858 859 860
call.muteRinger().then(() => {
    console.log(`muteRinger success.`);
}).catch((err) => {
S
shawn_he 已提交
861 862 863 864 865
    console.error(`muteRinger fail, promise: err->${JSON.stringify(err)}`);
});
```


S
shawn_he 已提交
866
## call.answerCall<sup>9+</sup>
S
shawn_he 已提交
867 868

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

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

S
shawn_he 已提交
872
**System API**: This is a system API.
S
shawn_he 已提交
873 874 875 876 877 878 879 880 881 882 883 884

**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 已提交
885
**Error codes**
S
shawn_he 已提交
886

S
shawn_he 已提交
887 888 889 890 891 892 893 894 895 896 897
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 已提交
898 899 900
**Example**

```js
S
shawn_he 已提交
901 902
call.answerCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
903 904 905 906
});
```


S
shawn_he 已提交
907
## call.answerCall<sup>9+</sup>
S
shawn_he 已提交
908

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

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

S
shawn_he 已提交
913
**System API**: This is a system API.
S
shawn_he 已提交
914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930

**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 已提交
931
**Error codes**
S
shawn_he 已提交
932

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
944 945 946
**Example**

```js
S
shawn_he 已提交
947 948 949
call.answerCall(1).then(() => {
    console.log(`answerCall success.`);
}).catch((err) => {
S
shawn_he 已提交
950
    console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
951 952 953 954
});
```


S
shawn_he 已提交
955
## call.answerCall<sup>9+</sup>
S
shawn_he 已提交
956

S
shawn_he 已提交
957 958 959
answerCall\(callback: AsyncCallback<void\>\): void

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

S
shawn_he 已提交
961
**System API**: This is a system API.
S
shawn_he 已提交
962

S
shawn_he 已提交
963 964
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
965 966 967 968 969 970 971 972
**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 已提交
973
**Error codes**
S
shawn_he 已提交
974

S
shawn_he 已提交
975 976 977 978 979 980 981 982 983 984 985
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 已提交
986 987 988
**Example**

```js
S
shawn_he 已提交
989 990
call.answerCall((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
991 992 993 994
});
```


S
shawn_he 已提交
995
## call.hangUpCall<sup>9+</sup>
S
shawn_he 已提交
996

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

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

S
shawn_he 已提交
1001
**System API**: This is a system API.
S
shawn_he 已提交
1002

S
shawn_he 已提交
1003 1004
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1005 1006 1007 1008 1009 1010
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
1014
**Error codes**
S
shawn_he 已提交
1015

S
shawn_he 已提交
1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026
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 已提交
1027 1028 1029
**Example**

```js
S
shawn_he 已提交
1030 1031
call.hangUpCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1032 1033 1034 1035
});
```


S
shawn_he 已提交
1036
## call.hangUpCall<sup>9+</sup>
S
shawn_he 已提交
1037

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

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

S
shawn_he 已提交
1042
**System API**: This is a system API.
S
shawn_he 已提交
1043

S
shawn_he 已提交
1044 1045
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059
**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 已提交
1060
**Error codes**
S
shawn_he 已提交
1061

S
shawn_he 已提交
1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072
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 已提交
1073 1074 1075
**Example**

```js
S
shawn_he 已提交
1076 1077 1078
call.hangUpCall(1).then(() => {
    console.log(`hangUpCall success.`);
}).catch((err) => {
S
shawn_he 已提交
1079
    console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1080 1081 1082 1083
});
```


S
shawn_he 已提交
1084 1085 1086
## call.hangUpCall<sup>9+</sup>

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

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

S
shawn_he 已提交
1090
**System API**: This is a system API.
S
shawn_he 已提交
1091

S
shawn_he 已提交
1092 1093
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1094 1095 1096 1097 1098 1099 1100 1101
**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 已提交
1102
**Error codes**
S
shawn_he 已提交
1103

S
shawn_he 已提交
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115
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 已提交
1116 1117 1118
**Example**

```js
S
shawn_he 已提交
1119 1120
call.hangUpCall((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1121 1122 1123 1124
});
```


S
shawn_he 已提交
1125
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1126

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

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

S
shawn_he 已提交
1131
**System API**: This is a system API.
S
shawn_he 已提交
1132

S
shawn_he 已提交
1133 1134
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1135 1136 1137 1138 1139 1140 1141 1142 1143
**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 已提交
1144
**Error codes**
S
shawn_he 已提交
1145

S
shawn_he 已提交
1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156
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 已提交
1157 1158 1159 1160

**Example**

```js
S
shawn_he 已提交
1161 1162
call.rejectCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1163 1164 1165 1166
});
```


S
shawn_he 已提交
1167
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1168 1169

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

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

S
shawn_he 已提交
1173
**System API**: This is a system API.
S
shawn_he 已提交
1174

S
shawn_he 已提交
1175 1176
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1177 1178 1179 1180 1181 1182 1183 1184 1185 1186
**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 已提交
1187
**Error codes**
S
shawn_he 已提交
1188

S
shawn_he 已提交
1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199
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 已提交
1200 1201 1202 1203 1204 1205
**Example**

```js
let rejectMessageOptions={
    messageContent: "Unknown number blocked"
}
S
shawn_he 已提交
1206 1207
call.rejectCall(1, rejectMessageOptions, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1208 1209 1210 1211
});
```


S
shawn_he 已提交
1212
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1213

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

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

S
shawn_he 已提交
1218
**System API**: This is a system API.
S
shawn_he 已提交
1219

S
shawn_he 已提交
1220 1221
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236
**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 已提交
1237
**Error codes**
S
shawn_he 已提交
1238

S
shawn_he 已提交
1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249
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 已提交
1250 1251 1252 1253 1254 1255
**Example**

```js
let rejectMessageOptions={
    messageContent: "Unknown number blocked"
}
S
shawn_he 已提交
1256 1257 1258 1259
call.reject(1, rejectMessageOptions).then(() => {
    console.log(`reject success.`);
}).catch((err) => {
    console.error(`reject fail, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1260 1261 1262
});
```

S
shawn_he 已提交
1263

S
shawn_he 已提交
1264
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1265

S
shawn_he 已提交
1266
rejectCall\(callback: AsyncCallback<void\>\): void
S
shawn_he 已提交
1267 1268 1269

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

S
shawn_he 已提交
1270
**System API**: This is a system API.
S
shawn_he 已提交
1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281

**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 已提交
1282
**Error codes**
S
shawn_he 已提交
1283

S
shawn_he 已提交
1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295
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 已提交
1296 1297

```js
S
shawn_he 已提交
1298 1299
call.rejectCall((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1300 1301 1302 1303
});
```


S
shawn_he 已提交
1304
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1305

S
shawn_he 已提交
1306
rejectCall\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): void
S
shawn_he 已提交
1307 1308 1309

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

S
shawn_he 已提交
1310
**System API**: This is a system API.
S
shawn_he 已提交
1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322

**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 已提交
1323
**Error codes**
S
shawn_he 已提交
1324

S
shawn_he 已提交
1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336
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 已提交
1337 1338 1339 1340 1341

```js
let rejectMessageOptions={
    messageContent: "Unknown number blocked"
}
S
shawn_he 已提交
1342 1343
call.rejectCall(rejectMessageOptions, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1344 1345 1346 1347
});
```


S
shawn_he 已提交
1348 1349 1350 1351 1352 1353
## 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 已提交
1354
**System API**: This is a system API.
S
shawn_he 已提交
1355

S
shawn_he 已提交
1356 1357
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1358 1359 1360 1361 1362 1363 1364 1365 1366
**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 已提交
1367
**Error codes**
S
shawn_he 已提交
1368

S
shawn_he 已提交
1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379
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 已提交
1380 1381 1382
**Example**

```js
S
shawn_he 已提交
1383 1384
call.holdCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1385 1386 1387 1388 1389 1390 1391 1392 1393 1394
});
```


## 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 已提交
1395
**System API**: This is a system API.
S
shawn_he 已提交
1396

S
shawn_he 已提交
1397 1398
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412
**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 已提交
1413
**Error codes**
S
shawn_he 已提交
1414

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

```js
S
shawn_he 已提交
1429 1430 1431
call.holdCall(1).then(() => {
    console.log(`holdCall success.`);
}).catch((err) => {
S
shawn_he 已提交
1432 1433 1434 1435 1436 1437 1438 1439 1440 1441
    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 已提交
1442
**System API**: This is a system API.
S
shawn_he 已提交
1443

S
shawn_he 已提交
1444 1445
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1446 1447 1448 1449 1450 1451 1452 1453 1454
**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 已提交
1455
**Error codes**
S
shawn_he 已提交
1456

S
shawn_he 已提交
1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467
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 已提交
1468 1469 1470
**Example**

```js
S
shawn_he 已提交
1471 1472
call.unHoldCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1473 1474 1475 1476 1477 1478 1479 1480 1481 1482
});
```


## 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 已提交
1483
**System API**: This is a system API.
S
shawn_he 已提交
1484

S
shawn_he 已提交
1485 1486
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500
**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 已提交
1501
**Error codes**
S
shawn_he 已提交
1502

S
shawn_he 已提交
1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513
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 已提交
1514 1515 1516
**Example**

```js
S
shawn_he 已提交
1517 1518 1519
call.unHoldCall(1).then(() => {
    console.log(`unHoldCall success.`);
}).catch((err) => {
S
shawn_he 已提交
1520 1521 1522 1523 1524 1525 1526 1527 1528 1529
    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 已提交
1530
**System API**: This is a system API.
S
shawn_he 已提交
1531

S
shawn_he 已提交
1532 1533
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1534 1535 1536 1537 1538 1539 1540 1541 1542
**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 已提交
1543
**Error codes**
S
shawn_he 已提交
1544

S
shawn_he 已提交
1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555
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 已提交
1556 1557 1558
**Example**

```js
S
shawn_he 已提交
1559 1560
call.switchCall(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1561 1562 1563 1564 1565 1566 1567 1568 1569 1570
});
```


## 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 已提交
1571
**System API**: This is a system API.
S
shawn_he 已提交
1572

S
shawn_he 已提交
1573 1574
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588
**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 已提交
1589
**Error codes**
S
shawn_he 已提交
1590

S
shawn_he 已提交
1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601
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 已提交
1602 1603 1604
**Example**

```js
S
shawn_he 已提交
1605 1606 1607
call.switchCall(1).then(() => {
    console.log(`switchCall success.`);
}).catch((err) => {
S
shawn_he 已提交
1608 1609 1610 1611 1612 1613 1614 1615 1616 1617
    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 已提交
1618
**System API**: This is a system API.
S
shawn_he 已提交
1619 1620 1621 1622 1623 1624 1625 1626 1627 1628

**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 已提交
1629
**Error codes**
S
shawn_he 已提交
1630

S
shawn_he 已提交
1631 1632 1633 1634 1635 1636 1637 1638 1639 1640
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 已提交
1641 1642 1643
**Example**

```js
S
shawn_he 已提交
1644 1645
call.combineConference(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1646 1647 1648 1649 1650 1651 1652 1653 1654 1655
});
```


## 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 已提交
1656
**System API**: This is a system API.
S
shawn_he 已提交
1657 1658 1659 1660 1661 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.|

**Return value**

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

S
shawn_he 已提交
1672
**Error codes**
S
shawn_he 已提交
1673

S
shawn_he 已提交
1674 1675 1676 1677 1678 1679 1680 1681 1682 1683
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
**Example**

```js
S
shawn_he 已提交
1687 1688 1689
call.combineConference(1).then(() => {
    console.log(`combineConference success.`);
}).catch((err) => {
S
shawn_he 已提交
1690 1691 1692 1693 1694 1695 1696 1697 1698 1699
    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 已提交
1700
**System API**: This is a system API.
S
shawn_he 已提交
1701 1702 1703 1704 1705 1706 1707 1708 1709 1710

**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 已提交
1711
**Error codes**
S
shawn_he 已提交
1712

S
shawn_he 已提交
1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723
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 已提交
1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738
**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 已提交
1739
**System API**: This is a system API.
S
shawn_he 已提交
1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754

**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 已提交
1755
**Error codes**
S
shawn_he 已提交
1756

S
shawn_he 已提交
1757 1758 1759 1760 1761 1762 1763 1764 1765 1766
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 已提交
1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783
**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 已提交
1784
**System API**: This is a system API.
S
shawn_he 已提交
1785 1786 1787 1788 1789 1790 1791 1792 1793 1794

**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 已提交
1795
**Error codes**
S
shawn_he 已提交
1796

S
shawn_he 已提交
1797 1798 1799 1800 1801 1802 1803 1804 1805 1806
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
**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 已提交
1822
**System API**: This is a system API.
S
shawn_he 已提交
1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837

**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 已提交
1838
**Error codes**
S
shawn_he 已提交
1839

S
shawn_he 已提交
1840 1841 1842 1843 1844 1845 1846 1847 1848 1849
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 已提交
1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866
**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 已提交
1867
**System API**: This is a system API.
S
shawn_he 已提交
1868 1869 1870 1871 1872 1873 1874 1875 1876 1877

**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 已提交
1878
**Error codes**
S
shawn_he 已提交
1879

S
shawn_he 已提交
1880 1881 1882 1883 1884 1885 1886 1887 1888 1889
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 已提交
1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904
**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 已提交
1905
**System API**: This is a system API.
S
shawn_he 已提交
1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920

**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 已提交
1921
**Error codes**
S
shawn_he 已提交
1922

S
shawn_he 已提交
1923 1924 1925 1926 1927 1928 1929 1930 1931 1932
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 已提交
1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949
**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 已提交
1950
**System API**: This is a system API.
S
shawn_he 已提交
1951

S
shawn_he 已提交
1952 1953
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
1954 1955 1956 1957 1958 1959
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

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

S
shawn_he 已提交
1965 1966 1967 1968 1969 1970 1971 1972 1973 1974
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

**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 已提交
1991
**System API**: This is a system API.
S
shawn_he 已提交
1992

S
shawn_he 已提交
1993 1994
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008
**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 已提交
2009
**Error codes**
S
shawn_he 已提交
2010

S
shawn_he 已提交
2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021
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 已提交
2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038
**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 已提交
2039
**System API**: This is a system API.
S
shawn_he 已提交
2040

S
shawn_he 已提交
2041 2042
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2043 2044 2045 2046 2047 2048 2049 2050 2051 2052
**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 已提交
2053
**Error codes**
S
shawn_he 已提交
2054

S
shawn_he 已提交
2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065
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 已提交
2066 2067 2068
**Example**

```js
S
shawn_he 已提交
2069 2070
call.setCallWaiting(0, true, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2071 2072 2073 2074 2075 2076 2077 2078 2079 2080
});
```


## 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 已提交
2081
**System API**: This is a system API.
S
shawn_he 已提交
2082

S
shawn_he 已提交
2083 2084
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099
**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 已提交
2100
**Error codes**
S
shawn_he 已提交
2101

S
shawn_he 已提交
2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112
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 已提交
2113 2114 2115
**Example**

```js
S
shawn_he 已提交
2116 2117 2118
call.setCallWaiting(0, true).then(() => {
    console.log(`setCallWaiting success.`);
}).catch((err) => {
S
shawn_he 已提交
2119 2120 2121 2122 2123 2124 2125 2126
    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 已提交
2127
Enables DTMF. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2128

S
shawn_he 已提交
2129
**System API**: This is a system API.
S
shawn_he 已提交
2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140

**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 已提交
2141
**Error codes**
S
shawn_he 已提交
2142

S
shawn_he 已提交
2143 2144 2145 2146 2147 2148 2149 2150 2151 2152
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 已提交
2153 2154 2155
**Example**

```js
S
shawn_he 已提交
2156 2157
call.startDTMF(1, "0", (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2158 2159 2160 2161 2162 2163 2164 2165 2166 2167
});
```


## 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 已提交
2168
**System API**: This is a system API.
S
shawn_he 已提交
2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184

**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 已提交
2185
**Error codes**
S
shawn_he 已提交
2186

S
shawn_he 已提交
2187 2188 2189 2190 2191 2192 2193 2194 2195 2196
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 已提交
2197 2198 2199
**Example**

```js
S
shawn_he 已提交
2200 2201 2202
call.startDTMF(1, "0").then(() => {
    console.log(`startDTMF success.`);
}).catch((err) => {
S
shawn_he 已提交
2203 2204 2205 2206 2207 2208 2209 2210 2211 2212
    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 已提交
2213
**System API**: This is a system API.
S
shawn_he 已提交
2214 2215 2216 2217 2218 2219 2220 2221 2222 2223

**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 已提交
2224
**Error codes**
S
shawn_he 已提交
2225

S
shawn_he 已提交
2226 2227 2228 2229 2230 2231 2232 2233 2234 2235
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 已提交
2236 2237 2238
**Example**

```js
S
shawn_he 已提交
2239 2240
call.stopDTMF(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2241 2242 2243 2244 2245 2246 2247 2248 2249 2250
});
```


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

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

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

S
shawn_he 已提交
2251
**System API**: This is a system API.
S
shawn_he 已提交
2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266

**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 已提交
2267
**Error codes**
S
shawn_he 已提交
2268

S
shawn_he 已提交
2269 2270 2271 2272 2273 2274 2275 2276 2277 2278
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 已提交
2279 2280 2281
**Example**

```js
S
shawn_he 已提交
2282 2283 2284
call.stopDTMF(1).then(() => {
    console.log(`stopDTMF success.`);
}).catch((err) => {
S
shawn_he 已提交
2285 2286 2287 2288 2289 2290 2291 2292 2293 2294
    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 已提交
2295
**System API**: This is a system API.
S
shawn_he 已提交
2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306

**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 已提交
2307
**Error codes**
S
shawn_he 已提交
2308

S
shawn_he 已提交
2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319
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 已提交
2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334
**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 已提交
2335
**System API**: This is a system API.
S
shawn_he 已提交
2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346

**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 已提交
2347
**Error codes**
S
shawn_he 已提交
2348

S
shawn_he 已提交
2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359
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 已提交
2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376
**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 已提交
2377
**System API**: This is a system API.
S
shawn_he 已提交
2378

S
shawn_he 已提交
2379 2380
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2381 2382 2383 2384 2385 2386
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2390
**Error codes**
S
shawn_he 已提交
2391

S
shawn_he 已提交
2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402
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 已提交
2403 2404 2405
**Example**

```js
S
shawn_he 已提交
2406 2407
call.on('callDetailsChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2408 2409 2410 2411 2412 2413 2414 2415 2416
});
```

## 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 已提交
2417
**System API**: This is a system API.
S
shawn_he 已提交
2418

S
shawn_he 已提交
2419 2420
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2421 2422 2423 2424 2425 2426
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

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

S
shawn_he 已提交
2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442
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 已提交
2443 2444 2445
**Example**

```js
S
shawn_he 已提交
2446 2447
call.on('callEventChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2448 2449 2450 2451 2452 2453 2454 2455 2456
});
```

## 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 已提交
2457
**System API**: This is a system API.
S
shawn_he 已提交
2458

S
shawn_he 已提交
2459 2460
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2461 2462 2463 2464 2465 2466
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

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

S
shawn_he 已提交
2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482
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 已提交
2483 2484 2485
**Example**

```js
S
shawn_he 已提交
2486 2487
call.on('callDisconnectedCause', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2488 2489 2490 2491 2492 2493 2494 2495 2496
});
```

## 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 已提交
2497
**System API**: This is a system API.
S
shawn_he 已提交
2498

S
shawn_he 已提交
2499 2500
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2501 2502 2503 2504 2505 2506
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2510
**Error codes**
S
shawn_he 已提交
2511

S
shawn_he 已提交
2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522
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 已提交
2523 2524 2525
**Example**

```js
S
shawn_he 已提交
2526 2527
call.on('mmiCodeResult', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2528 2529 2530 2531 2532 2533 2534 2535 2536
});
```

## 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 已提交
2537
**System API**: This is a system API.
S
shawn_he 已提交
2538

S
shawn_he 已提交
2539 2540
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2541 2542 2543 2544 2545 2546
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2550
**Error codes**
S
shawn_he 已提交
2551

S
shawn_he 已提交
2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562
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 已提交
2563 2564 2565
**Example**

```js
S
shawn_he 已提交
2566 2567
call.off('callDetailsChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2568 2569 2570 2571 2572 2573 2574 2575 2576
});
```

## 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 已提交
2577
**System API**: This is a system API.
S
shawn_he 已提交
2578

S
shawn_he 已提交
2579 2580
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2581 2582 2583 2584 2585 2586
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2590
**Error codes**
S
shawn_he 已提交
2591

S
shawn_he 已提交
2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602
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 已提交
2603 2604 2605
**Example**

```js
S
shawn_he 已提交
2606 2607
call.off('callEventChange', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2608 2609 2610 2611 2612 2613 2614 2615 2616
});
```

## 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 已提交
2617
**System API**: This is a system API.
S
shawn_he 已提交
2618

S
shawn_he 已提交
2619 2620
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2621 2622 2623 2624 2625
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2630
**Error codes**
S
shawn_he 已提交
2631

S
shawn_he 已提交
2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642
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 已提交
2643 2644 2645
**Example**

```js
S
shawn_he 已提交
2646 2647
call.off('callDisconnectedCause', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2648 2649 2650 2651 2652 2653 2654 2655 2656
});
```

## 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 已提交
2657
**System API**: This is a system API.
S
shawn_he 已提交
2658

S
shawn_he 已提交
2659 2660
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2661 2662 2663 2664
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2670
**Error codes**
S
shawn_he 已提交
2671

S
shawn_he 已提交
2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682
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 已提交
2683 2684 2685
**Example**

```js
S
shawn_he 已提交
2686 2687
call.off('mmiCodeResult', data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2688 2689 2690 2691 2692 2693 2694 2695 2696
});
```

## 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 已提交
2697
**System API**: This is a system API.
S
shawn_he 已提交
2698 2699 2700 2701 2702 2703 2704 2705 2706

**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 已提交
2707
**Error codes**
S
shawn_he 已提交
2708

S
shawn_he 已提交
2709 2710 2711 2712 2713 2714 2715 2716 2717 2718
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 已提交
2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733
**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 已提交
2734
**System API**: This is a system API.
S
shawn_he 已提交
2735 2736 2737 2738 2739 2740 2741 2742 2743

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

**Return value**

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

S
shawn_he 已提交
2744
**Error codes**
S
shawn_he 已提交
2745

S
shawn_he 已提交
2746 2747 2748 2749 2750 2751 2752 2753 2754 2755
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 已提交
2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770
**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 已提交
2771
Separates calls from a conference call. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2772

S
shawn_he 已提交
2773
**System API**: This is a system API.
S
shawn_he 已提交
2774 2775 2776 2777 2778 2779 2780 2781 2782 2783

**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 已提交
2784
**Error codes**
S
shawn_he 已提交
2785

S
shawn_he 已提交
2786 2787 2788 2789 2790 2791 2792 2793 2794 2795
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 已提交
2796 2797 2798
**Example**

```js
S
shawn_he 已提交
2799 2800
call.separateConference(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2801 2802 2803 2804 2805 2806 2807 2808
});
```


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

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

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

S
shawn_he 已提交
2811
**System API**: This is a system API.
S
shawn_he 已提交
2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826

**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 已提交
2827
**Error codes**
S
shawn_he 已提交
2828

S
shawn_he 已提交
2829 2830 2831 2832 2833 2834 2835 2836 2837 2838
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 已提交
2839 2840 2841
**Example**

```js
S
shawn_he 已提交
2842 2843 2844
call.separateConference(1).then(() => {
    console.log(`separateConference success.`);
}).catch((err) => {
S
shawn_he 已提交
2845 2846 2847 2848 2849 2850 2851 2852 2853 2854
    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 已提交
2855
**System API**: This is a system API.
S
shawn_he 已提交
2856

S
shawn_he 已提交
2857 2858
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
2859 2860 2861 2862 2863 2864 2865 2866 2867 2868
**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 已提交
2869
**Error codes**
S
shawn_he 已提交
2870

S
shawn_he 已提交
2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881
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 已提交
2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896
**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 已提交
2897
**System API**: This is a system API.
S
shawn_he 已提交
2898

S
shawn_he 已提交
2899 2900
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915
**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 已提交
2916
**Error codes**
S
shawn_he 已提交
2917

S
shawn_he 已提交
2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928
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 已提交
2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945
**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 已提交
2946
**System API**: This is a system API.
S
shawn_he 已提交
2947

S
shawn_he 已提交
2948 2949
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2950 2951 2952 2953 2954 2955 2956 2957 2958 2959
**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 已提交
2960
**Error codes**
S
shawn_he 已提交
2961

S
shawn_he 已提交
2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972
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 已提交
2973 2974 2975 2976 2977 2978 2979 2980
**Example**

```js
let callRestrictionInfo={
    type: 1,
    password: "123456",
    mode: 1
}
S
shawn_he 已提交
2981 2982
call.setCallRestriction(0, callRestrictionInfo, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2983 2984 2985 2986 2987 2988 2989 2990 2991 2992
});
```


## 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 已提交
2993
**System API**: This is a system API.
S
shawn_he 已提交
2994

S
shawn_he 已提交
2995 2996
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011
**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 已提交
3012
**Error codes**
S
shawn_he 已提交
3013

S
shawn_he 已提交
3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024
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 已提交
3025 3026 3027 3028 3029 3030 3031 3032
**Example**

```js
let callRestrictionInfo={
    type: 1,
    password: "123456",
    mode: 1
}
S
shawn_he 已提交
3033 3034 3035
call.setCallRestriction(0, callRestrictionInfo).then(() => {
    console.log(`setCallRestriction success.`);
}).catch((err) => {
S
shawn_he 已提交
3036 3037 3038 3039 3040 3041 3042 3043 3044 3045
    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 已提交
3046
**System API**: This is a system API.
S
shawn_he 已提交
3047

S
shawn_he 已提交
3048 3049
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
3050 3051 3052 3053 3054 3055 3056 3057 3058 3059
**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 已提交
3060
**Error codes**
S
shawn_he 已提交
3061

S
shawn_he 已提交
3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072
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 已提交
3073 3074 3075
**Example**

```js
S
shawn_he 已提交
3076
call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY, (err, data) => {
S
shawn_he 已提交
3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087
    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 已提交
3088
**System API**: This is a system API.
S
shawn_he 已提交
3089

S
shawn_he 已提交
3090 3091
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106
**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 已提交
3107
**Error codes**
S
shawn_he 已提交
3108

S
shawn_he 已提交
3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119
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 已提交
3120 3121 3122
**Example**

```js
S
shawn_he 已提交
3123
let promise = call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY);
S
shawn_he 已提交
3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136
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 已提交
3137
**System API**: This is a system API.
S
shawn_he 已提交
3138

S
shawn_he 已提交
3139 3140
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3141 3142 3143 3144 3145 3146 3147 3148 3149 3150
**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 已提交
3151
**Error codes**
S
shawn_he 已提交
3152

S
shawn_he 已提交
3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163
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 已提交
3164 3165 3166 3167 3168 3169 3170 3171
**Example**

```js
let callTransferInfo={
    transferNum: "111",
    type: 1,
    settingType: 1
}
S
shawn_he 已提交
3172 3173
call.setCallTransfer(0, callTransferInfo, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3174 3175 3176 3177 3178 3179 3180 3181 3182 3183
});
```


## 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 已提交
3184
**System API**: This is a system API.
S
shawn_he 已提交
3185

S
shawn_he 已提交
3186 3187
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202
**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 已提交
3203
**Error codes**
S
shawn_he 已提交
3204

S
shawn_he 已提交
3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215
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 已提交
3216 3217 3218 3219 3220 3221 3222 3223
**Example**

```js
let callTransferInfo={
    transferNum: "111",
    type: 1,
    settingType: 1
}
S
shawn_he 已提交
3224 3225 3226
call.setCallTransfer(0, callTransferInfo).then(() => {
    console.log(`setCallTransfer success.`);
}).catch((err) => {
S
shawn_he 已提交
3227 3228 3229 3230 3231 3232 3233 3234 3235 3236
    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 已提交
3237
**System API**: This is a system API.
S
shawn_he 已提交
3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248

**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 已提交
3249
**Error codes**
S
shawn_he 已提交
3250

S
shawn_he 已提交
3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261
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 已提交
3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276
**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 已提交
3277
**System API**: This is a system API.
S
shawn_he 已提交
3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288

**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 已提交
3289
**Error codes**
S
shawn_he 已提交
3290

S
shawn_he 已提交
3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301
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 已提交
3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318
**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 已提交
3319
**System API**: This is a system API.
S
shawn_he 已提交
3320 3321 3322 3323 3324 3325 3326 3327 3328

**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 已提交
3329
**Error codes**
S
shawn_he 已提交
3330

S
shawn_he 已提交
3331 3332 3333 3334 3335 3336 3337 3338 3339 3340
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 已提交
3341 3342 3343
**Example**

```js
S
shawn_he 已提交
3344 3345
call.setMuted((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3346 3347 3348 3349 3350 3351 3352 3353 3354 3355
});
```


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

setMuted\(\): Promise<void\>

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

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

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

**Return value**

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

S
shawn_he 已提交
3366
**Error codes**
S
shawn_he 已提交
3367

S
shawn_he 已提交
3368 3369 3370 3371 3372 3373 3374 3375 3376 3377
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 已提交
3378 3379 3380
**Example**

```js
S
shawn_he 已提交
3381 3382 3383
call.setMuted().then(() => {
    console.log(`setMuted success.`);
}).catch((err) => {
S
shawn_he 已提交
3384 3385 3386 3387 3388 3389 3390 3391 3392 3393
    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 已提交
3394
**System API**: This is a system API.
S
shawn_he 已提交
3395 3396 3397 3398 3399 3400 3401 3402 3403

**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 已提交
3404
**Error codes**
S
shawn_he 已提交
3405

S
shawn_he 已提交
3406 3407 3408 3409 3410 3411 3412 3413 3414 3415
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 已提交
3416 3417 3418
**Example**

```js
S
shawn_he 已提交
3419 3420
call.cancelMuted((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3421 3422 3423 3424 3425 3426 3427 3428 3429 3430
});
```


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

cancelMuted(): Promise<void\>

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

S
shawn_he 已提交
3431
**System API**: This is a system API.
S
shawn_he 已提交
3432 3433 3434 3435 3436 3437 3438 3439 3440

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

**Return value**

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

S
shawn_he 已提交
3441
**Error codes**
S
shawn_he 已提交
3442

S
shawn_he 已提交
3443 3444 3445 3446 3447 3448 3449 3450 3451 3452
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 已提交
3453 3454 3455
**Example**

```js
S
shawn_he 已提交
3456 3457 3458
call.cancelMuted().then(() => {
    console.log(`cancelMuted success.`);
}).catch((err) => {
S
shawn_he 已提交
3459 3460 3461 3462
    console.error(`cancelMuted fail, promise: err->${JSON.stringify(err)}`);
});
```

S
shawn_he 已提交
3463
## call.setAudioDevice<sup>8+</sup>
S
shawn_he 已提交
3464 3465 3466 3467 3468

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 已提交
3469
**System API**: This is a system API.
S
shawn_he 已提交
3470 3471 3472 3473 3474 3475 3476 3477 3478 3479

**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 已提交
3480
**Error codes**
S
shawn_he 已提交
3481

S
shawn_he 已提交
3482 3483 3484 3485 3486 3487 3488 3489 3490 3491
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 已提交
3492 3493 3494
**Example**

```js
S
shawn_he 已提交
3495 3496
call.setAudioDevice(1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3497 3498 3499 3500
});
```


S
shawn_he 已提交
3501
## call.setAudioDevice<sup>9+</sup>
S
shawn_he 已提交
3502 3503 3504 3505 3506

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 已提交
3507
**System API**: This is a system API.
S
shawn_he 已提交
3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518

**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 已提交
3519
**Error codes**
S
shawn_he 已提交
3520

S
shawn_he 已提交
3521 3522 3523 3524 3525 3526 3527 3528 3529 3530
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 已提交
3531 3532 3533 3534 3535 3536
**Example**

```js
let audioDeviceOptions={
    bluetoothAddress: "IEEE 802-2014"
}
S
shawn_he 已提交
3537 3538
call.setAudioDevice(1, audioDeviceOptions, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3539 3540 3541 3542
});
```


S
shawn_he 已提交
3543
## call.setAudioDevice<sup>9+</sup>
S
shawn_he 已提交
3544 3545 3546 3547 3548

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 已提交
3549
**System API**: This is a system API.
S
shawn_he 已提交
3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565

**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 已提交
3566
**Error codes**
S
shawn_he 已提交
3567

S
shawn_he 已提交
3568 3569 3570 3571 3572 3573 3574 3575 3576 3577
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 已提交
3578 3579 3580 3581 3582 3583
**Example**

```js
let audioDeviceOptions={
    bluetoothAddress: "IEEE 802-2014"
}
S
shawn_he 已提交
3584 3585 3586
call.setAudioDevice(1, audioDeviceOptions).then(() => {
    console.log(`setAudioDevice success.`);
}).catch((err) => {
S
shawn_he 已提交
3587 3588 3589 3590 3591 3592 3593 3594 3595 3596
    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 已提交
3597
**System API**: This is a system API.
S
shawn_he 已提交
3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608

**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 已提交
3609
**Error codes**
S
shawn_he 已提交
3610

S
shawn_he 已提交
3611 3612 3613 3614 3615 3616 3617 3618 3619 3620
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 已提交
3621 3622 3623
**Example**

```js
S
shawn_he 已提交
3624 3625 3626
let callNumberList: Array<string> = [
    "138XXXXXXXX"
];
S
shawn_he 已提交
3627 3628
call.joinConference(1, callNumberList, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3629 3630 3631 3632 3633 3634 3635 3636 3637
});
```

## 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 已提交
3638
**System API**: This is a system API.
S
shawn_he 已提交
3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654

**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 已提交
3655
**Error codes**
S
shawn_he 已提交
3656

S
shawn_he 已提交
3657 3658 3659 3660 3661 3662 3663 3664 3665 3666
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 已提交
3667 3668 3669
**Example**

```js
S
shawn_he 已提交
3670 3671 3672
let callNumberList: Array<string> = [
    "138XXXXXXXX"
];
S
shawn_he 已提交
3673 3674 3675
call.joinConference(1, callNumberList).then(() => {
    console.log(`joinConference success.`);
}).catch((err) => {
S
shawn_he 已提交
3676 3677 3678 3679 3680 3681 3682 3683 3684 3685
    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 已提交
3686
**System API**: This is a system API.
S
shawn_he 已提交
3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697

**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 已提交
3698
**Error codes**
S
shawn_he 已提交
3699

S
shawn_he 已提交
3700 3701 3702 3703 3704 3705 3706 3707 3708 3709
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 已提交
3710 3711 3712
**Example**

```js
S
shawn_he 已提交
3713 3714
call.updateImsCallMode(1, 1, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3715 3716 3717 3718 3719 3720 3721 3722 3723
});
```

## 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 已提交
3724
**System API**: This is a system API.
S
shawn_he 已提交
3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740

**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 已提交
3741
**Error codes**
S
shawn_he 已提交
3742

S
shawn_he 已提交
3743 3744 3745 3746 3747 3748 3749 3750 3751 3752
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 已提交
3753 3754 3755
**Example**

```js
S
shawn_he 已提交
3756 3757 3758
call.updateImsCallMode(1, 1).then(() => {
    console.log(`updateImsCallMode success.`);
}).catch((err) => {
S
shawn_he 已提交
3759 3760 3761 3762 3763 3764 3765 3766 3767 3768
    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 已提交
3769
**System API**: This is a system API.
S
shawn_he 已提交
3770

S
shawn_he 已提交
3771 3772
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3773 3774 3775 3776 3777 3778 3779 3780 3781
**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 已提交
3782
**Error codes**
S
shawn_he 已提交
3783

S
shawn_he 已提交
3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794
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 已提交
3795 3796 3797
**Example**

```js
S
shawn_he 已提交
3798 3799
call.enableImsSwitch(0, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3800 3801 3802 3803 3804 3805 3806 3807 3808
});
```

## 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 已提交
3809
**System API**: This is a system API.
S
shawn_he 已提交
3810

S
shawn_he 已提交
3811 3812
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826
**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 已提交
3827
**Error codes**
S
shawn_he 已提交
3828

S
shawn_he 已提交
3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839
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 已提交
3840 3841 3842
**Example**

```js
S
shawn_he 已提交
3843 3844 3845
call.enableImsSwitch(0).then(() => {
    console.log(`enableImsSwitch success.`);
}).catch((err) => {
S
shawn_he 已提交
3846 3847 3848 3849 3850 3851 3852 3853 3854 3855
    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 已提交
3856
**System API**: This is a system API.
S
shawn_he 已提交
3857

S
shawn_he 已提交
3858 3859
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3860 3861 3862 3863 3864 3865 3866 3867 3868
**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 已提交
3869
**Error codes**
S
shawn_he 已提交
3870

S
shawn_he 已提交
3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881
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 已提交
3882 3883 3884
**Example**

```js
S
shawn_he 已提交
3885 3886
call.disableImsSwitch(0, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
3887 3888 3889 3890 3891 3892 3893 3894 3895
});
```

## 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 已提交
3896
**System API**: This is a system API.
S
shawn_he 已提交
3897

S
shawn_he 已提交
3898 3899
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3900 3901 3902 3903
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

S
shawn_he 已提交
3904
| Name| Type  | Mandatory| Description                                   |
S
shawn_he 已提交
3905
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
3906
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
S
shawn_he 已提交
3907 3908 3909

**Return value**

S
shawn_he 已提交
3910
| Type               | Description                        |
S
shawn_he 已提交
3911
| ------------------- | --------------------------- |
S
shawn_he 已提交
3912
| Promise&lt;void&gt; | Promise used to return the result. |
S
shawn_he 已提交
3913

S
shawn_he 已提交
3914
**Error codes**
S
shawn_he 已提交
3915

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

S
shawn_he 已提交
3918
| ID|                  Error Message                    |
S
shawn_he 已提交
3919 3920 3921 3922 3923 3924 3925 3926
| -------- | -------------------------------------------- |
| 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 已提交
3927 3928 3929
**Example**

```js
S
shawn_he 已提交
3930 3931 3932
call.disableImsSwitch(0).then(() => {
    console.log(`disableImsSwitch success.`);
}).catch((err) => {
S
shawn_he 已提交
3933 3934 3935 3936 3937 3938 3939 3940 3941 3942
    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 已提交
3943
**System API**: This is a system API.
S
shawn_he 已提交
3944 3945 3946 3947 3948 3949 3950 3951 3952 3953

**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 已提交
3954
**Error codes**
S
shawn_he 已提交
3955

S
shawn_he 已提交
3956 3957 3958 3959 3960 3961 3962 3963 3964 3965
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 已提交
3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979
**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 已提交
3980
**System API**: This is a system API.
S
shawn_he 已提交
3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995

**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 已提交
3996
**Error codes**
S
shawn_he 已提交
3997

S
shawn_he 已提交
3998 3999 4000 4001 4002 4003 4004 4005 4006 4007
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 已提交
4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018
**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 已提交
4019
## DialOptions
S
shawn_he 已提交
4020

S
shawn_he 已提交
4021
Provides an option for determining whether a call is a video call.
S
shawn_he 已提交
4022 4023 4024

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

S
shawn_he 已提交
4025 4026
|        Name             | Type                              | Mandatory| Description                                                                                            |
| ------------------------ | ---------------------------------- | ---- | ----------------------------------------------------------------------------------------------- |
S
shawn_he 已提交
4027
| extras                   | boolean                            | No  | Indication of a video call. <br>- **true**: video call<br>- **false** (default): voice call|
S
shawn_he 已提交
4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044
| 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 已提交
4045

S
shawn_he 已提交
4046
## CallState
S
shawn_he 已提交
4047 4048

Enumerates call states.
S
shawn_he 已提交
4049

S
shawn_he 已提交
4050 4051 4052
**System capability**: SystemCapability.Telephony.CallManager

| Name              | Value  | Description                                                        |
S
shawn_he 已提交
4053
| ------------------ | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
4054 4055 4056
| 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 已提交
4057
| 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 已提交
4058

S
shawn_he 已提交
4059
## EmergencyNumberOptions<sup>7+</sup>
S
shawn_he 已提交
4060

S
shawn_he 已提交
4061
Provides an option for determining whether a number is an emergency number for the SIM card in the specified slot.
S
shawn_he 已提交
4062 4063 4064

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

S
shawn_he 已提交
4065
|  Name | Type  | Mandatory| Description                                          |
S
shawn_he 已提交
4066 4067
| ------ | ------ | ---- | ---------------------------------------------- |
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
4068

S
shawn_he 已提交
4069
## NumberFormatOptions<sup>7+</sup>
S
shawn_he 已提交
4070

S
shawn_he 已提交
4071
Provides an option for number formatting.
S
shawn_he 已提交
4072 4073 4074

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

S
shawn_he 已提交
4075
|    Name    | Type  | Mandatory| Description                                                      |
S
shawn_he 已提交
4076
| ----------- | ------ | ---- | ---------------------------------------------------------- |
S
shawn_he 已提交
4077
| countryCode | string | No  | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.|
S
shawn_he 已提交
4078 4079 4080 4081 4082

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

Enumerates IMS call modes.

S
shawn_he 已提交
4083
**System API**: This is a system API.
S
shawn_he 已提交
4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098

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

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

| Name                | Value  | Description        |
| -------------------- | ---- | ------------ |
S
shawn_he 已提交
4105 4106 4107
| DEVICE_EARPIECE      | 0    | Headset device.    |
| DEVICE_SPEAKER       | 1    | Speaker device.|
| DEVICE_WIRED_HEADSET | 2    | Wired headset device.|
S
shawn_he 已提交
4108
| DEVICE_BLUETOOTH_SCO | 3    | Bluetooth SCO device. |
S
shawn_he 已提交
4109
| DEVICE_MIC           | 4    | Microphone device|
S
shawn_he 已提交
4110 4111 4112 4113 4114

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

Enumerates call restriction types.

S
shawn_he 已提交
4115
**System API**: This is a system API.
S
shawn_he 已提交
4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133

**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 已提交
4134
**System API**: This is a system API.
S
shawn_he 已提交
4135 4136 4137

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

S
shawn_he 已提交
4138 4139 4140 4141 4142 4143 4144
|          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 已提交
4145
| endHour<sup>9+</sup>     | number                                               | No  | Minute in the end time.|
S
shawn_he 已提交
4146
| endMinute<sup>9+</sup>   | number                                               | No  | Minute in the end time.|
S
shawn_he 已提交
4147 4148 4149 4150 4151

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

Enumerates call transfer types.

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 4165 4166

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

**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 已提交
4182
**System API**: This is a system API.
S
shawn_he 已提交
4183 4184 4185

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

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

**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 已提交
4218
**System API**: This is a system API.
S
shawn_he 已提交
4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230

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

S
shawn_he 已提交
4233
**System API**: This is a system API.
S
shawn_he 已提交
4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245

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

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

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

S
shawn_he 已提交
4270
|   Name  | Type                                        | Mandatory| Description        |
S
shawn_he 已提交
4271 4272 4273 4274 4275 4276 4277 4278 4279
| -------- | -------------------------------------------- | ---- | ------------ |
| 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 已提交
4280
**System API**: This is a system API.
S
shawn_he 已提交
4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292

**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 已提交
4293
**System API**: This is a system API.
S
shawn_he 已提交
4294 4295 4296

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

S
shawn_he 已提交
4297
|   Name | Type                                      | Mandatory| Description          |
S
shawn_he 已提交
4298 4299 4300 4301 4302 4303 4304
| ------- | ------------------------------------------ | ---- | -------------- |
| eventId | [CallAbilityEventId](#callabilityeventid8) | Yes  | Call ability event ID.|

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

Enumerates call ability event IDs.

S
shawn_he 已提交
4305
**System API**: This is a system API.
S
shawn_he 已提交
4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317

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

**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 已提交
4332
**System API**: This is a system API.
S
shawn_he 已提交
4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345

**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 已提交
4346
**System API**: This is a system API.
S
shawn_he 已提交
4347 4348 4349

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

S
shawn_he 已提交
4350
|     Name      | Type  | Mandatory| Description    |
S
shawn_he 已提交
4351 4352 4353 4354 4355 4356 4357
| -------------- | ------ | ---- | -------- |
| messageContent | string | Yes  | Message content.|

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

Defines the call transfer result.

S
shawn_he 已提交
4358
**System API**: This is a system API.
S
shawn_he 已提交
4359 4360 4361

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

S
shawn_he 已提交
4362 4363 4364 4365 4366 4367
|          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 已提交
4368
| endHour<sup>9+</sup>     | number                             |  Yes | Minute in the end time.|
S
shawn_he 已提交
4369
| endMinute<sup>9+</sup>   | number                             |  Yes | Minute in the end time.|
S
shawn_he 已提交
4370 4371 4372 4373 4374

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

Enumerates call waiting states.

S
shawn_he 已提交
4375
**System API**: This is a system API.
S
shawn_he 已提交
4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387

**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 已提交
4388
**System API**: This is a system API.
S
shawn_he 已提交
4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400

**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 已提交
4401
**System API**: This is a system API.
S
shawn_he 已提交
4402 4403 4404 4405 4406 4407 4408 4409

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

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

S
shawn_he 已提交
4410 4411 4412 4413
## DisconnectedDetails<sup>9+</sup>

Defines the cause of a call disconnection.

S
shawn_he 已提交
4414
**System API**: This is a system API.
S
shawn_he 已提交
4415 4416 4417 4418 4419 4420 4421 4422 4423

**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 已提交
4424 4425 4426

Enumerates causes of call disconnection.

S
shawn_he 已提交
4427
**System API**: This is a system API.
S
shawn_he 已提交
4428 4429 4430

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

S
shawn_he 已提交
4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511
|                              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 已提交
4512 4513 4514 4515 4516

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

Defines the MMI code result.

S
shawn_he 已提交
4517
**System API**: This is a system API.
S
shawn_he 已提交
4518 4519 4520 4521 4522 4523 4524 4525 4526 4527

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

S
shawn_he 已提交
4530
**System API**: This is a system API.
S
shawn_he 已提交
4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542

**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 已提交
4543
**System API**: This is a system API.
S
shawn_he 已提交
4544 4545 4546 4547 4548 4549

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

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