1# @ohos.telephony.call (Call) (System API) 2 3The **call** module provides call management functions, including making calls, redirecting to the dial screen, obtaining the call status, and formatting phone numbers. 4 5To subscribe to call status changes, use [`observer.on('callStateChange')`](js-apis-observer.md#observeroncallstatechange). 6 7>**NOTE** 8> 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. 10> This topic describes only system APIs provided by the module. For details about its public APIs, see [@ohos.telephony.call (Call)](js-apis-call.md). 11 12 13## Modules to Import 14 15```ts 16import call from '@ohos.telephony.call'; 17``` 18 19## call.dialCall<sup>9+</sup> 20 21dialCall\(phoneNumber: string, callback: AsyncCallback\<void\>\): void 22 23Initiates a call. This API uses an asynchronous callback to return the result. 24 25**System API**: This is a system API. 26 27**Required Permissions**: ohos.permission.PLACE_CALL 28 29**System capability**: SystemCapability.Telephony.CallManager 30 31**Parameters** 32 33| Name | Type | Mandatory| Description | 34| ----------- | ---------------------------- | ---- | -------------------------------------- | 35| phoneNumber | string | Yes | Phone number. | 36| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 37 38**Error codes** 39 40For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 41 42| ID| Error Message | 43| -------- | -------------------------------------------- | 44| 201 | Permission denied. | 45| 202 | Non-system applications use system APIs. | 46| 401 | Parameter error. | 47| 8300001 | Invalid parameter value. | 48| 8300002 | Operation failed. Cannot connect to service. | 49| 8300003 | System internal error. | 50| 8300005 | Airplane mode is on. | 51| 8300006 | Network not in service. | 52| 8300999 | Unknown error code. | 53 54**Example** 55 56```ts 57import { BusinessError } from '@ohos.base'; 58 59call.dialCall("138xxxxxxxx", (err: BusinessError) => { 60 if (err) { 61 console.error(`dialCall fail, err->${JSON.stringify(err)}`); 62 } else { 63 console.log(`dialCall success.`); 64 } 65}); 66``` 67 68 69## call.dialCall<sup>9+</sup> 70 71dialCall\(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback\<void\>\): void 72 73Initiates a call. You can set call options as needed. This API uses an asynchronous callback to return the result. 74 75**System API**: This is a system API. 76 77**Required Permissions**: ohos.permission.PLACE_CALL 78 79**System capability**: SystemCapability.Telephony.CallManager 80 81**Parameters** 82 83| Name | Type | Mandatory| Description | 84| ----------- | ----------------------------------- | ---- | ----------------------------------- | 85| phoneNumber | string | Yes | Phone number. | 86| options | [DialCallOptions](#dialcalloptions9)| Yes | Call options, which carry other configuration information of the call. | 87| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 88 89**Error codes** 90 91For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 92 93| ID| Error Message | 94| -------- | -------------------------------------------- | 95| 201 | Permission denied. | 96| 202 | Non-system applications use system APIs. | 97| 401 | Parameter error. | 98| 8300001 | Invalid parameter value. | 99| 8300002 | Operation failed. Cannot connect to service. | 100| 8300003 | System internal error. | 101| 8300005 | Airplane mode is on. | 102| 8300006 | Network not in service. | 103| 8300999 | Unknown error code. | 104 105**Example** 106 107```ts 108import { BusinessError } from '@ohos.base'; 109 110let dialCallOptions: call.DialCallOptions = { 111 accountId: 0, 112 videoState: 0, 113 dialScene: 0, 114 dialType: 0, 115} 116call.dialCall("138xxxxxxxx", dialCallOptions, (err: BusinessError) => { 117 if (err) { 118 console.error(`dialCall fail, err->${JSON.stringify(err)}`); 119 } else { 120 console.log(`dialCall success.`); 121 } 122}); 123``` 124 125 126## call.dialCall<sup>9+</sup> 127 128dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise\<void\> 129 130Initiates a call. You can set call options as needed. This API uses a promise to return the result. 131 132**System API**: This is a system API. 133 134**Required Permissions**: ohos.permission.PLACE_CALL 135 136**System capability**: SystemCapability.Telephony.CallManager 137 138**Parameters** 139 140| Name | Type | Mandatory| Description | 141| ----------- | ----------------------------------- | ---- | -------------------------------------- | 142| phoneNumber | string | Yes | Phone number. | 143| options | [DialCallOptions](#dialcalloptions9)| No | Call options, which carry other configuration information of the call.<br>If this field is not set, the following configuration is used by default. For details, see [DialCallOptions](#dialcalloptions9).<br>- **accountId**: 0 (card slot 1)<br>- **videoState**: voice call<br>- **dialScene**: common call<br>- **dialType**: carrier call | 144 145**Return value** 146 147| Type | Description | 148| ---------------------- | ---------------------------- | 149| Promise<void> | Promise used to return the result.| 150 151**Error codes** 152 153For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 154 155| ID| Error Message | 156| -------- | -------------------------------------------- | 157| 201 | Permission denied. | 158| 202 | Non-system applications use system APIs. | 159| 401 | Parameter error. | 160| 8300001 | Invalid parameter value. | 161| 8300002 | Operation failed. Cannot connect to service. | 162| 8300003 | System internal error. | 163| 8300005 | Airplane mode is on. | 164| 8300006 | Network not in service. | 165| 8300999 | Unknown error code. | 166 167**Example** 168 169```ts 170import { BusinessError } from '@ohos.base'; 171 172let dialCallOptions: call.DialCallOptions = { 173 accountId: 0, 174 videoState: 0, 175 dialScene: 0, 176 dialType: 0, 177} 178call.dialCall("138xxxxxxxx", dialCallOptions).then(() => { 179 console.log(`dialCall success.`); 180}).catch((err: BusinessError) => { 181 console.error(`dialCall fail, promise: err->${JSON.stringify(err)}`); 182}); 183``` 184 185 186## call.muteRinger<sup>8+</sup> 187 188muteRinger\(callback: AsyncCallback\<void\>\): void 189 190Mutes 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. 191 192**System API**: This is a system API. 193 194**Required permission**: ohos.permission.SET_TELEPHONY_STATE 195 196**System capability**: SystemCapability.Telephony.CallManager 197 198**Parameters** 199 200| Name | Type | Mandatory| Description | 201| ----------- | ------------------------- | ---- | ---------- | 202| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 203 204**Error codes** 205 206For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 207 208| ID| Error Message | 209| -------- | -------------------------------------------- | 210| 201 | Permission denied. | 211| 202 | Non-system applications use system APIs. | 212| 401 | Parameter error. | 213| 8300001 | Invalid parameter value. | 214| 8300002 | Operation failed. Cannot connect to service. | 215| 8300003 | System internal error. | 216| 8300999 | Unknown error code. | 217 218**Example** 219 220```ts 221import { BusinessError } from '@ohos.base'; 222 223call.muteRinger((err: BusinessError) => { 224 if (err) { 225 console.error(`muteRinger fail, err->${JSON.stringify(err)}`); 226 } else { 227 console.log(`muteRinger success.`); 228 } 229}); 230``` 231 232 233## call.muteRinger<sup>8+</sup> 234 235muteRinger\(\): Promise\<void\> 236 237Mutes 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. 238 239**System API**: This is a system API. 240 241**Required permission**: ohos.permission.SET_TELEPHONY_STATE 242 243**System capability**: SystemCapability.Telephony.CallManager 244 245**Return value** 246 247| Type | Description | 248| ------------------- | --------------------------- | 249| Promise<void> | Promise used to return the result.| 250 251**Error codes** 252 253For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 254 255| ID| Error Message | 256| -------- | -------------------------------------------- | 257| 201 | Permission denied. | 258| 202 | Non-system applications use system APIs. | 259| 8300002 | Operation failed. Cannot connect to service. | 260| 8300003 | System internal error. | 261| 8300999 | Unknown error code. | 262 263**Example** 264 265```ts 266import { BusinessError } from '@ohos.base'; 267 268call.muteRinger().then(() => { 269 console.log(`muteRinger success.`); 270}).catch((err: BusinessError) => { 271 console.error(`muteRinger fail, promise: err->${JSON.stringify(err)}`); 272}); 273``` 274 275 276## call.answerCall<sup>9+</sup> 277 278answerCall\(callId: number, callback: AsyncCallback\<void\>\): void 279 280Answers a call. This API uses an asynchronous callback to return the result. 281 282**System API**: This is a system API. 283 284**Required permission**: ohos.permission.ANSWER_CALL 285 286**System capability**: SystemCapability.Telephony.CallManager 287 288**Parameters** 289 290| Name | Type | Mandatory| Description | 291| -------- | ------------------------- | ---- | ----------------------------------------------- | 292| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.| 293| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 294 295**Error codes** 296 297For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 298 299| ID| Error Message | 300| -------- | -------------------------------------------- | 301| 201 | Permission denied. | 302| 202 | Non-system applications use system APIs. | 303| 401 | Parameter error. | 304| 8300001 | Invalid parameter value. | 305| 8300002 | Operation failed. Cannot connect to service. | 306| 8300003 | System internal error. | 307| 8300999 | Unknown error code. | 308 309**Example** 310 311```ts 312import { BusinessError } from '@ohos.base'; 313 314call.answerCall(1, (err: BusinessError) => { 315 if (err) { 316 console.error(`answerCall fail, err->${JSON.stringify(err)}`); 317 } else { 318 console.log(`answerCall success.`); 319 } 320}); 321``` 322 323 324## call.answerCall<sup>9+</sup> 325 326answerCall(callId?: number\): Promise\<void\> 327 328Answers a call. This API uses a promise to return the result. 329 330**System API**: This is a system API. 331 332**Required permission**: ohos.permission.ANSWER_CALL 333 334**System capability**: SystemCapability.Telephony.CallManager 335 336**Parameters** 337 338| Name| Type | Mandatory| Description | 339| ------ | ------ | ---- | ------------------------------------------------------------ | 340| callId | number | No | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This field is optional from API version 9.<br>If this field is not set, the latest ringing call will be connected.| 341 342**Return value** 343 344| Type | Description | 345| ------------------- | --------------------------- | 346| Promise<void> | Promise used to return the result.| 347 348**Error codes** 349 350For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 351 352| ID| Error Message | 353| -------- | -------------------------------------------- | 354| 201 | Permission denied. | 355| 202 | Non-system applications use system APIs. | 356| 401 | Parameter error. | 357| 8300001 | Invalid parameter value. | 358| 8300002 | Operation failed. Cannot connect to service. | 359| 8300003 | System internal error. | 360| 8300999 | Unknown error code. | 361 362**Example** 363 364```ts 365import { BusinessError } from '@ohos.base'; 366 367call.answerCall(1).then(() => { 368 console.log(`answerCall success.`); 369}).catch((err: BusinessError) => { 370 console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`); 371}); 372``` 373 374 375## call.answerCall<sup>9+</sup> 376 377answerCall\(callback: AsyncCallback\<void\>\): void 378 379Answers a call. This API uses an asynchronous callback to return the result. 380 381**System API**: This is a system API. 382 383**Required permission**: ohos.permission.ANSWER_CALL 384 385**System capability**: SystemCapability.Telephony.CallManager 386 387**Parameters** 388 389| Name | Type | Mandatory| Description | 390| -------- | ------------------------- | ---- | ---------- | 391| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 392 393**Error codes** 394 395For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 396 397| ID| Error Message | 398| -------- | -------------------------------------------- | 399| 201 | Permission denied. | 400| 202 | Non-system applications use system APIs. | 401| 401 | Parameter error. | 402| 8300001 | Invalid parameter value. | 403| 8300002 | Operation failed. Cannot connect to service. | 404| 8300003 | System internal error. | 405| 8300999 | Unknown error code. | 406 407**Example** 408 409```ts 410import { BusinessError } from '@ohos.base'; 411 412call.answerCall((err: BusinessError) => { 413 if (err) { 414 console.error(`answerCall fail, err->${JSON.stringify(err)}`); 415 } else { 416 console.log(`answerCall success.`); 417 } 418}); 419``` 420 421 422## call.hangUpCall<sup>9+</sup> 423 424hangUpCall\(callId: number, callback: AsyncCallback\<void\>\): void 425 426Ends a call. This API uses an asynchronous callback to return the result. 427 428**System API**: This is a system API. 429 430**Required permission**: ohos.permission.ANSWER_CALL 431 432**System capability**: SystemCapability.Telephony.CallManager 433 434**Parameters** 435 436| Name | Type | Mandatory| Description | 437| -------- | ------------------------- | ---- | ----------------------------------------------- | 438| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.| 439| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 440 441**Error codes** 442 443For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 444 445| ID| Error Message | 446| -------- | -------------------------------------------- | 447| 201 | Permission denied. | 448| 202 | Non-system applications use system APIs. | 449| 401 | Parameter error. | 450| 8300001 | Invalid parameter value. | 451| 8300002 | Operation failed. Cannot connect to service. | 452| 8300003 | System internal error. | 453| 8300999 | Unknown error code. | 454 455**Example** 456 457```ts 458import { BusinessError } from '@ohos.base'; 459 460call.hangUpCall(1, (err: BusinessError) => { 461 if (err) { 462 console.error(`hangUpCall fail, err->${JSON.stringify(err)}`); 463 } else { 464 console.log(`hangUpCall success.`); 465 } 466}); 467``` 468 469 470## call.hangUpCall<sup>9+</sup> 471 472hangUpCall\(callId?: number\): Promise\<void\> 473 474Ends a call. This API uses a promise to return the result. 475 476**System API**: This is a system API. 477 478**Required permission**: ohos.permission.ANSWER_CALL 479 480**System capability**: SystemCapability.Telephony.CallManager 481 482**Parameters** 483 484| Name| Type | Mandatory| Description | 485| ------ | ------ | ---- | ------------------------------------------------------------ | 486| callId | number | No | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This field is optional from API version 9.<br>If this field is not set, the latest ongoing, dialed, or connected call will be ended.| 487 488**Return value** 489 490| Type | Description | 491| ------------------- | --------------------------- | 492| Promise<void> | Promise used to return the result.| 493 494**Error codes** 495 496For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 497 498| ID| Error Message | 499| -------- | -------------------------------------------- | 500| 201 | Permission denied. | 501| 202 | Non-system applications use system APIs. | 502| 401 | Parameter error. | 503| 8300001 | Invalid parameter value. | 504| 8300002 | Operation failed. Cannot connect to service. | 505| 8300003 | System internal error. | 506| 8300999 | Unknown error code. | 507 508**Example** 509 510```ts 511import { BusinessError } from '@ohos.base'; 512 513call.hangUpCall(1).then(() => { 514 console.log(`hangUpCall success.`); 515}).catch((err: BusinessError) => { 516 console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`); 517}); 518``` 519 520 521## call.hangUpCall<sup>9+</sup> 522 523hangUpCall\(callback: AsyncCallback\<void\>\): void 524 525Ends a call. This API uses an asynchronous callback to return the result. 526 527**System API**: This is a system API. 528 529**Required permission**: ohos.permission.ANSWER_CALL 530 531**System capability**: SystemCapability.Telephony.CallManager 532 533**Parameters** 534 535| Name | Type | Mandatory| Description | 536| -------- | ------------------------- | ---- | ---------- | 537| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 538 539**Error codes** 540 541For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 542 543| ID| Error Message | 544| -------- | -------------------------------------------- | 545| 201 | Permission denied. | 546| 202 | Non-system applications use system APIs. | 547| 401 | Parameter error. | 548| 8300001 | Invalid parameter value. | 549| 8300002 | Operation failed. Cannot connect to service. | 550| 8300003 | System internal error. | 551| 8300999 | Unknown error code. | 552 553 554**Example** 555 556```ts 557import { BusinessError } from '@ohos.base'; 558 559call.hangUpCall((err: BusinessError) => { 560 if (err) { 561 console.error(`hangUpCall fail, err->${JSON.stringify(err)}`); 562 } else { 563 console.log(`hangUpCall success.`); 564 } 565}); 566``` 567 568 569## call.rejectCall<sup>9+</sup> 570 571rejectCall\(callId: number, callback: AsyncCallback\<void\>\): void 572 573Rejects a call. This API uses an asynchronous callback to return the result. 574 575**System API**: This is a system API. 576 577**Required permission**: ohos.permission.ANSWER_CALL 578 579**System capability**: SystemCapability.Telephony.CallManager 580 581**Parameters** 582 583| Name | Type | Mandatory| Description | 584| -------- | ------------------------- | ---- | ----------------------------------------------- | 585| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.| 586| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 587 588**Error codes** 589 590For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 591 592| ID| Error Message | 593| -------- | -------------------------------------------- | 594| 201 | Permission denied. | 595| 202 | Non-system applications use system APIs. | 596| 401 | Parameter error. | 597| 8300001 | Invalid parameter value. | 598| 8300002 | Operation failed. Cannot connect to service. | 599| 8300003 | System internal error. | 600| 8300999 | Unknown error code. | 601 602 603**Example** 604 605```ts 606import { BusinessError } from '@ohos.base'; 607 608call.rejectCall(1, (err: BusinessError) => { 609 if (err) { 610 console.error(`rejectCall fail, err->${JSON.stringify(err)}`); 611 } else { 612 console.log(`rejectCall success.`); 613 } 614}); 615``` 616 617 618## call.rejectCall<sup>9+</sup> 619 620rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallback\<void\>\): void 621 622Rejects a call. This API uses an asynchronous callback to return the result. 623 624**System API**: This is a system API. 625 626**Required permission**: ohos.permission.ANSWER_CALL 627 628**System capability**: SystemCapability.Telephony.CallManager 629 630**Parameters** 631 632| Name | Type | Mandatory| Description | 633| -------- | ---------------------------------------------- | ---- | ----------------------------------------------- | 634| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.| 635| options | [RejectMessageOptions](#rejectmessageoptions7) | Yes | Options for the call rejection message. | 636| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 637 638**Error codes** 639 640For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 641 642| ID| Error Message | 643| -------- | -------------------------------------------- | 644| 201 | Permission denied. | 645| 202 | Non-system applications use system APIs. | 646| 401 | Parameter error. | 647| 8300001 | Invalid parameter value. | 648| 8300002 | Operation failed. Cannot connect to service. | 649| 8300003 | System internal error. | 650| 8300999 | Unknown error code. | 651 652**Example** 653 654```ts 655import { BusinessError } from '@ohos.base'; 656 657let rejectMessageOptions : call.RejectMessageOptions = { 658 messageContent: "Unknown number blocked" 659} 660call.rejectCall(1, rejectMessageOptions, (err: BusinessError) => { 661 if (err) { 662 console.error(`rejectCall fail, err->${JSON.stringify(err)}`); 663 } else { 664 console.log(`rejectCall success.`); 665 } 666}); 667``` 668 669 670## call.rejectCall<sup>9+</sup> 671 672rejectCall\(callId?: number, options?: RejectMessageOptions\): Promise\<void\> 673 674Rejects a call. This API uses a promise to return the result. 675 676**System API**: This is a system API. 677 678**Required permission**: ohos.permission.ANSWER_CALL 679 680**System capability**: SystemCapability.Telephony.CallManager 681 682**Parameters** 683 684| Name | Type | Mandatory| Description | 685| ------- | ---------------------------------------------- | ---- | ------------------------------------------------------------ | 686| callId | number | No | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This field is optional from API version 9.<br>If this field is not set, the latest ringing call will be rejected.| 687| options | [RejectMessageOptions](#rejectmessageoptions7) | No | Options for the call rejection message. If this field is not set, no call rejection message will be sent.| 688 689**Return value** 690 691| Type | Description | 692| ------------------- | --------------------------- | 693| Promise<void> | Promise used to return the result.| 694 695**Error codes** 696 697For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 698 699| ID| Error Message | 700| -------- | -------------------------------------------- | 701| 201 | Permission denied. | 702| 202 | Non-system applications use system APIs. | 703| 401 | Parameter error. | 704| 8300001 | Invalid parameter value. | 705| 8300002 | Operation failed. Cannot connect to service. | 706| 8300003 | System internal error. | 707| 8300999 | Unknown error code. | 708 709**Example** 710 711```ts 712import { BusinessError } from '@ohos.base'; 713 714let rejectMessageOptions: call.RejectMessageOptions = { 715 messageContent: "Unknown number blocked" 716} 717call.rejectCall(1, rejectMessageOptions).then(() => { 718 console.log(`rejectCall success.`); 719}).catch((err: BusinessError) => { 720 console.error(`rejectCall fail, promise: err->${JSON.stringify(err)}`); 721}); 722``` 723 724 725## call.rejectCall<sup>9+</sup> 726 727rejectCall\(callback: AsyncCallback\<void\>\): void 728 729Rejects a call. This API uses an asynchronous callback to return the result. 730 731**System API**: This is a system API. 732 733**Required permission**: ohos.permission.ANSWER_CALL 734 735**System capability**: SystemCapability.Telephony.CallManager 736 737**Parameters** 738 739| Name | Type | Mandatory| Description | 740| -------- | ------------------------- | ---- | ---------- | 741| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 742 743**Error codes** 744 745For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 746 747| ID| Error Message | 748| -------- | -------------------------------------------- | 749| 201 | Permission denied. | 750| 202 | Non-system applications use system APIs. | 751| 401 | Parameter error. | 752| 8300001 | Invalid parameter value. | 753| 8300002 | Operation failed. Cannot connect to service. | 754| 8300003 | System internal error. | 755| 8300999 | Unknown error code. | 756 757**Example** 758 759```ts 760import { BusinessError } from '@ohos.base'; 761 762call.rejectCall((err: BusinessError) => { 763 if (err) { 764 console.error(`rejectCall fail, err->${JSON.stringify(err)}`); 765 } else { 766 console.log(`rejectCall success.`); 767 } 768}); 769``` 770 771 772## call.rejectCall<sup>9+</sup> 773 774rejectCall\(options: RejectMessageOptions, callback: AsyncCallback\<void\>\): void 775 776Rejects a call. This API uses an asynchronous callback to return the result. 777 778**System API**: This is a system API. 779 780**Required permission**: ohos.permission.ANSWER_CALL 781 782**System capability**: SystemCapability.Telephony.CallManager 783 784**Parameters** 785 786| Name | Type | Mandatory| Description | 787| -------- | ---------------------------------------------- | ---- | -------------- | 788| options | [RejectMessageOptions](#rejectmessageoptions7) | Yes | Options for the call rejection message.| 789| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 790 791**Error codes** 792 793For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 794 795| ID| Error Message | 796| -------- | -------------------------------------------- | 797| 201 | Permission denied. | 798| 202 | Non-system applications use system APIs. | 799| 401 | Parameter error. | 800| 8300001 | Invalid parameter value. | 801| 8300002 | Operation failed. Cannot connect to service. | 802| 8300003 | System internal error. | 803| 8300999 | Unknown error code. | 804 805**Example** 806 807```ts 808import { BusinessError } from '@ohos.base'; 809 810let rejectMessageOptions: call.RejectMessageOptions = { 811 messageContent: "Unknown number blocked" 812} 813call.rejectCall(rejectMessageOptions, (err: BusinessError) => { 814 if (err) { 815 console.error(`rejectCall fail, err->${JSON.stringify(err)}`); 816 } else { 817 console.log(`rejectCall success.`); 818 } 819}); 820``` 821 822 823## call.holdCall<sup>7+</sup> 824 825holdCall\(callId: number, callback: AsyncCallback\<void\>\): void 826 827Holds a call based on the specified call ID. This API uses an asynchronous callback to return the result. 828 829**System API**: This is a system API. 830 831**Required permission**: ohos.permission.ANSWER_CALL 832 833**System capability**: SystemCapability.Telephony.CallManager 834 835**Parameters** 836 837| Name | Type | Mandatory| Description | 838| -------- | ------------------------- | ---- | ---------- | 839| callId | number | Yes | Call ID. | 840| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 841 842**Error codes** 843 844For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 845 846| ID| Error Message | 847| -------- | -------------------------------------------- | 848| 201 | Permission denied. | 849| 202 | Non-system applications use system APIs. | 850| 401 | Parameter error. | 851| 8300001 | Invalid parameter value. | 852| 8300002 | Operation failed. Cannot connect to service. | 853| 8300003 | System internal error. | 854| 8300999 | Unknown error code. | 855 856**Example** 857 858```ts 859import { BusinessError } from '@ohos.base'; 860 861call.holdCall(1, (err: BusinessError) => { 862 if (err) { 863 console.error(`holdCall fail, err->${JSON.stringify(err)}`); 864 } else { 865 console.log(`holdCall success.`); 866 } 867}); 868``` 869 870 871## call.holdCall<sup>7+</sup> 872 873holdCall\(callId: number\): Promise\<void\> 874 875Holds a call based on the specified call ID. This API uses a promise to return the result. 876 877**System API**: This is a system API. 878 879**Required permission**: ohos.permission.ANSWER_CALL 880 881**System capability**: SystemCapability.Telephony.CallManager 882 883**Parameters** 884 885| Name| Type | Mandatory| Description | 886| ------ | ------ | ---- | -------- | 887| callId | number | Yes | Call ID.| 888 889**Return value** 890 891| Type | Description | 892| ------------------- | --------------------------- | 893| Promise<void> | Promise used to return the result.| 894 895**Error codes** 896 897For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 898 899| ID| Error Message | 900| -------- | -------------------------------------------- | 901| 201 | Permission denied. | 902| 202 | Non-system applications use system APIs. | 903| 401 | Parameter error. | 904| 8300001 | Invalid parameter value. | 905| 8300002 | Operation failed. Cannot connect to service. | 906| 8300003 | System internal error. | 907| 8300999 | Unknown error code. | 908 909**Example** 910 911```ts 912import { BusinessError } from '@ohos.base'; 913 914call.holdCall(1).then(() => { 915 console.log(`holdCall success.`); 916}).catch((err: BusinessError) => { 917 console.error(`holdCall fail, promise: err->${JSON.stringify(err)}`); 918}); 919``` 920 921## call.unHoldCall<sup>7+</sup> 922 923unHoldCall\(callId: number, callback: AsyncCallback\<void\>\): void 924 925Unholds a call based on the specified call ID. This API uses an asynchronous callback to return the result. 926 927**System API**: This is a system API. 928 929**Required permission**: ohos.permission.ANSWER_CALL 930 931**System capability**: SystemCapability.Telephony.CallManager 932 933**Parameters** 934 935| Name | Type | Mandatory| Description | 936| -------- | ------------------------- | ---- | ---------- | 937| callId | number | Yes | Call ID. | 938| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 939 940**Error codes** 941 942For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 943 944| ID| Error Message | 945| -------- | -------------------------------------------- | 946| 201 | Permission denied. | 947| 202 | Non-system applications use system APIs. | 948| 401 | Parameter error. | 949| 8300001 | Invalid parameter value. | 950| 8300002 | Operation failed. Cannot connect to service. | 951| 8300003 | System internal error. | 952| 8300999 | Unknown error code. | 953 954**Example** 955 956```ts 957import { BusinessError } from '@ohos.base'; 958 959call.unHoldCall(1, (err: BusinessError) => { 960 if (err) { 961 console.error(`unHoldCall fail, err->${JSON.stringify(err)}`); 962 } else { 963 console.log(`unHoldCall success.`); 964 } 965}); 966``` 967 968 969## call.unHoldCall<sup>7+</sup> 970 971unHoldCall\(callId: number\): Promise\<void\> 972 973Unholds a call based on the specified call ID. This API uses a promise to return the result. 974 975**System API**: This is a system API. 976 977**Required permission**: ohos.permission.ANSWER_CALL 978 979**System capability**: SystemCapability.Telephony.CallManager 980 981**Parameters** 982 983| Name| Type | Mandatory| Description | 984| ------ | ------ | ---- | -------- | 985| callId | number | Yes | Call ID.| 986 987**Return value** 988 989| Type | Description | 990| ------------------- | --------------------------- | 991| Promise<void> | Promise used to return the result.| 992 993**Error codes** 994 995For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 996 997| ID| Error Message | 998| -------- | -------------------------------------------- | 999| 201 | Permission denied. | 1000| 202 | Non-system applications use system APIs. | 1001| 401 | Parameter error. | 1002| 8300001 | Invalid parameter value. | 1003| 8300002 | Operation failed. Cannot connect to service. | 1004| 8300003 | System internal error. | 1005| 8300999 | Unknown error code. | 1006 1007**Example** 1008 1009```ts 1010import { BusinessError } from '@ohos.base'; 1011 1012call.unHoldCall(1).then(() => { 1013 console.log(`unHoldCall success.`); 1014}).catch((err: BusinessError) => { 1015 console.error(`unHoldCall fail, promise: err->${JSON.stringify(err)}`); 1016}); 1017``` 1018 1019## call.switchCall<sup>7+</sup> 1020 1021switchCall\(callId: number, callback: AsyncCallback\<void\>\): void 1022 1023Switches a call. This API uses an asynchronous callback to return the result. 1024 1025**System API**: This is a system API. 1026 1027**Required permission**: ohos.permission.ANSWER_CALL 1028 1029**System capability**: SystemCapability.Telephony.CallManager 1030 1031**Parameters** 1032 1033| Name | Type | Mandatory| Description | 1034| -------- | ------------------------- | ---- | ---------- | 1035| callId | number | Yes | Call ID. | 1036| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 1037 1038**Error codes** 1039 1040For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1041 1042| ID| Error Message | 1043| -------- | -------------------------------------------- | 1044| 201 | Permission denied. | 1045| 202 | Non-system applications use system APIs. | 1046| 401 | Parameter error. | 1047| 8300001 | Invalid parameter value. | 1048| 8300002 | Operation failed. Cannot connect to service. | 1049| 8300003 | System internal error. | 1050| 8300999 | Unknown error code. | 1051 1052**Example** 1053 1054```ts 1055import { BusinessError } from '@ohos.base'; 1056 1057call.switchCall(1, (err: BusinessError) => { 1058 if (err) { 1059 console.error(`switchCall fail, err->${JSON.stringify(err)}`); 1060 } else { 1061 console.log(`switchCall success.`); 1062 } 1063}); 1064``` 1065 1066 1067## call.switchCall<sup>7+</sup> 1068 1069switchCall\(callId: number\): Promise\<void\> 1070 1071Switches a call. This API uses a promise to return the result. 1072 1073**System API**: This is a system API. 1074 1075**Required permission**: ohos.permission.ANSWER_CALL 1076 1077**System capability**: SystemCapability.Telephony.CallManager 1078 1079**Parameters** 1080 1081| Name| Type | Mandatory| Description | 1082| ------ | ------ | ---- | -------- | 1083| callId | number | Yes | Call ID.| 1084 1085**Return value** 1086 1087| Type | Description | 1088| ------------------- | --------------------------- | 1089| Promise<void> | Promise used to return the result.| 1090 1091**Error codes** 1092 1093For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1094 1095| ID| Error Message | 1096| -------- | -------------------------------------------- | 1097| 201 | Permission denied. | 1098| 202 | Non-system applications use system APIs. | 1099| 401 | Parameter error. | 1100| 8300001 | Invalid parameter value. | 1101| 8300002 | Operation failed. Cannot connect to service. | 1102| 8300003 | System internal error. | 1103| 8300999 | Unknown error code. | 1104 1105**Example** 1106 1107```ts 1108import { BusinessError } from '@ohos.base'; 1109 1110call.switchCall(1).then(() => { 1111 console.log(`switchCall success.`); 1112}).catch((err: BusinessError) => { 1113 console.error(`switchCall fail, promise: err->${JSON.stringify(err)}`); 1114}); 1115``` 1116 1117## call.combineConference<sup>11+</sup> 1118 1119combineConference\(callId: number, callback: AsyncCallback\<void\>\): void 1120 1121Combines two calls into a conference call. This API uses an asynchronous callback to return the result. 1122 1123**System API**: This is a system API. 1124 1125**System capability**: SystemCapability.Telephony.CallManager 1126 1127**Parameters** 1128 1129| Name | Type | Mandatory| Description | 1130| -------- | ------------------------- | ---- | ---------- | 1131| callId | number | Yes | Call ID. | 1132| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 1133 1134**Error codes** 1135 1136For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1137 1138| ID| Error Message | 1139| -------- | -------------------------------------------- | 1140| 202 | Non-system applications use system APIs. | 1141| 401 | Parameter error. | 1142| 801 | Capability not supported. | 1143| 8300001 | Invalid parameter value. | 1144| 8300002 | Operation failed. Cannot connect to service. | 1145| 8300003 | System internal error. | 1146| 8300007 | The number of conference calls exceeds the limit. | 1147 1148**Example** 1149 1150```ts 1151import { BusinessError } from '@ohos.base'; 1152 1153call.combineConference(1, (err: BusinessError) => { 1154 if (err) { 1155 console.error(`combineConference fail, err->${JSON.stringify(err)}`); 1156 } else { 1157 console.log(`combineConference success.`); 1158 } 1159}); 1160``` 1161 1162 1163## call.combineConference<sup>11+</sup> 1164 1165combineConference\(callId: number\): Promise\<void\> 1166 1167Combines two calls into a conference call. This API uses a promise to return the result. 1168 1169**System API**: This is a system API. 1170 1171**System capability**: SystemCapability.Telephony.CallManager 1172 1173**Parameters** 1174 1175| Name| Type | Mandatory| Description | 1176| ------ | ------ | ---- | -------- | 1177| callId | number | Yes | Call ID.| 1178 1179**Return value** 1180 1181| Type | Description | 1182| ------------------- | --------------------------- | 1183| Promise<void> | Promise used to return the result.| 1184 1185**Error codes** 1186 1187For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1188 1189| ID| Error Message | 1190| -------- | -------------------------------------------- | 1191| 202 | Non-system applications use system APIs. | 1192| 401 | Parameter error. | 1193| 801 | Capability not supported. | 1194| 8300001 | Invalid parameter value. | 1195| 8300002 | Operation failed. Cannot connect to service. | 1196| 8300003 | System internal error. | 1197| 8300007 | The number of conference calls exceeds the limit. | 1198 1199**Example** 1200 1201```ts 1202import { BusinessError } from '@ohos.base'; 1203 1204call.combineConference(1).then(() => { 1205 console.log(`combineConference success.`); 1206}).catch((err: BusinessError) => { 1207 console.error(`combineConference fail, promise: err->${JSON.stringify(err)}`); 1208}); 1209``` 1210 1211## call.kickOutFromConference<sup>10+</sup> 1212 1213kickOutFromConference\(callId: number, callback: AsyncCallback\<void\>\): void 1214 1215Removes a specified call from a conference call. This API uses an asynchronous callback to return the result. 1216 1217**System API**: This is a system API. 1218 1219**Required Permissions**: ohos.permission.PLACE_CALL 1220 1221**System capability**: SystemCapability.Telephony.CallManager 1222 1223**Parameters** 1224 1225| Name | Type | Mandatory| Description | 1226| -------- | ------------------------- | ---- | ---------- | 1227| callId | number | Yes | Call ID. | 1228| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 1229 1230**Error codes** 1231 1232For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1233 1234| ID| Error Message | 1235| -------- | -------------------------------------------- | 1236| 201 | Permission denied. | 1237| 202 | Non-system applications use system APIs. | 1238| 401 | Parameter error. | 1239| 8300001 | Invalid parameter value. | 1240| 8300002 | Operation failed. Cannot connect to service. | 1241| 8300003 | System internal error. | 1242| 8300999 | Unknown error code. | 1243 1244**Example** 1245 1246```ts 1247import { BusinessError } from '@ohos.base'; 1248 1249call.kickOutFromConference(1, (err: BusinessError) => { 1250 if (err) { 1251 console.error(`kickOutFromConference fail, err->${JSON.stringify(err)}`); 1252 } else { 1253 console.log(`kickOutFromConference success.`); 1254 } 1255}); 1256``` 1257 1258## call.kickOutFromConference<sup>10+</sup> 1259 1260kickOutFromConference\(callId: number\): Promise\<void\> 1261 1262Removes a specified call from a conference call. This API uses a promise to return the result. 1263 1264**System API**: This is a system API. 1265 1266**Required Permissions**: ohos.permission.PLACE_CALL 1267 1268**System capability**: SystemCapability.Telephony.CallManager 1269 1270**Parameters** 1271 1272| Name| Type | Mandatory| Description | 1273| ------ | ------ | ---- | -------- | 1274| callId | number | Yes | Call ID.| 1275 1276**Return value** 1277 1278| Type | Description | 1279| ------------------- | --------------------------- | 1280| Promise<void> | Promise used to return the result.| 1281 1282**Error codes** 1283 1284For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1285 1286| ID| Error Message | 1287| -------- | -------------------------------------------- | 1288| 201 | Permission denied. | 1289| 202 | Non-system applications use system APIs. | 1290| 401 | Parameter error. | 1291| 8300001 | Invalid parameter value. | 1292| 8300002 | Operation failed. Cannot connect to service. | 1293| 8300003 | System internal error. | 1294| 8300999 | Unknown error code. | 1295 1296**Example** 1297 1298```ts 1299import { BusinessError } from '@ohos.base'; 1300 1301call.kickOutFromConference(1).then(() => { 1302 console.log(`kickOutFromConference success.`); 1303}).catch((err: BusinessError) => { 1304 console.error(`kickOutFromConference fail, promise: err->${JSON.stringify(err)}`); 1305}); 1306``` 1307 1308## call.getMainCallId<sup>7+</sup> 1309 1310getMainCallId\(callId: number, callback: AsyncCallback\<number\>\): void 1311 1312Obtains the main call ID. This API uses an asynchronous callback to return the result. 1313 1314**System API**: This is a system API. 1315 1316**System capability**: SystemCapability.Telephony.CallManager 1317 1318**Parameters** 1319 1320| Name | Type | Mandatory| Description | 1321| -------- | --------------------------- | ---- | ------------------------ | 1322| callId | number | Yes | Call ID. | 1323| callback | AsyncCallback<number> | Yes | Callback used to return the result. | 1324 1325**Error codes** 1326 1327For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1328 1329| ID| Error Message | 1330| -------- | -------------------------------------------- | 1331| 202 | Non-system applications use system APIs. | 1332| 401 | Parameter error. | 1333| 801 | Capability not supported. | 1334| 8300001 | Invalid parameter value. | 1335| 8300002 | Operation failed. Cannot connect to service. | 1336| 8300003 | System internal error. | 1337 1338 1339**Example** 1340 1341```ts 1342import { BusinessError } from '@ohos.base'; 1343 1344call.getMainCallId(1, (err: BusinessError, data: number) => { 1345 if (err) { 1346 console.error(`getMainCallId fail, err->${JSON.stringify(err)}`); 1347 } else { 1348 console.log(`getMainCallId success, data->${JSON.stringify(data)}`); 1349 } 1350}); 1351``` 1352 1353 1354## call.getMainCallId<sup>7+</sup> 1355 1356getMainCallId\(callId: number\): Promise\<number\> 1357 1358Obtains the main call ID. This API uses a promise to return the result. 1359 1360**System API**: This is a system API. 1361 1362**System capability**: SystemCapability.Telephony.CallManager 1363 1364**Parameters** 1365 1366| Name| Type | Mandatory| Description | 1367| ------ | ------ | ---- | -------- | 1368| callId | number | Yes | Call ID.| 1369 1370**Return value** 1371 1372| Type | Description | 1373| ------------------- | ------------------------------- | 1374| Promise<number> | Promise used to return the result.| 1375 1376**Error codes** 1377 1378For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1379 1380| ID| Error Message | 1381| -------- | -------------------------------------------- | 1382| 202 | Non-system applications use system APIs. | 1383| 401 | Parameter error. | 1384| 801 | Capability not supported. | 1385| 8300001 | Invalid parameter value. | 1386| 8300002 | Operation failed. Cannot connect to service. | 1387| 8300003 | System internal error. | 1388 1389 1390**Example** 1391 1392```ts 1393import { BusinessError } from '@ohos.base'; 1394 1395call.getMainCallId(1).then((data: number) => { 1396 console.log(`getMainCallId success, promise: data->${JSON.stringify(data)}`); 1397}).catch((err: BusinessError) => { 1398 console.error(`getMainCallId fail, promise: err->${JSON.stringify(err)}`); 1399}); 1400``` 1401 1402## call.getSubCallIdList<sup>7+</sup> 1403 1404getSubCallIdList\(callId: number, callback: AsyncCallback\<Array\<string\>\>\): void 1405 1406Obtains the list of subcall IDs. This API uses an asynchronous callback to return the result. 1407 1408**System API**: This is a system API. 1409 1410**System capability**: SystemCapability.Telephony.CallManager 1411 1412**Parameters** 1413 1414| Name | Type | Mandatory| Description | 1415| -------- | ------------------------------ | ---- | ---------------------------- | 1416| callId | number | Yes | Call ID. | 1417| callback | AsyncCallback<Array<string\>\> | Yes | Callback used to return the result. | 1418 1419**Error codes** 1420 1421For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1422 1423| ID| Error Message | 1424| -------- | -------------------------------------------- | 1425| 202 | Non-system applications use system APIs. | 1426| 401 | Parameter error. | 1427| 801 | Capability not supported. | 1428| 8300001 | Invalid parameter value. | 1429| 8300002 | Operation failed. Cannot connect to service. | 1430| 8300003 | System internal error. | 1431 1432**Example** 1433 1434```ts 1435import { BusinessError } from '@ohos.base'; 1436 1437call.getSubCallIdList(1, (err: BusinessError, data: Array<string>) => { 1438 if (err) { 1439 console.error(`getSubCallIdList fail, err->${JSON.stringify(err)}`); 1440 } else { 1441 console.log(`getSubCallIdList success, data->${JSON.stringify(data)}`); 1442 } 1443}); 1444``` 1445 1446 1447## call.getSubCallIdList<sup>7+</sup> 1448 1449getSubCallIdList\(callId: number\): Promise\<Array\<string\>\> 1450 1451Obtains the list of subcall IDs. This API uses a promise to return the result. 1452 1453**System API**: This is a system API. 1454 1455**System capability**: SystemCapability.Telephony.CallManager 1456 1457**Parameters** 1458 1459| Name| Type | Mandatory| Description | 1460| ------ | ------ | ---- | -------- | 1461| callId | number | Yes | Call ID.| 1462 1463**Return value** 1464 1465| Type | Description | 1466| ----------------------------- | ----------------------------------- | 1467| Promise<Array<string\>> | Promise used to return the result.| 1468 1469**Error codes** 1470 1471For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1472 1473| ID| Error Message | 1474| -------- | -------------------------------------------- | 1475| 202 | Non-system applications use system APIs. | 1476| 401 | Parameter error. | 1477| 801 | Capability not supported. | 1478| 8300001 | Invalid parameter value. | 1479| 8300002 | Operation failed. Cannot connect to service. | 1480| 8300003 | System internal error. | 1481 1482**Example** 1483 1484```ts 1485import { BusinessError } from '@ohos.base'; 1486 1487call.getSubCallIdList(1).then((data: Array<string>) => { 1488 console.log(`getSubCallIdList success, promise: data->${JSON.stringify(data)}`); 1489}).catch((err: BusinessError) => { 1490 console.error(`getSubCallIdList fail, promise: err->${JSON.stringify(err)}`); 1491}); 1492``` 1493 1494## call.getCallIdListForConference<sup>7+</sup> 1495 1496getCallIdListForConference\(callId: number, callback: AsyncCallback\<Array\<string\>\>\): void 1497 1498Obtains the list of call IDs in a conference. This API uses an asynchronous callback to return the result. 1499 1500**System API**: This is a system API. 1501 1502**System capability**: SystemCapability.Telephony.CallManager 1503 1504**Parameters** 1505 1506| Name | Type | Mandatory| Description | 1507| -------- | ----------------------------------- | ---- | -------------------------------- | 1508| callId | number | Yes | Call ID. | 1509| callback | AsyncCallback<Array<string\>> | Yes | Callback used to return the result. | 1510 1511**Error codes** 1512 1513For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1514 1515| ID| Error Message | 1516| -------- | -------------------------------------------- | 1517| 202 | Non-system applications use system APIs. | 1518| 401 | Parameter error. | 1519| 801 | Capability not supported. | 1520| 8300001 | Invalid parameter value. | 1521| 8300002 | Operation failed. Cannot connect to service. | 1522| 8300003 | System internal error. | 1523 1524**Example** 1525 1526```ts 1527import { BusinessError } from '@ohos.base'; 1528 1529call.getCallIdListForConference(1, (err: BusinessError, data: Array<string>) => { 1530 if (err) { 1531 console.error(`getCallIdListForConference fail, err->${JSON.stringify(err)}`); 1532 } else { 1533 console.log(`getCallIdListForConference success, data->${JSON.stringify(data)}`); 1534 } 1535}); 1536``` 1537 1538 1539## call.getCallIdListForConference<sup>7+</sup> 1540 1541getCallIdListForConference\(callId: number\): Promise\<Array\<string\>\> 1542 1543Obtains the list of call IDs in a conference. This API uses a promise to return the result. 1544 1545**System API**: This is a system API. 1546 1547**System capability**: SystemCapability.Telephony.CallManager 1548 1549**Parameters** 1550 1551| Name| Type | Mandatory| Description | 1552| ------ | ------ | ---- | -------- | 1553| callId | number | Yes | Call ID.| 1554 1555**Return value** 1556 1557| Type | Description | 1558| ----------------------------- | --------------------------------------- | 1559| Promise<Array<string\>> | Promise used to return the result.| 1560 1561**Error codes** 1562 1563For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1564 1565| ID| Error Message | 1566| -------- | -------------------------------------------- | 1567| 202 | Non-system applications use system APIs. | 1568| 401 | Parameter error. | 1569| 801 | Capability not supported. | 1570| 8300001 | Invalid parameter value. | 1571| 8300002 | Operation failed. Cannot connect to service. | 1572| 8300003 | System internal error. | 1573 1574**Example** 1575 1576```ts 1577import { BusinessError } from '@ohos.base'; 1578 1579call.getCallIdListForConference(1).then((data: Array<string>) => { 1580 console.log(`getCallIdListForConference success, promise: data->${JSON.stringify(data)}`); 1581}).catch((err: BusinessError) => { 1582 console.error(`getCallIdListForConference fail, promise: err->${JSON.stringify(err)}`); 1583}); 1584``` 1585 1586## call.getCallWaitingStatus<sup>7+</sup> 1587 1588getCallWaitingStatus\(slotId: number, callback: AsyncCallback\<CallWaitingStatus\>\): void 1589 1590Obtains the call waiting status. This API uses an asynchronous callback to return the result. 1591 1592**System API**: This is a system API. 1593 1594**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1595 1596**System capability**: SystemCapability.Telephony.CallManager 1597 1598**Parameters** 1599 1600| Name | Type | Mandatory| Description | 1601| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | 1602| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 1603| callback | AsyncCallback<[CallWaitingStatus](#callwaitingstatus7)\> | Yes | Callback used to return the result.<br>The value can be:<br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.| 1604 1605**Error codes** 1606 1607For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1608 1609| ID| Error Message | 1610| -------- | -------------------------------------------- | 1611| 201 | Permission denied. | 1612| 202 | Non-system applications use system APIs. | 1613| 401 | Parameter error. | 1614| 801 | Capability not supported. | 1615| 8300001 | Invalid parameter value. | 1616| 8300002 | Operation failed. Cannot connect to service. | 1617| 8300003 | System internal error. | 1618 1619**Example** 1620 1621```ts 1622import { BusinessError } from '@ohos.base'; 1623 1624call.getCallWaitingStatus(0, (err: BusinessError, data: call.CallWaitingStatus) => { 1625 if (err) { 1626 console.error(`getCallWaitingStatus fail, err->${JSON.stringify(err)}`); 1627 } else { 1628 console.log(`getCallWaitingStatus success, data->${JSON.stringify(data)}`); 1629 } 1630}); 1631``` 1632 1633 1634## call.getCallWaitingStatus<sup>7+</sup> 1635 1636getCallWaitingStatus\(slotId: number\): Promise\<CallWaitingStatus\> 1637 1638Obtains the call waiting status. This API uses a promise to return the result. 1639 1640**System API**: This is a system API. 1641 1642**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1643 1644**System capability**: SystemCapability.Telephony.CallManager 1645 1646**Parameters** 1647 1648| Name| Type | Mandatory| Description | 1649| ------ | ------ | ---- | -------------------------------------- | 1650| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1651 1652**Return value** 1653 1654| Type | Description | 1655| ------------------------------------------------------- | ------------------------------------------------------------ | 1656| Promise<[CallWaitingStatus](#callwaitingstatus7)> | Promise used to return the result.<br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.| 1657 1658**Error codes** 1659 1660For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1661 1662| ID| Error Message | 1663| -------- | -------------------------------------------- | 1664| 201 | Permission denied. | 1665| 202 | Non-system applications use system APIs. | 1666| 401 | Parameter error. | 1667| 801 | Capability not supported. | 1668| 8300001 | Invalid parameter value. | 1669| 8300002 | Operation failed. Cannot connect to service. | 1670| 8300003 | System internal error. | 1671 1672**Example** 1673 1674```ts 1675import { BusinessError } from '@ohos.base'; 1676 1677call.getCallWaitingStatus(0).then((data: call.CallWaitingStatus) => { 1678 console.log(`getCallWaitingStatus success, promise: data->${JSON.stringify(data)}`); 1679}).catch((err: BusinessError) => { 1680 console.error(`getCallWaitingStatus fail, promise: err->${JSON.stringify(err)}`); 1681}); 1682``` 1683 1684## call.setCallWaiting<sup>7+</sup> 1685 1686setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback\<void\>\): void 1687 1688Specifies whether to enable the call waiting service. This API uses an asynchronous callback to return the result. 1689 1690**System API**: This is a system API. 1691 1692**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1693 1694**System capability**: SystemCapability.Telephony.CallManager 1695 1696**Parameters** 1697 1698| Name | Type | Mandatory| Description | 1699| -------- | -------------------- | ---- | ------------------------------------------------------------ | 1700| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 1701| activate | boolean | Yes | Whether to enable call waiting.<br>- **false**: Disable call waiting.<br>- **true**: Enable call waiting.| 1702| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | 1703 1704**Error codes** 1705 1706For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1707 1708| ID| Error Message | 1709| -------- | -------------------------------------------- | 1710| 201 | Permission denied. | 1711| 202 | Non-system applications use system APIs. | 1712| 401 | Parameter error. | 1713| 801 | Capability not supported. | 1714| 8300001 | Invalid parameter value. | 1715| 8300002 | Operation failed. Cannot connect to service. | 1716| 8300003 | System internal error. | 1717 1718**Example** 1719 1720```ts 1721import { BusinessError } from '@ohos.base'; 1722 1723call.setCallWaiting(0, true, (err: BusinessError) => { 1724 if (err) { 1725 console.error(`setCallWaiting fail, err->${JSON.stringify(err)}`); 1726 } else { 1727 console.log(`setCallWaiting success.`); 1728 } 1729}); 1730``` 1731 1732 1733## call.setCallWaiting<sup>7+</sup> 1734 1735setCallWaiting\(slotId: number, activate: boolean\): Promise\<void\> 1736 1737Specifies whether to enable the call waiting service. This API uses a promise to return the result. 1738 1739**System API**: This is a system API. 1740 1741**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1742 1743**System capability**: SystemCapability.Telephony.CallManager 1744 1745**Parameters** 1746 1747| Name | Type | Mandatory| Description | 1748| -------- | ------- | ---- | ------------------------------------------------------------ | 1749| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 1750| activate | boolean | Yes | Whether to enable call waiting.<br>- **false**: Disable call waiting.<br>- **true**: Enable call waiting.| 1751 1752**Return value** 1753 1754| Type | Description | 1755| ------------------- | --------------------------- | 1756| Promise<void> | Promise used to return the result.| 1757 1758**Error codes** 1759 1760For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1761 1762| ID| Error Message | 1763| -------- | -------------------------------------------- | 1764| 201 | Permission denied. | 1765| 202 | Non-system applications use system APIs. | 1766| 401 | Parameter error. | 1767| 801 | Capability not supported. | 1768| 8300001 | Invalid parameter value. | 1769| 8300002 | Operation failed. Cannot connect to service. | 1770| 8300003 | System internal error. | 1771 1772**Example** 1773 1774```ts 1775import { BusinessError } from '@ohos.base'; 1776 1777call.setCallWaiting(0, true).then(() => { 1778 console.log(`setCallWaiting success.`); 1779}).catch((err: BusinessError) => { 1780 console.error(`setCallWaiting fail, promise: err->${JSON.stringify(err)}`); 1781}); 1782``` 1783 1784## call.startDTMF<sup>7+</sup> 1785 1786startDTMF\(callId: number, character: string, callback: AsyncCallback\<void\>\): void 1787 1788Starts playing DTMF tones. This API uses an asynchronous callback to return the result. 1789 1790**System API**: This is a system API. 1791 1792**System capability**: SystemCapability.Telephony.CallManager 1793 1794**Parameters** 1795 1796| Name | Type | Mandatory| Description | 1797| --------- | -------------------- | ---- | ---------- | 1798| callId | number | Yes | Call ID. | 1799| character | string | Yes | DTMF string. | 1800| callback | AsyncCallback<void\> | Yes | Callback used to return the result.| 1801 1802**Error codes** 1803 1804For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1805 1806| ID| Error Message | 1807| -------- | -------------------------------------------- | 1808| 202 | Non-system applications use system APIs. | 1809| 401 | Parameter error. | 1810| 801 | Capability not supported. | 1811| 8300001 | Invalid parameter value. | 1812| 8300002 | Operation failed. Cannot connect to service. | 1813| 8300003 | System internal error. | 1814 1815**Example** 1816 1817```ts 1818import { BusinessError } from '@ohos.base'; 1819 1820call.startDTMF(1, "0", (err: BusinessError) => { 1821 if (err) { 1822 console.error(`startDTMF fail, err->${JSON.stringify(err)}`); 1823 } else { 1824 console.log(`startDTMF success.`); 1825 } 1826}); 1827``` 1828 1829 1830## call.startDTMF<sup>7+</sup> 1831 1832startDTMF\(callId: number, character: string\): Promise\<void\> 1833 1834Starts playing DTMF tones. This API uses a promise to return the result. 1835 1836**System API**: This is a system API. 1837 1838**System capability**: SystemCapability.Telephony.CallManager 1839 1840**Parameters** 1841 1842| Name | Type | Mandatory| Description | 1843| --------- | ------ | ---- | -------- | 1844| callId | number | Yes | Call ID.| 1845| character | string | Yes | DTMF string.| 1846 1847**Return value** 1848 1849| Type | Description | 1850| ------------------- | ----------------------- | 1851| Promise<void> | Promise used to return the result.| 1852 1853**Error codes** 1854 1855For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1856 1857| ID| Error Message | 1858| -------- | -------------------------------------------- | 1859| 202 | Non-system applications use system APIs. | 1860| 401 | Parameter error. | 1861| 801 | Capability not supported. | 1862| 8300001 | Invalid parameter value. | 1863| 8300002 | Operation failed. Cannot connect to service. | 1864| 8300003 | System internal error. | 1865 1866**Example** 1867 1868```ts 1869import { BusinessError } from '@ohos.base'; 1870 1871call.startDTMF(1, "0").then(() => { 1872 console.log(`startDTMF success.`); 1873}).catch((err: BusinessError) => { 1874 console.error(`startDTMF fail, promise: err->${JSON.stringify(err)}`); 1875}); 1876``` 1877 1878## call.stopDTMF<sup>7+</sup> 1879 1880stopDTMF\(callId: number, callback: AsyncCallback\<void\>\): void 1881 1882Stops playing DTMF tones. This API uses an asynchronous callback to return the result. 1883 1884**System API**: This is a system API. 1885 1886**System capability**: SystemCapability.Telephony.CallManager 1887 1888**Parameters** 1889 1890| Name | Type | Mandatory| Description | 1891| -------- | ------------------------- | ---- | ---------- | 1892| callId | number | Yes | Call ID. | 1893| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 1894 1895**Error codes** 1896 1897For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1898 1899| ID| Error Message | 1900| -------- | -------------------------------------------- | 1901| 202 | Non-system applications use system APIs. | 1902| 401 | Parameter error. | 1903| 801 | Capability not supported. | 1904| 8300001 | Invalid parameter value. | 1905| 8300002 | Operation failed. Cannot connect to service. | 1906| 8300003 | System internal error. | 1907 1908**Example** 1909 1910```ts 1911import { BusinessError } from '@ohos.base'; 1912 1913call.stopDTMF(1, (err: BusinessError) => { 1914 if (err) { 1915 console.error(`stopDTMF fail, err->${JSON.stringify(err)}`); 1916 } else { 1917 console.log(`stopDTMF success.`); 1918 } 1919}); 1920``` 1921 1922 1923## call.stopDTMF<sup>7+</sup> 1924 1925stopDTMF\(callId: number\): Promise\<void\> 1926 1927Stops playing DTMF tones. This API uses a promise to return the result. 1928 1929**System API**: This is a system API. 1930 1931**System capability**: SystemCapability.Telephony.CallManager 1932 1933**Parameters** 1934 1935| Name| Type | Mandatory| Description | 1936| ------ | ------ | ---- | -------- | 1937| callId | number | Yes | Call ID.| 1938 1939**Return value** 1940 1941| Type | Description | 1942| ------------------- | --------------------------- | 1943| Promise<void> | Promise used to return the result.| 1944 1945**Error codes** 1946 1947For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1948 1949| ID| Error Message | 1950| -------- | -------------------------------------------- | 1951| 202 | Non-system applications use system APIs. | 1952| 401 | Parameter error. | 1953| 801 | Capability not supported. | 1954| 8300001 | Invalid parameter value. | 1955| 8300002 | Operation failed. Cannot connect to service. | 1956| 8300003 | System internal error. | 1957 1958**Example** 1959 1960```ts 1961import { BusinessError } from '@ohos.base'; 1962 1963call.stopDTMF(1).then(() => { 1964 console.log(`stopDTMF success.`); 1965}).catch((err: BusinessError) => { 1966 console.error(`stopDTMF fail, promise: err->${JSON.stringify(err)}`); 1967}); 1968``` 1969 1970## call.postDialProceed<sup>11+</sup> 1971 1972postDialProceed\(callId: number, proceed: boolean, callback: AsyncCallback\<void\>\): void 1973 1974Continues a call by playing a post-dial DTMF string. This API uses an asynchronous callback to return the result. 1975 1976If the called number is in the format of "common phone number + semicolon (;) + DTMF string", for example, **400xxxxxxx;123**, and the listening for **postDialDelay** events is enabled, 1977the system reports a **postDialDelay** event when the call is connected. The application can then call this API to send DTMF tones. 1978 1979**System API**: This is a system API. 1980 1981**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1982 1983**System capability**: SystemCapability.Telephony.CallManager 1984 1985**Parameters** 1986 1987| Name | Type | Mandatory| Description | 1988| -------- | ------------------------- | ---- | -------------------------------------------------------------- | 1989| callId | number | Yes | Call ID. | 1990| proceed | boolean | Yes | Whether to send DTMF tones.| 1991| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 1992 1993**Error codes** 1994 1995For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 1996 1997| ID| Error Message | 1998| -------- | -------------------------------------------- | 1999| 201 | Permission denied. | 2000| 202 | Non-system applications use system APIs. | 2001| 401 | Parameter error. | 2002| 801 | Capability not supported. | 2003| 8300001 | Invalid parameter value. | 2004| 8300002 | Operation failed. Cannot connect to service. | 2005| 8300003 | System internal error. | 2006 2007**Example** 2008 2009```ts 2010import { BusinessError } from '@ohos.base'; 2011 2012call.postDialProceed(1, true, (err: BusinessError) => { 2013 console.log(`callback: err->${JSON.stringify(err)}`); 2014}); 2015``` 2016 2017 2018## call.postDialProceed<sup>11+</sup> 2019 2020postDialProceed\(callId: number, proceed: boolean\): Promise\<void\> 2021 2022Continues a call by playing a post-dial DTMF string. This API uses a promise to return the result. 2023 2024If the called number is in the format of "common phone number + semicolon (;) + DTMF string", for example, **400xxxxxxx;123**, and the listening for **postDialDelay** events is enabled, 2025the system reports a **postDialDelay** event when the call is connected. The application can then call this API to send DTMF tones. 2026 2027**System API**: This is a system API. 2028 2029**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2030 2031**System capability**: SystemCapability.Telephony.CallManager 2032 2033**Parameters** 2034 2035| Name | Type | Mandatory| Description | 2036| -------- | ------------------------- | ---- | ----------------------- | 2037| callId | number | Yes | Call ID. | 2038| proceed | boolean | Yes | Whether to send DTMF tones.| 2039 2040**Return value** 2041 2042| Type | Description | 2043| ------------------- | --------------------------- | 2044| Promise<void> | Promise used to return the result.| 2045 2046**Error codes** 2047 2048For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2049 2050| ID| Error Message | 2051| -------- | -------------------------------------------- | 2052| 201 | Permission denied. | 2053| 202 | Non-system applications use system APIs. | 2054| 401 | Parameter error. | 2055| 801 | Capability not supported. | 2056| 8300001 | Invalid parameter value. | 2057| 8300002 | Operation failed. Cannot connect to service. | 2058| 8300003 | System internal error. | 2059 2060**Example** 2061 2062```ts 2063import { BusinessError } from '@ohos.base'; 2064 2065call.postDialProceed(1, true).then(() => { 2066 console.log(`postDialProceed success.`); 2067}).catch((err: BusinessError) => { 2068 console.error(`postDialProceed fail, promise: err->${JSON.stringify(err)}`); 2069}); 2070``` 2071 2072## call.isInEmergencyCall<sup>7+</sup> 2073 2074isInEmergencyCall\(callback: AsyncCallback\<boolean\>\): void 2075 2076Checks whether a call is an emergency call. This API uses an asynchronous callback to return the result. 2077 2078**System API**: This is a system API. 2079 2080**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2081 2082**System capability**: SystemCapability.Telephony.CallManager 2083 2084**Parameters** 2085 2086| Name | Type | Mandatory| Description | 2087| -------- | ---------------------------- | ---- | ---------- | 2088| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. The value **true** indicates an emergency number, and the value **false** indicates a non-emergency number.| 2089 2090**Error codes** 2091 2092For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2093 2094| ID| Error Message | 2095| -------- | -------------------------------------------- | 2096| 201 | Permission denied. | 2097| 202 | Non-system applications use system APIs. | 2098| 401 | Parameter error. | 2099| 8300001 | Invalid parameter value. | 2100| 8300002 | Operation failed. Cannot connect to service. | 2101| 8300003 | System internal error. | 2102| 8300999 | Unknown error code. | 2103 2104**Example** 2105 2106```ts 2107import { BusinessError } from '@ohos.base'; 2108 2109call.isInEmergencyCall((err: BusinessError, data: boolean) => { 2110 if (err) { 2111 console.error(`isInEmergencyCall fail, err->${JSON.stringify(err)}`); 2112 } else { 2113 console.log(`isInEmergencyCall success, data->${JSON.stringify(data)}`); 2114 } 2115}); 2116``` 2117 2118 2119## call.isInEmergencyCall<sup>7+</sup> 2120 2121isInEmergencyCall\(\): Promise\<boolean\> 2122 2123Checks whether a call is an emergency call. This API uses a promise to return the result. 2124 2125**System API**: This is a system API. 2126 2127**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2128 2129**System capability**: SystemCapability.Telephony.CallManager 2130 2131**Return value** 2132 2133| Type | Description | 2134| ---------------------- | --------------------------- | 2135| Promise<boolean> | Promise used to return the result. The value **true** indicates an emergency number, and the value **false** indicates a non-emergency number.| 2136 2137**Error codes** 2138 2139For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2140 2141| ID| Error Message | 2142| -------- | -------------------------------------------- | 2143| 201 | Permission denied. | 2144| 202 | Non-system applications use system APIs. | 2145| 8300002 | Operation failed. Cannot connect to service. | 2146| 8300003 | System internal error. | 2147| 8300999 | Unknown error code. | 2148 2149**Example** 2150 2151```ts 2152import { BusinessError } from '@ohos.base'; 2153 2154call.isInEmergencyCall().then((data: boolean) => { 2155 console.log(`isInEmergencyCall success, promise: data->${JSON.stringify(data)}`); 2156}).catch((err: BusinessError) => { 2157 console.error(`isInEmergencyCall fail, promise: err->${JSON.stringify(err)}`); 2158}); 2159``` 2160 2161## call.on('callDetailsChange')<sup>7+</sup> 2162 2163on\(type: 'callDetailsChange', callback: Callback\<CallAttributeOptions\>\): void 2164 2165Subscribes to **callDetailsChange** events. This API uses an asynchronous callback to return the result. 2166 2167**System API**: This is a system API. 2168 2169**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2170 2171**System capability**: SystemCapability.Telephony.CallManager 2172 2173**Parameters** 2174 2175| Name | Type | Mandatory| Description | 2176| -------- | ------------------------------------------------------- | ---- | -------------------------- | 2177| type | string | Yes | Call event change. This field has a fixed value of **callDetailsChange**.| 2178| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | Yes | Callback used to return the result. | 2179 2180**Error codes** 2181 2182For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2183 2184| ID| Error Message | 2185| -------- | -------------------------------------------- | 2186| 201 | Permission denied. | 2187| 202 | Non-system applications use system APIs. | 2188| 401 | Parameter error. | 2189| 8300001 | Invalid parameter value. | 2190| 8300002 | Operation failed. Cannot connect to service. | 2191| 8300003 | System internal error. | 2192| 8300999 | Unknown error code. | 2193 2194**Example** 2195 2196```ts 2197call.on('callDetailsChange', (data: call.CallAttributeOptions) => { 2198 console.log(`callback: data->${JSON.stringify(data)}`); 2199}); 2200``` 2201 2202## call.on('callEventChange')<sup>8+</sup> 2203 2204on\(type: 'callEventChange', callback: Callback\<CallEventOptions\>\): void 2205 2206Subscribes to **callEventChange** events. This API uses an asynchronous callback to return the result. 2207 2208**System API**: This is a system API. 2209 2210**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2211 2212**System capability**: SystemCapability.Telephony.CallManager 2213 2214**Parameters** 2215 2216| Name | Type | Mandatory| Description | 2217| -------- | ------------------------------------------------ | ---- | -------------------------- | 2218| type | string | Yes | Call event change. This field has a fixed value of **callEventChange**.| 2219| callback | Callback<[CallEventOptions](#calleventoptions8)> | Yes | Callback used to return the result. | 2220 2221**Error codes** 2222 2223For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2224 2225| ID| Error Message | 2226| -------- | -------------------------------------------- | 2227| 201 | Permission denied. | 2228| 202 | Non-system applications use system APIs. | 2229| 401 | Parameter error. | 2230| 8300001 | Invalid parameter value. | 2231| 8300002 | Operation failed. Cannot connect to service. | 2232| 8300003 | System internal error. | 2233| 8300999 | Unknown error code. | 2234 2235**Example** 2236 2237```ts 2238call.on('callEventChange', (data: call.CallEventOptions) => { 2239 console.log(`callback: data->${JSON.stringify(data)}`); 2240}); 2241``` 2242 2243## call.on('callDisconnectedCause')<sup>8+</sup> 2244 2245on\(type: 'callDisconnectedCause', callback: Callback\<DisconnectedDetails\>\): void 2246 2247Subscribes to **callDisconnectedCause** events. This API uses an asynchronous callback to return the result. 2248 2249**System API**: This is a system API. 2250 2251**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2252 2253**System capability**: SystemCapability.Telephony.CallManager 2254 2255**Parameters** 2256 2257| Name | Type | Mandatory| Description | 2258| -------- | ------------------------------------------------------ | ---- | -------------------------- | 2259| type | string | Yes | Call disconnection cause. This field has a fixed value of **callDisconnectedCause**.| 2260| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | Yes | Callback used to return the result. | 2261 2262**Error codes** 2263 2264For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2265 2266| ID| Error Message | 2267| -------- | -------------------------------------------- | 2268| 201 | Permission denied. | 2269| 202 | Non-system applications use system APIs. | 2270| 401 | Parameter error. | 2271| 8300001 | Invalid parameter value. | 2272| 8300002 | Operation failed. Cannot connect to service. | 2273| 8300003 | System internal error. | 2274| 8300999 | Unknown error code. | 2275 2276**Example** 2277 2278```ts 2279call.on('callDisconnectedCause', (data: call.DisconnectedDetails) => { 2280 console.log(`callback: data->${JSON.stringify(data)}`); 2281}); 2282``` 2283 2284## call.on('mmiCodeResult')<sup>9+</sup> 2285 2286on\(type: 'mmiCodeResult', callback: Callback\<MmiCodeResults\>\): void 2287 2288Subscribes to **mmiCodeResult** events. This API uses an asynchronous callback to return the result. 2289 2290**System API**: This is a system API. 2291 2292**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2293 2294**System capability**: SystemCapability.Telephony.CallManager 2295 2296**Parameters** 2297 2298| Name | Type | Mandatory| Description | 2299| -------- | -------------------------------------------- | ---- | --------------------- | 2300| type | string | Yes | MMI code result. This field has a fixed value of **mmiCodeResult**.| 2301| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | Yes | Callback used to return the result.| 2302 2303**Error codes** 2304 2305For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2306 2307| ID| Error Message | 2308| -------- | -------------------------------------------- | 2309| 201 | Permission denied. | 2310| 202 | Non-system applications use system APIs. | 2311| 401 | Parameter error. | 2312| 8300001 | Invalid parameter value. | 2313| 8300002 | Operation failed. Cannot connect to service. | 2314| 8300003 | System internal error. | 2315| 8300999 | Unknown error code. | 2316 2317**Example** 2318 2319```ts 2320call.on('mmiCodeResult', (data: call.MmiCodeResults) => { 2321 console.log(`callback: data->${JSON.stringify(data)}`); 2322}); 2323``` 2324 2325## call.off('callDetailsChange')<sup>7+</sup> 2326 2327off\(type: 'callDetailsChange', callback?: Callback\<CallAttributeOptions\>\): void 2328 2329Unsubscribes from **callDetailsChange** events. This API uses an asynchronous callback to return the result. 2330 2331**System API**: This is a system API. 2332 2333**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2334 2335**System capability**: SystemCapability.Telephony.CallManager 2336 2337**Parameters** 2338 2339| Name | Type | Mandatory| Description | 2340| -------- | -------------------------------------------------------- | ---- | ---------------------------------- | 2341| type | string | Yes | Call details change. This field has a fixed value of **callDetailsChange**.| 2342| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | No | Callback used to return the result. If this field is not set, no subscription cancellation result will be received.| 2343 2344**Error codes** 2345 2346For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2347 2348| ID| Error Message | 2349| -------- | -------------------------------------------- | 2350| 201 | Permission denied. | 2351| 202 | Non-system applications use system APIs. | 2352| 401 | Parameter error. | 2353| 8300001 | Invalid parameter value. | 2354| 8300002 | Operation failed. Cannot connect to service. | 2355| 8300003 | System internal error. | 2356| 8300999 | Unknown error code. | 2357 2358**Example** 2359 2360```ts 2361call.off('callDetailsChange', (data: call.CallAttributeOptions) => { 2362 console.log(`callback: data->${JSON.stringify(data)}`); 2363}); 2364``` 2365 2366## call.off('callEventChange')<sup>8+</sup> 2367 2368off\(type: 'callEventChange', callback?: Callback\<CallEventOptions\>\): void 2369 2370Unsubscribes from **callEventChange** events. This API uses an asynchronous callback to return the result. 2371 2372**System API**: This is a system API. 2373 2374**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2375 2376**System capability**: SystemCapability.Telephony.CallManager 2377 2378**Parameters** 2379 2380| Name | Type | Mandatory| Description | 2381| -------- | ------------------------------------------------ | ---- | ---------------------------------- | 2382| type | string | Yes | Call event change. This field has a fixed value of **callEventChange**.| 2383| callback | Callback<[CallEventOptions](#calleventoptions8)> | No | Callback used to return the result. If this field is not set, no subscription cancellation result will be received.| 2384 2385**Error codes** 2386 2387For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2388 2389| ID| Error Message | 2390| -------- | -------------------------------------------- | 2391| 201 | Permission denied. | 2392| 202 | Non-system applications use system APIs. | 2393| 401 | Parameter error. | 2394| 8300001 | Invalid parameter value. | 2395| 8300002 | Operation failed. Cannot connect to service. | 2396| 8300003 | System internal error. | 2397| 8300999 | Unknown error code. | 2398 2399**Example** 2400 2401```ts 2402call.off('callEventChange', (data: call.CallEventOptions) => { 2403 console.log(`callback: data->${JSON.stringify(data)}`); 2404}); 2405``` 2406 2407## call.off('callDisconnectedCause')<sup>8+</sup> 2408 2409off\(type: 'callDisconnectedCause', callback?: Callback\<DisconnectedDetails\>\): void 2410 2411Unsubscribes from **callDisconnectedCause** events. This API uses an asynchronous callback to return the result. 2412 2413**System API**: This is a system API. 2414 2415**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2416 2417**System capability**: SystemCapability.Telephony.CallManager 2418 2419**Parameters** 2420 2421| Name | Type | Mandatory| Description | 2422| -------- | ---------------------------------------------------------- | ---- | ------------------- | 2423| type | string | Yes | Call disconnection cause. This field has a fixed value of **callDisconnectedCause**.| 2424| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | No | Callback used to return the result. If this field is not set, no subscription cancellation result will be received.| 2425 2426**Error codes** 2427 2428For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2429 2430| ID| Error Message | 2431| -------- | -------------------------------------------- | 2432| 201 | Permission denied. | 2433| 202 | Non-system applications use system APIs. | 2434| 401 | Parameter error. | 2435| 8300001 | Invalid parameter value. | 2436| 8300002 | Operation failed. Cannot connect to service. | 2437| 8300003 | System internal error. | 2438| 8300999 | Unknown error code. | 2439 2440**Example** 2441 2442```ts 2443call.off('callDisconnectedCause', (data: call.DisconnectedDetails) => { 2444 console.log(`callback: data->${JSON.stringify(data)}`); 2445}); 2446``` 2447 2448## call.off('mmiCodeResult')<sup>9+</sup> 2449 2450off\(type: 'mmiCodeResult', callback?: Callback\<MmiCodeResults\>\): void 2451 2452Unsubscribes from **mmiCodeResult** events. This API uses an asynchronous callback to return the result. 2453 2454**System API**: This is a system API. 2455 2456**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2457 2458**System capability**: SystemCapability.Telephony.CallManager 2459 2460**Parameters** 2461 2462| Name | Type | Mandatory| Description | 2463| -------- | ------------------------------------------------ | ---- | ----------- | 2464| type | string | Yes | MMI code result. This field has a fixed value of **mmiCodeResult**.| 2465| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | No | Callback used to return the result. If this field is not set, no subscription cancellation result will be received.| 2466 2467**Error codes** 2468 2469For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2470 2471| ID| Error Message | 2472| -------- | -------------------------------------------- | 2473| 201 | Permission denied. | 2474| 202 | Non-system applications use system APIs. | 2475| 401 | Parameter error. | 2476| 8300001 | Invalid parameter value. | 2477| 8300002 | Operation failed. Cannot connect to service. | 2478| 8300003 | System internal error. | 2479| 8300999 | Unknown error code. | 2480 2481**Example** 2482 2483```ts 2484call.off('mmiCodeResult', (data: call.MmiCodeResults) => { 2485 console.log(`callback: data->${JSON.stringify(data)}`); 2486}); 2487``` 2488 2489 2490## call.on('audioDeviceChange')<sup>10+</sup> 2491 2492on\(type: 'audioDeviceChange', callback: Callback\<AudioDeviceCallbackInfo\>\): void 2493 2494Subscribes to audio device change events. This API uses an asynchronous callback to return the result. 2495 2496**System API**: This is a system API. 2497 2498**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2499 2500**System capability**: SystemCapability.Telephony.CallManager 2501 2502**Parameters** 2503 2504| Name | Type | Mandatory| Description | 2505| -------- | ----------------------------------------------- | ---- | --------------------------------------------------- | 2506| type | string | Yes | Audio device change. This field has a fixed value of **audioDeviceChange**.| 2507| callback | Callback<[AudioDeviceCallbackInfo](#audiodevicecallbackinfo10)> | Yes | Callback used to return the result. | 2508 2509**Error codes** 2510 2511For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2512 2513| ID| Error Message | 2514| -------- | -------------------------------------------- | 2515| 201 | Permission denied. | 2516| 202 | Non-system applications use system APIs. | 2517| 401 | Parameter error. | 2518| 8300001 | Invalid parameter value. | 2519| 8300002 | Operation failed. Cannot connect to service. | 2520| 8300003 | System internal error. | 2521| 8300999 | Unknown error code. | 2522 2523**Example** 2524 2525```ts 2526call.on('audioDeviceChange', (data: call.AudioDeviceCallbackInfo) => { 2527 console.log(`callback: data->${JSON.stringify(data)}`); 2528}); 2529``` 2530 2531 2532## call.off('audioDeviceChange')<sup>10+</sup> 2533 2534off\(type: 'audioDeviceChange', callback?: Callback\<AudioDeviceCallbackInfo\>\): void 2535 2536Unsubscribes from **audioDeviceChange** events. This API uses an asynchronous callback to return the result. 2537 2538**System API**: This is a system API. 2539 2540**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2541 2542**System capability**: SystemCapability.Telephony.CallManager 2543 2544**Parameters** 2545 2546| Name | Type | Mandatory | Description | 2547| -------- | ---------------------------------------------------------- | ---- | --------------------------------------------------- | 2548| type | string | Yes | Audio device change. This field has a fixed value of **audioDeviceChange**.| 2549| callback | Callback<[AudioDeviceCallbackInfo](#audiodevicecallbackinfo10)> | No | Callback used to return the result. If this field is not set, no subscription cancellation result will be received. | 2550 2551**Error codes** 2552 2553For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2554 2555| ID| Error Message | 2556| -------- | -------------------------------------------- | 2557| 201 | Permission denied. | 2558| 202 | Non-system applications use system APIs. | 2559| 401 | Parameter error. | 2560| 8300001 | Invalid parameter value. | 2561| 8300002 | Operation failed. Cannot connect to service. | 2562| 8300003 | System internal error. | 2563| 8300999 | Unknown error code. | 2564 2565**Example** 2566 2567```ts 2568call.off('audioDeviceChange', (data: call.AudioDeviceCallbackInfo) => { 2569 console.log(`callback: data->${JSON.stringify(data)}`); 2570}); 2571``` 2572 2573## call.on('postDialDelay')<sup>11+</sup> 2574 2575on\(type: 'postDialDelay', callback: Callback\<string\>\): void 2576 2577Subscribes to **postDialDelay** events. This API uses an asynchronous callback to return the result. 2578 2579**System API**: This is a system API. 2580 2581**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2582 2583**System capability**: SystemCapability.Telephony.CallManager 2584 2585**Parameters** 2586 2587| Name | Type | Mandatory| Description | 2588| -------- | ----------------------------------------------- | ---- | --------------------------------------------------- | 2589| type | string | Yes | Post-dial delay. This field has a fixed value of **postDialDelay**. | 2590| callback | Callback<string> | Yes |Callback used to return the result. | 2591 2592**Error codes** 2593 2594For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2595 2596| ID| Error Message | 2597| -------- | -------------------------------------------- | 2598| 201 | Permission denied. | 2599| 202 | Non-system applications use system APIs. | 2600| 401 | Parameter error. | 2601| 8300001 | Invalid parameter value. | 2602| 8300002 | Operation failed. Cannot connect to service. | 2603| 8300003 | System internal error. | 2604| 8300999 | Unknown error code. | 2605 2606**Example** 2607 2608```ts 2609call.on('postDialDelay', (data: string) => { 2610 console.log(`callback: data->${JSON.stringify(data)}`); 2611}); 2612``` 2613 2614## call.off('postDialDelay')<sup>11+</sup> 2615 2616off\(type: 'postDialDelay', callback?: Callback\<string\>\): void 2617 2618Unsubscribes from **postDialDelay** events. This API uses an asynchronous callback to return the result. 2619 2620**System API**: This is a system API. 2621 2622**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2623 2624**System capability**: SystemCapability.Telephony.CallManager 2625 2626**Parameters** 2627 2628| Name | Type | Mandatory | Description | 2629| -------- | ---------------------------------------------------------- | ---- | --------------------------------------------------- | 2630| type | string | Yes | Post-dial delay. This field has a fixed value of **postDialDelay**. | 2631| callback | Callback<string> | No | Callback used to return the result. If this field is not set, no subscription cancellation result will be received. | 2632 2633**Error codes** 2634 2635For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2636 2637| ID| Error Message | 2638| -------- | -------------------------------------------- | 2639| 201 | Permission denied. | 2640| 202 | Non-system applications use system APIs. | 2641| 401 | Parameter error. | 2642| 8300001 | Invalid parameter value. | 2643| 8300002 | Operation failed. Cannot connect to service. | 2644| 8300003 | System internal error. | 2645| 8300999 | Unknown error code. | 2646 2647**Example** 2648 2649```ts 2650call.off('postDialDelay', (data: string) => { 2651 console.log(`callback: data->${JSON.stringify(data)}`); 2652}); 2653``` 2654 2655## call.isNewCallAllowed<sup>8+</sup> 2656 2657isNewCallAllowed\(callback: AsyncCallback\<boolean\>\): void 2658 2659Checks whether a new call is allowed. This API uses an asynchronous callback to return the result. 2660 2661**System API**: This is a system API. 2662 2663**System capability**: SystemCapability.Telephony.CallManager 2664 2665**Parameters** 2666 2667| Name | Type | Mandatory| Description | 2668| -------- | ---------------------------- | ---- | ---------- | 2669| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. The value **true** indicates that the call is allowed, and the value **false** indicates the opposite.| 2670 2671**Error codes** 2672 2673For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2674 2675| ID| Error Message | 2676| -------- | -------------------------------------------- | 2677| 202 | Non-system applications use system APIs. | 2678| 401 | Parameter error. | 2679| 8300001 | Invalid parameter value. | 2680| 8300002 | Operation failed. Cannot connect to service. | 2681| 8300003 | System internal error. | 2682| 8300999 | Unknown error code. | 2683 2684**Example** 2685 2686```ts 2687import { BusinessError } from '@ohos.base'; 2688 2689call.isNewCallAllowed((err: BusinessError, data: boolean) => { 2690 if (err) { 2691 console.error(`isNewCallAllowed fail, err->${JSON.stringify(err)}`); 2692 } else { 2693 console.log(`isNewCallAllowed success, data->${JSON.stringify(data)}`); 2694 } 2695}); 2696``` 2697 2698 2699## call.isNewCallAllowed<sup>8+</sup> 2700 2701isNewCallAllowed\(\): Promise\<boolean\> 2702 2703Checks whether a new call is allowed. This API uses a promise to return the result. 2704 2705**System API**: This is a system API. 2706 2707**System capability**: SystemCapability.Telephony.CallManager 2708 2709**Return value** 2710 2711| Type | Description | 2712| ---------------------- | --------------------------- | 2713| Promise<boolean> | Promise used to return the result. The value **true** indicates that the call is allowed, and the value **false** indicates the opposite.| 2714 2715**Error codes** 2716 2717For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2718 2719| ID| Error Message | 2720| -------- | -------------------------------------------- | 2721| 202 | Non-system applications use system APIs. | 2722| 8300002 | Operation failed. Cannot connect to service. | 2723| 8300003 | System internal error. | 2724| 8300999 | Unknown error code. | 2725 2726**Example** 2727 2728```ts 2729import { BusinessError } from '@ohos.base'; 2730 2731call.isNewCallAllowed().then((data: boolean) => { 2732 console.log(`isNewCallAllowed success, promise: data->${JSON.stringify(data)}`); 2733}).catch((err: BusinessError) => { 2734 console.error(`isNewCallAllowed fail, promise: err->${JSON.stringify(err)}`); 2735}); 2736``` 2737 2738## call.separateConference<sup>11+</sup> 2739 2740separateConference\(callId: number, callback: AsyncCallback\<void\>\): void 2741 2742Separates calls from a conference call. This API uses an asynchronous callback to return the result. 2743 2744**System API**: This is a system API. 2745 2746**System capability**: SystemCapability.Telephony.CallManager 2747 2748**Parameters** 2749 2750| Name | Type | Mandatory| Description | 2751| -------- | ------------------------- | ---- | ---------- | 2752| callId | number | Yes | Call ID. | 2753| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 2754 2755**Error codes** 2756 2757For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2758 2759| ID| Error Message | 2760| -------- | -------------------------------------------- | 2761| 202 | Non-system applications use system APIs. | 2762| 401 | Parameter error. | 2763| 8300001 | Invalid parameter value. | 2764| 8300002 | Operation failed. Cannot connect to service. | 2765| 8300003 | System internal error. | 2766| 8300008 | Conference call is not active. | 2767| 8300999 | Unknown error code. | 2768 2769**Example** 2770 2771```ts 2772import { BusinessError } from '@ohos.base'; 2773 2774call.separateConference(1, (err: BusinessError) => { 2775 if (err) { 2776 console.error(`separateConference fail, err->${JSON.stringify(err)}`); 2777 } else { 2778 console.log(`separateConference success.`); 2779 } 2780}); 2781``` 2782 2783 2784## call.separateConference<sup>11+</sup> 2785 2786separateConference\(callId: number\): Promise\<void\> 2787 2788Separates calls from a conference call. This API uses a promise to return the result. 2789 2790**System API**: This is a system API. 2791 2792**System capability**: SystemCapability.Telephony.CallManager 2793 2794**Parameters** 2795 2796| Name| Type | Mandatory| Description | 2797| ------ | ------ | ---- | -------- | 2798| callId | number | Yes | Call ID.| 2799 2800**Return value** 2801 2802| Type | Description | 2803| ------------------- | --------------------------- | 2804| Promise<void> | Promise used to return the result.| 2805 2806**Error codes** 2807 2808For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2809 2810| ID| Error Message | 2811| -------- | -------------------------------------------- | 2812| 202 | Non-system applications use system APIs. | 2813| 401 | Parameter error. | 2814| 8300001 | Invalid parameter value. | 2815| 8300002 | Operation failed. Cannot connect to service. | 2816| 8300003 | System internal error. | 2817| 8300008 | Conference call is not active. | 2818| 8300999 | Unknown error code. | 2819 2820**Example** 2821 2822```ts 2823import { BusinessError } from '@ohos.base'; 2824 2825call.separateConference(1).then(() => { 2826 console.log(`separateConference success.`); 2827}).catch((err: BusinessError) => { 2828 console.error(`separateConference fail, promise: err->${JSON.stringify(err)}`); 2829}); 2830``` 2831 2832## call.getCallRestrictionStatus<sup>8+</sup> 2833 2834getCallRestrictionStatus\(slotId: number, type: CallRestrictionType, callback: AsyncCallback\<RestrictionStatus\>\): void 2835 2836Obtains the call restriction status. This API uses an asynchronous callback to return the result. 2837 2838**System API**: This is a system API. 2839 2840**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2841 2842**System capability**: SystemCapability.Telephony.CallManager 2843 2844**Parameters** 2845 2846| Name | Type | Mandatory| Description | 2847| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 2848| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2849| type | [CallRestrictionType](#callrestrictiontype8) | Yes | Call restriction type. | 2850| callback | AsyncCallback<[RestrictionStatus](#restrictionstatus8)> | Yes | Callback used to return the result. | 2851 2852**Error codes** 2853 2854For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2855 2856| ID| Error Message | 2857| -------- | -------------------------------------------- | 2858| 201 | Permission denied. | 2859| 202 | Non-system applications use system APIs. | 2860| 401 | Parameter error. | 2861| 801 | Capability not supported. | 2862| 8300001 | Invalid parameter value. | 2863| 8300002 | Operation failed. Cannot connect to service. | 2864| 8300003 | System internal error. | 2865 2866**Example** 2867 2868```ts 2869import { BusinessError } from '@ohos.base'; 2870 2871call.getCallRestrictionStatus(0, 1, (err: BusinessError, data: call.RestrictionStatus) => { 2872 if (err) { 2873 console.error(`getCallRestrictionStatus fail, err->${JSON.stringify(err)}`); 2874 } else { 2875 console.log(`getCallRestrictionStatus success, data->${JSON.stringify(data)}`); 2876 } 2877}); 2878``` 2879 2880 2881## call.getCallRestrictionStatus<sup>8+</sup> 2882 2883getCallRestrictionStatus\(slotId: number, type: CallRestrictionType\): Promise\<RestrictionStatus\> 2884 2885Obtains the call restriction status. This API uses a promise to return the result. 2886 2887**System API**: This is a system API. 2888 2889**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2890 2891**System capability**: SystemCapability.Telephony.CallManager 2892 2893**Parameters** 2894 2895| Name| Type | Mandatory| Description | 2896| ------ | -------------------------------------------- | ---- | -------------------------------------- | 2897| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2898| type | [CallRestrictionType](#callrestrictiontype8) | Yes | Call restriction type. | 2899 2900**Return value** 2901 2902| Type | Description | 2903| ------------------------------------------------------- | --------------------------- | 2904| Promise<[RestrictionStatus](#restrictionstatus8)> | Promise used to return the result.| 2905 2906**Error codes** 2907 2908For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2909 2910| ID| Error Message | 2911| -------- | -------------------------------------------- | 2912| 201 | Permission denied. | 2913| 202 | Non-system applications use system APIs. | 2914| 401 | Parameter error. | 2915| 801 | Capability not supported. | 2916| 8300001 | Invalid parameter value. | 2917| 8300002 | Operation failed. Cannot connect to service. | 2918| 8300003 | System internal error. | 2919 2920**Example** 2921 2922```ts 2923import { BusinessError } from '@ohos.base'; 2924 2925call.getCallRestrictionStatus(0, 1).then((data: call.RestrictionStatus) => { 2926 console.log(`getCallRestrictionStatus success, promise: data->${JSON.stringify(data)}`); 2927}).catch((err: BusinessError) => { 2928 console.error(`getCallRestrictionStatus fail, promise: err->${JSON.stringify(err)}`); 2929}); 2930``` 2931 2932## call.setCallRestriction<sup>8+</sup> 2933 2934setCallRestriction\(slotId: number, info: CallRestrictionInfo, callback: AsyncCallback\<void\>\): void 2935 2936Sets the call restriction status. This API uses an asynchronous callback to return the result. 2937 2938**System API**: This is a system API. 2939 2940**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2941 2942**System capability**: SystemCapability.Telephony.CallManager 2943 2944**Parameters** 2945 2946| Name | Type | Mandatory| Description | 2947| -------- | ------------------------------------------- | ---- | -------------------------------------- | 2948| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2949| info | [CallRestrictionInfo](#callrestrictioninfo8) | Yes | Call restriction information. | 2950| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 2951 2952**Error codes** 2953 2954For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 2955 2956| ID| Error Message | 2957| -------- | -------------------------------------------- | 2958| 201 | Permission denied. | 2959| 202 | Non-system applications use system APIs. | 2960| 401 | Parameter error. | 2961| 801 | Capability not supported. | 2962| 8300001 | Invalid parameter value. | 2963| 8300002 | Operation failed. Cannot connect to service. | 2964| 8300003 | System internal error. | 2965 2966**Example** 2967 2968```ts 2969import { BusinessError } from '@ohos.base'; 2970 2971let callRestrictionInfo: call.CallRestrictionInfo = { 2972 type: call.CallRestrictionType.RESTRICTION_TYPE_ALL_OUTGOING, 2973 password: "123456", 2974 mode: call.CallRestrictionMode.RESTRICTION_MODE_ACTIVATION 2975} 2976call.setCallRestriction(0, callRestrictionInfo, (err: BusinessError) => { 2977 if (err) { 2978 console.error(`setCallRestriction fail, err->${JSON.stringify(err)}`); 2979 } else { 2980 console.log(`setCallRestriction success.`); 2981 } 2982}); 2983``` 2984 2985 2986## call.setCallRestriction<sup>8+</sup> 2987 2988setCallRestriction\(slotId: number, info: CallRestrictionInfo\): Promise\<void\> 2989 2990Sets the call restriction status. This API uses a promise to return the result. 2991 2992**System API**: This is a system API. 2993 2994**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2995 2996**System capability**: SystemCapability.Telephony.CallManager 2997 2998**Parameters** 2999 3000| Name| Type | Mandatory| Description | 3001| ------ | -------------------------------------------- | ---- | -------------------------------------- | 3002| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3003| info | [CallRestrictionInfo](#callrestrictioninfo8) | Yes | Call restriction information. | 3004 3005**Return value** 3006 3007| Type | Description | 3008| ------------------- | --------------------------- | 3009| Promise<void> | Promise used to return the result.| 3010 3011**Error codes** 3012 3013For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3014 3015| ID| Error Message | 3016| -------- | -------------------------------------------- | 3017| 201 | Permission denied. | 3018| 202 | Non-system applications use system APIs. | 3019| 401 | Parameter error. | 3020| 801 | Capability not supported. | 3021| 8300001 | Invalid parameter value. | 3022| 8300002 | Operation failed. Cannot connect to service. | 3023| 8300003 | System internal error. | 3024 3025**Example** 3026 3027```ts 3028import { BusinessError } from '@ohos.base'; 3029 3030let callRestrictionInfo: call.CallRestrictionInfo = { 3031 type: call.CallRestrictionType.RESTRICTION_TYPE_ALL_INCOMING, 3032 password: "123456", 3033 mode: call.CallRestrictionMode.RESTRICTION_MODE_ACTIVATION 3034} 3035call.setCallRestriction(0, callRestrictionInfo).then(() => { 3036 console.log(`setCallRestriction success.`); 3037}).catch((err: BusinessError) => { 3038 console.error(`setCallRestriction fail, promise: err->${JSON.stringify(err)}`); 3039}); 3040``` 3041 3042## call.setCallRestrictionPassword<sup>10+</sup> 3043 3044setCallRestrictionPassword\(slotId: number, oldPassword: string, newPassword: string, callback: AsyncCallback\<void\>\): void 3045 3046Changes the call barring password. This API uses an asynchronous callback to return the result. 3047 3048**System API**: This is a system API. 3049 3050**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3051 3052**System capability**: SystemCapability.Telephony.CallManager 3053 3054**Parameters** 3055 3056| Name | Type | Mandatory| Description | 3057| --------------- | ------------------------------------------- | ---- | ------------------------------------ | 3058| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3059| oldPassword | string | Yes | Old password for call barring. | 3060| newPassword | string | Yes | New password for call barring. | 3061| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 3062 3063**Error codes** 3064 3065For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3066 3067| ID| Error Message | 3068| -------- | -------------------------------------------- | 3069| 201 | Permission denied. | 3070| 202 | Non-system applications use system APIs. | 3071| 401 | Parameter error. | 3072| 801 | Capability not supported. | 3073| 8300001 | Invalid parameter value. | 3074| 8300002 | Operation failed. Cannot connect to service. | 3075| 8300003 | System internal error. | 3076 3077**Example** 3078 3079```ts 3080import { BusinessError } from '@ohos.base'; 3081 3082call.setCallRestrictionPassword(0, "123456", "654321", (err: BusinessError) => { 3083 if (err) { 3084 console.error(`setCallRestrictionPassword fail, err->${JSON.stringify(err)}`); 3085 } else { 3086 console.log(`setCallRestrictionPassword success.`); 3087 } 3088}); 3089``` 3090 3091## call.setCallRestrictionPassword<sup>10+</sup> 3092 3093setCallRestrictionPassword\(slotId: number, oldPassword: string, newPassword: string\): Promise\<void\> 3094 3095Changes the call barring password. This API uses a promise to return the result. 3096 3097**System API**: This is a system API. 3098 3099**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3100 3101**System capability**: SystemCapability.Telephony.CallManager 3102 3103**Parameters** 3104 3105| Name | Type | Mandatory| Description | 3106| --------------- | ------------------------------------------- | ---- | ------------------------------------ | 3107| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3108| oldPassword | string | Yes | Old password for call barring. | 3109| newPassword | string | Yes | New password for call barring. | 3110 3111**Return value** 3112 3113| Type | Description | 3114| ------------------- | --------------------------- | 3115| Promise<void> | Promise used to return the result.| 3116 3117**Error codes** 3118 3119For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3120 3121| ID| Error Message | 3122| -------- | -------------------------------------------- | 3123| 201 | Permission denied. | 3124| 202 | Non-system applications use system APIs. | 3125| 401 | Parameter error. | 3126| 801 | Capability not supported. | 3127| 8300001 | Invalid parameter value. | 3128| 8300002 | Operation failed. Cannot connect to service. | 3129| 8300003 | System internal error. | 3130 3131**Example** 3132 3133```ts 3134import { BusinessError } from '@ohos.base'; 3135 3136call.setCallRestrictionPassword(0, "123456", "654321").then(() => { 3137 console.log(`setCallRestrictionPassword success.`); 3138}).catch((err: BusinessError) => { 3139 console.error(`setCallRestrictionPassword fail, promise: err->${JSON.stringify(err)}`); 3140}); 3141``` 3142 3143## call.getCallTransferInfo<sup>8+</sup> 3144 3145getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCallback\<CallTransferResult\>\): void 3146 3147Obtains call transfer information. This API uses an asynchronous callback to return the result. 3148 3149**System API**: This is a system API. 3150 3151**Required permission**: ohos.permission.GET_TELEPHONY_STATE 3152 3153**System capability**: SystemCapability.Telephony.CallManager 3154 3155**Parameters** 3156 3157| Name | Type | Mandatory| Description | 3158| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 3159| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3160| type | [CallTransferType](#calltransfertype8) | Yes | Call transfer type. | 3161| callback | AsyncCallback<[CallTransferResult](#calltransferresult8)> | Yes | Callback used to return the result. | 3162 3163**Error codes** 3164 3165For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3166 3167| ID| Error Message | 3168| -------- | -------------------------------------------- | 3169| 201 | Permission denied. | 3170| 202 | Non-system applications use system APIs. | 3171| 401 | Parameter error. | 3172| 801 | Capability not supported. | 3173| 8300001 | Invalid parameter value. | 3174| 8300002 | Operation failed. Cannot connect to service. | 3175| 8300003 | System internal error. | 3176 3177**Example** 3178 3179```ts 3180import { BusinessError } from '@ohos.base'; 3181 3182call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY, (err: BusinessError, data: call.CallTransferResult) => { 3183 if (err) { 3184 console.error(`getCallTransferInfo fail, err->${JSON.stringify(err)}`); 3185 } else { 3186 console.log(`getCallTransferInfo success, data->${JSON.stringify(data)}`); 3187 } 3188}); 3189``` 3190 3191 3192## call.getCallTransferInfo<sup>8+</sup> 3193 3194getCallTransferInfo\(slotId: number, type: CallTransferType\): Promise\<CallTransferResult\> 3195 3196Obtains call transfer information. This API uses a promise to return the result. 3197 3198**System API**: This is a system API. 3199 3200**Required permission**: ohos.permission.GET_TELEPHONY_STATE 3201 3202**System capability**: SystemCapability.Telephony.CallManager 3203 3204**Parameters** 3205 3206| Name| Type | Mandatory| Description | 3207| ------ | -------------------------------------- | ---- | -------------------------------------- | 3208| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3209| type | [CallTransferType](#calltransfertype8) | Yes | Call transfer type. | 3210 3211**Return value** 3212 3213| Type | Description | 3214| --------------------------------------------------------- | --------------------------- | 3215| Promise<[CallTransferResult](#calltransferresult8)> | Promise used to return the result.| 3216 3217**Error codes** 3218 3219For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3220 3221| ID| Error Message | 3222| -------- | -------------------------------------------- | 3223| 201 | Permission denied. | 3224| 202 | Non-system applications use system APIs. | 3225| 401 | Parameter error. | 3226| 801 | Capability not supported. | 3227| 8300001 | Invalid parameter value. | 3228| 8300002 | Operation failed. Cannot connect to service. | 3229| 8300003 | System internal error. | 3230 3231**Example** 3232 3233```ts 3234import { BusinessError } from '@ohos.base'; 3235 3236call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY).then((data: call.CallTransferResult) => { 3237 console.log(`getCallTransferInfo success, promise: data->${JSON.stringify(data)}`); 3238}).catch((err: BusinessError) => { 3239 console.error(`getCallTransferInfo fail, promise: err->${JSON.stringify(err)}`); 3240}); 3241``` 3242 3243## call.setCallTransfer<sup>8+</sup> 3244 3245setCallTransfer\(slotId: number, info: CallTransferInfo, callback: AsyncCallback\<void\>\): void 3246 3247Sets call transfer information. This API uses an asynchronous callback to return the result. 3248 3249**System API**: This is a system API. 3250 3251**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3252 3253**System capability**: SystemCapability.Telephony.CallManager 3254 3255**Parameters** 3256 3257| Name | Type | Mandatory| Description | 3258| -------- | ------------------------------------- | ---- | -------------------------------------- | 3259| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3260| info | [CallTransferInfo](#calltransferinfo8) | Yes | Call transfer information. | 3261| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 3262 3263**Error codes** 3264 3265For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3266 3267| ID| Error Message | 3268| -------- | -------------------------------------------- | 3269| 201 | Permission denied. | 3270| 202 | Non-system applications use system APIs. | 3271| 401 | Parameter error. | 3272| 801 | Capability not supported. | 3273| 8300001 | Invalid parameter value. | 3274| 8300002 | Operation failed. Cannot connect to service. | 3275| 8300003 | System internal error. | 3276 3277**Example** 3278 3279```ts 3280import { BusinessError } from '@ohos.base'; 3281 3282let callTransferInfo: call.CallTransferInfo = { 3283 transferNum: "111", 3284 type: call.CallTransferType.TRANSFER_TYPE_BUSY, 3285 settingType: call.CallTransferSettingType.CALL_TRANSFER_ENABLE 3286} 3287call.setCallTransfer(0, callTransferInfo, (err: BusinessError) => { 3288 if (err) { 3289 console.error(`setCallTransfer fail, err->${JSON.stringify(err)}`); 3290 } else { 3291 console.log(`setCallTransfer success.`); 3292 } 3293}); 3294``` 3295 3296 3297## call.setCallTransfer<sup>8+</sup> 3298 3299setCallTransfer\(slotId: number, info: CallTransferInfo\): Promise\<void\> 3300 3301Sets call transfer information. This API uses a promise to return the result. 3302 3303**System API**: This is a system API. 3304 3305**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3306 3307**System capability**: SystemCapability.Telephony.CallManager 3308 3309**Parameters** 3310 3311| Name| Type | Mandatory| Description | 3312| ------ | ------------------------------------- | ---- | -------------------------------------- | 3313| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3314| info | [CallTransferInfo](#calltransferinfo8) | Yes | Call transfer information. | 3315 3316**Return value** 3317 3318| Type | Description | 3319| ------------------- | --------------------------- | 3320| Promise<void> | Promise used to return the result.| 3321 3322**Error codes** 3323 3324For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3325 3326| ID| Error Message | 3327| -------- | -------------------------------------------- | 3328| 201 | Permission denied. | 3329| 202 | Non-system applications use system APIs. | 3330| 401 | Parameter error. | 3331| 801 | Capability not supported. | 3332| 8300001 | Invalid parameter value. | 3333| 8300002 | Operation failed. Cannot connect to service. | 3334| 8300003 | System internal error. | 3335 3336**Example** 3337 3338```ts 3339import { BusinessError } from '@ohos.base'; 3340 3341let callTransferInfo: call.CallTransferInfo = { 3342 transferNum: "111", 3343 type: call.CallTransferType.TRANSFER_TYPE_BUSY, 3344 settingType: call.CallTransferSettingType.CALL_TRANSFER_ENABLE 3345} 3346call.setCallTransfer(0, callTransferInfo).then(() => { 3347 console.log(`setCallTransfer success.`); 3348}).catch((err: BusinessError) => { 3349 console.error(`setCallTransfer fail, promise: err->${JSON.stringify(err)}`); 3350}); 3351``` 3352 3353## call.isRinging<sup>8+</sup> 3354 3355isRinging\(callback: AsyncCallback\<boolean\>\): void 3356 3357Checks whether the ringtone is playing. This API uses an asynchronous callback to return the result. 3358 3359**System API**: This is a system API. 3360 3361**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3362 3363**System capability**: SystemCapability.Telephony.CallManager 3364 3365**Parameters** 3366 3367| Name | Type | Mandatory| Description | 3368| -------- | ---------------------------- | ---- | ---------- | 3369| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. The value **true** indicates that the ringtone is playing, and the value **false** indicates the opposite.| 3370 3371**Error codes** 3372 3373For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3374 3375| ID| Error Message | 3376| -------- | -------------------------------------------- | 3377| 201 | Permission denied. | 3378| 202 | Non-system applications use system APIs. | 3379| 401 | Parameter error. | 3380| 8300001 | Invalid parameter value. | 3381| 8300002 | Operation failed. Cannot connect to service. | 3382| 8300003 | System internal error. | 3383| 8300999 | Unknown error code. | 3384 3385**Example** 3386 3387```ts 3388import { BusinessError } from '@ohos.base'; 3389 3390call.isRinging((err: BusinessError, data: boolean) => { 3391 if (err) { 3392 console.error(`isRinging fail, err->${JSON.stringify(err)}`); 3393 } else { 3394 console.log(`isRinging success, data->${JSON.stringify(data)}`); 3395 } 3396}); 3397``` 3398 3399 3400## call.isRinging<sup>8+</sup> 3401 3402isRinging\(\): Promise\<boolean\> 3403 3404Checks whether the ringtone is playing. This API uses a promise to return the result. 3405 3406**System API**: This is a system API. 3407 3408**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3409 3410**System capability**: SystemCapability.Telephony.CallManager 3411 3412**Return value** 3413 3414| Type | Description | 3415| ---------------------- | --------------------------- | 3416| Promise<boolean> | Promise used to return the result. The value **true** indicates that the ringtone is playing, and the value **false** indicates the opposite.| 3417 3418**Error codes** 3419 3420For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3421 3422| ID| Error Message | 3423| -------- | -------------------------------------------- | 3424| 201 | Permission denied. | 3425| 202 | Non-system applications use system APIs. | 3426| 8300002 | Operation failed. Cannot connect to service. | 3427| 8300003 | System internal error. | 3428| 8300999 | Unknown error code. | 3429 3430**Example** 3431 3432```ts 3433import { BusinessError } from '@ohos.base'; 3434 3435call.isRinging().then((data: boolean) => { 3436 console.log(`isRinging success, promise: data->${JSON.stringify(data)}`); 3437}).catch((err: BusinessError) => { 3438 console.error(`isRinging fail, promise: err->${JSON.stringify(err)}`); 3439}); 3440``` 3441 3442## call.setMuted<sup>8+</sup> 3443 3444setMuted\(callback: AsyncCallback\<void\>\): void 3445 3446Sets call muting. This API uses an asynchronous callback to return the result. 3447 3448**System API**: This is a system API. 3449 3450**System capability**: SystemCapability.Telephony.CallManager 3451 3452**Parameters** 3453 3454| Name | Type | Mandatory| Description | 3455| -------- | ------------------------- | ---- | ---------- | 3456| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 3457 3458**Error codes** 3459 3460For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3461 3462| ID| Error Message | 3463| -------- | -------------------------------------------- | 3464| 202 | Non-system applications use system APIs. | 3465| 401 | Parameter error. | 3466| 8300001 | Invalid parameter value. | 3467| 8300002 | Operation failed. Cannot connect to service. | 3468| 8300003 | System internal error. | 3469| 8300999 | Unknown error code. | 3470 3471**Example** 3472 3473```ts 3474import { BusinessError } from '@ohos.base'; 3475 3476call.setMuted((err: BusinessError) => { 3477 if (err) { 3478 console.error(`setMuted fail, err->${JSON.stringify(err)}`); 3479 } else { 3480 console.log(`setMuted success.`); 3481 } 3482}); 3483``` 3484 3485 3486## call.setMuted<sup>8+</sup> 3487 3488setMuted\(\): Promise\<void\> 3489 3490Sets call muting. This API uses a promise to return the result. 3491 3492**System API**: This is a system API. 3493 3494**System capability**: SystemCapability.Telephony.CallManager 3495 3496**Return value** 3497 3498| Type | Description | 3499| ------------------- | --------------------------- | 3500| Promise<void> | Promise used to return the result.| 3501 3502**Error codes** 3503 3504For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3505 3506| ID| Error Message | 3507| -------- | -------------------------------------------- | 3508| 202 | Non-system applications use system APIs. | 3509| 8300002 | Operation failed. Cannot connect to service. | 3510| 8300003 | System internal error. | 3511| 8300999 | Unknown error code. | 3512 3513**Example** 3514 3515```ts 3516import { BusinessError } from '@ohos.base'; 3517 3518call.setMuted().then(() => { 3519 console.log(`setMuted success.`); 3520}).catch((err: BusinessError) => { 3521 console.error(`setMuted fail, promise: err->${JSON.stringify(err)}`); 3522}); 3523``` 3524 3525## call.cancelMuted<sup>8+</sup> 3526 3527cancelMuted\(callback: AsyncCallback\<void\>\): void 3528 3529Cancels call muting. This API uses an asynchronous callback to return the result. 3530 3531**System API**: This is a system API. 3532 3533**System capability**: SystemCapability.Telephony.CallManager 3534 3535**Parameters** 3536 3537| Name | Type | Mandatory| Description | 3538| -------- | ------------------------- | ---- | ---------- | 3539| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 3540 3541**Error codes** 3542 3543For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3544 3545| ID| Error Message | 3546| -------- | -------------------------------------------- | 3547| 202 | Non-system applications use system APIs. | 3548| 401 | Parameter error. | 3549| 8300001 | Invalid parameter value. | 3550| 8300002 | Operation failed. Cannot connect to service. | 3551| 8300003 | System internal error. | 3552| 8300999 | Unknown error code. | 3553 3554**Example** 3555 3556```ts 3557import { BusinessError } from '@ohos.base'; 3558 3559call.cancelMuted((err: BusinessError) => { 3560 if (err) { 3561 console.error(`cancelMuted fail, err->${JSON.stringify(err)}`); 3562 } else { 3563 console.log(`cancelMuted success.`); 3564 } 3565}); 3566``` 3567 3568 3569## call.cancelMuted<sup>8+</sup> 3570 3571cancelMuted\(\): Promise\<void\> 3572 3573Cancels call muting. This API uses a promise to return the result. 3574 3575**System API**: This is a system API. 3576 3577**System capability**: SystemCapability.Telephony.CallManager 3578 3579**Return value** 3580 3581| Type | Description | 3582| ------------------- | --------------------------- | 3583| Promise<void> | Promise used to return the result.| 3584 3585**Error codes** 3586 3587For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3588 3589| ID| Error Message | 3590| -------- | -------------------------------------------- | 3591| 202 | Non-system applications use system APIs. | 3592| 8300002 | Operation failed. Cannot connect to service. | 3593| 8300003 | System internal error. | 3594| 8300999 | Unknown error code. | 3595 3596**Example** 3597 3598```ts 3599import { BusinessError } from '@ohos.base'; 3600 3601call.cancelMuted().then(() => { 3602 console.log(`cancelMuted success.`); 3603}).catch((err: BusinessError) => { 3604 console.error(`cancelMuted fail, promise: err->${JSON.stringify(err)}`); 3605}); 3606``` 3607 3608## call.setAudioDevice<sup>8+</sup> 3609 3610setAudioDevice\(device: AudioDevice, callback: AsyncCallback\<void\>\): void 3611 3612Sets the audio device for a call. This API uses an asynchronous callback to return the result. 3613 3614**System API**: This is a system API. 3615 3616**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3617 3618**System capability**: SystemCapability.Telephony.CallManager 3619 3620**Parameters** 3621 3622| Name | Type | Mandatory| Description | 3623| -------- | ---------------------------- | ---- | ---------- | 3624| device | [AudioDevice](#audiodevice10)| Yes | Audio device.| 3625| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 3626 3627**Error codes** 3628 3629For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3630 3631| ID| Error Message | 3632| -------- | -------------------------------------------- | 3633| 201 | Permission denied. | 3634| 202 | Non-system applications use system APIs. | 3635| 401 | Parameter error. | 3636| 8300001 | Invalid parameter value. | 3637| 8300002 | Operation failed. Cannot connect to service. | 3638| 8300003 | System internal error. | 3639| 8300999 | Unknown error code. | 3640 3641**Example** 3642 3643```ts 3644import { BusinessError } from '@ohos.base'; 3645 3646let audioDevice: call.AudioDevice = { 3647 deviceType: call.AudioDeviceType.DEVICE_EARPIECE 3648} 3649call.setAudioDevice(audioDevice, (err: BusinessError) => { 3650 if (err) { 3651 console.error(`setAudioDevice fail, err->${JSON.stringify(err)}`); 3652 } else { 3653 console.log(`setAudioDevice success.`); 3654 } 3655}); 3656``` 3657 3658## call.setAudioDevice<sup>10+</sup> 3659 3660setAudioDevice\(device: AudioDevice): Promise\<void\> 3661 3662Sets the audio device for a call. This API uses a promise to return the result. 3663 3664**System API**: This is a system API. 3665 3666**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3667 3668**System capability**: SystemCapability.Telephony.CallManager 3669 3670**Parameters** 3671 3672| Name | Type | Mandatory| Description | 3673| -------- | ---------------------------- | ---- | ---------- | 3674| device | [AudioDevice](#audiodevice10)| Yes | Audio device.| 3675 3676**Return value** 3677 3678| Type | Description | 3679| ------------------- | --------------------------- | 3680| Promise<void> | Promise used to return the result.| 3681 3682**Error codes** 3683 3684For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3685 3686| ID| Error Message | 3687| -------- | -------------------------------------------- | 3688| 201 | Permission denied. | 3689| 202 | Non-system applications use system APIs. | 3690| 401 | Parameter error. | 3691| 8300001 | Invalid parameter value. | 3692| 8300002 | Operation failed. Cannot connect to service. | 3693| 8300003 | System internal error. | 3694| 8300999 | Unknown error code. | 3695 3696**Example** 3697 3698```ts 3699import { BusinessError } from '@ohos.base'; 3700 3701let audioDevice: call.AudioDevice = { 3702 deviceType: call.AudioDeviceType.DEVICE_EARPIECE 3703} 3704call.setAudioDevice(audioDevice).then(() => { 3705 console.log(`setAudioDevice success.`); 3706}).catch((err: BusinessError) => { 3707 console.error(`setAudioDevice fail, promise: err->${JSON.stringify(err)}`); 3708}); 3709``` 3710 3711## call.joinConference<sup>8+</sup> 3712 3713joinConference\(mainCallId: number, callNumberList: Array\<string\>, callback: AsyncCallback\<void\>\): void 3714 3715Joins a conference call. This API uses an asynchronous callback to return the result. 3716 3717**System API**: This is a system API. 3718 3719**System capability**: SystemCapability.Telephony.CallManager 3720 3721**Parameters** 3722 3723| Name | Type | Mandatory| Description | 3724| -------------- | ------------------------- | ---- | --------------- | 3725| mainCallId | number | Yes | Main call ID. | 3726| callNumberList | Array<string\> | Yes | List of call numbers.| 3727| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 3728 3729**Error codes** 3730 3731For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3732 3733| ID| Error Message | 3734| -------- | -------------------------------------------- | 3735| 202 | Non-system applications use system APIs. | 3736| 401 | Parameter error. | 3737| 8300001 | Invalid parameter value. | 3738| 8300002 | Operation failed. Cannot connect to service. | 3739| 8300003 | System internal error. | 3740| 8300999 | Unknown error code. | 3741 3742**Example** 3743 3744```ts 3745import { BusinessError } from '@ohos.base'; 3746 3747let callNumberList: Array<string> = [ 3748 "138XXXXXXXX" 3749]; 3750call.joinConference(1, callNumberList, (err: BusinessError) => { 3751 if (err) { 3752 console.error(`joinConference fail, err->${JSON.stringify(err)}`); 3753 } else { 3754 console.log(`joinConference success.`); 3755 } 3756}); 3757``` 3758 3759## call.joinConference<sup>8+</sup> 3760 3761joinConference\(mainCallId: number, callNumberList: Array\<string\>\): Promise\<void\> 3762 3763Joins a conference call. This API uses a promise to return the result. 3764 3765**System API**: This is a system API. 3766 3767**System capability**: SystemCapability.Telephony.CallManager 3768 3769**Parameters** 3770 3771| Name | Type | Mandatory| Description | 3772| -------------- | -------------- | ---- | --------------- | 3773| mainCallId | number | Yes | Main call ID. | 3774| callNumberList | Array<string\> | Yes | List of call numbers.| 3775 3776**Return value** 3777 3778| Type | Description | 3779| ------------------- | --------------------------- | 3780| Promise<void> | Promise used to return the result.| 3781 3782**Error codes** 3783 3784For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3785 3786| ID| Error Message | 3787| -------- | -------------------------------------------- | 3788| 202 | Non-system applications use system APIs. | 3789| 401 | Parameter error. | 3790| 8300001 | Invalid parameter value. | 3791| 8300002 | Operation failed. Cannot connect to service. | 3792| 8300003 | System internal error. | 3793| 8300999 | Unknown error code. | 3794 3795**Example** 3796 3797```ts 3798import { BusinessError } from '@ohos.base'; 3799 3800let callNumberList: Array<string> = [ 3801 "138XXXXXXXX" 3802]; 3803call.joinConference(1, callNumberList).then(() => { 3804 console.log(`joinConference success.`); 3805}).catch((err: BusinessError) => { 3806 console.error(`joinConference fail, promise: err->${JSON.stringify(err)}`); 3807}); 3808``` 3809 3810## call.updateImsCallMode<sup>8+</sup> 3811 3812updateImsCallMode\(callId: number, mode: ImsCallMode, callback: AsyncCallback\<void\>\): void 3813 3814Updates the IMS call mode. This API uses an asynchronous callback to return the result. 3815 3816**System API**: This is a system API. 3817 3818**System capability**: SystemCapability.Telephony.CallManager 3819 3820**Parameters** 3821 3822| Name | Type | Mandatory| Description | 3823| -------- | ---------------------------- | ---- | -------------- | 3824| callId | number | Yes | Call ID. | 3825| mode | [ImsCallMode](#imscallmode8) | Yes | IMS call mode.| 3826| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 3827 3828**Error codes** 3829 3830For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3831 3832| ID| Error Message | 3833| -------- | -------------------------------------------- | 3834| 202 | Non-system applications use system APIs. | 3835| 401 | Parameter error. | 3836| 8300001 | Invalid parameter value. | 3837| 8300002 | Operation failed. Cannot connect to service. | 3838| 8300003 | System internal error. | 3839| 8300999 | Unknown error code. | 3840 3841**Example** 3842 3843```ts 3844import { BusinessError } from '@ohos.base'; 3845 3846call.updateImsCallMode(1, 1, (err: BusinessError) => { 3847 if (err) { 3848 console.error(`updateImsCallMode fail, err->${JSON.stringify(err)}`); 3849 } else { 3850 console.log(`updateImsCallMode success.`); 3851 } 3852}); 3853``` 3854 3855## call.updateImsCallMode<sup>8+</sup> 3856 3857updateImsCallMode\(callId: number, mode: ImsCallMode\): Promise\<void\> 3858 3859Updates the IMS call mode. This API uses a promise to return the result. 3860 3861**System API**: This is a system API. 3862 3863**System capability**: SystemCapability.Telephony.CallManager 3864 3865**Parameters** 3866 3867| Name| Type | Mandatory| Description | 3868| ------ | ---------------------------- | ---- | -------------- | 3869| callId | number | Yes | Call ID. | 3870| mode | [ImsCallMode](#imscallmode8) | Yes | IMS call mode.| 3871 3872**Return value** 3873 3874| Type | Description | 3875| ------------------- | --------------------------- | 3876| Promise<void> | Promise used to return the result.| 3877 3878**Error codes** 3879 3880For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3881 3882| ID| Error Message | 3883| -------- | -------------------------------------------- | 3884| 202 | Non-system applications use system APIs. | 3885| 401 | Parameter error. | 3886| 8300001 | Invalid parameter value. | 3887| 8300002 | Operation failed. Cannot connect to service. | 3888| 8300003 | System internal error. | 3889| 8300999 | Unknown error code. | 3890 3891**Example** 3892 3893```ts 3894import { BusinessError } from '@ohos.base'; 3895 3896call.updateImsCallMode(1, 1).then(() => { 3897 console.log(`updateImsCallMode success.`); 3898}).catch((err: BusinessError) => { 3899 console.error(`updateImsCallMode fail, promise: err->${JSON.stringify(err)}`); 3900}); 3901``` 3902 3903## call.enableImsSwitch<sup>8+</sup> 3904 3905enableImsSwitch\(slotId: number, callback: AsyncCallback\<void\>\): void 3906 3907Enables the IMS service. This API uses an asynchronous callback to return the result. 3908 3909**System API**: This is a system API. 3910 3911**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3912 3913**System capability**: SystemCapability.Telephony.CallManager 3914 3915**Parameters** 3916 3917| Name | Type | Mandatory| Description | 3918| -------- | ------------------------- | ---- | -------------------------------------- | 3919| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3920| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 3921 3922**Error codes** 3923 3924For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3925 3926| ID| Error Message | 3927| -------- | -------------------------------------------- | 3928| 201 | Permission denied. | 3929| 202 | Non-system applications use system APIs. | 3930| 401 | Parameter error. | 3931| 8300001 | Invalid parameter value. | 3932| 8300002 | Operation failed. Cannot connect to service. | 3933| 8300003 | System internal error. | 3934| 8300999 | Unknown error code. | 3935 3936**Example** 3937 3938```ts 3939import { BusinessError } from '@ohos.base'; 3940 3941call.enableImsSwitch(0, (err: BusinessError) => { 3942 if (err) { 3943 console.error(`enableImsSwitch fail, err->${JSON.stringify(err)}`); 3944 } else { 3945 console.log(`enableImsSwitch success.`); 3946 } 3947}); 3948``` 3949 3950## call.enableImsSwitch<sup>8+</sup> 3951 3952enableImsSwitch\(slotId: number\): Promise\<void\> 3953 3954Enables the IMS service. This API uses a promise to return the result. 3955 3956**System API**: This is a system API. 3957 3958**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3959 3960**System capability**: SystemCapability.Telephony.CallManager 3961 3962**Parameters** 3963 3964| Name| Type | Mandatory| Description | 3965| ------ | ------ | ---- | -------------------------------------- | 3966| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3967 3968**Return value** 3969 3970| Type | Description | 3971| ------------------- | --------------------------- | 3972| Promise<void> | Promise used to return the result.| 3973 3974**Error codes** 3975 3976For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 3977 3978| ID| Error Message | 3979| -------- | -------------------------------------------- | 3980| 201 | Permission denied. | 3981| 202 | Non-system applications use system APIs. | 3982| 401 | Parameter error. | 3983| 8300001 | Invalid parameter value. | 3984| 8300002 | Operation failed. Cannot connect to service. | 3985| 8300003 | System internal error. | 3986| 8300999 | Unknown error code. | 3987 3988**Example** 3989 3990```ts 3991import { BusinessError } from '@ohos.base'; 3992 3993call.enableImsSwitch(0).then(() => { 3994 console.log(`enableImsSwitch success.`); 3995}).catch((err: BusinessError) => { 3996 console.error(`enableImsSwitch fail, promise: err->${JSON.stringify(err)}`); 3997}); 3998``` 3999 4000## call.disableImsSwitch<sup>8+</sup> 4001 4002disableImsSwitch\(slotId: number, callback: AsyncCallback\<void\>\): void 4003 4004Disables the IMS service. This API uses an asynchronous callback to return the result. 4005 4006**System API**: This is a system API. 4007 4008**Required permission**: ohos.permission.SET_TELEPHONY_STATE 4009 4010**System capability**: SystemCapability.Telephony.CallManager 4011 4012**Parameters** 4013 4014| Name | Type | Mandatory| Description | 4015| -------- | ------------------------- | ---- | -------------------------------------- | 4016| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 4017| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 4018 4019**Error codes** 4020 4021For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4022 4023| ID| Error Message | 4024| -------- | -------------------------------------------- | 4025| 201 | Permission denied. | 4026| 202 | Non-system applications use system APIs. | 4027| 401 | Parameter error. | 4028| 8300001 | Invalid parameter value. | 4029| 8300002 | Operation failed. Cannot connect to service. | 4030| 8300003 | System internal error. | 4031| 8300999 | Unknown error code. | 4032 4033**Example** 4034 4035```ts 4036import { BusinessError } from '@ohos.base'; 4037 4038call.disableImsSwitch(0, (err: BusinessError) => { 4039 if (err) { 4040 console.error(`disableImsSwitch fail, err->${JSON.stringify(err)}`); 4041 } else { 4042 console.log(`disableImsSwitch success.`); 4043 } 4044}); 4045``` 4046 4047## call.disableImsSwitch<sup>8+</sup> 4048 4049disableImsSwitch\(slotId: number\): Promise\<void\> 4050 4051Disables the IMS service. This API uses a promise to return the result. 4052 4053**System API**: This is a system API. 4054 4055**Required permission**: ohos.permission.SET_TELEPHONY_STATE 4056 4057**System capability**: SystemCapability.Telephony.CallManager 4058 4059**Parameters** 4060 4061| Name| Type | Mandatory| Description | 4062| ------ | ------ | ---- | -------------------------------------- | 4063| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 4064 4065**Return value** 4066 4067| Type | Description | 4068| ------------------- | --------------------------- | 4069| Promise<void> | Promise used to return the result. | 4070 4071**Error codes** 4072 4073For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4074 4075| ID| Error Message | 4076| -------- | -------------------------------------------- | 4077| 201 | Permission denied. | 4078| 202 | Non-system applications use system APIs. | 4079| 401 | Parameter error. | 4080| 8300001 | Invalid parameter value. | 4081| 8300002 | Operation failed. Cannot connect to service. | 4082| 8300003 | System internal error. | 4083| 8300999 | Unknown error code. | 4084 4085**Example** 4086 4087```ts 4088import { BusinessError } from '@ohos.base'; 4089 4090call.disableImsSwitch(0).then(() => { 4091 console.log(`disableImsSwitch success.`); 4092}).catch((err: BusinessError) => { 4093 console.error(`disableImsSwitch fail, promise: err->${JSON.stringify(err)}`); 4094}); 4095``` 4096 4097## call.isImsSwitchEnabled<sup>8+</sup> 4098 4099isImsSwitchEnabled\(slotId: number, callback: AsyncCallback\<boolean\>\): void 4100 4101Checks whether the IMS service is enabled. This API uses an asynchronous callback to return the result. 4102 4103**System API**: This is a system API. 4104 4105**System capability**: SystemCapability.Telephony.CallManager 4106 4107**Parameters** 4108 4109| Name | Type | Mandatory| Description | 4110| -------- | ---------------------------- | ---- | -------------------------------------- | 4111| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 4112| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. The value **true** indicates that the IMS service is enabled, and the value **false** indicates the opposite. The value **true** indicates that the IMS service is enabled, and the value **false** indicates the opposite.| 4113 4114**Error codes** 4115 4116For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4117 4118| ID| Error Message | 4119| -------- | -------------------------------------------- | 4120| 202 | Non-system applications use system APIs. | 4121| 401 | Parameter error. | 4122| 8300001 | Invalid parameter value. | 4123| 8300002 | Operation failed. Cannot connect to service. | 4124| 8300003 | System internal error. | 4125| 8300999 | Unknown error code. | 4126 4127**Example** 4128 4129```ts 4130import { BusinessError } from '@ohos.base'; 4131 4132call.isImsSwitchEnabled(0, (err: BusinessError, data: boolean) => { 4133 if (err) { 4134 console.error(`isImsSwitchEnabled fail, err->${JSON.stringify(err)}`); 4135 } else { 4136 console.log(`isImsSwitchEnabled success, data->${JSON.stringify(data)}`); 4137 } 4138}); 4139``` 4140 4141## call.isImsSwitchEnabled<sup>8+</sup> 4142 4143isImsSwitchEnabled\(slotId: number\): Promise\<boolean\> 4144 4145Checks whether the IMS service is enabled. This API uses a promise to return the result. 4146 4147**System API**: This is a system API. 4148 4149**System capability**: SystemCapability.Telephony.CallManager 4150 4151**Parameters** 4152 4153| Name| Type | Mandatory| Description | 4154| ------ | ------ | ---- | -------------------------------------- | 4155| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 4156 4157**Return value** 4158 4159| Type | Description | 4160| ------------------- | --------------------------- | 4161| Promise<boolean> | Promise used to return the result. The value **true** indicates that the IMS service is enabled, and the value **false** indicates the opposite.| 4162 4163**Error codes** 4164 4165For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4166 4167| ID| Error Message | 4168| -------- | -------------------------------------------- | 4169| 202 | Non-system applications use system APIs. | 4170| 401 | Parameter error. | 4171| 8300001 | Invalid parameter value. | 4172| 8300002 | Operation failed. Cannot connect to service. | 4173| 8300003 | System internal error. | 4174| 8300999 | Unknown error code. | 4175 4176**Example** 4177 4178```ts 4179import { BusinessError } from '@ohos.base'; 4180 4181call.isImsSwitchEnabled(0).then((data: boolean) => { 4182 console.log(`isImsSwitchEnabled success, promise: data->${JSON.stringify(data)}`); 4183}).catch((err: BusinessError) => { 4184 console.error(`isImsSwitchEnabled fail, promise: err->${JSON.stringify(err)}`); 4185}); 4186``` 4187 4188 4189## call.closeUnfinishedUssd<sup>10+</sup> 4190 4191closeUnfinishedUssd\(slotId: number, callback: AsyncCallback\<void\>\): void 4192 4193Cancels the unfinished USSD services. This API uses an asynchronous callback to return the result. 4194 4195**System API**: This is a system API. 4196 4197**Required permission**: ohos.permission.SET_TELEPHONY_STATE 4198 4199**System capability**: SystemCapability.Telephony.CallManager 4200 4201**Parameters** 4202 4203| Name | Type | Mandatory| Description | 4204| -------- | ------------------------- | ---- | -------------------------------------- | 4205| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 4206| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 4207 4208**Error codes** 4209 4210For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4211 4212| ID| Error Message | 4213| -------- | -------------------------------------------- | 4214| 201 | Permission denied. | 4215| 202 | Non-system applications use system APIs. | 4216| 401 | Parameter error. | 4217| 8300001 | Invalid parameter value. | 4218| 8300002 | Operation failed. Cannot connect to service. | 4219| 8300003 | System internal error. | 4220| 8300999 | Unknown error code. | 4221 4222**Example** 4223 4224```ts 4225import { BusinessError } from '@ohos.base'; 4226 4227let slotId: number = 0; 4228call.closeUnfinishedUssd(slotId, (err: BusinessError) => { 4229 if (err) { 4230 console.error(`closeUnfinishedUssd fail, err->${JSON.stringify(err)}`); 4231 } else { 4232 console.log(`closeUnfinishedUssd success.`); 4233 } 4234}); 4235``` 4236 4237## call.closeUnfinishedUssd<sup>10+</sup> 4238 4239closeUnfinishedUssd\(slotId: number\): Promise\<void\> 4240 4241Cancels the unfinished USSD services. This API uses a promise to return the result. 4242 4243**System API**: This is a system API. 4244 4245**Required permission**: ohos.permission.SET_TELEPHONY_STATE 4246 4247**System capability**: SystemCapability.Telephony.CallManager 4248 4249**Parameters** 4250 4251| Name| Type | Mandatory| Description | 4252| ------ | ------ | ---- | -------------------------------------- | 4253| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 4254 4255**Return value** 4256 4257| Type | Description | 4258| ------------------- | --------------------------- | 4259| Promise<void> | Promise used to return the result. | 4260 4261**Error codes** 4262 4263For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4264 4265| ID| Error Message | 4266| -------- | -------------------------------------------- | 4267| 201 | Permission denied. | 4268| 202 | Non-system applications use system APIs. | 4269| 401 | Parameter error. | 4270| 8300001 | Invalid parameter value. | 4271| 8300002 | Operation failed. Cannot connect to service. | 4272| 8300003 | System internal error. | 4273| 8300999 | Unknown error code. | 4274 4275**Example** 4276 4277```ts 4278import { BusinessError } from '@ohos.base'; 4279 4280let slotId: number = 0; 4281call.closeUnfinishedUssd(slotId).then(() => { 4282 console.log(`closeUnfinishedUssd success.`); 4283}).catch((err: BusinessError) => { 4284 console.error(`closeUnfinishedUssd fail, promise: err->${JSON.stringify(err)}`); 4285}); 4286``` 4287 4288 4289## call.setVoNRState<sup>10+</sup> 4290 4291setVoNRState\(slotId: number, state: VoNRState, callback: AsyncCallback\<void\>\): void 4292 4293Sets the status of the VoNR switch. This API uses an asynchronous callback to return the result. 4294 4295**System API**: This is a system API. 4296 4297**Required permission**: ohos.permission.SET_TELEPHONY_STATE 4298 4299**System capability**: SystemCapability.Telephony.CallManager 4300 4301**Parameters** 4302 4303| Name | Type | Mandatory| Description | 4304| ----------- | ----------------------------- | ---- | ---------------------------------------------------- | 4305| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 4306| state | [VoNRState](#vonrstate10) | Yes | Status of the VoNR switch. | 4307| callback | AsyncCallback<void> | Yes | Callback used to return the result.| 4308 4309**Error codes** 4310 4311For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4312 4313| ID| Error Message | 4314| -------- | -------------------------------------------- | 4315| 201 | Permission denied. | 4316| 202 | Non-system applications use system APIs. | 4317| 401 | Parameter error. | 4318| 8300001 | Invalid parameter value. | 4319| 8300002 | Operation failed. Cannot connect to service. | 4320| 8300003 | System internal error. | 4321| 8300999 | Unknown error code. | 4322 4323**Example** 4324 4325```ts 4326import { BusinessError } from '@ohos.base'; 4327 4328let slotId: number = 0; 4329let state: call.VoNRState = call.VoNRState.VONR_STATE_ON; 4330call.setVoNRState(slotId, state, (err: BusinessError) => { 4331 if (err) { 4332 console.error(`setVoNRState fail, err->${JSON.stringify(err)}`); 4333 } else { 4334 console.log(`setVoNRState success`); 4335 } 4336}); 4337``` 4338 4339 4340## call.setVoNRState<sup>10+</sup> 4341 4342setVoNRState\(slotId: number, state: VoNRState\): Promise\<void\> 4343 4344Sets the status of the VoNR switch. This API uses a promise to return the result. 4345 4346**System API**: This is a system API. 4347 4348**Required permission**: ohos.permission.SET_TELEPHONY_STATE 4349 4350**System capability**: SystemCapability.Telephony.CallManager 4351 4352**Parameters** 4353 4354| Name | Type | Mandatory| Description | 4355| ----------- | ----------------------------- | ---- | ------------------------------------------- | 4356| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 4357| state | [VoNRState](#vonrstate10) | Yes | Status of the VoNR switch. | 4358 4359**Return value** 4360 4361| Type | Description | 4362| ---------------------- | --------------------------------------------- | 4363| Promise<void> | Promise used to return the result. | 4364 4365**Error codes** 4366 4367For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4368 4369| ID| Error Message | 4370| -------- | -------------------------------------------- | 4371| 201 | Permission denied. | 4372| 202 | Non-system applications use system APIs. | 4373| 401 | Parameter error. | 4374| 8300001 | Invalid parameter value. | 4375| 8300002 | Operation failed. Cannot connect to service. | 4376| 8300003 | System internal error. | 4377| 8300999 | Unknown error code. | 4378 4379**Example** 4380 4381```ts 4382import { BusinessError } from '@ohos.base'; 4383 4384let slotId: number = 0; 4385let state: call.VoNRState = call.VoNRState.VONR_STATE_ON; 4386call.setVoNRState(slotId, state).then(() => { 4387 console.log(`setVoNRState success`); 4388}).catch((err: BusinessError) => { 4389 console.error(`setVoNRState fail, promise: err->${JSON.stringify(err)}`); 4390}); 4391``` 4392 4393 4394## call.getVoNRState<sup>10+</sup> 4395 4396getVoNRState\(slotId: number, callback: AsyncCallback\<VoNRState\>\): void 4397 4398Obtains the status of the VoNR switch. This API uses an asynchronous callback to return the result. 4399 4400**System API**: This is a system API. 4401 4402**Required permission**: ohos.permission.GET_TELEPHONY_STATE 4403 4404**System capability**: SystemCapability.Telephony.CallManager 4405 4406**Parameters** 4407 4408| Name | Type | Mandatory | Description | 4409| ----------- | --------------------------------------------- | ---- | ------------------------------------------------------ | 4410| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 4411| callback | AsyncCallback<[VoNRState](#vonrstate10)>| Yes | Callback used to return the result. | 4412 4413**Error codes** 4414 4415For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4416 4417| ID| Error Message | 4418| -------- | -------------------------------------------- | 4419| 201 | Permission denied. | 4420| 202 | Non-system applications use system APIs. | 4421| 401 | Parameter error. | 4422| 8300001 | Invalid parameter value. | 4423| 8300002 | Operation failed. Cannot connect to service. | 4424| 8300003 | System internal error. | 4425| 8300999 | Unknown error code. | 4426 4427**Example** 4428 4429```ts 4430import { BusinessError } from '@ohos.base'; 4431 4432let slotId: number = 0; 4433call.getVoNRState(slotId, (err: BusinessError, data: call.VoNRState) => { 4434 if (err) { 4435 console.error(`getVoNRState fail, err->${JSON.stringify(err)}`); 4436 } else { 4437 console.log(`getVoNRState success, data->${JSON.stringify(data)}`); 4438 } 4439}); 4440``` 4441 4442 4443## call.getVoNRState<sup>10+</sup> 4444 4445getVoNRState\(slotId: number\): Promise\<VoNRState\> 4446 4447Obtains the status of the VoNR switch. This API uses a promise to return the result. 4448 4449**System API**: This is a system API. 4450 4451**Required permission**: ohos.permission.GET_TELEPHONY_STATE 4452 4453**System capability**: SystemCapability.Telephony.CallManager 4454 4455**Parameters** 4456 4457| Name | Type | Mandatory| Description | 4458| ----------- | ----------------------------- | ---- | ------------------------------------------- | 4459| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 4460 4461**Return value** 4462 4463| Type | Description | 4464| ---------------------------------------- | ------------------------------------------- | 4465| Promise<[VoNRState](#vonrstate10)> | Promise used to return the result. | 4466 4467**Error codes** 4468 4469For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4470 4471| ID| Error Message | 4472| -------- | -------------------------------------------- | 4473| 201 | Permission denied. | 4474| 202 | Non-system applications use system APIs. | 4475| 401 | Parameter error. | 4476| 8300001 | Invalid parameter value. | 4477| 8300002 | Operation failed. Cannot connect to service. | 4478| 8300003 | System internal error. | 4479| 8300999 | Unknown error code. | 4480 4481**Example** 4482 4483```ts 4484import { BusinessError } from '@ohos.base'; 4485 4486let slotId: number = 0; 4487call.getVoNRState(slotId).then((data: call.VoNRState) => { 4488 console.log(`getVoNRState success, promise: data->${JSON.stringify(data)}`); 4489}).catch((err: BusinessError) => { 4490 console.error(`getVoNRState fail, promise: err->${JSON.stringify(err)}`); 4491}); 4492``` 4493 4494 4495## call.canSetCallTransferTime<sup>10+</sup> 4496 4497canSetCallTransferTime\(slotId: number, callback: AsyncCallback\<boolean\>\): void 4498 4499Checks whether the call forwarding time can be set. This API uses an asynchronous callback to return the result. 4500 4501**System API**: This is a system API. 4502 4503**Required permission**: ohos.permission.GET_TELEPHONY_STATE 4504 4505**System capability**: SystemCapability.Telephony.CallManager 4506 4507**Parameters** 4508 4509| Name | Type | Mandatory| Description | 4510| ----------- | ----------------------------- | ---- | ----------------------------------------------------- | 4511| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 4512| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. The value **true** indicates that the call forwarding time can be set, and the value **false** indicates the opposite.| 4513 4514**Error codes** 4515 4516For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4517 4518| ID| Error Message | 4519| -------- | -------------------------------------------- | 4520| 201 | Permission denied. | 4521| 202 | Non-system applications use system APIs. | 4522| 401 | Parameter error. | 4523| 8300001 | Invalid parameter value. | 4524| 8300002 | Operation failed. Cannot connect to service. | 4525| 8300003 | System internal error. | 4526| 8300999 | Unknown error code. | 4527 4528**Example** 4529 4530```ts 4531import { BusinessError } from '@ohos.base'; 4532 4533let slotId: number = 0; 4534call.canSetCallTransferTime(slotId, (err: BusinessError, data: boolean) => { 4535 if (err) { 4536 console.error(`canSetCallTransferTime fail, err->${JSON.stringify(err)}`); 4537 } else { 4538 console.log(`canSetCallTransferTime success, data->${JSON.stringify(data)}`); 4539 } 4540}); 4541``` 4542 4543 4544## call.canSetCallTransferTime<sup>10+</sup> 4545 4546canSetCallTransferTime\(slotId: number\): Promise\<boolean\> 4547 4548Checks whether the call forwarding time can be set. This API uses a promise to return the result. 4549 4550**System API**: This is a system API. 4551 4552**Required permission**: ohos.permission.GET_TELEPHONY_STATE 4553 4554**System capability**: SystemCapability.Telephony.CallManager 4555 4556**Parameters** 4557 4558| Name | Type | Mandatory| Description | 4559| ----------- | ----------------------------- | ---- | ------------------------------------------- | 4560| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 4561 4562**Return value** 4563 4564| Type | Description | 4565| ---------------------- | --------------------------------------------- | 4566| Promise<boolean> | Promise used to return the result. The value **true** indicates that the call forwarding time can be set, and the value **false** indicates the opposite.| 4567 4568**Error codes** 4569 4570For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4571 4572| ID| Error Message | 4573| -------- | -------------------------------------------- | 4574| 201 | Permission denied. | 4575| 202 | Non-system applications use system APIs. | 4576| 401 | Parameter error. | 4577| 8300001 | Invalid parameter value. | 4578| 8300002 | Operation failed. Cannot connect to service. | 4579| 8300003 | System internal error. | 4580| 8300999 | Unknown error code. | 4581 4582**Example** 4583 4584```ts 4585import { BusinessError } from '@ohos.base'; 4586 4587let slotId: number = 0; 4588call.canSetCallTransferTime(slotId).then((data: boolean) => { 4589 console.log(`canSetCallTransferTime success, promise: data->${JSON.stringify(data)}`); 4590}).catch((err: BusinessError) => { 4591 console.error(`canSetCallTransferTime fail, promise: err->${JSON.stringify(err)}`); 4592}); 4593``` 4594 4595 4596## call.inputDialerSpecialCode<sup>10+</sup> 4597 4598inputDialerSpecialCode\(inputCode: string, callback: AsyncCallback\<void\>\): void 4599 4600Performs a secret code broadcast. This API uses an asynchronous callback to return the result. 4601 4602**System API**: This is a system API. 4603 4604**Required Permissions**: ohos.permission.PLACE_CALL 4605 4606**System capability**: SystemCapability.Telephony.CallManager 4607 4608**Parameters** 4609 4610| Name | Type | Mandatory| Description | 4611| ----------- | ---------------------------- | ---- | ----------------------------------------- | 4612| inputCode | string | Yes | Secret code, for example, **2846579** (project menu).| 4613| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 4614 4615**Error codes** 4616 4617For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4618 4619| ID| Error Message | 4620| -------- | -------------------------------------------- | 4621| 201 | Permission denied. | 4622| 202 | Non-system applications use system APIs. | 4623| 401 | Parameter error. | 4624| 8300001 | Invalid parameter value. | 4625| 8300002 | Operation failed. Cannot connect to service. | 4626| 8300003 | System internal error. | 4627 4628**Example** 4629 4630```ts 4631import { BusinessError } from '@ohos.base'; 4632 4633call.inputDialerSpecialCode('2846579', (err: BusinessError) => { 4634 if (err) { 4635 console.error(`inputDialerSpecialCode fail, err->${JSON.stringify(error)}`); 4636 } else { 4637 console.log(`inputDialerSpecialCode success`); 4638 } 4639}); 4640``` 4641 4642## call.inputDialerSpecialCode<sup>10+</sup> 4643 4644inputDialerSpecialCode\(inputCode: string\): Promise\<void\> 4645 4646Performs a secret code broadcast. This API uses a promise to return the result. 4647 4648**System API**: This is a system API. 4649 4650**Required Permissions**: ohos.permission.PLACE_CALL 4651 4652**System capability**: SystemCapability.Telephony.CallManager 4653 4654**Parameters** 4655 4656| Name | Type | Mandatory| Description | 4657| ----------- | ---------------------------- | ---- | ----------------------------------------- | 4658| inputCode | string | Yes | Secret code, for example, **2846579** (project menu).| 4659 4660**Return value** 4661 4662| Type | Description | 4663| ------------------- | --------------------------- | 4664| Promise<void> | Promise used to return the result.| 4665 4666**Error codes** 4667 4668For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4669 4670| ID| Error Message | 4671| -------- | -------------------------------------------- | 4672| 201 | Permission denied. | 4673| 202 | Non-system applications use system APIs. | 4674| 401 | Parameter error. | 4675| 8300001 | Invalid parameter value. | 4676| 8300002 | Operation failed. Cannot connect to service. | 4677| 8300003 | System internal error. | 4678 4679**Example** 4680 4681```ts 4682import { BusinessError } from '@ohos.base'; 4683 4684try { 4685 call.inputDialerSpecialCode('2846579'); 4686 console.log(`inputDialerSpecialCode success`); 4687} catch (error) { 4688 console.error(`inputDialerSpecialCode fail, promise: err->${JSON.stringify(error)}`); 4689} 4690``` 4691 4692 4693## call.removeMissedIncomingCallNotification<sup>10+</sup> 4694 4695removeMissedIncomingCallNotification\(callback: AsyncCallback\<void\>\): void 4696 4697Removes missed call notifications. This API uses an asynchronous callback to return the result. 4698 4699**System API**: This is a system API. 4700 4701**Required permissions**: ohos.permission.SET_TELEPHONY_STATE, ohos.permission.READ_CALL_LOG, and ohos.permission.WRITE_CALL_LOG 4702 4703**System capability**: SystemCapability.Telephony.CallManager 4704 4705**Parameters** 4706 4707| Name | Type | Mandatory| Description | 4708| ----------- | ---------------------------- | ---- | --------------------------------------- | 4709| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 4710 4711**Error codes** 4712 4713For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4714 4715| ID| Error Message | 4716| -------- | -------------------------------------------- | 4717| 201 | Permission denied. | 4718| 202 | Non-system applications use system APIs. | 4719| 401 | Parameter error. | 4720| 8300002 | Operation failed. Cannot connect to service. | 4721| 8300003 | System internal error. | 4722| 8300999 | Unknown error code. | 4723 4724**Example** 4725 4726```ts 4727import { BusinessError } from '@ohos.base'; 4728 4729call.removeMissedIncomingCallNotification((err: BusinessError) => { 4730 if (err) { 4731 console.error(`removeMissedIncomingCallNotification failed, err->${JSON.stringify(err)}`); 4732 } else { 4733 console.log(`removeMissedIncomingCallNotification success`); 4734 } 4735}); 4736``` 4737 4738 4739## call.removeMissedIncomingCallNotification<sup>10+</sup> 4740 4741removeMissedIncomingCallNotification\(\): Promise\<void\> 4742 4743Removes missed call notifications. This API uses a promise to return the result. 4744 4745**System API**: This is a system API. 4746 4747**Required permissions**: ohos.permission.SET_TELEPHONY_STATE, ohos.permission.READ_CALL_LOG, and ohos.permission.WRITE_CALL_LOG 4748 4749**System capability**: SystemCapability.Telephony.CallManager 4750 4751**Return value** 4752 4753| Type | Description | 4754| ------------------- | --------------------------- | 4755| Promise<void> | Promise used to return the result.| 4756 4757**Error codes** 4758 4759For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 4760 4761| ID| Error Message | 4762| -------- | -------------------------------------------- | 4763| 201 | Permission denied. | 4764| 202 | Non-system applications use system APIs. | 4765| 8300002 | Operation failed. Cannot connect to service. | 4766| 8300003 | System internal error. | 4767| 8300999 | Unknown error code. | 4768 4769**Example** 4770 4771```ts 4772import { BusinessError } from '@ohos.base'; 4773 4774call.removeMissedIncomingCallNotification().then(() => { 4775 console.log(`removeMissedIncomingCallNotification success`); 4776}).catch((err: BusinessError) => { 4777 console.error(`removeMissedIncomingCallNotification failed, promise: err->${JSON.stringify(err)}`); 4778}); 4779``` 4780 4781 4782## DialOptions 4783 4784Provides an option for determining whether a call is a video call. 4785 4786**System capability**: SystemCapability.Telephony.CallManager 4787 4788| Name | Type | Mandatory| Description | 4789| ------------------------ | ---------------------------------- | ---- | ----------------------------------------------------------------------------------------------- | 4790| accountId <sup>8+</sup> | number | No | Account ID.<br>- **0**: card slot 1<br>- **1**: card slot 2<br> This is a system API. | 4791| videoState <sup>8+</sup> | [VideoStateType](#videostatetype7) | No | Video state type. This is a system API. | 4792| dialScene <sup>8+</sup> | [DialScene](#dialscene8) | No | Dialup scenario. This is a system API. | 4793| dialType <sup>8+</sup> | [DialType](#dialtype8) | No | Dialup type. This is a system API. | 4794 4795## DialCallOptions<sup>9+</sup> 4796 4797Provides an option for determining whether a call is a video call. 4798 4799**System API**: This is a system API. 4800 4801**System capability**: SystemCapability.Telephony.CallManager 4802 4803| Name | Type | Mandatory| Description | 4804| ------------------------ | ---------------------------------- | ---- | ------------------------------------------- | 4805| accountId <sup>9+</sup> | number | No | Account ID.<br>- **0**: card slot 1<br>- **1**: card slot 2<br> | 4806| videoState <sup>9+</sup> | [VideoStateType](#videostatetype7) | No | Video state type. | 4807| dialScene <sup>9+</sup> | [DialScene](#dialscene8) | No | Dialup scenario. | 4808| dialType <sup>9+</sup> | [DialType](#dialtype8) | No | Dialup type. | 4809 4810 4811## ImsCallMode<sup>8+</sup> 4812 4813Enumerates IMS call modes. 4814 4815**System API**: This is a system API. 4816 4817**System capability**: SystemCapability.Telephony.CallManager 4818 4819| Name | Value | Description | 4820| ---------------------- | ---- | ------------------ | 4821| CALL_MODE_AUDIO_ONLY | 0 | Audio call only. | 4822| CALL_MODE_SEND_ONLY | 1 | Sending calls only. | 4823| CALL_MODE_RECEIVE_ONLY | 2 | Receiving calls only. | 4824| CALL_MODE_SEND_RECEIVE | 3 | Sending and receiving calls.| 4825| CALL_MODE_VIDEO_PAUSED | 4 | Pausing video calls. | 4826 4827## VoNRState<sup>10+</sup> 4828 4829Enumerates VoNR switch states. 4830 4831**System API**: This is a system API. 4832 4833**System capability**: SystemCapability.Telephony.CallManager 4834 4835| Name | Value | Description | 4836| ---------------------- | ---- | ----------------- | 4837| VONR_STATE_OFF | 0 | Disabled. | 4838| VONR_STATE_ON | 1 | Enabled. | 4839 4840## AudioDevice<sup>10+</sup> 4841 4842Enumerates audio devices. 4843 4844**System API**: This is a system API. 4845 4846**System capability**: SystemCapability.Telephony.CallManager 4847 4848| Name | Type | Mandatory | Description | 4849| --------------------------------- | ------------------------------------- | ---- | ---------------- | 4850| deviceType <sup>10+</sup> | [AudioDeviceType](#audiodevicetype10) | Yes | Audio device type. | 4851| address <sup>10+</sup> | string | No | Audio device address. | 4852| deviceName <sup>11+</sup> | string | No | Audio device name. | 4853 4854## AudioDeviceType<sup>10+</sup> 4855 4856Enumerates audio device types. 4857 4858**System API**: This is a system API. 4859 4860**System capability**: SystemCapability.Telephony.CallManager 4861 4862| Name | Value | Description | 4863| -------------------- | ---- | ----------- | 4864| DEVICE_EARPIECE | 0 | Headset device. | 4865| DEVICE_SPEAKER | 1 | Speaker device. | 4866| DEVICE_WIRED_HEADSET | 2 | Wired headset device.| 4867| DEVICE_BLUETOOTH_SCO | 3 | Bluetooth SCO device. | 4868| DEVICE_DISTRIBUTED_AUTOMOTIVE<sup>11+</sup> | 4 | Distributed head unit.| 4869 4870## AudioDeviceCallbackInfo<sup>10+</sup> 4871 4872Defines the audio device information. 4873 4874**System API**: This is a system API. 4875 4876**System capability**: SystemCapability.Telephony.CallManager 4877 4878| Name | Type | Mandatory | Description | 4879| --------------------------------- | ------------------------------------- | ---- | ---------------- | 4880| audioDeviceList <sup>10+</sup> | [Array\<AudioDevice\>](#audiodevice10) | Yes | Audio device list. | 4881| currentAudioDevice <sup>10+</sup> | [AudioDevice](#audiodevice10) | Yes | Current audio device. | 4882| isMuted <sup>10+</sup> | boolean | Yes | Whether the audio device is muted. | 4883 4884 4885## CallRestrictionType<sup>8+</sup> 4886 4887Enumerates call restriction types. 4888 4889**System API**: This is a system API. 4890 4891**System capability**: SystemCapability.Telephony.CallManager 4892 4893| Name | Value | Description | 4894| --------------------------------------------- | ---- | -------------------------- | 4895| RESTRICTION_TYPE_ALL_INCOMING | 0 | Barring of all incoming calls. | 4896| RESTRICTION_TYPE_ALL_OUTGOING | 1 | Barring of all outgoing calls. | 4897| RESTRICTION_TYPE_INTERNATIONAL | 2 | Barring of international calls. | 4898| RESTRICTION_TYPE_INTERNATIONAL_EXCLUDING_HOME | 3 | Barring of international calls except those in the home country.| 4899| RESTRICTION_TYPE_ROAMING_INCOMING | 4 | Barring of incoming roaming calls. | 4900| RESTRICTION_TYPE_ALL_CALLS | 5 | Barring of all calls. | 4901| RESTRICTION_TYPE_OUTGOING_SERVICES | 6 | Barring of outgoing services. | 4902| RESTRICTION_TYPE_INCOMING_SERVICES | 7 | Barring of incoming services. | 4903 4904## CallTransferInfo<sup>8+</sup> 4905 4906Defines the call transfer information. 4907 4908**System API**: This is a system API. 4909 4910**System capability**: SystemCapability.Telephony.CallManager 4911 4912| Name | Type | Mandatory| Description | 4913| ------------------------ | ---------------------------------------------------- | ---- | ---------------- | 4914| transferNum | string | Yes | Call transfer number. | 4915| type | [CallTransferType](#calltransfertype8) | Yes | Call transfer type. | 4916| settingType | [CallTransferSettingType](#calltransfersettingtype8) | Yes | Call transfer setting type.| 4917| startHour<sup>9+</sup> | number | No | Hour in the start time.| 4918| startMinute<sup>9+</sup> | number | No | Minute in the start time.| 4919| endHour<sup>9+</sup> | number | No | Hour in the end time.| 4920| endMinute<sup>9+</sup> | number | No | Minute in the end time.| 4921 4922## CallTransferType<sup>8+</sup> 4923 4924Enumerates call transfer types. 4925 4926**System API**: This is a system API. 4927 4928**System capability**: SystemCapability.Telephony.CallManager 4929 4930| Name | Value | Description | 4931| --------------------------- | ---- | ------------ | 4932| TRANSFER_TYPE_UNCONDITIONAL | 0 | Call forwarding unconditional. | 4933| TRANSFER_TYPE_BUSY | 1 | Call forwarding busy. | 4934| TRANSFER_TYPE_NO_REPLY | 2 | Call forwarding on no reply. | 4935| TRANSFER_TYPE_NOT_REACHABLE | 3 | Call forwarding on no user not reachable.| 4936 4937## CallTransferSettingType<sup>8+</sup> 4938 4939Enumerates call transfer setting types. 4940 4941**System API**: This is a system API. 4942 4943**System capability**: SystemCapability.Telephony.CallManager 4944 4945| Name | Value | Description | 4946| -------------------------- | ---- | ------------ | 4947| CALL_TRANSFER_DISABLE | 0 | Disabling of call transfer.| 4948| CALL_TRANSFER_ENABLE | 1 | Enabling of call transfer.| 4949| CALL_TRANSFER_REGISTRATION | 3 | Registration of call transfer.| 4950| CALL_TRANSFER_ERASURE | 4 | Erasing of call transfer.| 4951 4952## CallAttributeOptions<sup>7+</sup> 4953 4954Defines the call attribute options. 4955 4956**System API**: This is a system API. 4957 4958**System capability**: SystemCapability.Telephony.CallManager 4959 4960| Name | Type | Mandatory| Description | 4961| --------------- | ---------------------------------------- | ---- | -------------- | 4962| accountNumber | string | Yes | Account number. | 4963| speakerphoneOn | boolean | Yes | Speakerphone on.| 4964| accountId | number | Yes | Account ID. | 4965| videoState | [VideoStateType](#videostatetype7) | Yes | Video state type. | 4966| startTime | number | Yes | Start time. | 4967| isEcc | boolean | Yes | Whether the call is an ECC. | 4968| callType | [CallType](#calltype7) | Yes | Call type. | 4969| callId | number | Yes | Call ID. | 4970| callState | [DetailedCallState](#detailedcallstate7) | Yes | Detailed call state. | 4971| conferenceState | [ConferenceState](#conferencestate7) | Yes | Conference state. | 4972| voipCallAttribute<sup>11+</sup> | [VoipCallAttribute](#voipcallattribute11) | No | VoIP call information. | 4973| crsType<sup>11+</sup> | number | Yes | Video RBT type.| 4974| originalCallType<sup>11+</sup> | number | Yes | Original call type of the Video RBT service.| 4975 4976## VoipCallAttribute<sup>11+</sup> 4977 4978Defines the VoIP call information. 4979 4980**System API**: This is a system API. 4981 4982**System capability**: SystemCapability.Telephony.CallManager 4983 4984| Name | Type | Mandatory| Description | 4985| --------------- | ------------------- | ---- | -------------- | 4986| voipCallId | string | Yes | Unique ID of a VoIP call. | 4987| userName | string | Yes | User nickname.| 4988| userProfile | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7) | Yes | User profile picture. | 4989| extensionId | string | Yes | Process ID of the third-party application. | 4990| abilityName | string | Yes | Ability name of the third-party application. | 4991| voipBundleName | string | Yes | Bundle name of the third-party application. | 4992 4993## ConferenceState<sup>7+</sup> 4994 4995Enumerates conference states. 4996 4997**System API**: This is a system API. 4998 4999**System capability**: SystemCapability.Telephony.CallManager 5000 5001| Name | Value | Description | 5002| ---------------------------- | ---- | -------------- | 5003| TEL_CONFERENCE_IDLE | 0 | Idle state. | 5004| TEL_CONFERENCE_ACTIVE | 1 | Active state. | 5005| TEL_CONFERENCE_DISCONNECTING | 2 | Disconnecting state. | 5006| TEL_CONFERENCE_DISCONNECTED | 3 | Disconnected state.| 5007 5008## CallType<sup>7+</sup> 5009 5010Enumerates call types. 5011 5012**System API**: This is a system API. 5013 5014**System capability**: SystemCapability.Telephony.CallManager 5015 5016| Name | Value | Description | 5017| ------------- | ---- | ------------ | 5018| TYPE_CS | 0 | CS call. | 5019| TYPE_IMS | 1 | IMS call. | 5020| TYPE_OTT | 2 | OTT call. | 5021| TYPE_ERR_CALL | 3 | Error call type.| 5022| TYPE_VOIP<sup>11+</sup> | 4 | VoIP call.| 5023 5024## VideoStateType<sup>7+</sup> 5025 5026Video state type. 5027 5028**System API**: This is a system API. 5029 5030**System capability**: SystemCapability.Telephony.CallManager 5031 5032| Name | Value | Description | 5033| ------------------------------------- | ---- | --------| 5034| TYPE_VOICE | 0 | Voice state.| 5035| TYPE_VIDEO_SEND_ONLY<sup>11+</sup> | 1 | Data sending only during a video call.| 5036| TYPE_VIDEO_RECEIVE_ONLY<sup>11+</sup> | 2 | Data receiving only during a video call.| 5037| TYPE_VIDEO | 3 | Video state.| 5038| TYPE_VIDEO_BIDIRECTIONAL<sup>11+</sup>| 4 | Data receiving/sending status during a video call.| 5039 5040## DetailedCallState<sup>7+</sup> 5041 5042Enumerates detailed call states. 5043 5044**System API**: This is a system API. 5045 5046**System capability**: SystemCapability.Telephony.CallManager 5047 5048| Name | Value | Description | 5049| ------------------------- | ---- | -------------- | 5050| CALL_STATUS_ACTIVE | 0 | Active state. | 5051| CALL_STATUS_HOLDING | 1 | Hold state. | 5052| CALL_STATUS_DIALING | 2 | Dialing state. | 5053| CALL_STATUS_ALERTING | 3 | Alerting state. | 5054| CALL_STATUS_INCOMING | 4 | Incoming state. | 5055| CALL_STATUS_WAITING | 5 | Waiting state. | 5056| CALL_STATUS_DISCONNECTED | 6 | Disconnected state.| 5057| CALL_STATUS_DISCONNECTING | 7 | Disconnecting state. | 5058| CALL_STATUS_IDLE | 8 | Idle state. | 5059 5060## CallRestrictionInfo<sup>8+</sup> 5061 5062Defines the call restriction information. 5063 5064**System API**: This is a system API. 5065 5066**System capability**: SystemCapability.Telephony.CallManager 5067 5068| Name | Type | Mandatory| Description | 5069| -------- | -------------------------------------------- | ---- | ------------ | 5070| type | [CallRestrictionType](#callrestrictiontype8) | Yes | Call restriction type.| 5071| password | string | Yes | Password. | 5072| mode | [CallRestrictionMode](#callrestrictionmode8) | Yes | Call restriction mode.| 5073 5074## CallRestrictionMode<sup>8+</sup> 5075 5076Enumerates call restriction modes. 5077 5078**System API**: This is a system API. 5079 5080**System capability**: SystemCapability.Telephony.CallManager 5081 5082| Name | Value | Description | 5083| ----------------------------- | ---- | ------------ | 5084| RESTRICTION_MODE_DEACTIVATION | 0 | Call restriction deactivated.| 5085| RESTRICTION_MODE_ACTIVATION | 1 | Call restriction activated.| 5086 5087## CallEventOptions<sup>8+</sup> 5088 5089Defines the call event options. 5090 5091**System API**: This is a system API. 5092 5093**System capability**: SystemCapability.Telephony.CallManager 5094 5095| Name | Type | Mandatory| Description | 5096| ------- | ------------------------------------------ | ---- | -------------- | 5097| eventId | [CallAbilityEventId](#callabilityeventid8) | Yes | Call ability event ID.| 5098 5099## CallAbilityEventId<sup>8+</sup> 5100 5101Enumerates call ability event IDs. 5102 5103**System API**: This is a system API. 5104 5105**System capability**: SystemCapability.Telephony.CallManager 5106 5107| Name | Value | Description | 5108| ------------------------------------- | ---- | --------------- | 5109| EVENT_DIAL_NO_CARRIER | 1 | No available carrier during dialing. | 5110| EVENT_INVALID_FDN_NUMBER | 2 | Invalid FDN.| 5111| EVENT_HOLD_CALL_FAILED<sup>11+</sup> | 3 | Failed to place the call on hold.| 5112| EVENT_SWAP_CALL_FAILED<sup>11+</sup> | 4 | Failed to place the current call on hold and answer the waiting call.| 5113| EVENT_COMBINE_CALL_FAILED<sup>11+</sup> | 5 | Failed to combine calls.| 5114| EVENT_SPLIT_CALL_FAILED<sup>11+</sup> | 6 | Failed to split the call.| 5115 5116## DialScene<sup>8+</sup> 5117 5118Enumerates dialup scenarios. 5119 5120**System API**: This is a system API. 5121 5122**System capability**: SystemCapability.Telephony.CallManager 5123 5124| Name | Value | Description | 5125| --------------- | ---- | ------------ | 5126| CALL_NORMAL | 0 | Common call. | 5127| CALL_PRIVILEGED | 1 | Privileged call. | 5128| CALL_EMERGENCY | 2 | Emergency call.| 5129 5130## DialType<sup>8+</sup> 5131 5132Enumerates dialup types. 5133 5134**System API**: This is a system API. 5135 5136**System capability**: SystemCapability.Telephony.CallManager 5137 5138| Name | Value | Description | 5139| -------------------- | ---- | ---------------- | 5140| DIAL_CARRIER_TYPE | 0 | Carrier. | 5141| DIAL_VOICE_MAIL_TYPE | 1 | Voice mail.| 5142| DIAL_OTT_TYPE | 2 | OTT. | 5143 5144## RejectMessageOptions<sup>7+</sup> 5145 5146Defines options for the call rejection message. 5147 5148**System API**: This is a system API. 5149 5150**System capability**: SystemCapability.Telephony.CallManager 5151 5152| Name | Type | Mandatory| Description | 5153| -------------- | ------ | ---- | -------- | 5154| messageContent | string | Yes | Message content.| 5155 5156## CallTransferResult<sup>8+</sup> 5157 5158Defines the call transfer result. 5159 5160**System API**: This is a system API. 5161 5162**System capability**: SystemCapability.Telephony.CallManager 5163 5164| Name | Type | Mandatory| Description | 5165| ------------------------ | ---------------------------------- | ---- | ---------------- | 5166| status | [TransferStatus](#transferstatus8) | Yes | Call transfer status. | 5167| number | string | Yes | Call transfer number. | 5168| startHour<sup>9+</sup> | number | Yes | Hour in the start time.| 5169| startMinute<sup>9+</sup> | number | Yes | Minute in the start time.| 5170| endHour<sup>9+</sup> | number | Yes | Hour in the end time.| 5171| endMinute<sup>9+</sup> | number | Yes | Minute in the end time.| 5172 5173## CallWaitingStatus<sup>7+</sup> 5174 5175Enumerates call waiting states. 5176 5177**System API**: This is a system API. 5178 5179**System capability**: SystemCapability.Telephony.CallManager 5180 5181| Name | Value | Description | 5182| -------------------- | ---- | ------------ | 5183| CALL_WAITING_DISABLE | 0 | Call waiting disabled.| 5184| CALL_WAITING_ENABLE | 1 | Call waiting enabled.| 5185 5186## RestrictionStatus<sup>8+</sup> 5187 5188Enumerates call restriction states. 5189 5190**System API**: This is a system API. 5191 5192**System capability**: SystemCapability.Telephony.CallManager 5193 5194| Name | Value | Description | 5195| ------------------- | ---- | -------- | 5196| RESTRICTION_DISABLE | 0 | Call restriction disabled.| 5197| RESTRICTION_ENABLE | 1 | Call restriction enabled.| 5198 5199## TransferStatus<sup>8+</sup> 5200 5201Enumerates call transfer states. 5202 5203**System API**: This is a system API. 5204 5205**System capability**: SystemCapability.Telephony.CallManager 5206 5207| Name | Value | Description | 5208| ---------------- | ---- | -------- | 5209| TRANSFER_DISABLE | 0 | Call transfer disabled.| 5210| TRANSFER_ENABLE | 1 | Call transfer enabled.| 5211 5212## DisconnectedDetails<sup>9+</sup> 5213 5214Defines the call disconnection cause. 5215 5216**System API**: This is a system API. 5217 5218**System capability**: SystemCapability.Telephony.CallManager 5219 5220| Name | Type | Mandatory| Description | 5221| ------- | ------------------------------------------ | ---- | --------------- | 5222| reason | [DisconnectedReason](#disconnectedreason8) | Yes | Call disconnection cause. | 5223| message | string | Yes | Call ending message.| 5224 5225## DisconnectedReason<sup>8+</sup> 5226 5227Enumerates call disconnection causes. 5228 5229**System API**: This is a system API. 5230 5231**System capability**: SystemCapability.Telephony.CallManager 5232 5233| Name | Value | Description | 5234| ------------------------------------------------------------ | ---- | --------------------------------------- | 5235| UNASSIGNED_NUMBER | 1 | Unallocated (unassigned) number. | 5236| NO_ROUTE_TO_DESTINATION | 3 | No route to destination. | 5237| CHANNEL_UNACCEPTABLE | 6 | Channel unacceptable. | 5238| OPERATOR_DETERMINED_BARRING | 8 | Operator determined barring (ODB). | 5239| CALL_COMPLETED_ELSEWHERE<sup>9+</sup> | 13 | Call completed elsewhere. | 5240| NORMAL_CALL_CLEARING | 16 | Normal call clearing. | 5241| USER_BUSY | 17 | User busy. | 5242| NO_USER_RESPONDING | 18 | No user responding. | 5243| USER_ALERTING_NO_ANSWER | 19 | User alerting, no answer. | 5244| CALL_REJECTED | 21 | Call rejected. | 5245| NUMBER_CHANGED | 22 | Number changed. | 5246| CALL_REJECTED_DUE_TO_FEATURE_AT_THE_DESTINATION<sup>9+</sup> | 24 | Call rejected due to feature at the destination.| 5247| FAILED_PRE_EMPTION<sup>9+</sup> | 25 | Failed preemption. | 5248| NON_SELECTED_USER_CLEARING<sup>9+</sup> | 26 | Non-selected user clearing. | 5249| DESTINATION_OUT_OF_ORDER | 27 | Destination out of order. | 5250| INVALID_NUMBER_FORMAT | 28 | Invalid number format (incomplete number). | 5251| FACILITY_REJECTED<sup>9+</sup> | 29 | Facility rejected. | 5252| RESPONSE_TO_STATUS_ENQUIRY<sup>9+</sup> | 30 | Response to status enquiry. | 5253| NORMAL_UNSPECIFIED<sup>9+</sup> | 31 | Normal, unspecified. | 5254| NO_CIRCUIT_CHANNEL_AVAILABLE<sup>9+</sup> | 34 | No circuit/channel available. | 5255| NETWORK_OUT_OF_ORDER | 38 | Network fault. | 5256| TEMPORARY_FAILURE | 41 | Temporary failure. | 5257| SWITCHING_EQUIPMENT_CONGESTION<sup>9+</sup> | 42 | Switching equipment congestion. | 5258| ACCESS_INFORMATION_DISCARDED<sup>9+</sup> | 43 | Access information discarded. | 5259| REQUEST_CIRCUIT_CHANNEL_NOT_AVAILABLE<sup>9+</sup> | 44 | Requested circuit/channel unavailable | 5260| RESOURCES_UNAVAILABLE_UNSPECIFIED<sup>9+</sup> | 47 | Resources unavailable, unspecified. | 5261| QUALITY_OF_SERVICE_UNAVAILABLE<sup>9+</sup> | 49 | QoS unavailable. | 5262| REQUESTED_FACILITY_NOT_SUBSCRIBED<sup>9+</sup> | 50 | Requested facility not subscribed. | 5263| INCOMING_CALLS_BARRED_WITHIN_THE_CUG<sup>9+</sup> | 55 | Incoming calls barred within the CUG. | 5264| BEARER_CAPABILITY_NOT_AUTHORIZED<sup>9+</sup> | 57 | Bearer capability not authorized. | 5265| BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE<sup>9+</sup> | 58 | Bearer capability presently available. | 5266| SERVICE_OR_OPTION_NOT_AVAILABLE_UNSPECIFIED<sup>9+</sup> | 63 | Service or option not available, unspecified. | 5267| BEARER_SERVICE_NOT_IMPLEMENTED<sup>9+</sup> | 65 | Bearer service not implemented. | 5268| ACM_EQUALTO_OR_GREATER_THAN_THE_MAXIMUM_VALUE<sup>9+</sup> | 68 | ACM greater than or equal to the maximum value. | 5269| REQUESTED_FACILITY_NOT_IMPLEMENTED<sup>9+</sup> | 69 | Requested facility not implemented. | 5270| ONLY_RESTRICTED_DIGITAL_INFO_BEARER_CAPABILITY_IS_AVAILABLE<sup>9+</sup> | 70 | Only restricted digital information bearer capability available. | 5271| SERVICE_OR_OPTION_NOT_IMPLEMENTED_UNSPECIFIED<sup>9+</sup> | 79 | Service or option not implemented, unspecified. | 5272| INVALID_TRANSACTION_IDENTIFIER_VALUE<sup>9+</sup> | 81 | Invalid transaction identifier value. | 5273| USER_NOT_MEMBER_OF_CUG<sup>9+</sup> | 87 | User not member of CUG. | 5274| INCOMPATIBLE_DESTINATION<sup>9+</sup> | 88 | Incompatible destination. | 5275| INVALID_TRANSIT_NETWORK_SELECTION<sup>9+</sup> | 91 | Invalid transit network selection. | 5276| SEMANTICALLY_INCORRECT_MESSAGE<sup>9+</sup> | 95 | Semantically incorrect message. | 5277| INVALID_MANDATORY_INFORMATION<sup>9+</sup> | 96 | Invalid mandatory information. | 5278| MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED<sup>9+</sup> | 97 | Message type non-existent or not implemented. | 5279| MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE<sup>9+</sup> | 98 | Message type not compatible with protocol state. | 5280| INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED<sup>9+</sup> | 99 | IE non-existent or not implemented. | 5281| CONDITIONAL_IE_ERROR<sup>9+</sup> | 100 | Conditional IE error. | 5282| MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE<sup>9+</sup> | 101 | Message not compatible with protocol state. | 5283| RECOVERY_ON_TIMER_EXPIRED<sup>9+</sup> | 102 | Recovery on timer expiry. | 5284| PROTOCOL_ERROR_UNSPECIFIED<sup>9+</sup> | 111 | Protocol error, unspecified. | 5285| INTERWORKING_UNSPECIFIED<sup>9+</sup> | 127 | Interworking, unspecified. | 5286| CALL_BARRED<sup>9+</sup> | 240 | Call barred. | 5287| FDN_BLOCKED<sup>9+</sup> | 241 | FDN blocked. | 5288| IMSI_UNKNOWN_IN_VLR<sup>9+</sup> | 242 | IMSI unknown in VLR. | 5289| IMEI_NOT_ACCEPTED<sup>9+</sup> | 243 | IMEI not accepted. | 5290| DIAL_MODIFIED_TO_USSD<sup>9+</sup> | 244 | Dial request modified to USSD request. | 5291| DIAL_MODIFIED_TO_SS<sup>9+</sup> | 245 | Dial request modified to SS request. | 5292| DIAL_MODIFIED_TO_DIAL<sup>9+</sup> | 246 | Dial request modified to dial with different number. | 5293| RADIO_OFF<sup>9+</sup> | 247 | Radio off. | 5294| OUT_OF_SERVICE<sup>9+</sup> | 248 | Out of service. | 5295| NO_VALID_SIM<sup>9+</sup> | 249 | No valid SIM. | 5296| RADIO_INTERNAL_ERROR<sup>9+</sup> | 250 | Radio internal error. | 5297| NETWORK_RESP_TIMEOUT<sup>9+</sup> | 251 | Network response timeout. | 5298| NETWORK_REJECT<sup>9+</sup> | 252 | Request rejected by network. | 5299| RADIO_ACCESS_FAILURE<sup>9+</sup> | 253 | Radio access failure. | 5300| RADIO_LINK_FAILURE<sup>9+</sup> | 254 | Radio link failure. | 5301| RADIO_LINK_LOST<sup>9+</sup> | 255 | Radio link lost. | 5302| RADIO_UPLINK_FAILURE<sup>9+</sup> | 256 | Radio uplink failure. | 5303| RADIO_SETUP_FAILURE<sup>9+</sup> | 257 | Radio setup failure. | 5304| RADIO_RELEASE_NORMAL<sup>9+</sup> | 258 | Radio release normal. | 5305| RADIO_RELEASE_ABNORMAL<sup>9+</sup> | 259 | Radio release abnormal. | 5306| ACCESS_CLASS_BLOCKED<sup>9+</sup> | 260 | Access class blocked. | 5307| NETWORK_DETACH<sup>9+</sup> | 261 | Network detached. | 5308| INVALID_PARAMETER | 1025 | Invalid parameter. | 5309| SIM_NOT_EXIT | 1026 | SIM not exit. | 5310| SIM_PIN_NEED | 1027 | SIM PIN needed. | 5311| CALL_NOT_ALLOW | 1029 | Call not allowed. | 5312| SIM_INVALID | 1045 | No valid SIM. | 5313| UNKNOWN | 1279 | Unknown reason. | 5314 5315## MmiCodeResults<sup>9+</sup> 5316 5317Defines the MMI code result. 5318 5319**System API**: This is a system API. 5320 5321**System capability**: SystemCapability.Telephony.CallManager 5322 5323| Name | Type | Mandatory| Description | 5324| ------- | -------------------------------- | ---- | --------------- | 5325| result | [MmiCodeResult](#mmicoderesult9) | Yes | MMI code result.| 5326| message | string | Yes | MMI code message.| 5327 5328## MmiCodeResult<sup>9+</sup> 5329 5330Defines the MMI code result. 5331 5332**System API**: This is a system API. 5333 5334**System capability**: SystemCapability.Telephony.CallManager 5335 5336| Name | Value | Description | 5337| ---------------- | ---- | ------------- | 5338| MMI_CODE_SUCCESS | 0 | Success.| 5339| MMI_CODE_FAILED | 1 | Failure.| 5340 5341## call.answerCall<sup>11+</sup> 5342 5343answerCall(videoState: VideoStateType, callId: number\): Promise\<void\> 5344 5345Answers a call. This API uses a promise to return the result. 5346 5347**System API**: This is a system API. 5348 5349**Required permission**: ohos.permission.ANSWER_CALL 5350 5351**System capability**: SystemCapability.Telephony.CallManager 5352 5353**Parameters** 5354 5355| Name | Type | Mandatory| Description | 5356| ----------------------- | ------------------- | ---- | ------------------------------------------------------------ | 5357| videoState| [VideoStateType](#videostatetype7)| Yes | Video state. | 5358| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. | 5359 5360**Return value** 5361 5362| Type | Description | 5363| ------------------- | --------------------------- | 5364| Promise<void> | Promise used to return the result.| 5365 5366**Error codes** 5367 5368For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5369 5370| ID| Error Message | 5371| -------- | -------------------------------------------- | 5372| 201 | Permission denied. | 5373| 202 | Non-system applications use system APIs. | 5374| 401 | Parameter error. | 5375| 8300001 | Invalid parameter value. | 5376| 8300002 | Operation failed. Cannot connect to service. | 5377| 8300003 | System internal error. | 5378| 8300999 | Unknown error code. | 5379 5380**Example** 5381 5382```ts 5383import { BusinessError } from '@ohos.base'; 5384 5385call.answerCall(0, 1).then(() => { 5386 console.log(`answerCall success.`); 5387}).catch((err: BusinessError) => { 5388 console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`); 5389}); 5390``` 5391 5392## call.cancelCallUpgrade<sup>11+</sup> 5393 5394cancelCallUpgrade\(callId: number\): Promise\<void\> 5395 5396Cancels the upgrade of a video call. This API uses a promise to return the result. 5397 5398**System API**: This is a system API. 5399 5400**Required Permissions**: ohos.permission.PLACE_CALL 5401 5402**System capability**: SystemCapability.Telephony.CallManager 5403 5404**Parameters** 5405 5406| Name| Type | Mandatory| Description | 5407| ------ | ---------------------------- | ---- | -------------- | 5408| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.| 5409 5410**Return value** 5411 5412| Type | Description | 5413| ------------------- | --------------------------- | 5414| Promise<void> | Promise used to return the result.| 5415 5416**Error codes** 5417 5418For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5419 5420| ID| Error Message | 5421| -------- | -------------------------------------------- | 5422| 201 | Permission denied. | 5423| 202 | Non-system applications use system APIs. | 5424| 401 | Parameter error. | 5425| 8300001 | Invalid parameter value. | 5426| 8300002 | Operation failed. Cannot connect to service. | 5427| 8300003 | System internal error. | 5428| 8300999 | Unknown error code. | 5429 5430**Example** 5431 5432```ts 5433import { BusinessError } from '@ohos.base'; 5434 5435call.cancelCallUpgrade(1).then(() => { 5436 console.log(`cancelCallUpgrade success.`); 5437}).catch((err: BusinessError) => { 5438 console.error(`cancelCallUpgrade fail, promise: err->${JSON.stringify(err)}`); 5439}); 5440``` 5441 5442## call.controlCamera<sup>11+</sup> 5443 5444controlCamera\(callId: number, cameraId: string\): Promise\<void\> 5445 5446Uses the specified camera to make a video call. If **cameraId** is left empty, the camera is disabled. This API uses a promise to return the result. 5447 5448**System API**: This is a system API. 5449 5450**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5451 5452**System capability**: SystemCapability.Telephony.CallManager 5453 5454**Parameters** 5455 5456| Name| Type | Mandatory| Description | 5457| ------ | ---------------------------- | ---- | -------------- | 5458| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. | 5459| cameraId | string | Yes | Camera ID. For details about how to obtain **cameraId**, see [Camera Management](../apis-camera-kit/js-apis-camera.md#getsupportedcameras).| 5460 5461**Return value** 5462 5463| Type | Description | 5464| ------------------- | --------------------------- | 5465| Promise<void> | Promise used to return the result of starting, closing, or switching a camera.| 5466 5467**Error codes** 5468 5469For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5470 5471| ID| Error Message | 5472| -------- | -------------------------------------------- | 5473| 201 | Permission denied. | 5474| 202 | Non-system applications use system APIs. | 5475| 401 | Parameter error. | 5476| 8300001 | Invalid parameter value. | 5477| 8300002 | Operation failed. Cannot connect to service. | 5478| 8300003 | System internal error. | 5479| 8300999 | Unknown error code. | 5480 5481**Example** 5482 5483```ts 5484import { BusinessError } from '@ohos.base'; 5485 5486call.controlCamera(1, "1").then(() => { 5487 console.log(`controlCamera success.`); 5488}).catch((err: BusinessError) => { 5489 console.error(`controlCamera fail, promise: err->${JSON.stringify(err)}`); 5490}); 5491``` 5492 5493## call.setPreviewSurface<sup>11+</sup> 5494 5495setPreviewSurface\(callId: number, surfaceId: string\): Promise\<void\> 5496 5497Sets the local preview window. This API uses a promise to return the result. 5498 5499**System API**: This is a system API. 5500 5501**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5502 5503**System capability**: SystemCapability.Telephony.CallManager 5504 5505**Parameters** 5506 5507| Name| Type | Mandatory| Description | 5508| ------ | ---------------------------- | ---- | -------------- | 5509| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. | 5510| surfaceId | string | Yes | Preview window ID. For details about how to obtain **surfaceId**, see [XComponent](../apis-arkui/arkui-ts/ts-basic-components-xcomponent.md#getxcomponentsurfaceid). | 5511 5512**Return value** 5513 5514| Type | Description | 5515| ------------------- | --------------------------- | 5516| Promise<void> | Promise used to return the result.| 5517 5518**Error codes** 5519 5520For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5521 5522| ID| Error Message | 5523| -------- | -------------------------------------------- | 5524| 201 | Permission denied. | 5525| 202 | Non-system applications use system APIs. | 5526| 401 | Parameter error. | 5527| 8300001 | Invalid parameter value. | 5528| 8300002 | Operation failed. Cannot connect to service. | 5529| 8300003 | System internal error. | 5530| 8300999 | Unknown error code. | 5531 5532**Example** 5533 5534```ts 5535import { BusinessError } from '@ohos.base'; 5536 5537call.setPreviewSurface(1, "surfaceId1").then(() => { 5538 console.log(`setPreviewSurface success.`); 5539}).catch((err: BusinessError) => { 5540 console.error(`setPreviewSurface fail, promise: err->${JSON.stringify(err)}`); 5541}); 5542``` 5543 5544## call.setDisplaySurface<sup>11+</sup> 5545 5546setDisplaySurface\(callId: number, surfaceId: string\): Promise\<void\> 5547 5548Sets the remote display window. This API uses a promise to return the result. 5549 5550**System API**: This is a system API. 5551 5552**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5553 5554**System capability**: SystemCapability.Telephony.CallManager 5555 5556**Parameters** 5557 5558| Name| Type | Mandatory| Description | 5559| ------ | ---------------------------- | ---- | -------------- | 5560| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. | 5561| surfaceId | string | Yes | Display window ID. For details about how to obtain **surfaceId**, see [XComponent](../apis-arkui/arkui-ts/ts-basic-components-xcomponent.md#getxcomponentsurfaceid). | 5562 5563**Return value** 5564 5565| Type | Description | 5566| ------------------- | --------------------------- | 5567| Promise<void> | Promise used to return the result.| 5568 5569**Error codes** 5570 5571For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5572 5573| ID| Error Message | 5574| -------- | -------------------------------------------- | 5575| 201 | Permission denied. | 5576| 202 | Non-system applications use system APIs. | 5577| 401 | Parameter error. | 5578| 8300001 | Invalid parameter value. | 5579| 8300002 | Operation failed. Cannot connect to service. | 5580| 8300003 | System internal error. | 5581| 8300999 | Unknown error code. | 5582 5583**Example** 5584 5585```ts 5586import { BusinessError } from '@ohos.base'; 5587 5588call.setDisplaySurface(1, "surfaceId1").then(() => { 5589 console.log(`setDisplaySurface success.`); 5590}).catch((err: BusinessError) => { 5591 console.error(`setDisplaySurface fail, promise: err->${JSON.stringify(err)}`); 5592}); 5593``` 5594 5595## call.setDeviceDirection<sup>11+</sup> 5596 5597setDeviceDirection\(callId: number, deviceDirection: DeviceDirection\): Promise\<void\> 5598 5599Sets the video image to follow the device direction. This API uses a promise to return the result. 5600 5601**System API**: This is a system API. 5602 5603**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5604 5605**System capability**: SystemCapability.Telephony.CallManager 5606 5607**Parameters** 5608 5609| Name| Type | Mandatory| Description | 5610| ------ | ----------------------------------------------- | ---- | -------------- | 5611| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.| 5612| deviceDirection | [DeviceDirection](#devicedirection11) | Yes | Device direction. It determines the direction of the video image. | 5613 5614**Return value** 5615 5616| Type | Description | 5617| ------------------- | --------------------------- | 5618| Promise<void> | Promise used to return the result.| 5619 5620**Error codes** 5621 5622For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5623 5624| ID| Error Message | 5625| -------- | -------------------------------------------- | 5626| 201 | Permission denied. | 5627| 202 | Non-system applications use system APIs. | 5628| 401 | Parameter error. | 5629| 8300001 | Invalid parameter value. | 5630| 8300002 | Operation failed. Cannot connect to service. | 5631| 8300003 | System internal error. | 5632| 8300999 | Unknown error code. | 5633 5634**Example** 5635 5636```ts 5637import { BusinessError } from '@ohos.base'; 5638 5639call.setDeviceDirection(1, 0).then(() => { 5640 console.log(`setDeviceDirection success.`); 5641}).catch((err: BusinessError) => { 5642 console.error(`setDeviceDirection fail, promise: err->${JSON.stringify(err)}`); 5643}); 5644``` 5645 5646## call.on('imsCallModeChange')<sup>11+</sup> 5647 5648on\(type: 'imsCallModeChange', callback: Callback\<ImsCallModeInfo\>\): void 5649 5650Subscribes to **imsCallModeChange** events. This API uses an asynchronous callback to return the result. 5651 5652**System API**: This is a system API. 5653 5654**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5655 5656**System capability**: SystemCapability.Telephony.CallManager 5657 5658**Parameters** 5659 5660| Name | Type | Mandatory| Description | 5661| -------- | ------------------------------------------ | ---- | -------------------------- | 5662| type | string | Yes | Call mode change. This field has a fixed value of **imsCallModeChange**.| 5663| callback | Callback<[ImsCallModeInfo](#imscallmode8)> | Yes | Callback used to return the result. | 5664 5665**Error codes** 5666 5667For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5668 5669| ID| Error Message | 5670| -------- | -------------------------------------------- | 5671| 201 | Permission denied. | 5672| 202 | Non-system applications use system APIs. | 5673| 401 | Parameter error. | 5674| 8300001 | Invalid parameter value. | 5675| 8300002 | Operation failed. Cannot connect to service. | 5676| 8300003 | System internal error. | 5677| 8300999 | Unknown error code. | 5678 5679**Example** 5680 5681```ts 5682import { BusinessError } from '@ohos.base'; 5683 5684call.on('imsCallModeChange', (data: call.ImsCallModeInfo) => { 5685 console.log(`callback: data->${JSON.stringify(data)}`); 5686}); 5687``` 5688 5689## call.off('imsCallModeChange')<sup>11+</sup> 5690 5691off\(type: 'imsCallModeChange', callback?: Callback\<ImsCallModeInfo\>\): void 5692 5693Unsubscribes from **imsCallModeChange** events. This API uses an asynchronous callback to return the result. 5694 5695**System API**: This is a system API. 5696 5697**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5698 5699**System capability**: SystemCapability.Telephony.CallManager 5700 5701**Parameters** 5702 5703| Name | Type | Mandatory| Description | 5704| -------- | ------------------------------------------ | ---- | ---------------------------------- | 5705| type | string | Yes | Call mode change. This field has a fixed value of **imsCallModeChange**.| 5706| callback | Callback<[ImsCallModeInfo](#imscallmode8)> | No | Callback used to return the result. If this field is not set, no subscription cancellation result will be received.| 5707 5708**Error codes** 5709 5710For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5711 5712| ID| Error Message | 5713| -------- | -------------------------------------------- | 5714| 201 | Permission denied. | 5715| 202 | Non-system applications use system APIs. | 5716| 401 | Parameter error. | 5717| 8300001 | Invalid parameter value. | 5718| 8300002 | Operation failed. Cannot connect to service. | 5719| 8300003 | System internal error. | 5720| 8300999 | Unknown error code. | 5721 5722**Example** 5723 5724```ts 5725import { BusinessError } from '@ohos.base'; 5726 5727call.off('imsCallModeChange', (data: call.ImsCallModeInfo) => { 5728 console.log(`callback: data->${JSON.stringify(data)}`); 5729}); 5730``` 5731 5732## call.on('callSessionEvent')<sup>11+</sup> 5733 5734on\(type: 'callSessionEvent', callback: Callback\<CallSessionEvent\>\): void 5735 5736Subscribes to **callSessionEvent** events. This API uses an asynchronous callback to return the result. 5737 5738**System API**: This is a system API. 5739 5740**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5741 5742**System capability**: SystemCapability.Telephony.CallManager 5743 5744**Parameters** 5745 5746| Name | Type | Mandatory| Description | 5747| -------- | ------------------------------------------------- | ---- | -------------------------- | 5748| type | string | Yes | Call session event. This field has a fixed value of **callSessionEvent**.| 5749| callback | Callback<[CallSessionEvent](#callsessionevent11)> | Yes | Callback used to return the result. | 5750 5751**Error codes** 5752 5753For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5754 5755| ID| Error Message | 5756| -------- | -------------------------------------------- | 5757| 201 | Permission denied. | 5758| 202 | Non-system applications use system APIs. | 5759| 401 | Parameter error. | 5760| 8300001 | Invalid parameter value. | 5761| 8300002 | Operation failed. Cannot connect to service. | 5762| 8300003 | System internal error. | 5763| 8300999 | Unknown error code. | 5764 5765**Example** 5766 5767```ts 5768import { BusinessError } from '@ohos.base'; 5769 5770call.on('callSessionEvent', (data: call.CallSessionEvent) => { 5771 console.log(`callback: data->${JSON.stringify(data)}`); 5772}); 5773``` 5774 5775## call.off('callSessionEvent')<sup>11+</sup> 5776 5777off\(type: 'callSessionEvent', callback?: Callback\<CallSessionEvent\>\): void 5778 5779Unsubscribes from **callSessionEvent** events. This API uses an asynchronous callback to return the result. 5780 5781**System API**: This is a system API. 5782 5783**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5784 5785**System capability**: SystemCapability.Telephony.CallManager 5786 5787**Parameters** 5788 5789| Name | Type | Mandatory| Description | 5790| -------- | ------------------------------------------ | ---- | ---------------------------------- | 5791| type | string | Yes | Call session event. This field has a fixed value of **callSessionEvent**.| 5792| callback | Callback<[CallSessionEvent](#callsessionevent11)> | No | Callback used to return the result. If this field is not set, no subscription cancellation result will be received.| 5793 5794**Error codes** 5795 5796For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5797 5798| ID| Error Message | 5799| -------- | -------------------------------------------- | 5800| 201 | Permission denied. | 5801| 202 | Non-system applications use system APIs. | 5802| 401 | Parameter error. | 5803| 8300001 | Invalid parameter value. | 5804| 8300002 | Operation failed. Cannot connect to service. | 5805| 8300003 | System internal error. | 5806| 8300999 | Unknown error code. | 5807 5808**Example** 5809 5810```ts 5811import { BusinessError } from '@ohos.base'; 5812 5813call.off('callSessionEvent', (data: call.CallSessionEvent) => { 5814 console.log(`callback: data->${JSON.stringify(data)}`); 5815}); 5816``` 5817 5818## call.on('peerDimensionsChange')<sup>11+</sup> 5819 5820on\(type: 'peerDimensionsChange', callback: Callback\<PeerDimensionsDetail\>\): void 5821 5822Subscribes to **peerDimensionsChange** events. This API uses an asynchronous callback to return the result. 5823 5824**System API**: This is a system API. 5825 5826**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5827 5828**System capability**: SystemCapability.Telephony.CallManager 5829 5830**Parameters** 5831 5832| Name | Type | Mandatory| Description | 5833| -------- | --------------------------------------------------------- | ---- | -------------------------- | 5834| type | string | Yes | Screen resolution change. This field has a fixed value of **peerDimensionsChange**.| 5835| callback | Callback<[PeerDimensionsDetail](#peerdimensionsdetail11)> | Yes | Callback used to return the result. | 5836 5837**Error codes** 5838 5839For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5840 5841| ID| Error Message | 5842| -------- | -------------------------------------------- | 5843| 201 | Permission denied. | 5844| 202 | Non-system applications use system APIs. | 5845| 401 | Parameter error. | 5846| 8300001 | Invalid parameter value. | 5847| 8300002 | Operation failed. Cannot connect to service. | 5848| 8300003 | System internal error. | 5849| 8300999 | Unknown error code. | 5850 5851**Example** 5852 5853```ts 5854import { BusinessError } from '@ohos.base'; 5855 5856call.on('peerDimensionsChange', (data: call.PeerDimensionsDetail) => { 5857 console.log(`callback: data->${JSON.stringify(data)}`); 5858}); 5859``` 5860 5861## call.off('peerDimensionsChange')<sup>11+</sup> 5862 5863off\(type: 'peerDimensionsChange', callback?: Callback\<PeerDimensionsDetail\>\): void 5864 5865Unsubscribes from **peerDimensionsChange** events. This API uses an asynchronous callback to return the result. 5866 5867**System API**: This is a system API. 5868 5869**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5870 5871**System capability**: SystemCapability.Telephony.CallManager 5872 5873**Parameters** 5874 5875| Name | Type | Mandatory| Description | 5876| -------- | --------------------------------------------------------- | ---- | -------------------------- | 5877| type | string | Yes | Screen resolution change. This field has a fixed value of **peerDimensionsChange**.| 5878| callback | Callback<[PeerDimensionsDetail](#peerdimensionsdetail11)> | No | Callback used to return the result. If this field is not set, no subscription cancellation result will be received. | 5879 5880**Error codes** 5881 5882For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5883 5884| ID| Error Message | 5885| -------- | -------------------------------------------- | 5886| 201 | Permission denied. | 5887| 202 | Non-system applications use system APIs. | 5888| 401 | Parameter error. | 5889| 8300001 | Invalid parameter value. | 5890| 8300002 | Operation failed. Cannot connect to service. | 5891| 8300003 | System internal error. | 5892| 8300999 | Unknown error code. | 5893 5894**Example** 5895 5896```ts 5897import { BusinessError } from '@ohos.base'; 5898 5899call.off('peerDimensionsChange', (data: call.PeerDimensionsDetail) => { 5900 console.log(`callback: data->${JSON.stringify(data)}`); 5901}); 5902``` 5903 5904## call.on('cameraCapabilitiesChange')<sup>11+</sup> 5905 5906on\(type: 'cameraCapabilitiesChange', callback: Callback\<CameraCapabilities\>\): void 5907 5908Subscribes to **cameraCapabilitiesChange** events. This API uses an asynchronous callback to return the result. 5909 5910**System API**: This is a system API. 5911 5912**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5913 5914**System capability**: SystemCapability.Telephony.CallManager 5915 5916**Parameters** 5917 5918| Name | Type | Mandatory| Description | 5919| -------- | ------------------------------------------------------| ---- | -------------------------- | 5920| type | string | Yes | Camera capability change. This field has a fixed value of **cameraCapabilitiesChange**.| 5921| callback | Callback<[CameraCapabilities](#cameracapabilities11)> | Yes | Callback used to return the result. | 5922 5923**Error codes** 5924 5925For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5926 5927| ID| Error Message | 5928| -------- | -------------------------------------------- | 5929| 201 | Permission denied. | 5930| 202 | Non-system applications use system APIs. | 5931| 401 | Parameter error. | 5932| 8300001 | Invalid parameter value. | 5933| 8300002 | Operation failed. Cannot connect to service. | 5934| 8300003 | System internal error. | 5935| 8300999 | Unknown error code. | 5936 5937**Example** 5938 5939```ts 5940call.on('cameraCapabilitiesChange', (data: call.CameraCapabilities) => { 5941 console.log(`callback: data->${JSON.stringify(data)}`); 5942}); 5943``` 5944 5945## call.off('cameraCapabilitiesChange')<sup>11+</sup> 5946 5947off\(type: 'cameraCapabilitiesChange', callback?: Callback\<CameraCapabilities\>\): void 5948 5949Unsubscribes from **cameraCapabilitiesChange** events. This API uses an asynchronous callback to return the result. 5950 5951**System API**: This is a system API. 5952 5953**Required permission**: ohos.permission.SET_TELEPHONY_STATE 5954 5955**System capability**: SystemCapability.Telephony.CallManager 5956 5957**Parameters** 5958 5959| Name | Type | Mandatory| Description | 5960| -------- | ----------------------------------------------------- | ---- | ---------------------------------- | 5961| type | string | Yes | Camera capability change. This field has a fixed value of **cameraCapabilitiesChange**.| 5962| callback | Callback<[CameraCapabilities](#cameracapabilities11)> | No | Callback used to return the result. If this field is not set, no subscription cancellation result will be received.| 5963 5964**Error codes** 5965 5966For details about the error codes, see [ohos.telephony (Telephony) Error Codes](errorcode-telephony.md) and [Universal Error Codes](../errorcode-universal.md). 5967 5968| ID| Error Message | 5969| -------- | -------------------------------------------- | 5970| 201 | Permission denied. | 5971| 202 | Non-system applications use system APIs. | 5972| 401 | Parameter error. | 5973| 8300001 | Invalid parameter value. | 5974| 8300002 | Operation failed. Cannot connect to service. | 5975| 8300003 | System internal error. | 5976| 8300999 | Unknown error code. | 5977 5978**Example** 5979 5980```ts 5981call.off('cameraCapabilitiesChange', (data: call.CameraCapabilities) => { 5982 console.log(`callback: data->${JSON.stringify(data)}`); 5983}); 5984``` 5985 5986## VideoRequestResultType<sup>11+</sup> 5987 5988Enumerates video call upgrade or downgrade request types. 5989 5990**System API**: This is a system API. 5991 5992**System capability**: SystemCapability.Telephony.CallManager 5993 5994| Name | Value | Description | 5995| ------------------------------------------ | ------ | --------| 5996| TYPE_REQUEST_SUCCESS | 0 | Success.| 5997| TYPE_REQUEST_FAILURE | 1 | Failed.| 5998| TYPE_REQUEST_INVALID | 2 | Invalid request.| 5999| TYPE_REQUEST_TIMED_OUT | 3 | Request timeout.| 6000| TYPE_REQUEST_REJECTED_BY_REMOTE | 4 | Request denied.| 6001| TYPE_REQUEST_UPGRADE_CANCELED | 5 | Upgrade request canceled.| 6002| TYPE_DOWNGRADE_RTP_OR_RTCP_TIMEOUT | 100 | RTP or RTCP downgrade timeout.| 6003| TYPE_DOWNGRADE_RTP_AND_RTCP_TIMEOUT | 101 | RTP and RTCP downgrade timeout.| 6004 6005## DeviceDirection<sup>11+</sup> 6006 6007Enumerates device directions in a video call. 6008 6009**System API**: This is a system API. 6010 6011**System capability**: SystemCapability.Telephony.CallManager 6012 6013| Name | Value | Description | 6014| -------------------- | ------ | --------| 6015| DEVICE_DIRECTION_0 | 0 | 0-degree direction.| 6016| DEVICE_DIRECTION_90 | 90 | 90-degree direction.| 6017| DEVICE_DIRECTION_180 | 180 | 180-degree direction.| 6018| DEVICE_DIRECTION_270 | 270 | 270-degree direction.| 6019 6020## CallSessionEventId<sup>11+</sup> 6021 6022Enumerates video call event types. 6023 6024**System API**: This is a system API. 6025 6026**System capability**: SystemCapability.Telephony.CallManager 6027 6028| Name | Value | Description | 6029| ------------------------------ | ------ | --------| 6030| EVENT_CONTROL_CAMERA_FAILURE | 0 | Camera setting failed.| 6031| EVENT_CONTROL_CAMERA_READY | 1 | Camera setting succeeded.| 6032| EVENT_DISPLAY_SURFACE_RELEASED | 100 | Remote display window released.| 6033| EVENT_PREVIEW_SURFACE_RELEASED | 101 | Local preview window released.| 6034 6035## ImsCallModeInfo<sup>11+</sup> 6036 6037Defines the video call mode information. 6038 6039**System API**: This is a system API. 6040 6041**System capability**: SystemCapability.Telephony.CallManager 6042 6043| Name | Type | Mandatory| Description | 6044| ------- | -------------------------------------------------- | ---- | ------------- | 6045| callId | number | Yes | Call ID. | 6046| isRequestInfo| boolean | Yes | Whether the information is request information.| 6047| imsCallMode | [ImsCallMode](#imscallmode8) | Yes | Video call mode. | 6048| result | [VideoRequestResultType](#videorequestresulttype11)| Yes | Call ending message.| 6049 6050## CallSessionEvent<sup>11+</sup> 6051 6052Defines the video call event information. 6053 6054**System API**: This is a system API. 6055 6056**System capability**: SystemCapability.Telephony.CallManager 6057 6058| Name | Type | Mandatory| Description | 6059| ------- | -------------------------------------------------- | ---- | ------------- | 6060| callId | number | Yes | Call ID. | 6061| eventId | [CallSessionEventId](#callsessioneventid11) | Yes | Video call event. | 6062 6063## PeerDimensionsDetail<sup>11+</sup> 6064 6065Defines the peer image resolution in a video call. 6066 6067**System API**: This is a system API. 6068 6069**System capability**: SystemCapability.Telephony.CallManager 6070 6071| Name | Type | Mandatory| Description | 6072| ------- | ------------ | ---- | ------------- | 6073| callId | number | Yes | Call ID. | 6074| width | number | Yes | Width of the peer image, in pixels. | 6075| height | number | Yes | Height of the peer image, in pixels. | 6076 6077## CameraCapabilities<sup>11+</sup> 6078 6079Defines the local image resolution in a video call. 6080 6081**System API**: This is a system API. 6082 6083**System capability**: SystemCapability.Telephony.CallManager 6084 6085| Name | Type | Mandatory| Description | 6086| ------- | ------------ | ---- | ------------- | 6087| callId | number | Yes | Call ID. | 6088| width | number | Yes | Width of the local image, in pixels. | 6089| height | number | Yes | Height of the local image, in pixels. | 6090