# Telephony Subsystem Changelog ## cl.telephony.1 Call Module reject API Change Changed the `reject` API to the `rejectCall` API in the call module of the telephony subsystem since API version 9. You need to adapt your application based on the following information. **Change Impact** The `reject` API is deprecated and cannot be used anymore. Use the `rejectCall` API instead. Otherwise, relevant functions will be affected. - Involved APIs: ```js function reject(callId: number, callback: AsyncCallback): void; function reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback): void; function reject(callId?: number, options?: RejectMessageOptions): Promise; function reject(callback: AsyncCallback): void; function reject(options: RejectMessageOptions, callback: AsyncCallback): void; ``` - Before change: ```js function reject(callId: number, callback: AsyncCallback): void; function reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback): void; function reject(callId?: number, options?: RejectMessageOptions): Promise; function reject(callback: AsyncCallback): void; function reject(options: RejectMessageOptions, callback: AsyncCallback): void; ``` - After change: ```js function rejectCall(callId: number, callback: AsyncCallback): void; function rejectCall(callId: number, options: RejectMessageOptions, callback: AsyncCallback): void; function rejectCall(callId?: number, options?: RejectMessageOptions): Promise; function rejectCall(callback: AsyncCallback): void; function rejectCall(options: RejectMessageOptions, callback: AsyncCallback): void; ``` **Adaptation Guide** The `reject` API is deprecated and cannot be used anymore. Use the `rejectCall` API instead. Use the new API. The sample code is as follows: ```js call.rejectCall("138xxxxxxxx", (err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` ```js let rejectMessageOptions={ messageContent: "Unknown number blocked" } let promise = call.rejectCall(1, rejectMessageOptions); promise.then(data => { console.log(`rejectCall success, promise: data->${JSON.stringify(data)}`); }).catch(err => { console.error(`rejectCall fail, promise: err->${JSON.stringify(err)}`); }); ``` ```js let rejectMessageOptions={ messageContent: "Unknown number blocked" } let promise = call.rejectCall(1, rejectMessageOptions); promise.then(data => { console.log(`rejectCall success, promise: data->${JSON.stringify(data)}`); }).catch(err => { console.error(`rejectCall fail, promise: err->${JSON.stringify(err)}`); }); ``` ```js call.rejectCall((err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` ```js let rejectMessageOptions={ messageContent: "Unknown number blocked" } call.rejectCall(rejectMessageOptions, (err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` ## cl.telephony.2 Call Module answer API Change Changed the `answer` API to the `answerCall` API in the call module of the telephony subsystem since API version 9. You need to adapt your application based on the following information. **Change Impact** The `answer` API is deprecated and cannot be used anymore. Use the `answerCall` API instead. Otherwise, relevant functions will be affected. - Involved APIs: ```js function answer(callId: number, callback: AsyncCallback): void; function answer(callId?: number): Promise; function answer(callback: AsyncCallback): void; ``` - Before change: ```js function answer(callId: number, callback: AsyncCallback): void; function answer(callId?: number): Promise; function answer(callback: AsyncCallback): void; ``` - After change: ```js function answerCall(callId: number, callback: AsyncCallback): void; function answerCall(callId?: number): Promise; function answerCall(callback: AsyncCallback): void; ``` **Adaptation Guide** The `answer` API is deprecated and cannot be used anymore. Use the `answerCall` API instead. Use the new API. The sample code is as follows: ```js call.answerCall(1, (err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` ```js let promise = call.answerCall(1); promise.then(data => { console.log(`answerCall success, promise: data->${JSON.stringify(data)}`); }).catch(err => { console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`); }); ``` ```js call.answerCall((err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` ## cl.telephony.1 Call Module hangup API Change Changed the `hangup` API to the `hangUpCall` API in the call module of the telephony subsystem since API version 9. You need to adapt your application based on the following information. **Change Impact** The `hangup` API is deprecated and cannot be used anymore. Use the `hangUpCall` API instead. Otherwise, relevant functions will be affected. - Involved APIs: ```js function hangup(callId: number, callback: AsyncCallback): void; function hangup(callId?: number): Promise; function hangup(callback: AsyncCallback): void; ``` - Before change: ```js function hangup(callId: number, callback: AsyncCallback): void; function hangup(callId?: number): Promise; function hangup(callback: AsyncCallback): void; ``` - After change: ```js function hangUpCall(callId: number, callback: AsyncCallback): void; function hangUpCall(callId?: number): Promise; function hangUpCall(callback: AsyncCallback): void; ``` **Adaptation Guide** The `hangup` API is deprecated and cannot be used anymore. Use the `hangUpCall` API instead. Use the new API. The sample code is as follows: ```js call.hangUpCall(1, (err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` ```js let promise = call.hangUpCall(1); promise.then(data => { console.log(`hangUpCall success, promise: data->${JSON.stringify(data)}`); }).catch(err => { console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`); }); ``` ```js call.hangUpCall((err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ```