ringcentral-softphone 1.1.12 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -1
- package/dist/cjs/call-session/outbound.d.ts +2 -0
- package/dist/cjs/call-session/outbound.js +10 -0
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/types.d.ts +1 -0
- package/dist/esm/call-session/outbound.d.ts +2 -0
- package/dist/esm/call-session/outbound.js +10 -0
- package/dist/esm/index.js +5 -1
- package/dist/esm/types.d.ts +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -271,12 +271,34 @@ callSession1.on("rtpPacket", (rtpPacket: RtpPacket) => {
|
|
|
271
271
|
|
|
272
272
|
For outbound calls, you will be able to find header like this
|
|
273
273
|
`p-rc-api-ids: party-id=p-a0d17e323f0fez1953f50f90dz296e3440000-1;session-id=s-a0d17e323f0fez1953f50f90dz296e3440000`
|
|
274
|
-
from `
|
|
274
|
+
from `outbounCallSession.sipMessage.headers`. I have added two sugar methods:
|
|
275
|
+
`outboundCallSession.sessionId` and `outboundCallSession.partyId`.
|
|
275
276
|
|
|
276
277
|
However, for inbound calls, the server doesn't tell us anything about the
|
|
277
278
|
Telephony Session ID. Here is a workaround solution:
|
|
278
279
|
https://github.com/tylerlong/rc-softphone-call-id-test
|
|
279
280
|
|
|
281
|
+
## 🔧 `ignoreTlsCertErrors` (optional)
|
|
282
|
+
|
|
283
|
+
Most developers **do not need this option**.
|
|
284
|
+
|
|
285
|
+
However, in rare cases — such as testing in a **lab or development environment**
|
|
286
|
+
with self-signed or improperly configured TLS certificates — you may encounter
|
|
287
|
+
certificate validation errors when establishing a TLS connection.
|
|
288
|
+
|
|
289
|
+
To bypass these errors, you can set the `ignoreTlsCertErrors` flag to `true`:
|
|
290
|
+
|
|
291
|
+
```ts
|
|
292
|
+
const softphone = new Softphone({
|
|
293
|
+
...
|
|
294
|
+
ignoreTlsCertErrors: true
|
|
295
|
+
});
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
> ⚠️ Warning: Enabling this option disables certificate verification and makes
|
|
299
|
+
> the TLS connection vulnerable to man-in-the-middle (MITM) attacks. Use only in
|
|
300
|
+
> trusted, controlled environments — never in production.
|
|
301
|
+
|
|
280
302
|
## Troubleshooting (Common issues)
|
|
281
303
|
|
|
282
304
|
### `SIP/2.0 486 Busy Here` for outbound call
|
|
@@ -303,6 +325,14 @@ Content below is for the maintainer/contributor of this SDK.
|
|
|
303
325
|
- Caller Id feature is not supported. `P-Asserted-Identity` doesn't work. I
|
|
304
326
|
think it is by design, since hardphone cannot support it.
|
|
305
327
|
|
|
328
|
+
## Conferences
|
|
329
|
+
|
|
330
|
+
Conference involves RESTful API which is out of scope of this SDK. With this
|
|
331
|
+
being said, this SDK works well with conferences. Here is a
|
|
332
|
+
[demo project for this SDK work with conferences](https://github.com/tylerlong/softphone-invite-agent-to-conference-demo).
|
|
333
|
+
The demo is about making a call to a call queue number, it would be even simpler
|
|
334
|
+
if there is no call queue.
|
|
335
|
+
|
|
306
336
|
#### Code style
|
|
307
337
|
|
|
308
338
|
We use `deno fmt && deno lint --fix` to format and lint all code.
|
|
@@ -52,5 +52,15 @@ class OutboundCallSession extends index_js_1.default {
|
|
|
52
52
|
});
|
|
53
53
|
await this.softphone.send(requestMessage);
|
|
54
54
|
}
|
|
55
|
+
get sessionId() {
|
|
56
|
+
const header = this.sipMessage.headers["p-rc-api-ids"];
|
|
57
|
+
let match = header.match(/party-id=([^;]+);session-id=([^;]+)/);
|
|
58
|
+
return match[2];
|
|
59
|
+
}
|
|
60
|
+
get partyId() {
|
|
61
|
+
const header = this.sipMessage.headers["p-rc-api-ids"];
|
|
62
|
+
let match = header.match(/party-id=([^;]+);session-id=([^;]+)/);
|
|
63
|
+
return match[1];
|
|
64
|
+
}
|
|
55
65
|
}
|
|
56
66
|
exports.default = OutboundCallSession;
|
package/dist/cjs/index.js
CHANGED
|
@@ -39,7 +39,11 @@ class Softphone extends node_events_1.default {
|
|
|
39
39
|
this.sipInfo.outboundProxy = "sip10.ringcentral.com:5096";
|
|
40
40
|
}
|
|
41
41
|
const tokens = this.sipInfo.outboundProxy.split(":");
|
|
42
|
-
this.client = node_tls_1.default.connect({
|
|
42
|
+
this.client = node_tls_1.default.connect({
|
|
43
|
+
host: tokens[0],
|
|
44
|
+
port: parseInt(tokens[1], 10),
|
|
45
|
+
rejectUnauthorized: !this.sipInfo.ignoreTlsCertErrors,
|
|
46
|
+
}, () => {
|
|
43
47
|
this.connected = true;
|
|
44
48
|
});
|
|
45
49
|
let cache = "";
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -47,5 +47,15 @@ class OutboundCallSession extends CallSession {
|
|
|
47
47
|
});
|
|
48
48
|
await this.softphone.send(requestMessage);
|
|
49
49
|
}
|
|
50
|
+
get sessionId() {
|
|
51
|
+
const header = this.sipMessage.headers["p-rc-api-ids"];
|
|
52
|
+
let match = header.match(/party-id=([^;]+);session-id=([^;]+)/);
|
|
53
|
+
return match[2];
|
|
54
|
+
}
|
|
55
|
+
get partyId() {
|
|
56
|
+
const header = this.sipMessage.headers["p-rc-api-ids"];
|
|
57
|
+
let match = header.match(/party-id=([^;]+);session-id=([^;]+)/);
|
|
58
|
+
return match[1];
|
|
59
|
+
}
|
|
50
60
|
}
|
|
51
61
|
export default OutboundCallSession;
|
package/dist/esm/index.js
CHANGED
|
@@ -34,7 +34,11 @@ class Softphone extends EventEmitter {
|
|
|
34
34
|
this.sipInfo.outboundProxy = "sip10.ringcentral.com:5096";
|
|
35
35
|
}
|
|
36
36
|
const tokens = this.sipInfo.outboundProxy.split(":");
|
|
37
|
-
this.client = tls.connect({
|
|
37
|
+
this.client = tls.connect({
|
|
38
|
+
host: tokens[0],
|
|
39
|
+
port: parseInt(tokens[1], 10),
|
|
40
|
+
rejectUnauthorized: !this.sipInfo.ignoreTlsCertErrors,
|
|
41
|
+
}, () => {
|
|
38
42
|
this.connected = true;
|
|
39
43
|
});
|
|
40
44
|
let cache = "";
|
package/dist/esm/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ringcentral-softphone",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"homepage": "https://github.com/ringcentral/ringcentral-softphone-ts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"werift-rtp": "^0.8.4"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/node": "^
|
|
38
|
+
"@types/node": "^24.0.15",
|
|
39
39
|
"dotenv-override-true": "^6.2.2",
|
|
40
|
-
"tsx": "^4.
|
|
40
|
+
"tsx": "^4.20.3",
|
|
41
41
|
"typescript": "^5.8.3",
|
|
42
42
|
"yarn-upgrade-all": "^0.7.5"
|
|
43
43
|
},
|