ringcentral-softphone 1.3.0 → 1.3.2
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.
|
@@ -33,10 +33,11 @@ class Streamer extends node_events_1.default {
|
|
|
33
33
|
this.sendPacket();
|
|
34
34
|
}
|
|
35
35
|
get finished() {
|
|
36
|
-
return this.
|
|
36
|
+
return this.callSession.disposed ||
|
|
37
|
+
this.buffer.length < this.callSession.softphone.codec.packetSize;
|
|
37
38
|
}
|
|
38
39
|
sendPacket() {
|
|
39
|
-
if (!this.
|
|
40
|
+
if (!this.paused && !this.finished) {
|
|
40
41
|
const temp = this.callSession.encoder.encode(this.buffer.subarray(0, this.callSession.softphone.codec.packetSize));
|
|
41
42
|
const rtpPacket = new werift_rtp_1.RtpPacket(new werift_rtp_1.RtpHeader({
|
|
42
43
|
version: 2,
|
|
@@ -9,10 +9,15 @@ class ResponseMessage extends index_js_1.default {
|
|
|
9
9
|
constructor(inboundMessage, responseCode, headers = {}, body = "") {
|
|
10
10
|
super(undefined, { ...headers }, body);
|
|
11
11
|
this.subject = `SIP/2.0 ${responseCode} ${response_codes_js_1.default[responseCode]}`;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const requiredKeys = new Set(["via", "from", "to", "call-id", "cseq"]);
|
|
13
|
+
const allKeys = Object.keys(inboundMessage.headers).reduce((acc, key) => {
|
|
14
|
+
acc[key.toLowerCase()] = key;
|
|
15
|
+
return acc;
|
|
16
|
+
}, {});
|
|
17
|
+
for (const key of requiredKeys) {
|
|
18
|
+
if (allKeys[key]) {
|
|
19
|
+
const originalKey = allKeys[key];
|
|
20
|
+
this.headers[originalKey] = inboundMessage.headers[originalKey];
|
|
16
21
|
}
|
|
17
22
|
}
|
|
18
23
|
}
|
|
@@ -28,10 +28,11 @@ class Streamer extends EventEmitter {
|
|
|
28
28
|
this.sendPacket();
|
|
29
29
|
}
|
|
30
30
|
get finished() {
|
|
31
|
-
return this.
|
|
31
|
+
return this.callSession.disposed ||
|
|
32
|
+
this.buffer.length < this.callSession.softphone.codec.packetSize;
|
|
32
33
|
}
|
|
33
34
|
sendPacket() {
|
|
34
|
-
if (!this.
|
|
35
|
+
if (!this.paused && !this.finished) {
|
|
35
36
|
const temp = this.callSession.encoder.encode(this.buffer.subarray(0, this.callSession.softphone.codec.packetSize));
|
|
36
37
|
const rtpPacket = new RtpPacket(new RtpHeader({
|
|
37
38
|
version: 2,
|
|
@@ -4,10 +4,15 @@ class ResponseMessage extends OutboundMessage {
|
|
|
4
4
|
constructor(inboundMessage, responseCode, headers = {}, body = "") {
|
|
5
5
|
super(undefined, { ...headers }, body);
|
|
6
6
|
this.subject = `SIP/2.0 ${responseCode} ${responseCodes[responseCode]}`;
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const requiredKeys = new Set(["via", "from", "to", "call-id", "cseq"]);
|
|
8
|
+
const allKeys = Object.keys(inboundMessage.headers).reduce((acc, key) => {
|
|
9
|
+
acc[key.toLowerCase()] = key;
|
|
10
|
+
return acc;
|
|
11
|
+
}, {});
|
|
12
|
+
for (const key of requiredKeys) {
|
|
13
|
+
if (allKeys[key]) {
|
|
14
|
+
const originalKey = allKeys[key];
|
|
15
|
+
this.headers[originalKey] = inboundMessage.headers[originalKey];
|
|
11
16
|
}
|
|
12
17
|
}
|
|
13
18
|
}
|