ringcentral-softphone 1.4.0-beta.2 → 1.4.0-beta.3
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.
|
@@ -9,11 +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
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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];
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
23
|
}
|
|
@@ -4,11 +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
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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];
|
|
12
16
|
}
|
|
13
17
|
}
|
|
14
18
|
}
|