changelog-telephony.md 6.3 KB
Newer Older
S
shawn_he 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
# 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.

**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>): void;
  function reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback<void>): void;
  function reject(callId?: number, options?: RejectMessageOptions): Promise<void>;
  function reject(callback: AsyncCallback<void>): void;
  function reject(options: RejectMessageOptions, callback: AsyncCallback<void>): void;
```

- Before change:

```js
  function reject(callId: number, callback: AsyncCallback<void>): void;
  function reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback<void>): void;
  function reject(callId?: number, options?: RejectMessageOptions): Promise<void>;
  function reject(callback: AsyncCallback<void>): void;
  function reject(options: RejectMessageOptions, callback: AsyncCallback<void>): void;
```

- After change:

```js
  function rejectCall(callId: number, callback: AsyncCallback<void>): void;
  function rejectCall(callId: number, options: RejectMessageOptions, callback: AsyncCallback<void>): void;
  function rejectCall(callId?: number, options?: RejectMessageOptions): Promise<void>;
  function rejectCall(callback: AsyncCallback<void>): void;
  function rejectCall(options: RejectMessageOptions, callback: AsyncCallback<void>): void;
```


**Adaptation Guide**

The `reject` API is deprecated and cannot be used  anymore. Use the `rejectCall` API instead.
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.

**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>): void;
  function answer(callId?: number): Promise<void>;
  function answer(callback: AsyncCallback<void>): void;
```

- Before change:

```js
  function answer(callId: number, callback: AsyncCallback<void>): void;
  function answer(callId?: number): Promise<void>;
  function answer(callback: AsyncCallback<void>): void;
```

- After change:

```js
  function answerCall(callId: number, callback: AsyncCallback<void>): void;
  function answerCall(callId?: number): Promise<void>;
  function answerCall(callback: AsyncCallback<void>): void;
```


**Adaptation Guide**

The `answer` API is deprecated and cannot be used  anymore. Use the `answerCall` API instead.
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.

**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>): void;
  function hangup(callId?: number): Promise<void>;
  function hangup(callback: AsyncCallback<void>): void;
```

- Before change:

```js
  function hangup(callId: number, callback: AsyncCallback<void>): void;
  function hangup(callId?: number): Promise<void>;
  function hangup(callback: AsyncCallback<void>): void;
```

- After change:

```js
  function hangUpCall(callId: number, callback: AsyncCallback<void>): void;
  function hangUpCall(callId?: number): Promise<void>;
  function hangUpCall(callback: AsyncCallback<void>): void;
```


**Adaptation Guide**

The `hangup` API is deprecated and cannot be used  anymore. Use the `hangUpCall` API instead.
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)}`);
});
```