@webex/plugin-meetings 3.0.0-beta.315 → 3.0.0-beta.317
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/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meeting/in-meeting-actions.js +2 -0
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +4 -0
- package/dist/meeting/index.js.map +1 -1
- package/dist/rtcMetrics/index.js +25 -0
- package/dist/rtcMetrics/index.js.map +1 -1
- package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
- package/dist/types/rtcMetrics/index.d.ts +7 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +19 -19
- package/src/meeting/in-meeting-actions.ts +4 -0
- package/src/meeting/index.ts +4 -0
- package/src/rtcMetrics/index.ts +24 -0
- package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
- package/test/unit/spec/meeting/index.js +5 -0
- package/test/unit/spec/rtcMetrics/index.ts +20 -0
package/dist/rtcMetrics/index.js
CHANGED
|
@@ -6,10 +6,13 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
9
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
10
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
11
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
13
|
+
var _internalPluginMetrics = require("@webex/internal-plugin-metrics");
|
|
12
14
|
var _constants = _interopRequireDefault(require("./constants"));
|
|
15
|
+
/* eslint-disable class-methods-use-this */
|
|
13
16
|
/**
|
|
14
17
|
* Rtc Metrics
|
|
15
18
|
*/
|
|
@@ -66,6 +69,9 @@ var RtcMetrics = /*#__PURE__*/function () {
|
|
|
66
69
|
key: "addMetrics",
|
|
67
70
|
value: function addMetrics(data) {
|
|
68
71
|
if (data.payload.length) {
|
|
72
|
+
if (data.name === 'stats-report') {
|
|
73
|
+
data.payload = data.payload.map(this.anonymizeIp);
|
|
74
|
+
}
|
|
69
75
|
this.metricsQueue.push(data);
|
|
70
76
|
}
|
|
71
77
|
}
|
|
@@ -82,6 +88,25 @@ var RtcMetrics = /*#__PURE__*/function () {
|
|
|
82
88
|
clearInterval(this.intervalId);
|
|
83
89
|
}
|
|
84
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Anonymize IP addresses.
|
|
93
|
+
*
|
|
94
|
+
* @param {array} stats - An RTCStatsReport organized into an array of strings.
|
|
95
|
+
* @returns {string}
|
|
96
|
+
*/
|
|
97
|
+
}, {
|
|
98
|
+
key: "anonymizeIp",
|
|
99
|
+
value: function anonymizeIp(stats) {
|
|
100
|
+
var data = JSON.parse(stats);
|
|
101
|
+
// on local and remote candidates, anonymize the last 4 bits.
|
|
102
|
+
if (data.type === 'local-candidate' || data.type === 'remote-candidate') {
|
|
103
|
+
data.ip = _internalPluginMetrics.CallDiagnosticUtils.anonymizeIPAddress(data.ip) || undefined;
|
|
104
|
+
data.address = _internalPluginMetrics.CallDiagnosticUtils.anonymizeIPAddress(data.address) || undefined;
|
|
105
|
+
data.relatedAddress = _internalPluginMetrics.CallDiagnosticUtils.anonymizeIPAddress(data.relatedAddress) || undefined;
|
|
106
|
+
}
|
|
107
|
+
return (0, _stringify.default)(data);
|
|
108
|
+
}
|
|
109
|
+
|
|
85
110
|
/**
|
|
86
111
|
* Send metrics to the metrics service.
|
|
87
112
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RtcMetrics","webex","meetingId","correlationId","intervalId","window","setInterval","sendMetricsInQueue","bind","setTimeout","metricsQueue","length","sendMetrics","data","payload","push","clearInterval","request","method","service","resource","headers","
|
|
1
|
+
{"version":3,"names":["RtcMetrics","webex","meetingId","correlationId","intervalId","window","setInterval","sendMetricsInQueue","bind","setTimeout","metricsQueue","length","sendMetrics","data","payload","name","map","anonymizeIp","push","clearInterval","stats","JSON","parse","type","ip","CallDiagnosticUtils","anonymizeIPAddress","undefined","address","relatedAddress","request","method","service","resource","headers","appId","RTC_METRICS","APP_ID","body","metrics","version","userId","internal","device"],"sources":["index.ts"],"sourcesContent":["/* eslint-disable class-methods-use-this */\nimport {CallDiagnosticUtils} from '@webex/internal-plugin-metrics';\nimport RTC_METRICS from './constants';\n\n/**\n * Rtc Metrics\n */\nexport default class RtcMetrics {\n /**\n * Array of MetricData items to be sent to the metrics service.\n */\n metricsQueue = [];\n\n intervalId: number;\n\n webex: any;\n\n meetingId: string;\n\n correlationId: string;\n\n /**\n * Initialize the interval.\n *\n * @param {object} webex - The main `webex` object.\n * @param {string} meetingId - The meeting id.\n * @param {string} correlationId - The correlation id.\n */\n constructor(webex, meetingId, correlationId) {\n // `window` is used to prevent typescript from returning a NodeJS.Timer.\n this.intervalId = window.setInterval(this.sendMetricsInQueue.bind(this), 30 * 1000);\n this.meetingId = meetingId;\n this.webex = webex;\n this.correlationId = correlationId;\n // Send the first set of metrics at 5 seconds in the case of a user leaving the call shortly after joining.\n setTimeout(this.sendMetricsInQueue.bind(this), 5 * 1000);\n }\n\n /**\n * Check to see if the metrics queue has any items.\n *\n * @returns {void}\n */\n public sendMetricsInQueue() {\n if (this.metricsQueue.length) {\n this.sendMetrics();\n this.metricsQueue = [];\n }\n }\n\n /**\n * Add metrics items to the metrics queue.\n *\n * @param {object} data - An object with a payload array of metrics items.\n *\n * @returns {void}\n */\n addMetrics(data) {\n if (data.payload.length) {\n if (data.name === 'stats-report') {\n data.payload = data.payload.map(this.anonymizeIp);\n }\n this.metricsQueue.push(data);\n }\n }\n\n /**\n * Clear the metrics interval.\n *\n * @returns {void}\n */\n closeMetrics() {\n this.sendMetricsInQueue();\n clearInterval(this.intervalId);\n }\n\n /**\n * Anonymize IP addresses.\n *\n * @param {array} stats - An RTCStatsReport organized into an array of strings.\n * @returns {string}\n */\n anonymizeIp(stats: string): string {\n const data = JSON.parse(stats);\n // on local and remote candidates, anonymize the last 4 bits.\n if (data.type === 'local-candidate' || data.type === 'remote-candidate') {\n data.ip = CallDiagnosticUtils.anonymizeIPAddress(data.ip) || undefined;\n data.address = CallDiagnosticUtils.anonymizeIPAddress(data.address) || undefined;\n data.relatedAddress =\n CallDiagnosticUtils.anonymizeIPAddress(data.relatedAddress) || undefined;\n }\n\n return JSON.stringify(data);\n }\n\n /**\n * Send metrics to the metrics service.\n *\n * @returns {void}\n */\n private sendMetrics() {\n this.webex.request({\n method: 'POST',\n service: 'unifiedTelemetry',\n resource: 'metric/v2',\n headers: {\n type: 'webrtcMedia',\n appId: RTC_METRICS.APP_ID,\n },\n body: {\n metrics: [\n {\n type: 'webrtc',\n version: '1.0.1',\n userId: this.webex.internal.device.userId,\n meetingId: this.meetingId,\n correlationId: this.correlationId,\n data: this.metricsQueue,\n },\n ],\n },\n });\n }\n}\n"],"mappings":"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"}
|
|
@@ -68,6 +68,7 @@ interface IInMeetingActions {
|
|
|
68
68
|
canShareDesktop?: boolean;
|
|
69
69
|
canShareContent?: boolean;
|
|
70
70
|
canTransferFile?: boolean;
|
|
71
|
+
canChat?: boolean;
|
|
71
72
|
canDoVideo?: boolean;
|
|
72
73
|
canAnnotate?: boolean;
|
|
73
74
|
canUseVoip?: boolean;
|
|
@@ -142,6 +143,7 @@ export default class InMeetingActions implements IInMeetingActions {
|
|
|
142
143
|
canShareDesktop: any;
|
|
143
144
|
canShareContent: any;
|
|
144
145
|
canTransferFile: any;
|
|
146
|
+
canChat: any;
|
|
145
147
|
canDoVideo: any;
|
|
146
148
|
canAnnotate: any;
|
|
147
149
|
canUseVoip: any;
|
|
@@ -38,6 +38,13 @@ export default class RtcMetrics {
|
|
|
38
38
|
* @returns {void}
|
|
39
39
|
*/
|
|
40
40
|
closeMetrics(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Anonymize IP addresses.
|
|
43
|
+
*
|
|
44
|
+
* @param {array} stats - An RTCStatsReport organized into an array of strings.
|
|
45
|
+
* @returns {string}
|
|
46
|
+
*/
|
|
47
|
+
anonymizeIp(stats: string): string;
|
|
41
48
|
/**
|
|
42
49
|
* Send metrics to the metrics service.
|
|
43
50
|
*
|
package/dist/webinar/index.js
CHANGED
|
@@ -62,7 +62,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
|
|
|
62
62
|
updateCanManageWebcast: function updateCanManageWebcast(canManageWebcast) {
|
|
63
63
|
this.set('canManageWebcast', canManageWebcast);
|
|
64
64
|
},
|
|
65
|
-
version: "3.0.0-beta.
|
|
65
|
+
version: "3.0.0-beta.317"
|
|
66
66
|
});
|
|
67
67
|
var _default = Webinar;
|
|
68
68
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-meetings",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.317",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
|
|
6
6
|
"contributors": [
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@webex/plugin-meetings": "3.0.0-beta.
|
|
36
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
37
|
-
"@webex/test-helper-mocha": "3.0.0-beta.
|
|
38
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
39
|
-
"@webex/test-helper-retry": "3.0.0-beta.
|
|
40
|
-
"@webex/test-helper-test-users": "3.0.0-beta.
|
|
35
|
+
"@webex/plugin-meetings": "3.0.0-beta.317",
|
|
36
|
+
"@webex/test-helper-chai": "3.0.0-beta.317",
|
|
37
|
+
"@webex/test-helper-mocha": "3.0.0-beta.317",
|
|
38
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.317",
|
|
39
|
+
"@webex/test-helper-retry": "3.0.0-beta.317",
|
|
40
|
+
"@webex/test-helper-test-users": "3.0.0-beta.317",
|
|
41
41
|
"chai": "^4.3.4",
|
|
42
42
|
"chai-as-promised": "^7.1.1",
|
|
43
43
|
"jsdom-global": "3.0.2",
|
|
@@ -46,19 +46,19 @@
|
|
|
46
46
|
"typescript": "^4.7.4"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@webex/common": "3.0.0-beta.
|
|
49
|
+
"@webex/common": "3.0.0-beta.317",
|
|
50
50
|
"@webex/internal-media-core": "2.2.1",
|
|
51
|
-
"@webex/internal-plugin-conversation": "3.0.0-beta.
|
|
52
|
-
"@webex/internal-plugin-device": "3.0.0-beta.
|
|
53
|
-
"@webex/internal-plugin-llm": "3.0.0-beta.
|
|
54
|
-
"@webex/internal-plugin-mercury": "3.0.0-beta.
|
|
55
|
-
"@webex/internal-plugin-metrics": "3.0.0-beta.
|
|
56
|
-
"@webex/internal-plugin-support": "3.0.0-beta.
|
|
57
|
-
"@webex/internal-plugin-user": "3.0.0-beta.
|
|
58
|
-
"@webex/media-helpers": "3.0.0-beta.
|
|
59
|
-
"@webex/plugin-people": "3.0.0-beta.
|
|
60
|
-
"@webex/plugin-rooms": "3.0.0-beta.
|
|
61
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
51
|
+
"@webex/internal-plugin-conversation": "3.0.0-beta.317",
|
|
52
|
+
"@webex/internal-plugin-device": "3.0.0-beta.317",
|
|
53
|
+
"@webex/internal-plugin-llm": "3.0.0-beta.317",
|
|
54
|
+
"@webex/internal-plugin-mercury": "3.0.0-beta.317",
|
|
55
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.317",
|
|
56
|
+
"@webex/internal-plugin-support": "3.0.0-beta.317",
|
|
57
|
+
"@webex/internal-plugin-user": "3.0.0-beta.317",
|
|
58
|
+
"@webex/media-helpers": "3.0.0-beta.317",
|
|
59
|
+
"@webex/plugin-people": "3.0.0-beta.317",
|
|
60
|
+
"@webex/plugin-rooms": "3.0.0-beta.317",
|
|
61
|
+
"@webex/webex-core": "3.0.0-beta.317",
|
|
62
62
|
"ampersand-collection": "^2.0.2",
|
|
63
63
|
"bowser": "^2.11.0",
|
|
64
64
|
"btoa": "^1.2.1",
|
|
@@ -71,6 +71,7 @@ interface IInMeetingActions {
|
|
|
71
71
|
canShareDesktop?: boolean;
|
|
72
72
|
canShareContent?: boolean;
|
|
73
73
|
canTransferFile?: boolean;
|
|
74
|
+
canChat?: boolean;
|
|
74
75
|
canDoVideo?: boolean;
|
|
75
76
|
canAnnotate?: boolean;
|
|
76
77
|
canUseVoip?: boolean;
|
|
@@ -209,6 +210,8 @@ export default class InMeetingActions implements IInMeetingActions {
|
|
|
209
210
|
|
|
210
211
|
canTransferFile = null;
|
|
211
212
|
|
|
213
|
+
canChat = null;
|
|
214
|
+
|
|
212
215
|
canDoVideo = null;
|
|
213
216
|
|
|
214
217
|
canAnnotate = null;
|
|
@@ -288,6 +291,7 @@ export default class InMeetingActions implements IInMeetingActions {
|
|
|
288
291
|
canShareDesktop: this.canShareDesktop,
|
|
289
292
|
canShareContent: this.canShareContent,
|
|
290
293
|
canTransferFile: this.canTransferFile,
|
|
294
|
+
canChat: this.canChat,
|
|
291
295
|
canDoVideo: this.canDoVideo,
|
|
292
296
|
canAnnotate: this.canAnnotate,
|
|
293
297
|
canUseVoip: this.canUseVoip,
|
package/src/meeting/index.ts
CHANGED
|
@@ -3420,6 +3420,10 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3420
3420
|
requiredPolicies: [SELF_POLICY.SUPPORT_FILE_TRANSFER],
|
|
3421
3421
|
policies: this.selfUserPolicies,
|
|
3422
3422
|
}),
|
|
3423
|
+
canChat: ControlsOptionsUtil.hasPolicies({
|
|
3424
|
+
requiredPolicies: [SELF_POLICY.SUPPORT_CHAT],
|
|
3425
|
+
policies: this.selfUserPolicies,
|
|
3426
|
+
}),
|
|
3423
3427
|
canShareApplication:
|
|
3424
3428
|
(ControlsOptionsUtil.hasHints({
|
|
3425
3429
|
requiredHints: [DISPLAY_HINTS.SHARE_APPLICATION],
|
package/src/rtcMetrics/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable class-methods-use-this */
|
|
2
|
+
import {CallDiagnosticUtils} from '@webex/internal-plugin-metrics';
|
|
1
3
|
import RTC_METRICS from './constants';
|
|
2
4
|
|
|
3
5
|
/**
|
|
@@ -55,6 +57,9 @@ export default class RtcMetrics {
|
|
|
55
57
|
*/
|
|
56
58
|
addMetrics(data) {
|
|
57
59
|
if (data.payload.length) {
|
|
60
|
+
if (data.name === 'stats-report') {
|
|
61
|
+
data.payload = data.payload.map(this.anonymizeIp);
|
|
62
|
+
}
|
|
58
63
|
this.metricsQueue.push(data);
|
|
59
64
|
}
|
|
60
65
|
}
|
|
@@ -69,6 +74,25 @@ export default class RtcMetrics {
|
|
|
69
74
|
clearInterval(this.intervalId);
|
|
70
75
|
}
|
|
71
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Anonymize IP addresses.
|
|
79
|
+
*
|
|
80
|
+
* @param {array} stats - An RTCStatsReport organized into an array of strings.
|
|
81
|
+
* @returns {string}
|
|
82
|
+
*/
|
|
83
|
+
anonymizeIp(stats: string): string {
|
|
84
|
+
const data = JSON.parse(stats);
|
|
85
|
+
// on local and remote candidates, anonymize the last 4 bits.
|
|
86
|
+
if (data.type === 'local-candidate' || data.type === 'remote-candidate') {
|
|
87
|
+
data.ip = CallDiagnosticUtils.anonymizeIPAddress(data.ip) || undefined;
|
|
88
|
+
data.address = CallDiagnosticUtils.anonymizeIPAddress(data.address) || undefined;
|
|
89
|
+
data.relatedAddress =
|
|
90
|
+
CallDiagnosticUtils.anonymizeIPAddress(data.relatedAddress) || undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return JSON.stringify(data);
|
|
94
|
+
}
|
|
95
|
+
|
|
72
96
|
/**
|
|
73
97
|
* Send metrics to the metrics service.
|
|
74
98
|
*
|
|
@@ -67,6 +67,7 @@ describe('plugin-meetings', () => {
|
|
|
67
67
|
canShareDesktop: null,
|
|
68
68
|
canShareContent: null,
|
|
69
69
|
canTransferFile: null,
|
|
70
|
+
canChat: null,
|
|
70
71
|
canDoVideo: null,
|
|
71
72
|
canAnnotate: null,
|
|
72
73
|
canUseVoip: null,
|
|
@@ -145,6 +146,7 @@ describe('plugin-meetings', () => {
|
|
|
145
146
|
'canShareDesktop',
|
|
146
147
|
'canShareContent',
|
|
147
148
|
'canTransferFile',
|
|
149
|
+
'canChat',
|
|
148
150
|
'canDoVideo',
|
|
149
151
|
'canAnnotate',
|
|
150
152
|
'canUseVoip',
|
|
@@ -7528,6 +7528,11 @@ describe('plugin-meetings', () => {
|
|
|
7528
7528
|
requiredDisplayHints: [],
|
|
7529
7529
|
requiredPolicies: [SELF_POLICY.SUPPORT_FILE_TRANSFER],
|
|
7530
7530
|
},
|
|
7531
|
+
{
|
|
7532
|
+
actionName: 'canChat',
|
|
7533
|
+
requiredDisplayHints: [],
|
|
7534
|
+
requiredPolicies: [SELF_POLICY.SUPPORT_CHAT],
|
|
7535
|
+
},
|
|
7531
7536
|
{
|
|
7532
7537
|
actionName: 'canShareDesktop',
|
|
7533
7538
|
requiredDisplayHints: [DISPLAY_HINTS.SHARE_DESKTOP],
|
|
@@ -6,15 +6,26 @@ import RTC_METRICS from '../../../../src/rtcMetrics/constants';
|
|
|
6
6
|
|
|
7
7
|
const FAKE_METRICS_ITEM = {payload: ['fake-metrics']};
|
|
8
8
|
|
|
9
|
+
const STATS_WITH_IP = '{\"id\":\"RTCIceCandidate_/kQs0ZNU\",\"type\":\"remote-candidate\",\"transportId\":\"RTCTransport_0_1\",\"isRemote\":true,\"ip\":\"11.22.111.255\",\"address\":\"11.22.111.255\",\"port\":5004,\"protocol\":\"udp\",\"candidateType\":\"host\",\"priority\":2130706431}';
|
|
10
|
+
const STATS_WITH_IP_RESULT = '{\"id\":\"RTCIceCandidate_/kQs0ZNU\",\"type\":\"remote-candidate\",\"transportId\":\"RTCTransport_0_1\",\"isRemote\":true,\"ip\":\"11.22.111.240\",\"address\":\"11.22.111.240\",\"port\":5004,\"protocol\":\"udp\",\"candidateType\":\"host\",\"priority\":2130706431}';
|
|
11
|
+
|
|
9
12
|
describe('RtcMetrics', () => {
|
|
10
13
|
let metrics: RtcMetrics;
|
|
11
14
|
let webex: MockWebex;
|
|
12
15
|
let clock;
|
|
16
|
+
let anonymizeIpSpy;
|
|
17
|
+
|
|
18
|
+
const sandbox = sinon.createSandbox();
|
|
13
19
|
|
|
14
20
|
beforeEach(() => {
|
|
15
21
|
clock = sinon.useFakeTimers();
|
|
16
22
|
webex = new MockWebex();
|
|
17
23
|
metrics = new RtcMetrics(webex, 'mock-meeting-id', 'mock-correlation-id');
|
|
24
|
+
anonymizeIpSpy = sandbox.spy(metrics, 'anonymizeIp');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
afterEach(() => {
|
|
28
|
+
sandbox.restore();
|
|
18
29
|
});
|
|
19
30
|
|
|
20
31
|
it('sendMetrics should send a webex request', () => {
|
|
@@ -70,4 +81,13 @@ describe('RtcMetrics', () => {
|
|
|
70
81
|
|
|
71
82
|
assert.callCount(webex.request, 1);
|
|
72
83
|
});
|
|
84
|
+
|
|
85
|
+
it('should anonymize IP addresses', () => {
|
|
86
|
+
assert.strictEqual(metrics.anonymizeIp(STATS_WITH_IP), STATS_WITH_IP_RESULT);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('should call anonymizeIp', () => {
|
|
90
|
+
metrics.addMetrics({ name: 'stats-report', payload: [STATS_WITH_IP] });
|
|
91
|
+
assert.calledOnce(anonymizeIpSpy);
|
|
92
|
+
})
|
|
73
93
|
});
|