ringcentral-softphone 1.2.0 → 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 CHANGED
@@ -271,7 +271,8 @@ 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 `callSession.sipMessage.headers`.
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:
@@ -288,7 +289,7 @@ certificate validation errors when establishing a TLS connection.
288
289
  To bypass these errors, you can set the `ignoreTlsCertErrors` flag to `true`:
289
290
 
290
291
  ```ts
291
- const phone = new SoftPhone({
292
+ const softphone = new Softphone({
292
293
  ...
293
294
  ignoreTlsCertErrors: true
294
295
  });
@@ -324,6 +325,14 @@ Content below is for the maintainer/contributor of this SDK.
324
325
  - Caller Id feature is not supported. `P-Asserted-Identity` doesn't work. I
325
326
  think it is by design, since hardphone cannot support it.
326
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
+
327
336
  #### Code style
328
337
 
329
338
  We use `deno fmt && deno lint --fix` to format and lint all code.
@@ -5,5 +5,7 @@ declare class OutboundCallSession extends CallSession {
5
5
  constructor(softphone: Softphone, answerMessage: InboundMessage);
6
6
  init(): void;
7
7
  cancel(): Promise<void>;
8
+ get sessionId(): string;
9
+ get partyId(): string;
8
10
  }
9
11
  export default OutboundCallSession;
@@ -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;
@@ -5,5 +5,7 @@ declare class OutboundCallSession extends CallSession {
5
5
  constructor(softphone: Softphone, answerMessage: InboundMessage);
6
6
  init(): void;
7
7
  cancel(): Promise<void>;
8
+ get sessionId(): string;
9
+ get partyId(): string;
8
10
  }
9
11
  export default OutboundCallSession;
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ringcentral-softphone",
3
- "version": "1.2.0",
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",