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

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

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

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

## Modules to Import

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

S
shawn_he 已提交
17
## call.dial<sup>(deprecated)</sup>
S
shawn_he 已提交
18 19 20

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

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

S
shawn_he 已提交
23 24 25 26
>**NOTE**
>
>This parameter is supported since API version 6 and deprecated since API version 9. You are advised to use [dialCall](#calldialcall9).

S
shawn_he 已提交
27
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
28 29

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

S
shawn_he 已提交
31
**Parameters**
S
shawn_he 已提交
32

S
shawn_he 已提交
33 34 35 36
| Name     | Type                        | Mandatory| Description                                   |
| ----------- | ---------------------------- | ---- | --------------------------------------- |
| phoneNumber | string                       | Yes  | Phone number.                             |
| callback    | AsyncCallback&lt;boolean&gt; | Yes  | Callback used to return the result.<br>- **true**: success<br>- **false**: failure|
S
shawn_he 已提交
37 38 39

**Example**

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


S
shawn_he 已提交
47
## call.dial<sup>(deprecated)</sup>
S
shawn_he 已提交
48 49 50

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

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

S
shawn_he 已提交
53 54 55 56
>**NOTE**
>
>This parameter is supported since API version 6 and deprecated since API version 9. You are advised to use [dialCall](#calldialcall9).

S
shawn_he 已提交
57
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
58 59

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

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

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

S
shawn_he 已提交
69
**Example**
S
shawn_he 已提交
70

S
shawn_he 已提交
71
```js
S
shawn_he 已提交
72 73 74 75 76 77
call.dial("138xxxxxxxx", {
    extras: false
}, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
78 79


S
shawn_he 已提交
80
## call.dial<sup>(deprecated)</sup>
S
shawn_he 已提交
81 82 83

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

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

S
shawn_he 已提交
86 87 88 89
>**NOTE**
>
>This parameter is supported since API version 6 and deprecated since API version 9. You are advised to use [dialCall](#calldialcall9).

S
shawn_he 已提交
90
**Required Permissions**: ohos.permission.PLACE_CALL
S
shawn_he 已提交
91 92

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

S
shawn_he 已提交
94
**Parameters**
S
shawn_he 已提交
95

S
shawn_he 已提交
96
| Name     | Type                       | Mandatory| Description                                  |
S
shawn_he 已提交
97
| ----------- | --------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
98 99
| phoneNumber | string                      | Yes  | Phone number.                            |
| options     | [DialOptions](#dialoptions) | No  | Call option, which indicates whether the call is a voice call or video call.|
S
shawn_he 已提交
100

S
shawn_he 已提交
101
**Return value**
S
shawn_he 已提交
102

S
shawn_he 已提交
103 104 105
| Type                  | Description                                                        |
| ---------------------- | ------------------------------------------------------------ |
| Promise&lt;boolean&gt; | Promise used to return the result.<br>- **true**: success<br>- **false**: failure|
S
shawn_he 已提交
106

S
shawn_he 已提交
107
**Example**
S
shawn_he 已提交
108

S
shawn_he 已提交
109
```js
S
shawn_he 已提交
110 111 112 113 114 115 116 117 118
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 已提交
119

S
shawn_he 已提交
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135

## 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 已提交
136
| ----------- | ---------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
137
| phoneNumber | string                       | Yes  | Phone number.                             |
S
shawn_he 已提交
138
| callback    | AsyncCallback&lt;void&gt;    | Yes  | Callback used to return the result.  |
S
shawn_he 已提交
139 140

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

S
shawn_he 已提交
142 143 144 145 146 147 148 149 150 151 152 153 154 155
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 已提交
156 157
call.dialCall("138xxxxxxxx", (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
});
```


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

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

S
shawn_he 已提交
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
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 已提交
203 204
}, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
});
```


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

**Return value**

S
shawn_he 已提交
230 231 232
| Type                  | Description                         |
| ---------------------- | ---------------------------- |
| Promise&lt;void&gt;    | Promise used to return the result.|
S
shawn_he 已提交
233 234

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

S
shawn_he 已提交
236 237 238 239 240 241 242 243 244 245 246 247 248 249
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 已提交
250 251 252 253 254 255 256 257 258 259 260
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 已提交
261 262 263
```


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

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

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

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

**Parameters**

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
290 291 292

**Example**

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


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

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

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

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

**Parameters**

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

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

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
331 332 333

**Example**

S
shawn_he 已提交
334
```js
S
shawn_he 已提交
335 336 337 338 339
let promise = call.makeCall("138xxxxxxxx");
promise.then(() => {
    console.log(`makeCall success`);
}).catch(err => {
    console.error(`makeCall fail, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
340 341 342
});
```

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

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

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

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

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

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

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

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


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

hasCall\(\): Promise<boolean\>

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

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

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

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

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

S
shawn_he 已提交
382
```js
S
shawn_he 已提交
383 384 385 386 387 388 389
let promise = call.hasCall();
promise.then(data => {
    console.log(`hasCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`hasCall fail, promise: err->${JSON.stringify(err)}`);
});
```
S
shawn_he 已提交
390 391


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

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

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

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

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

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

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

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


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

getCallState\(\): Promise<CallState\>

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

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

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

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

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

S
shawn_he 已提交
431
```js
S
shawn_he 已提交
432 433 434 435 436 437 438
let promise = call.getCallState();
promise.then(data => {
    console.log(`getCallState success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getCallState fail, promise: err->${JSON.stringify(err)}`);
});
```
S
shawn_he 已提交
439

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

hasVoiceCapability(): boolean

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

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

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

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

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

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

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

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

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

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

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
485

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

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


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

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

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

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

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

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
522

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

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


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

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

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

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

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

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

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

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
564

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

S
shawn_he 已提交
567
```js
S
shawn_he 已提交
568 569 570 571 572 573 574
let promise = call.isEmergencyPhoneNumber("138xxxxxxxx", {slotId: 1});
promise.then(data => {
    console.log(`isEmergencyPhoneNumber success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`isEmergencyPhoneNumber fail, promise: err->${JSON.stringify(err)}`);
});
```
S
shawn_he 已提交
575

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

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

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

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

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

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

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
604

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

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

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

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

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

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

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

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

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
642

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

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


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

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

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

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

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

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

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

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

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
688

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

S
shawn_he 已提交
691
```js
S
shawn_he 已提交
692 693 694 695 696 697 698 699 700
let promise = call.formatPhoneNumber("138xxxxxxxx", {
    countryCode: "CN"
});
promise.then(data => {
    console.log(`formatPhoneNumber success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`formatPhoneNumber fail, promise: err->${JSON.stringify(err)}`);
});
```
S
shawn_he 已提交
701

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

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

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

The phone number must match the specified country code. For example, for a China phone number, the country code must be **CN**. Otherwise, **null** will be returned.

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

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

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
731

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

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


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

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

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

The phone number must match the specified country code. For example, for a China phone number, the country code must be **CN**. Otherwise, **null** will be returned.

All country codes are supported.

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

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

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

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

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

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
777

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

S
shawn_he 已提交
780
```js
S
shawn_he 已提交
781
let promise = call.formatPhoneNumberToE164("138xxxxxxxx", "CN");
S
shawn_he 已提交
782 783 784 785 786 787
promise.then(data => {
    console.log(`formatPhoneNumberToE164 success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`formatPhoneNumberToE164 fail, promise: err->${JSON.stringify(err)}`);
});
```
S
shawn_he 已提交
788

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

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

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

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

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

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

**Parameters**

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

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

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

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

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


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

muteRinger\(\): Promise<void\>

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

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

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

S
shawn_he 已提交
849 850 851 852 853 854 855 856 857
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 已提交
858 859 860
**Example**

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


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

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

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

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

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

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

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


S
shawn_he 已提交
910
## call.answerCall<sup>9+</sup>
S
shawn_he 已提交
911

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

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

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

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

S
shawn_he 已提交
936 937 938 939 940 941 942 943 944 945 946
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 已提交
947 948 949
**Example**

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


S
shawn_he 已提交
958
## call.answerCall<sup>9+</sup>
S
shawn_he 已提交
959

S
shawn_he 已提交
960 961 962
answerCall\(callback: AsyncCallback<void\>\): void

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

S
shawn_he 已提交
964
**System API**: This is a system API.
S
shawn_he 已提交
965

S
shawn_he 已提交
966 967
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
968 969 970 971 972 973 974 975
**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 已提交
976
**Error codes**
S
shawn_he 已提交
977

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

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


S
shawn_he 已提交
998
## call.hangUpCall<sup>9+</sup>
S
shawn_he 已提交
999

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

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

S
shawn_he 已提交
1004
**System API**: This is a system API.
S
shawn_he 已提交
1005

S
shawn_he 已提交
1006 1007
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1008 1009 1010 1011 1012 1013
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
1017
**Error codes**
S
shawn_he 已提交
1018

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

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


S
shawn_he 已提交
1039
## call.hangUpCall<sup>9+</sup>
S
shawn_he 已提交
1040

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

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

S
shawn_he 已提交
1045
**System API**: This is a system API.
S
shawn_he 已提交
1046

S
shawn_he 已提交
1047 1048
**Required permission**: ohos.permission.ANSWER_CALL

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

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1076 1077 1078
**Example**

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


S
shawn_he 已提交
1087 1088 1089
## call.hangUpCall<sup>9+</sup>

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

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

S
shawn_he 已提交
1093
**System API**: This is a system API.
S
shawn_he 已提交
1094

S
shawn_he 已提交
1095 1096
**Required permission**: ohos.permission.ANSWER_CALL

S
shawn_he 已提交
1097 1098 1099 1100 1101 1102 1103 1104
**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 已提交
1105
**Error codes**
S
shawn_he 已提交
1106

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

| ID| Error Message                                    |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 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 已提交
1119 1120 1121
**Example**

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


S
shawn_he 已提交
1128
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1129

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

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

S
shawn_he 已提交
1134
**System API**: This is a system API.
S
shawn_he 已提交
1135

S
shawn_he 已提交
1136 1137
**Required permission**: ohos.permission.ANSWER_CALL

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

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

**Example**

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


S
shawn_he 已提交
1170
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1171 1172

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

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

S
shawn_he 已提交
1176
**System API**: This is a system API.
S
shawn_he 已提交
1177

S
shawn_he 已提交
1178 1179
**Required permission**: ohos.permission.ANSWER_CALL

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

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

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


S
shawn_he 已提交
1215
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1216

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

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

S
shawn_he 已提交
1221
**System API**: This is a system API.
S
shawn_he 已提交
1222

S
shawn_he 已提交
1223 1224
**Required permission**: ohos.permission.ANSWER_CALL

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

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

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

S
shawn_he 已提交
1266

S
shawn_he 已提交
1267
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1268

S
shawn_he 已提交
1269
rejectCall\(callback: AsyncCallback<void\>\): void
S
shawn_he 已提交
1270 1271 1272

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

S
shawn_he 已提交
1273
**System API**: This is a system API.
S
shawn_he 已提交
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284

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

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

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


S
shawn_he 已提交
1307
## call.rejectCall<sup>9+</sup>
S
shawn_he 已提交
1308

S
shawn_he 已提交
1309
rejectCall\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): void
S
shawn_he 已提交
1310 1311 1312

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

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

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

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

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


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

S
shawn_he 已提交
1359 1360
**Required permission**: ohos.permission.ANSWER_CALL

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

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

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


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

S
shawn_he 已提交
1400 1401
**Required permission**: ohos.permission.ANSWER_CALL

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

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

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

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

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

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

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


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

S
shawn_he 已提交
1488 1489
**Required permission**: ohos.permission.ANSWER_CALL

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

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

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

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

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

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

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


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

S
shawn_he 已提交
1576 1577
**Required permission**: ohos.permission.ANSWER_CALL

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

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

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

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

S
shawn_he 已提交
1634 1635 1636 1637 1638 1639 1640 1641 1642 1643
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

S
shawn_he 已提交
1644 1645 1646
**Example**

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


## 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 已提交
1659
**System API**: This is a system API.
S
shawn_he 已提交
1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674

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

S
shawn_he 已提交
1677 1678 1679 1680 1681 1682 1683 1684 1685 1686
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 已提交
1687 1688 1689
**Example**

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

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

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

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

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

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

S
shawn_he 已提交
1800 1801 1802 1803 1804 1805 1806 1807 1808 1809
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 已提交
1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824
**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 已提交
1825
**System API**: This is a system API.
S
shawn_he 已提交
1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840

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

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

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

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

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

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

S
shawn_he 已提交
1955 1956
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

S
shawn_he 已提交
1957 1958 1959 1960 1961 1962
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                                       | Mandatory| Description                                                        |
| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
1963 1964 1965 1966
| 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 已提交
1967

S
shawn_he 已提交
1968 1969 1970 1971 1972 1973 1974 1975 1976 1977
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 已提交
1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993

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

S
shawn_he 已提交
1996 1997
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

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

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

S
shawn_he 已提交
2044 2045
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

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

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


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

S
shawn_he 已提交
2086 2087
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

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

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

S
shawn_he 已提交
2132
**System API**: This is a system API.
S
shawn_he 已提交
2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143

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

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

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


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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

S
shawn_he 已提交
2382 2383
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2384 2385 2386 2387 2388 2389
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2393
**Error codes**
S
shawn_he 已提交
2394

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

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

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

S
shawn_he 已提交
2422 2423
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2424 2425 2426 2427 2428 2429
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                            | Mandatory| Description                      |
| -------- | ------------------------------------------------ | ---- | -------------------------- |
S
shawn_he 已提交
2430
| type     | string                                           | Yes  | This interface is used to monitor the change of call events during a call. The parameter has a fixed value of callEventChange.|
S
shawn_he 已提交
2431 2432
| callback | Callback<[CallEventOptions](#calleventoptions8)> | Yes  | Callback used to return the result.                |

S
shawn_he 已提交
2433
**Error codes**
S
shawn_he 已提交
2434

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

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

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

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

S
shawn_he 已提交
2464 2465 2466 2467 2468 2469
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                                  | Mandatory| Description                      |
| -------- | ------------------------------------------------------ | ---- | -------------------------- |
S
shawn_he 已提交
2470
| type     | string                                                 | Yes  | Event type. The field has a fixed value of **callDisconnectedCause**.|
S
shawn_he 已提交
2471
| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | Yes  | Callback used to return the result.                |
S
shawn_he 已提交
2472

S
shawn_he 已提交
2473
**Error codes**
S
shawn_he 已提交
2474

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

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

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

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

S
shawn_he 已提交
2504 2505 2506 2507 2508 2509
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

| Name  | Type                                        | Mandatory| Description                 |
| -------- | -------------------------------------------- | ---- | --------------------- |
S
shawn_he 已提交
2510
| type     | string                                       | Yes  | Event type. The field has a fixed value of **mmiCodeResult**.|
S
shawn_he 已提交
2511 2512
| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | Yes  | Callback used to return the result.           |

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

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

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

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

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

S
shawn_he 已提交
2544 2545 2546 2547 2548 2549
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

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

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

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

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

S
shawn_he 已提交
2582 2583
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2584 2585 2586 2587 2588 2589
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

S
shawn_he 已提交
2593
**Error codes**
S
shawn_he 已提交
2594

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

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

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

S
shawn_he 已提交
2622 2623
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

**Parameters**

| Name  | Type                                                      | Mandatory| Description                |
S
shawn_he 已提交
2629 2630 2631
| -------- | ---------------------------------------------------------- | ---- | ------------------- |
| type     | string                                                     | Yes  | Event type. The field has a fixed value of **callDisconnectedCause**.|
| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)>     | No  | Callback used to return the result.          |
S
shawn_he 已提交
2632

S
shawn_he 已提交
2633
**Error codes**
S
shawn_he 已提交
2634

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

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

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

S
shawn_he 已提交
2662 2663
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
2664 2665 2666 2667
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

S
shawn_he 已提交
2668
| Name  | Type                                             | Mandatory| Description       |
S
shawn_he 已提交
2669
| -------- | ------------------------------------------------ | ---- | ----------- |
S
shawn_he 已提交
2670 2671
| type     | string                                           | Yes  | Event type. The field has a fixed value of **mmiCodeResult**.|
| callback | Callback<[MmiCodeResults](#mmicoderesults9)>     | No  | Callback used to return the result. |
S
shawn_he 已提交
2672

S
shawn_he 已提交
2673
**Error codes**
S
shawn_he 已提交
2674

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

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

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

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

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

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

**Return value**

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

S
shawn_he 已提交
2747
**Error codes**
S
shawn_he 已提交
2748

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

S
shawn_he 已提交
2776
**System API**: This is a system API.
S
shawn_he 已提交
2777 2778 2779 2780 2781 2782 2783 2784 2785 2786

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

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

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


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

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

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

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

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

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

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

S
shawn_he 已提交
2860 2861
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

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

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

S
shawn_he 已提交
2902 2903
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

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

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

S
shawn_he 已提交
2951 2952
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

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

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


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

S
shawn_he 已提交
2998 2999
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

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

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

S
shawn_he 已提交
3051 3052
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

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

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

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

S
shawn_he 已提交
3093 3094
**Required permission**: ohos.permission.GET_TELEPHONY_STATE

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

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

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

S
shawn_he 已提交
3142 3143
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

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

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


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

S
shawn_he 已提交
3189 3190
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

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

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

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

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

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

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

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

**Parameters**

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

S
shawn_he 已提交
3332
**Error codes**
S
shawn_he 已提交
3333

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

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


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

setMuted\(\): Promise<void\>

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

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

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

**Return value**

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

S
shawn_he 已提交
3369
**Error codes**
S
shawn_he 已提交
3370

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

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

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

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

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


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

cancelMuted(): Promise<void\>

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

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

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

**Return value**

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

S
shawn_he 已提交
3444
**Error codes**
S
shawn_he 已提交
3445

S
shawn_he 已提交
3446 3447 3448 3449 3450 3451 3452 3453 3454 3455
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

S
shawn_he 已提交
3456 3457 3458
**Example**

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

S
shawn_he 已提交
3466
## call.setAudioDevice<sup>8+</sup>
S
shawn_he 已提交
3467 3468 3469 3470 3471

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

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

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

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


S
shawn_he 已提交
3504
## call.setAudioDevice<sup>9+</sup>
S
shawn_he 已提交
3505 3506 3507 3508 3509

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

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

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

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


S
shawn_he 已提交
3546
## call.setAudioDevice<sup>9+</sup>
S
shawn_he 已提交
3547 3548 3549 3550 3551

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

S
shawn_he 已提交
3774 3775
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

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

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

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

S
shawn_he 已提交
3814 3815
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

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

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

S
shawn_he 已提交
3861 3862
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

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

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

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

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

S
shawn_he 已提交
3901 3902
**Required permission**: ohos.permission.SET_TELEPHONY_STATE

S
shawn_he 已提交
3903 3904 3905 3906
**System capability**: SystemCapability.Telephony.CallManager

**Parameters**

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

**Return value**

S
shawn_he 已提交
3913
| Type               | Description                        |
S
shawn_he 已提交
3914
| ------------------- | --------------------------- |
S
shawn_he 已提交
3915
| Promise&lt;void&gt; | Promise used to return the result. |
S
shawn_he 已提交
3916

S
shawn_he 已提交
3917
**Error codes**
S
shawn_he 已提交
3918

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

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

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

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

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

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

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

S
shawn_he 已提交
4024
Provides an option for determining whether a call is a video call.
S
shawn_he 已提交
4025 4026 4027

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

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

S
shawn_he 已提交
4049
## CallState
S
shawn_he 已提交
4050 4051

Enumerates call states.
S
shawn_he 已提交
4052

S
shawn_he 已提交
4053 4054 4055
**System capability**: SystemCapability.Telephony.CallManager

| Name              | Value  | Description                                                        |
S
shawn_he 已提交
4056
| ------------------ | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
4057 4058 4059
| 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 已提交
4060
| 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 已提交
4061

S
shawn_he 已提交
4062
## EmergencyNumberOptions<sup>7+</sup>
S
shawn_he 已提交
4063

S
shawn_he 已提交
4064
Provides an option for determining whether a number is an emergency number for the SIM card in the specified slot.
S
shawn_he 已提交
4065 4066 4067

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

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

S
shawn_he 已提交
4072
## NumberFormatOptions<sup>7+</sup>
S
shawn_he 已提交
4073

S
shawn_he 已提交
4074
Provides an option for number formatting.
S
shawn_he 已提交
4075 4076 4077

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

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

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

Enumerates IMS call modes.

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

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

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

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

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

Enumerates call restriction types.

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

**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 已提交
4137
**System API**: This is a system API.
S
shawn_he 已提交
4138 4139 4140

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

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

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

Enumerates call transfer types.

S
shawn_he 已提交
4155
**System API**: This is a system API.
S
shawn_he 已提交
4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169

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

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

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

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

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

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

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

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

**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 已提交
4269
**System API**: This is a system API.
S
shawn_he 已提交
4270 4271 4272

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

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

**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 已提交
4296
**System API**: This is a system API.
S
shawn_he 已提交
4297 4298 4299

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

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

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

Enumerates call ability event IDs.

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

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

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

**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 已提交
4349
**System API**: This is a system API.
S
shawn_he 已提交
4350 4351 4352

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

S
shawn_he 已提交
4353
|     Name      | Type  | Mandatory| Description    |
S
shawn_he 已提交
4354 4355 4356 4357 4358 4359 4360
| -------------- | ------ | ---- | -------- |
| messageContent | string | Yes  | Message content.|

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

Defines the call transfer result.

S
shawn_he 已提交
4361
**System API**: This is a system API.
S
shawn_he 已提交
4362 4363 4364

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

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

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

Enumerates call waiting states.

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

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

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

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

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

S
shawn_he 已提交
4413 4414 4415 4416
## DisconnectedDetails<sup>9+</sup>

Defines the cause of a call disconnection.

S
shawn_he 已提交
4417
**System API**: This is a system API.
S
shawn_he 已提交
4418 4419 4420 4421 4422 4423 4424 4425 4426

**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 已提交
4427 4428 4429

Enumerates causes of call disconnection.

S
shawn_he 已提交
4430
**System API**: This is a system API.
S
shawn_he 已提交
4431 4432 4433

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

S
shawn_he 已提交
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 4512 4513 4514
|                              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 已提交
4515 4516 4517 4518 4519

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

Defines the MMI code result.

S
shawn_he 已提交
4520
**System API**: This is a system API.
S
shawn_he 已提交
4521 4522 4523 4524 4525 4526 4527 4528 4529 4530

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

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

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

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

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