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