1e41f4b71Sopenharmony_ci# Telephony Subsystem Changelog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci## cl.telephony.1 Call Module reject API Change 6e41f4b71Sopenharmony_ciChanged the `reject` API to the `rejectCall` API in the call module of the telephony subsystem since API version 9. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ciYou need to adapt your application. 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci**Change Impact** 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ciThe `reject` API is deprecated and cannot be used any more. Use the `rejectCall` API instead. Otherwise, relevant functions will be affected. 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci- Involved APIs: 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci```js 17e41f4b71Sopenharmony_ci function reject(callId: number, callback: AsyncCallback<void>): void; 18e41f4b71Sopenharmony_ci function reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback<void>): void; 19e41f4b71Sopenharmony_ci function reject(callId?: number, options?: RejectMessageOptions): Promise<void>; 20e41f4b71Sopenharmony_ci function reject(callback: AsyncCallback<void>): void; 21e41f4b71Sopenharmony_ci function reject(options: RejectMessageOptions, callback: AsyncCallback<void>): void; 22e41f4b71Sopenharmony_ci``` 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci- Before change: 25e41f4b71Sopenharmony_ci 26e41f4b71Sopenharmony_ci```js 27e41f4b71Sopenharmony_ci function reject(callId: number, callback: AsyncCallback<void>): void; 28e41f4b71Sopenharmony_ci function reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback<void>): void; 29e41f4b71Sopenharmony_ci function reject(callId?: number, options?: RejectMessageOptions): Promise<void>; 30e41f4b71Sopenharmony_ci function reject(callback: AsyncCallback<void>): void; 31e41f4b71Sopenharmony_ci function reject(options: RejectMessageOptions, callback: AsyncCallback<void>): void; 32e41f4b71Sopenharmony_ci``` 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci- After change: 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ci```js 37e41f4b71Sopenharmony_ci function rejectCall(callId: number, callback: AsyncCallback<void>): void; 38e41f4b71Sopenharmony_ci function rejectCall(callId: number, options: RejectMessageOptions, callback: AsyncCallback<void>): void; 39e41f4b71Sopenharmony_ci function rejectCall(callId?: number, options?: RejectMessageOptions): Promise<void>; 40e41f4b71Sopenharmony_ci function rejectCall(callback: AsyncCallback<void>): void; 41e41f4b71Sopenharmony_ci function rejectCall(options: RejectMessageOptions, callback: AsyncCallback<void>): void; 42e41f4b71Sopenharmony_ci``` 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci 45e41f4b71Sopenharmony_ci**Adaptation Guide** 46e41f4b71Sopenharmony_ci 47e41f4b71Sopenharmony_ciThe `reject` API is deprecated and cannot be used any more. Use the `rejectCall` API instead. 48e41f4b71Sopenharmony_ciUse the new API. The sample code is as follows: 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ci```js 51e41f4b71Sopenharmony_cicall.rejectCall("138xxxxxxxx", (err, data) => { 52e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 53e41f4b71Sopenharmony_ci}); 54e41f4b71Sopenharmony_ci``` 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ci```js 58e41f4b71Sopenharmony_cilet rejectMessageOptions={ 59e41f4b71Sopenharmony_ci messageContent: "Unknown number blocked" 60e41f4b71Sopenharmony_ci} 61e41f4b71Sopenharmony_cilet promise = call.rejectCall(1, rejectMessageOptions); 62e41f4b71Sopenharmony_cipromise.then(data => { 63e41f4b71Sopenharmony_ci console.log(`rejectCall success, promise: data->${JSON.stringify(data)}`); 64e41f4b71Sopenharmony_ci}).catch(err => { 65e41f4b71Sopenharmony_ci console.error(`rejectCall fail, promise: err->${JSON.stringify(err)}`); 66e41f4b71Sopenharmony_ci}); 67e41f4b71Sopenharmony_ci``` 68e41f4b71Sopenharmony_ci 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_ci```js 71e41f4b71Sopenharmony_cilet rejectMessageOptions={ 72e41f4b71Sopenharmony_ci messageContent: "Unknown number blocked" 73e41f4b71Sopenharmony_ci} 74e41f4b71Sopenharmony_cilet promise = call.rejectCall(1, rejectMessageOptions); 75e41f4b71Sopenharmony_cipromise.then(data => { 76e41f4b71Sopenharmony_ci console.log(`rejectCall success, promise: data->${JSON.stringify(data)}`); 77e41f4b71Sopenharmony_ci}).catch(err => { 78e41f4b71Sopenharmony_ci console.error(`rejectCall fail, promise: err->${JSON.stringify(err)}`); 79e41f4b71Sopenharmony_ci}); 80e41f4b71Sopenharmony_ci``` 81e41f4b71Sopenharmony_ci 82e41f4b71Sopenharmony_ci 83e41f4b71Sopenharmony_ci```js 84e41f4b71Sopenharmony_cicall.rejectCall((err, data) => { 85e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 86e41f4b71Sopenharmony_ci}); 87e41f4b71Sopenharmony_ci``` 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ci 90e41f4b71Sopenharmony_ci```js 91e41f4b71Sopenharmony_cilet rejectMessageOptions={ 92e41f4b71Sopenharmony_ci messageContent: "Unknown number blocked" 93e41f4b71Sopenharmony_ci} 94e41f4b71Sopenharmony_cicall.rejectCall(rejectMessageOptions, (err, data) => { 95e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 96e41f4b71Sopenharmony_ci}); 97e41f4b71Sopenharmony_ci``` 98e41f4b71Sopenharmony_ci 99e41f4b71Sopenharmony_ci 100e41f4b71Sopenharmony_ci## cl.telephony.2 Call Module answer API Change 101e41f4b71Sopenharmony_ciChanged the `answer` API to the `answerCall` API in the call module of the telephony subsystem since API version 9. 102e41f4b71Sopenharmony_ci 103e41f4b71Sopenharmony_ciYou need to adapt your application. 104e41f4b71Sopenharmony_ci 105e41f4b71Sopenharmony_ci**Change Impact** 106e41f4b71Sopenharmony_ci 107e41f4b71Sopenharmony_ciThe `answer` API is deprecated and cannot be used any more. Use the `answerCall` API instead. Otherwise, relevant functions will be affected. 108e41f4b71Sopenharmony_ci 109e41f4b71Sopenharmony_ci- Involved APIs: 110e41f4b71Sopenharmony_ci 111e41f4b71Sopenharmony_ci```js 112e41f4b71Sopenharmony_ci function answer(callId: number, callback: AsyncCallback<void>): void; 113e41f4b71Sopenharmony_ci function answer(callId?: number): Promise<void>; 114e41f4b71Sopenharmony_ci function answer(callback: AsyncCallback<void>): void; 115e41f4b71Sopenharmony_ci``` 116e41f4b71Sopenharmony_ci 117e41f4b71Sopenharmony_ci- Before change: 118e41f4b71Sopenharmony_ci 119e41f4b71Sopenharmony_ci```js 120e41f4b71Sopenharmony_ci function answer(callId: number, callback: AsyncCallback<void>): void; 121e41f4b71Sopenharmony_ci function answer(callId?: number): Promise<void>; 122e41f4b71Sopenharmony_ci function answer(callback: AsyncCallback<void>): void; 123e41f4b71Sopenharmony_ci``` 124e41f4b71Sopenharmony_ci 125e41f4b71Sopenharmony_ci- After change: 126e41f4b71Sopenharmony_ci 127e41f4b71Sopenharmony_ci```js 128e41f4b71Sopenharmony_ci function answerCall(callId: number, callback: AsyncCallback<void>): void; 129e41f4b71Sopenharmony_ci function answerCall(callId?: number): Promise<void>; 130e41f4b71Sopenharmony_ci function answerCall(callback: AsyncCallback<void>): void; 131e41f4b71Sopenharmony_ci``` 132e41f4b71Sopenharmony_ci 133e41f4b71Sopenharmony_ci 134e41f4b71Sopenharmony_ci**Adaptation Guide** 135e41f4b71Sopenharmony_ci 136e41f4b71Sopenharmony_ciThe `answer` API is deprecated and cannot be used any more. Use the `answerCall` API instead. 137e41f4b71Sopenharmony_ciUse the new API. The sample code is as follows: 138e41f4b71Sopenharmony_ci 139e41f4b71Sopenharmony_ci```js 140e41f4b71Sopenharmony_cicall.answerCall(1, (err, data) => { 141e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 142e41f4b71Sopenharmony_ci}); 143e41f4b71Sopenharmony_ci``` 144e41f4b71Sopenharmony_ci 145e41f4b71Sopenharmony_ci 146e41f4b71Sopenharmony_ci```js 147e41f4b71Sopenharmony_cilet promise = call.answerCall(1); 148e41f4b71Sopenharmony_cipromise.then(data => { 149e41f4b71Sopenharmony_ci console.log(`answerCall success, promise: data->${JSON.stringify(data)}`); 150e41f4b71Sopenharmony_ci}).catch(err => { 151e41f4b71Sopenharmony_ci console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`); 152e41f4b71Sopenharmony_ci}); 153e41f4b71Sopenharmony_ci``` 154e41f4b71Sopenharmony_ci 155e41f4b71Sopenharmony_ci 156e41f4b71Sopenharmony_ci```js 157e41f4b71Sopenharmony_cicall.answerCall((err, data) => { 158e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 159e41f4b71Sopenharmony_ci}); 160e41f4b71Sopenharmony_ci``` 161e41f4b71Sopenharmony_ci 162e41f4b71Sopenharmony_ci 163e41f4b71Sopenharmony_ci## cl.telephony.1 Call Module hangup API Change 164e41f4b71Sopenharmony_ciChanged the `hangup` API to the `hangUpCall` API in the call module of the telephony subsystem since API version 9. 165e41f4b71Sopenharmony_ci 166e41f4b71Sopenharmony_ciYou need to adapt your application. 167e41f4b71Sopenharmony_ci 168e41f4b71Sopenharmony_ci**Change Impact** 169e41f4b71Sopenharmony_ci 170e41f4b71Sopenharmony_ciThe `hangup` API is deprecated and cannot be used any more. Use the `hangUpCall` API instead. Otherwise, relevant functions will be affected. 171e41f4b71Sopenharmony_ci 172e41f4b71Sopenharmony_ci- Involved APIs: 173e41f4b71Sopenharmony_ci 174e41f4b71Sopenharmony_ci```js 175e41f4b71Sopenharmony_ci function hangup(callId: number, callback: AsyncCallback<void>): void; 176e41f4b71Sopenharmony_ci function hangup(callId?: number): Promise<void>; 177e41f4b71Sopenharmony_ci function hangup(callback: AsyncCallback<void>): void; 178e41f4b71Sopenharmony_ci``` 179e41f4b71Sopenharmony_ci 180e41f4b71Sopenharmony_ci- Before change: 181e41f4b71Sopenharmony_ci 182e41f4b71Sopenharmony_ci```js 183e41f4b71Sopenharmony_ci function hangup(callId: number, callback: AsyncCallback<void>): void; 184e41f4b71Sopenharmony_ci function hangup(callId?: number): Promise<void>; 185e41f4b71Sopenharmony_ci function hangup(callback: AsyncCallback<void>): void; 186e41f4b71Sopenharmony_ci``` 187e41f4b71Sopenharmony_ci 188e41f4b71Sopenharmony_ci- After change: 189e41f4b71Sopenharmony_ci 190e41f4b71Sopenharmony_ci```js 191e41f4b71Sopenharmony_ci function hangUpCall(callId: number, callback: AsyncCallback<void>): void; 192e41f4b71Sopenharmony_ci function hangUpCall(callId?: number): Promise<void>; 193e41f4b71Sopenharmony_ci function hangUpCall(callback: AsyncCallback<void>): void; 194e41f4b71Sopenharmony_ci``` 195e41f4b71Sopenharmony_ci 196e41f4b71Sopenharmony_ci 197e41f4b71Sopenharmony_ci**Adaptation Guide** 198e41f4b71Sopenharmony_ci 199e41f4b71Sopenharmony_ciThe `hangup` API is deprecated and cannot be used any more. Use the `hangUpCall` API instead. 200e41f4b71Sopenharmony_ciUse the new API. The sample code is as follows: 201e41f4b71Sopenharmony_ci 202e41f4b71Sopenharmony_ci```js 203e41f4b71Sopenharmony_cicall.hangUpCall(1, (err, data) => { 204e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 205e41f4b71Sopenharmony_ci}); 206e41f4b71Sopenharmony_ci``` 207e41f4b71Sopenharmony_ci 208e41f4b71Sopenharmony_ci 209e41f4b71Sopenharmony_ci```js 210e41f4b71Sopenharmony_cilet promise = call.hangUpCall(1); 211e41f4b71Sopenharmony_cipromise.then(data => { 212e41f4b71Sopenharmony_ci console.log(`hangUpCall success, promise: data->${JSON.stringify(data)}`); 213e41f4b71Sopenharmony_ci}).catch(err => { 214e41f4b71Sopenharmony_ci console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`); 215e41f4b71Sopenharmony_ci}); 216e41f4b71Sopenharmony_ci``` 217e41f4b71Sopenharmony_ci 218e41f4b71Sopenharmony_ci 219e41f4b71Sopenharmony_ci```js 220e41f4b71Sopenharmony_cicall.hangUpCall((err, data) => { 221e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 222e41f4b71Sopenharmony_ci}); 223e41f4b71Sopenharmony_ci``` 224