@webex/calling 3.11.0-webex-services-ready.1 → 3.12.0-metrics-init-fix-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/dist/CallHistory/CallHistory.js +68 -51
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallRecording/CallRecording.js +160 -0
- package/dist/CallRecording/CallRecording.js.map +1 -0
- package/dist/CallRecording/CallRecording.test.js +257 -0
- package/dist/CallRecording/CallRecording.test.js.map +1 -0
- package/dist/CallRecording/WxcCallRecordingConnector.js +577 -0
- package/dist/CallRecording/WxcCallRecordingConnector.js.map +1 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js +652 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js.map +1 -0
- package/dist/CallRecording/callRecordingFixtures.js +235 -0
- package/dist/CallRecording/callRecordingFixtures.js.map +1 -0
- package/dist/CallRecording/constants.js +50 -0
- package/dist/CallRecording/constants.js.map +1 -0
- package/dist/CallRecording/types.js +137 -0
- package/dist/CallRecording/types.js.map +1 -0
- package/dist/CallRecording/utils.js +42 -0
- package/dist/CallRecording/utils.js.map +1 -0
- package/dist/CallRecording/utils.test.js +97 -0
- package/dist/CallRecording/utils.test.js.map +1 -0
- package/dist/CallingClient/CallingClient.js +522 -195
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +607 -133
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +642 -461
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +832 -453
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +106 -35
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +140 -0
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/types.js +5 -0
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/constants.js +32 -3
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +4 -1
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +16 -1
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +740 -407
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +380 -58
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +41 -104
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +39 -153
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
- package/dist/CallingClient/types.js +7 -0
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/CallingClient/utils/constants.js +58 -0
- package/dist/CallingClient/utils/constants.js.map +1 -0
- package/dist/CallingClient/utils/index.js +63 -0
- package/dist/CallingClient/utils/index.js.map +1 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.js +122 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.js.map +1 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.test.js +221 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.test.js.map +1 -0
- package/dist/CallingClient/utils/request.js +435 -0
- package/dist/CallingClient/utils/request.js.map +1 -0
- package/dist/CallingClient/utils/request.test.js +999 -0
- package/dist/CallingClient/utils/request.test.js.map +1 -0
- package/dist/CallingClient/utils/types.js +7 -0
- package/dist/CallingClient/utils/types.js.map +1 -0
- package/dist/CallingClient/utils/wsFeatureFlag.js +70 -0
- package/dist/CallingClient/utils/wsFeatureFlag.js.map +1 -0
- package/dist/CallingClient/utils/wsFeatureFlag.test.js +139 -0
- package/dist/CallingClient/utils/wsFeatureFlag.test.js.map +1 -0
- package/dist/Contacts/ContactsClient.js +13 -11
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +3 -8
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Events/types.js +38 -11
- package/dist/Events/types.js.map +1 -1
- package/dist/Metrics/index.js +63 -2
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +357 -1
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +19 -1
- package/dist/Metrics/types.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/api.js +56 -0
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +159 -53
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +205 -44
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/testUtil.js +10 -5
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js +3 -0
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +171 -40
- package/dist/index.js.map +1 -1
- package/dist/mobius-socket/config.js +24 -0
- package/dist/mobius-socket/config.js.map +1 -0
- package/dist/mobius-socket/errors.js +143 -0
- package/dist/mobius-socket/errors.js.map +1 -0
- package/dist/mobius-socket/errors.test.js +20 -0
- package/dist/mobius-socket/errors.test.js.map +1 -0
- package/dist/mobius-socket/index.js +57 -0
- package/dist/mobius-socket/index.js.map +1 -0
- package/dist/mobius-socket/mobius-socket-events.test.js +492 -0
- package/dist/mobius-socket/mobius-socket-events.test.js.map +1 -0
- package/dist/mobius-socket/mobius-socket.js +849 -0
- package/dist/mobius-socket/mobius-socket.js.map +1 -0
- package/dist/mobius-socket/mobius-socket.test.js +1898 -0
- package/dist/mobius-socket/mobius-socket.test.js.map +1 -0
- package/dist/mobius-socket/socket/constants.js +55 -0
- package/dist/mobius-socket/socket/constants.js.map +1 -0
- package/dist/mobius-socket/socket/index.js +15 -0
- package/dist/mobius-socket/socket/index.js.map +1 -0
- package/dist/mobius-socket/socket/socket-base.js +604 -0
- package/dist/mobius-socket/socket/socket-base.js.map +1 -0
- package/dist/mobius-socket/socket/socket.js +19 -0
- package/dist/mobius-socket/socket/socket.js.map +1 -0
- package/dist/mobius-socket/socket/socket.shim.js +26 -0
- package/dist/mobius-socket/socket/socket.shim.js.map +1 -0
- package/dist/mobius-socket/socket/types.js +7 -0
- package/dist/mobius-socket/socket/types.js.map +1 -0
- package/dist/mobius-socket/socket.test.js +727 -0
- package/dist/mobius-socket/socket.test.js.map +1 -0
- package/dist/mobius-socket/test/mocha-helpers.js +23 -0
- package/dist/mobius-socket/test/mocha-helpers.js.map +1 -0
- package/dist/mobius-socket/test/promise-tick.js +28 -0
- package/dist/mobius-socket/test/promise-tick.js.map +1 -0
- package/dist/mobius-socket/types.js +7 -0
- package/dist/mobius-socket/types.js.map +1 -0
- package/dist/module/CallHistory/CallHistory.js +28 -17
- package/dist/module/CallRecording/CallRecording.js +56 -0
- package/dist/module/CallRecording/WxcCallRecordingConnector.js +257 -0
- package/dist/module/CallRecording/callRecordingFixtures.js +201 -0
- package/dist/module/CallRecording/constants.js +28 -0
- package/dist/module/CallRecording/types.js +19 -0
- package/dist/module/CallRecording/utils.js +14 -0
- package/dist/module/CallingClient/CallingClient.js +166 -8
- package/dist/module/CallingClient/calling/call.js +200 -67
- package/dist/module/CallingClient/calling/callManager.js +51 -11
- package/dist/module/CallingClient/calling/types.js +2 -0
- package/dist/module/CallingClient/constants.js +27 -0
- package/dist/module/CallingClient/line/index.js +2 -2
- package/dist/module/CallingClient/registration/register.js +247 -63
- package/dist/module/CallingClient/registration/webWorker.js +42 -61
- package/dist/module/CallingClient/registration/webWorkerStr.js +47 -82
- package/dist/module/CallingClient/utils/constants.js +36 -0
- package/dist/module/CallingClient/utils/index.js +5 -0
- package/dist/module/CallingClient/utils/mobiusSocketMapper.js +72 -0
- package/dist/module/CallingClient/utils/request.js +211 -0
- package/dist/module/CallingClient/utils/types.js +1 -0
- package/dist/module/CallingClient/utils/wsFeatureFlag.js +41 -0
- package/dist/module/Contacts/ContactsClient.js +1 -1
- package/dist/module/Events/types.js +23 -10
- package/dist/module/Metrics/index.js +48 -1
- package/dist/module/Metrics/types.js +18 -0
- package/dist/module/api.js +3 -2
- package/dist/module/common/Utils.js +63 -18
- package/dist/module/common/testUtil.js +6 -1
- package/dist/module/common/types.js +3 -0
- package/dist/module/index.js +7 -3
- package/dist/module/mobius-socket/config.js +15 -0
- package/dist/module/mobius-socket/errors.js +58 -0
- package/dist/module/mobius-socket/index.js +24 -0
- package/dist/module/mobius-socket/mobius-socket.js +593 -0
- package/dist/module/mobius-socket/socket/constants.js +26 -0
- package/dist/module/mobius-socket/socket/index.js +4 -0
- package/dist/module/mobius-socket/socket/socket-base.js +368 -0
- package/dist/module/mobius-socket/socket/socket.js +9 -0
- package/dist/module/mobius-socket/socket/socket.shim.js +12 -0
- package/dist/module/mobius-socket/socket/types.js +1 -0
- package/dist/module/mobius-socket/types.js +1 -0
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallRecording/CallRecording.d.ts +18 -0
- package/dist/types/CallRecording/CallRecording.d.ts.map +1 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts +23 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts.map +1 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts +61 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts.map +1 -0
- package/dist/types/CallRecording/constants.d.ts +29 -0
- package/dist/types/CallRecording/constants.d.ts.map +1 -0
- package/dist/types/CallRecording/types.d.ts +176 -0
- package/dist/types/CallRecording/types.d.ts.map +1 -0
- package/dist/types/CallRecording/utils.d.ts +3 -0
- package/dist/types/CallRecording/utils.d.ts.map +1 -0
- package/dist/types/CallingClient/CallingClient.d.ts +10 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +17 -3
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts +8 -4
- package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +38 -9
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +27 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +1 -1
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +9 -2
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +6 -3
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts +1 -1
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -1
- package/dist/types/CallingClient/types.d.ts +6 -3
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/CallingClient/utils/constants.d.ts +35 -0
- package/dist/types/CallingClient/utils/constants.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/index.d.ts +6 -0
- package/dist/types/CallingClient/utils/index.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/mobiusSocketMapper.d.ts +5 -0
- package/dist/types/CallingClient/utils/mobiusSocketMapper.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/request.d.ts +28 -0
- package/dist/types/CallingClient/utils/request.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/types.d.ts +34 -0
- package/dist/types/CallingClient/utils/types.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/wsFeatureFlag.d.ts +4 -0
- package/dist/types/CallingClient/utils/wsFeatureFlag.d.ts.map +1 -0
- package/dist/types/Events/types.d.ts +79 -15
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +19 -2
- package/dist/types/Metrics/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +39 -12
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +6 -4
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +11 -3
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +5 -1
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +9 -1
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +9 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mobius-socket/config.d.ts +17 -0
- package/dist/types/mobius-socket/config.d.ts.map +1 -0
- package/dist/types/mobius-socket/errors.d.ts +32 -0
- package/dist/types/mobius-socket/errors.d.ts.map +1 -0
- package/dist/types/mobius-socket/index.d.ts +14 -0
- package/dist/types/mobius-socket/index.d.ts.map +1 -0
- package/dist/types/mobius-socket/mobius-socket.d.ts +48 -0
- package/dist/types/mobius-socket/mobius-socket.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/constants.d.ts +27 -0
- package/dist/types/mobius-socket/socket/constants.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/index.d.ts +5 -0
- package/dist/types/mobius-socket/socket/index.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket-base.d.ts +43 -0
- package/dist/types/mobius-socket/socket/socket-base.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket.d.ts +6 -0
- package/dist/types/mobius-socket/socket/socket.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket.shim.d.ts +6 -0
- package/dist/types/mobius-socket/socket/socket.shim.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/types.d.ts +61 -0
- package/dist/types/mobius-socket/socket/types.d.ts.map +1 -0
- package/dist/types/mobius-socket/types.d.ts +21 -0
- package/dist/types/mobius-socket/types.d.ts.map +1 -0
- package/package.json +20 -5
- package/src/mobius-socket/socket/socket.shim.ts +22 -0
- package/src/mobius-socket/socket/socket.ts +14 -0
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _typeof = require("@babel/runtime-corejs2/helpers/typeof");
|
|
4
|
-
var
|
|
5
|
-
var _Object$
|
|
4
|
+
var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
5
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
6
6
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
7
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
8
|
+
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
|
9
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
10
|
+
var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
|
|
7
11
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
8
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
9
13
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
10
14
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
11
15
|
var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
|
|
12
16
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
17
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
18
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
|
|
13
19
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
14
20
|
var InternalMediaCoreModule = _interopRequireWildcard(require("@webex/internal-media-core"));
|
|
15
|
-
var
|
|
21
|
+
var _mediaHelpers = require("@webex/media-helpers");
|
|
16
22
|
var _types = require("../../Errors/types");
|
|
17
23
|
var _Utils = _interopRequireWildcard(require("../../common/Utils"));
|
|
18
24
|
var Utils = _Utils;
|
|
@@ -27,11 +33,17 @@ var _callManager = require("./callManager");
|
|
|
27
33
|
var _Logger = _interopRequireDefault(require("../../Logger"));
|
|
28
34
|
var _Errors = require("../../Errors");
|
|
29
35
|
var _constants2 = require("../../common/constants");
|
|
36
|
+
var _request = require("../utils/request");
|
|
30
37
|
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
31
|
-
|
|
32
|
-
/* eslint-disable dot-notation */
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
39
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable dot-notation */ /* eslint-disable @typescript-eslint/no-shadow */
|
|
40
|
+
jest.mock('../../mobius-socket', function () {
|
|
41
|
+
return {
|
|
42
|
+
getMobiusSocketInstance: jest.fn().mockReturnValue({
|
|
43
|
+
sendWssRequest: jest.fn()
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
});
|
|
35
47
|
jest.mock('@webex/internal-media-core');
|
|
36
48
|
var uploadLogsSpy = jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
37
49
|
var webex = (0, _testUtil.getTestUtilsWebex)();
|
|
@@ -116,6 +128,11 @@ describe('Call Tests', function () {
|
|
|
116
128
|
webex.request = jest.fn();
|
|
117
129
|
});
|
|
118
130
|
beforeEach(function () {
|
|
131
|
+
_request.APIRequest.resetInstance();
|
|
132
|
+
_request.APIRequest.getInstance({
|
|
133
|
+
webex: webex,
|
|
134
|
+
isMobiusSocketEnabled: false
|
|
135
|
+
});
|
|
119
136
|
callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
120
137
|
});
|
|
121
138
|
it('create call object', function () {
|
|
@@ -428,10 +445,305 @@ describe('Call Tests', function () {
|
|
|
428
445
|
}
|
|
429
446
|
}, _callee8);
|
|
430
447
|
})));
|
|
431
|
-
it('
|
|
432
|
-
var mockStream
|
|
448
|
+
it('registers and unregisters media connection listeners with stable handlers', function () {
|
|
449
|
+
var mockStream = {
|
|
450
|
+
outputStream: {
|
|
451
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
452
|
+
},
|
|
453
|
+
on: jest.fn(),
|
|
454
|
+
getEffectByKind: jest.fn().mockReturnValue(undefined)
|
|
455
|
+
};
|
|
456
|
+
var localAudioStream = mockStream;
|
|
457
|
+
var call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
458
|
+
call.dial(localAudioStream);
|
|
459
|
+
var mediaOnMock = call['mediaConnection'].on;
|
|
460
|
+
var mediaOffSpy = jest.spyOn(call['mediaConnection'], 'off');
|
|
461
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND, expect.any(Function));
|
|
462
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ROAP_FAILURE, expect.any(Function));
|
|
463
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.REMOTE_TRACK_ADDED, expect.any(Function));
|
|
464
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_GATHERING_STATE_CHANGED, expect.any(Function));
|
|
465
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED, expect.any(Function));
|
|
466
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CONNECTION_STATE_CHANGED, expect.any(Function));
|
|
467
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CANDIDATE_ERROR, expect.any(Function));
|
|
468
|
+
call['unregisterMediaConnectionListeners']();
|
|
469
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND, expect.any(Function));
|
|
470
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ROAP_FAILURE, expect.any(Function));
|
|
471
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.REMOTE_TRACK_ADDED, expect.any(Function));
|
|
472
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_GATHERING_STATE_CHANGED, expect.any(Function));
|
|
473
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED, expect.any(Function));
|
|
474
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CONNECTION_STATE_CHANGED, expect.any(Function));
|
|
475
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CANDIDATE_ERROR, expect.any(Function));
|
|
476
|
+
});
|
|
477
|
+
it('handles ICE listener payloads and submits metrics with event names', function () {
|
|
478
|
+
var mockStream = {
|
|
479
|
+
outputStream: {
|
|
480
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
481
|
+
},
|
|
482
|
+
on: jest.fn(),
|
|
483
|
+
getEffectByKind: jest.fn().mockReturnValue(undefined)
|
|
484
|
+
};
|
|
485
|
+
var localAudioStream = mockStream;
|
|
486
|
+
var call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
487
|
+
call.dial(localAudioStream);
|
|
488
|
+
var metricSpy = jest.spyOn(call['metricManager'], 'submitMediaMetric');
|
|
489
|
+
var warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
490
|
+
var getHandlerForEvent = function getHandlerForEvent(eventName) {
|
|
491
|
+
var _mock$calls$find;
|
|
492
|
+
return (_mock$calls$find = call['mediaConnection'].on.mock.calls.find(function (_ref9) {
|
|
493
|
+
var _ref0 = (0, _slicedToArray2.default)(_ref9, 1),
|
|
494
|
+
name = _ref0[0];
|
|
495
|
+
return name === eventName;
|
|
496
|
+
})) === null || _mock$calls$find === void 0 ? void 0 : _mock$calls$find[1];
|
|
497
|
+
};
|
|
498
|
+
var iceGatheringHandler = getHandlerForEvent(InternalMediaCoreModule.MediaConnectionEventNames.ICE_GATHERING_STATE_CHANGED);
|
|
499
|
+
var peerConnectionHandler = getHandlerForEvent(InternalMediaCoreModule.MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED);
|
|
500
|
+
var iceConnectionHandler = getHandlerForEvent(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CONNECTION_STATE_CHANGED);
|
|
501
|
+
var iceCandidateErrorHandler = getHandlerForEvent(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CANDIDATE_ERROR);
|
|
502
|
+
iceGatheringHandler({
|
|
503
|
+
iceGatheringState: 'gathering'
|
|
504
|
+
});
|
|
505
|
+
peerConnectionHandler({
|
|
506
|
+
connectionState: 'connected'
|
|
507
|
+
});
|
|
508
|
+
iceConnectionHandler({
|
|
509
|
+
iceConnectionState: 'completed'
|
|
510
|
+
});
|
|
511
|
+
iceCandidateErrorHandler({
|
|
512
|
+
errorCode: 701,
|
|
513
|
+
errorText: 'STUN host lookup failed',
|
|
514
|
+
url: 'stun:example.org:3478'
|
|
515
|
+
});
|
|
516
|
+
expect(metricSpy).toHaveBeenNthCalledWith(1, _types4.METRIC_EVENT.MEDIA, _types4.MEDIA_CONNECTION_ACTION.ICE_GATHERING_STATE_CHANGED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined, undefined, 'gathering');
|
|
517
|
+
expect(metricSpy).toHaveBeenNthCalledWith(2, _types4.METRIC_EVENT.MEDIA, _types4.MEDIA_CONNECTION_ACTION.PEER_CONNECTION_STATE_CHANGED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined, undefined, 'connected');
|
|
518
|
+
expect(metricSpy).toHaveBeenNthCalledWith(3, _types4.METRIC_EVENT.MEDIA, _types4.MEDIA_CONNECTION_ACTION.ICE_CONNECTION_STATE_CHANGED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined, undefined, 'completed');
|
|
519
|
+
expect(metricSpy).toHaveBeenNthCalledWith(4, _types4.METRIC_EVENT.MEDIA_ERROR, _types4.MEDIA_CONNECTION_ACTION.ICE_CANDIDATE_ERROR, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined, undefined, undefined, expect.any(_Errors.CallError));
|
|
520
|
+
var mediaErrorCall = metricSpy.mock.calls[3];
|
|
521
|
+
expect(mediaErrorCall[mediaErrorCall.length - 1].getCallError().message).toBe('ICE candidate error occurred: {"address":null,"errorCode":701,"errorText":"STUN host lookup failed","port":null,"url":"stun:example.org:3478"}');
|
|
522
|
+
expect(warnSpy).toHaveBeenCalledWith('ICE candidate error occurred: {"address":null,"errorCode":701,"errorText":"STUN host lookup failed","port":null,"url":"stun:example.org:3478"}', {
|
|
523
|
+
file: 'call',
|
|
524
|
+
method: 'mediaIceEventsListener'
|
|
525
|
+
});
|
|
526
|
+
});
|
|
527
|
+
it('handles ROAP failure listener and submits media error metric', function () {
|
|
528
|
+
var _mock$calls$find2;
|
|
529
|
+
var mockStream = {
|
|
530
|
+
outputStream: {
|
|
531
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
532
|
+
},
|
|
533
|
+
on: jest.fn(),
|
|
534
|
+
getEffectByKind: jest.fn().mockReturnValue(undefined)
|
|
535
|
+
};
|
|
536
|
+
var localAudioStream = mockStream;
|
|
537
|
+
var call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
538
|
+
call.dial(localAudioStream);
|
|
539
|
+
var metricSpy = jest.spyOn(call['metricManager'], 'submitMediaMetric');
|
|
540
|
+
var warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
541
|
+
var roapFailureHandler = (_mock$calls$find2 = call['mediaConnection'].on.mock.calls.find(function (_ref1) {
|
|
542
|
+
var _ref10 = (0, _slicedToArray2.default)(_ref1, 1),
|
|
543
|
+
name = _ref10[0];
|
|
544
|
+
return name === InternalMediaCoreModule.MediaConnectionEventNames.ROAP_FAILURE;
|
|
545
|
+
})) === null || _mock$calls$find2 === void 0 ? void 0 : _mock$calls$find2[1];
|
|
546
|
+
var roapFailure = new Error('Failed to process remote SDP');
|
|
547
|
+
roapFailureHandler(roapFailure);
|
|
548
|
+
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.MEDIA_ERROR, _types4.MEDIA_CONNECTION_ACTION.ROAP_FAILURE, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined, undefined, undefined, expect.any(_Errors.CallError));
|
|
549
|
+
var roapFailureMetricCall = metricSpy.mock.calls.find(function (_ref11) {
|
|
550
|
+
var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
|
|
551
|
+
name = _ref12[0],
|
|
552
|
+
metricAction = _ref12[1];
|
|
553
|
+
return name === _types4.METRIC_EVENT.MEDIA_ERROR && metricAction === _types4.MEDIA_CONNECTION_ACTION.ROAP_FAILURE;
|
|
554
|
+
});
|
|
555
|
+
expect(roapFailureMetricCall).toBeDefined();
|
|
556
|
+
expect((roapFailureMetricCall === null || roapFailureMetricCall === void 0 ? void 0 : roapFailureMetricCall[roapFailureMetricCall.length - 1]).getCallError().message).toBe('ROAP failure occurred: Failed to process remote SDP');
|
|
557
|
+
expect(warnSpy).toHaveBeenCalledWith('ROAP failure occurred: Failed to process remote SDP', {
|
|
558
|
+
file: 'call',
|
|
559
|
+
method: 'mediaRoapEventsListener'
|
|
560
|
+
});
|
|
561
|
+
});
|
|
562
|
+
it('sends connect before ROAP answer when inbound offer is delayed', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
563
|
+
var _mock$calls$find3;
|
|
564
|
+
var mockStream, localAudioStream, call, handleOutgoingCallConnectSpy, delayedOffer, sendCallStateMachineEvtSpy, sendMediaStateMachineEvtSpy, roapListener;
|
|
433
565
|
return _regenerator.default.wrap(function (_context9) {
|
|
434
566
|
while (1) switch (_context9.prev = _context9.next) {
|
|
567
|
+
case 0:
|
|
568
|
+
mockStream = {
|
|
569
|
+
outputStream: {
|
|
570
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
571
|
+
},
|
|
572
|
+
on: jest.fn(),
|
|
573
|
+
getEffectByKind: jest.fn().mockImplementation(function () {
|
|
574
|
+
return mockEffect;
|
|
575
|
+
})
|
|
576
|
+
};
|
|
577
|
+
localAudioStream = mockStream;
|
|
578
|
+
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.INBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
579
|
+
webex.request.mockReturnValue({
|
|
580
|
+
statusCode: 200,
|
|
581
|
+
body: {
|
|
582
|
+
callId: 'mock-call-id'
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
call.sendCallStateMachineEvt({
|
|
586
|
+
type: 'E_RECV_CALL_SETUP',
|
|
587
|
+
data: {
|
|
588
|
+
seq: 1,
|
|
589
|
+
messageType: 'OFFER'
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
593
|
+
_context9.next = 1;
|
|
594
|
+
return call.answer(localAudioStream);
|
|
595
|
+
case 1:
|
|
596
|
+
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_CONNECT');
|
|
597
|
+
|
|
598
|
+
// Connect is attempted by answer(), but is deferred because offer is not buffered yet.
|
|
599
|
+
handleOutgoingCallConnectSpy = jest.spyOn(call, 'handleOutgoingCallConnect');
|
|
600
|
+
expect(call['connectPending']).toBe(true);
|
|
601
|
+
expect(call['mediaConnection'].roapMessageReceived).not.toHaveBeenCalled();
|
|
602
|
+
delayedOffer = {
|
|
603
|
+
seq: 1,
|
|
604
|
+
messageType: 'OFFER',
|
|
605
|
+
sdp: 'v=0',
|
|
606
|
+
version: 1
|
|
607
|
+
};
|
|
608
|
+
call.sendMediaStateMachineEvt({
|
|
609
|
+
type: 'E_RECV_ROAP_OFFER',
|
|
610
|
+
data: delayedOffer
|
|
611
|
+
});
|
|
612
|
+
_context9.next = 2;
|
|
613
|
+
return (0, _testUtil.flushPromises)(2);
|
|
614
|
+
case 2:
|
|
615
|
+
expect(call['mediaConnection'].roapMessageReceived).toHaveBeenCalledWith(delayedOffer);
|
|
616
|
+
sendCallStateMachineEvtSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
|
|
617
|
+
sendMediaStateMachineEvtSpy = jest.spyOn(call, 'sendMediaStateMachineEvt');
|
|
618
|
+
roapListener = (_mock$calls$find3 = call['mediaConnection'].on.mock.calls.find(function (_ref14) {
|
|
619
|
+
var _ref15 = (0, _slicedToArray2.default)(_ref14, 1),
|
|
620
|
+
eventName = _ref15[0];
|
|
621
|
+
return eventName === InternalMediaCoreModule.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND;
|
|
622
|
+
})) === null || _mock$calls$find3 === void 0 ? void 0 : _mock$calls$find3[1];
|
|
623
|
+
expect(roapListener).toBeDefined();
|
|
624
|
+
_context9.next = 3;
|
|
625
|
+
return roapListener({
|
|
626
|
+
roapMessage: {
|
|
627
|
+
messageType: 'ANSWER',
|
|
628
|
+
sdp: 'v=0',
|
|
629
|
+
seq: 1,
|
|
630
|
+
version: 2
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
case 3:
|
|
634
|
+
_context9.next = 4;
|
|
635
|
+
return (0, _testUtil.flushPromises)(2);
|
|
636
|
+
case 4:
|
|
637
|
+
// On ANSWER from media layer, connect is retried first, then ROAP answer is posted.
|
|
638
|
+
expect(sendCallStateMachineEvtSpy).toHaveBeenNthCalledWith(1, {
|
|
639
|
+
type: 'E_SEND_CALL_CONNECT'
|
|
640
|
+
});
|
|
641
|
+
expect(sendMediaStateMachineEvtSpy).toHaveBeenNthCalledWith(1, {
|
|
642
|
+
type: 'E_SEND_ROAP_ANSWER',
|
|
643
|
+
data: expect.objectContaining({
|
|
644
|
+
messageType: 'ANSWER'
|
|
645
|
+
})
|
|
646
|
+
});
|
|
647
|
+
expect(handleOutgoingCallConnectSpy).toHaveBeenCalled();
|
|
648
|
+
expect(call['mediaConnection'].roapMessageReceived).toHaveBeenLastCalledWith(delayedOffer);
|
|
649
|
+
expect(call['connectPending']).toBe(false);
|
|
650
|
+
case 5:
|
|
651
|
+
case "end":
|
|
652
|
+
return _context9.stop();
|
|
653
|
+
}
|
|
654
|
+
}, _callee9);
|
|
655
|
+
})));
|
|
656
|
+
var iceLiteOfferSdp = 'v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n' + 'a=ice-lite\r\nm=audio 19564 UDP/TLS/RTP/SAVPF 0\r\na=sendrecv\r\n';
|
|
657
|
+
var fullIceOfferSdp = 'v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n' + 'm=audio 19564 UDP/TLS/RTP/SAVPF 0\r\na=sendrecv\r\na=ice-ufrag:mLbW\r\n';
|
|
658
|
+
describe.each([{
|
|
659
|
+
name: 'reduced timeout when the offer is ice-lite and reduceTimeoutForIceLite is enabled',
|
|
660
|
+
sdp: iceLiteOfferSdp,
|
|
661
|
+
iceGatheringConfig: {
|
|
662
|
+
reduceTimeoutForIceLite: true
|
|
663
|
+
},
|
|
664
|
+
expectedTimeout: _constants.ICE_LITE_CANDIDATES_TIMEOUT
|
|
665
|
+
}, {
|
|
666
|
+
name: 'custom reduced timeout when the offer is ice-lite and iceLiteTimeout is overridden',
|
|
667
|
+
sdp: iceLiteOfferSdp,
|
|
668
|
+
iceGatheringConfig: {
|
|
669
|
+
reduceTimeoutForIceLite: true,
|
|
670
|
+
iceLiteTimeout: 750
|
|
671
|
+
},
|
|
672
|
+
expectedTimeout: 750
|
|
673
|
+
}, {
|
|
674
|
+
name: 'default timeout when the offer is ice-lite but reduceTimeoutForIceLite is disabled',
|
|
675
|
+
sdp: iceLiteOfferSdp,
|
|
676
|
+
iceGatheringConfig: {
|
|
677
|
+
reduceTimeoutForIceLite: false
|
|
678
|
+
},
|
|
679
|
+
expectedTimeout: _constants.ICE_CANDIDATES_TIMEOUT
|
|
680
|
+
}, {
|
|
681
|
+
name: 'default timeout when the offer is ice-lite but no iceGathering config is provided',
|
|
682
|
+
sdp: iceLiteOfferSdp,
|
|
683
|
+
iceGatheringConfig: undefined,
|
|
684
|
+
expectedTimeout: _constants.ICE_CANDIDATES_TIMEOUT
|
|
685
|
+
}, {
|
|
686
|
+
name: 'default timeout when reduceTimeoutForIceLite is enabled but the offer is not ice-lite',
|
|
687
|
+
sdp: fullIceOfferSdp,
|
|
688
|
+
iceGatheringConfig: {
|
|
689
|
+
reduceTimeoutForIceLite: true
|
|
690
|
+
},
|
|
691
|
+
expectedTimeout: _constants.ICE_CANDIDATES_TIMEOUT
|
|
692
|
+
}])('ICE candidates timeout selection', function (_ref16) {
|
|
693
|
+
var name = _ref16.name,
|
|
694
|
+
sdp = _ref16.sdp,
|
|
695
|
+
iceGatheringConfig = _ref16.iceGatheringConfig,
|
|
696
|
+
expectedTimeout = _ref16.expectedTimeout;
|
|
697
|
+
it("uses ".concat(name), /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
698
|
+
var mockStream, localAudioStream, call;
|
|
699
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
700
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
701
|
+
case 0:
|
|
702
|
+
mockStream = {
|
|
703
|
+
outputStream: {
|
|
704
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
705
|
+
},
|
|
706
|
+
on: jest.fn(),
|
|
707
|
+
getEffectByKind: jest.fn().mockImplementation(function () {
|
|
708
|
+
return mockEffect;
|
|
709
|
+
})
|
|
710
|
+
};
|
|
711
|
+
localAudioStream = mockStream;
|
|
712
|
+
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.INBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest, iceGatheringConfig);
|
|
713
|
+
webex.request.mockReturnValue({
|
|
714
|
+
statusCode: 200,
|
|
715
|
+
body: {
|
|
716
|
+
callId: 'mock-call-id'
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
/* Buffer the remote offer before answering so it is available at media connection init. */
|
|
721
|
+
call.sendMediaStateMachineEvt({
|
|
722
|
+
type: 'E_RECV_ROAP_OFFER',
|
|
723
|
+
data: {
|
|
724
|
+
seq: 1,
|
|
725
|
+
messageType: 'OFFER',
|
|
726
|
+
version: 1,
|
|
727
|
+
sdp: sdp
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
_context0.next = 1;
|
|
731
|
+
return call.answer(localAudioStream);
|
|
732
|
+
case 1:
|
|
733
|
+
expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(_objectSpread(_objectSpread({}, roapMediaConnectionConfig), {}, {
|
|
734
|
+
iceCandidatesTimeout: expectedTimeout
|
|
735
|
+
}), roapMediaConnectionOptions, expect.any(String), expect.any(Function), expect.any(Function), expect.any(Function));
|
|
736
|
+
case 2:
|
|
737
|
+
case "end":
|
|
738
|
+
return _context0.stop();
|
|
739
|
+
}
|
|
740
|
+
}, _callee0);
|
|
741
|
+
})));
|
|
742
|
+
});
|
|
743
|
+
it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
744
|
+
var mockStream, localAudioStream, onStreamSpy, onEffectSpy, offStreamSpy, offEffectSpy, call, updateLocalTracksSpy, bnrMetricSpy;
|
|
745
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
746
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
435
747
|
case 0:
|
|
436
748
|
mockStream = {
|
|
437
749
|
outputStream: {
|
|
@@ -463,8 +775,8 @@ describe('Call Tests', function () {
|
|
|
463
775
|
bnrMetricSpy.mockClear();
|
|
464
776
|
/* Invoking the callback function to trigger EffectAdded event to simulate adding effect to the stream */
|
|
465
777
|
onStreamSpy.mock.calls[1][1](mockEffect);
|
|
466
|
-
expect(onEffectSpy).toBeCalledWith(
|
|
467
|
-
expect(onEffectSpy).toBeCalledWith(
|
|
778
|
+
expect(onEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Enabled, expect.any(Function));
|
|
779
|
+
expect(onEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Disabled, expect.any(Function));
|
|
468
780
|
|
|
469
781
|
/* Send Enabled event on the effect, update track and send metrics for BNR disabled */
|
|
470
782
|
onStreamSpy.mock.calls[0][1](mockTrack);
|
|
@@ -487,25 +799,25 @@ describe('Call Tests', function () {
|
|
|
487
799
|
});
|
|
488
800
|
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_DISABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
489
801
|
call.end();
|
|
490
|
-
|
|
802
|
+
_context1.next = 1;
|
|
491
803
|
return (0, _Utils.waitForMsecs)(50);
|
|
492
804
|
case 1:
|
|
493
805
|
/* Checks for switching off the listeners on call disconnect */
|
|
494
806
|
expect(offStreamSpy).toBeCalledTimes(2);
|
|
495
807
|
expect(offStreamSpy).toBeCalledWith(InternalMediaCoreModule.LocalStreamEventNames.OutputTrackChange, expect.any(Function));
|
|
496
808
|
expect(offStreamSpy).toBeCalledWith(InternalMediaCoreModule.LocalStreamEventNames.EffectAdded, expect.any(Function));
|
|
497
|
-
expect(offEffectSpy).toBeCalledWith(
|
|
498
|
-
expect(offEffectSpy).toBeCalledWith(
|
|
809
|
+
expect(offEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Enabled, expect.any(Function));
|
|
810
|
+
expect(offEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Disabled, expect.any(Function));
|
|
499
811
|
case 2:
|
|
500
812
|
case "end":
|
|
501
|
-
return
|
|
813
|
+
return _context1.stop();
|
|
502
814
|
}
|
|
503
|
-
},
|
|
815
|
+
}, _callee1);
|
|
504
816
|
})));
|
|
505
|
-
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
817
|
+
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
506
818
|
var mockStream, localAudioStream, warnSpy, call;
|
|
507
|
-
return _regenerator.default.wrap(function (
|
|
508
|
-
while (1) switch (
|
|
819
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
820
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
509
821
|
case 0:
|
|
510
822
|
mockStream = {
|
|
511
823
|
outputStream: {
|
|
@@ -529,7 +841,7 @@ describe('Call Tests', function () {
|
|
|
529
841
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
530
842
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
531
843
|
call.answer(localAudioStream);
|
|
532
|
-
|
|
844
|
+
_context10.next = 1;
|
|
533
845
|
return (0, _Utils.waitForMsecs)(50);
|
|
534
846
|
case 1:
|
|
535
847
|
expect(warnSpy).toBeCalledTimes(2);
|
|
@@ -544,14 +856,14 @@ describe('Call Tests', function () {
|
|
|
544
856
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
545
857
|
case 2:
|
|
546
858
|
case "end":
|
|
547
|
-
return
|
|
859
|
+
return _context10.stop();
|
|
548
860
|
}
|
|
549
|
-
},
|
|
861
|
+
}, _callee10);
|
|
550
862
|
})));
|
|
551
|
-
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
863
|
+
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
552
864
|
var mockStream, localAudioStream, warnSpy, call;
|
|
553
|
-
return _regenerator.default.wrap(function (
|
|
554
|
-
while (1) switch (
|
|
865
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
866
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
555
867
|
case 0:
|
|
556
868
|
mockStream = {
|
|
557
869
|
outputStream: {
|
|
@@ -563,7 +875,7 @@ describe('Call Tests', function () {
|
|
|
563
875
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
564
876
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
565
877
|
call.dial(localAudioStream);
|
|
566
|
-
|
|
878
|
+
_context11.next = 1;
|
|
567
879
|
return (0, _Utils.waitForMsecs)(50);
|
|
568
880
|
case 1:
|
|
569
881
|
expect(warnSpy).toBeCalledTimes(1);
|
|
@@ -576,9 +888,9 @@ describe('Call Tests', function () {
|
|
|
576
888
|
expect(webex.request).not.toBeCalledOnceWith();
|
|
577
889
|
case 2:
|
|
578
890
|
case "end":
|
|
579
|
-
return
|
|
891
|
+
return _context11.stop();
|
|
580
892
|
}
|
|
581
|
-
},
|
|
893
|
+
}, _callee11);
|
|
582
894
|
})));
|
|
583
895
|
it('update media after call creation with valid stream', function () {
|
|
584
896
|
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
@@ -652,10 +964,10 @@ describe('Call Tests', function () {
|
|
|
652
964
|
method: 'dial'
|
|
653
965
|
});
|
|
654
966
|
});
|
|
655
|
-
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
967
|
+
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
656
968
|
var logSpy, callManager, mockStream, localAudioStream, call;
|
|
657
|
-
return _regenerator.default.wrap(function (
|
|
658
|
-
while (1) switch (
|
|
969
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
970
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
659
971
|
case 0:
|
|
660
972
|
logSpy = jest.spyOn(_Logger.default, 'info');
|
|
661
973
|
webex.request.mockReturnValue({
|
|
@@ -731,9 +1043,9 @@ describe('Call Tests', function () {
|
|
|
731
1043
|
expect(mockStream.setUserMuted).toBeCalledOnceWith(false);
|
|
732
1044
|
case 1:
|
|
733
1045
|
case "end":
|
|
734
|
-
return
|
|
1046
|
+
return _context12.stop();
|
|
735
1047
|
}
|
|
736
|
-
},
|
|
1048
|
+
}, _callee12);
|
|
737
1049
|
})));
|
|
738
1050
|
describe('Guest Calling Flow Tests', function () {
|
|
739
1051
|
var dummyEvent = {
|
|
@@ -741,10 +1053,10 @@ describe('Call Tests', function () {
|
|
|
741
1053
|
data: undefined
|
|
742
1054
|
};
|
|
743
1055
|
var call;
|
|
744
|
-
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1056
|
+
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
745
1057
|
var requestSpy, requestArgs;
|
|
746
|
-
return _regenerator.default.wrap(function (
|
|
747
|
-
while (1) switch (
|
|
1058
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
1059
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
748
1060
|
case 0:
|
|
749
1061
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
750
1062
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -757,14 +1069,14 @@ describe('Call Tests', function () {
|
|
|
757
1069
|
expect('callee' in requestArgs.body).toBe(true);
|
|
758
1070
|
case 1:
|
|
759
1071
|
case "end":
|
|
760
|
-
return
|
|
1072
|
+
return _context13.stop();
|
|
761
1073
|
}
|
|
762
|
-
},
|
|
1074
|
+
}, _callee13);
|
|
763
1075
|
})));
|
|
764
|
-
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1076
|
+
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
765
1077
|
var requestSpy, requestArgs;
|
|
766
|
-
return _regenerator.default.wrap(function (
|
|
767
|
-
while (1) switch (
|
|
1078
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
1079
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
768
1080
|
case 0:
|
|
769
1081
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
770
1082
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -777,9 +1089,9 @@ describe('Call Tests', function () {
|
|
|
777
1089
|
expect('callee' in requestArgs.body).toBe(false);
|
|
778
1090
|
case 1:
|
|
779
1091
|
case "end":
|
|
780
|
-
return
|
|
1092
|
+
return _context14.stop();
|
|
781
1093
|
}
|
|
782
|
-
},
|
|
1094
|
+
}, _callee14);
|
|
783
1095
|
})));
|
|
784
1096
|
});
|
|
785
1097
|
});
|
|
@@ -799,6 +1111,11 @@ describe('State Machine handler tests', function () {
|
|
|
799
1111
|
var call;
|
|
800
1112
|
var dtmfMock;
|
|
801
1113
|
beforeEach(function () {
|
|
1114
|
+
_request.APIRequest.resetInstance();
|
|
1115
|
+
_request.APIRequest.getInstance({
|
|
1116
|
+
webex: webex,
|
|
1117
|
+
isMobiusSocketEnabled: false
|
|
1118
|
+
});
|
|
802
1119
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
803
1120
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
804
1121
|
var dummy = 10;
|
|
@@ -812,10 +1129,10 @@ describe('State Machine handler tests', function () {
|
|
|
812
1129
|
|
|
813
1130
|
// afterEach(() => call.removeAllListeners());
|
|
814
1131
|
|
|
815
|
-
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1132
|
+
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
816
1133
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
817
|
-
return _regenerator.default.wrap(function (
|
|
818
|
-
while (1) switch (
|
|
1134
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
1135
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
819
1136
|
case 0:
|
|
820
1137
|
statusPayload = {
|
|
821
1138
|
statusCode: 200,
|
|
@@ -835,7 +1152,7 @@ describe('State Machine handler tests', function () {
|
|
|
835
1152
|
/* This is to flush all the promises from the Promise queue so that
|
|
836
1153
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
837
1154
|
*/
|
|
838
|
-
|
|
1155
|
+
_context15.next = 1;
|
|
839
1156
|
return (0, _testUtil.flushPromises)(3);
|
|
840
1157
|
case 1:
|
|
841
1158
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
@@ -851,14 +1168,14 @@ describe('State Machine handler tests', function () {
|
|
|
851
1168
|
});
|
|
852
1169
|
case 2:
|
|
853
1170
|
case "end":
|
|
854
|
-
return
|
|
1171
|
+
return _context15.stop();
|
|
855
1172
|
}
|
|
856
|
-
},
|
|
1173
|
+
}, _callee15);
|
|
857
1174
|
})));
|
|
858
|
-
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1175
|
+
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
859
1176
|
var statusPayload, emitSpy, funcSpy;
|
|
860
|
-
return _regenerator.default.wrap(function (
|
|
861
|
-
while (1) switch (
|
|
1177
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
1178
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
862
1179
|
case 0:
|
|
863
1180
|
expect.assertions(4);
|
|
864
1181
|
statusPayload = {
|
|
@@ -873,25 +1190,27 @@ describe('State Machine handler tests', function () {
|
|
|
873
1190
|
funcSpy = jest.spyOn(call, 'postStatus').mockRejectedValue(statusPayload);
|
|
874
1191
|
call['handleCallEstablished']({});
|
|
875
1192
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
876
|
-
|
|
1193
|
+
_context16.next = 1;
|
|
877
1194
|
return _promise.default.resolve();
|
|
878
1195
|
case 1:
|
|
879
|
-
|
|
1196
|
+
_context16.next = 2;
|
|
880
1197
|
return _promise.default.resolve();
|
|
881
1198
|
case 2:
|
|
882
|
-
|
|
1199
|
+
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
1200
|
+
// and once in handleCallKeepaliveError when clearing timer due to error
|
|
1201
|
+
expect(clearInterval).toHaveBeenCalledTimes(2);
|
|
883
1202
|
expect(funcSpy).toBeCalledTimes(1);
|
|
884
1203
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
885
1204
|
case 3:
|
|
886
1205
|
case "end":
|
|
887
|
-
return
|
|
1206
|
+
return _context16.stop();
|
|
888
1207
|
}
|
|
889
|
-
},
|
|
1208
|
+
}, _callee16);
|
|
890
1209
|
})));
|
|
891
|
-
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1210
|
+
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
892
1211
|
var statusPayload, funcSpy;
|
|
893
|
-
return _regenerator.default.wrap(function (
|
|
894
|
-
while (1) switch (
|
|
1212
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
1213
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
895
1214
|
case 0:
|
|
896
1215
|
expect.assertions(4);
|
|
897
1216
|
statusPayload = {
|
|
@@ -910,21 +1229,23 @@ describe('State Machine handler tests', function () {
|
|
|
910
1229
|
/* This is to flush all the promises from the Promise queue so that
|
|
911
1230
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
912
1231
|
*/
|
|
913
|
-
|
|
1232
|
+
_context17.next = 1;
|
|
914
1233
|
return (0, _testUtil.flushPromises)(2);
|
|
915
1234
|
case 1:
|
|
916
|
-
|
|
1235
|
+
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
1236
|
+
// and once in handleCallKeepaliveError when clearing timer due to error
|
|
1237
|
+
expect(clearInterval).toHaveBeenCalledTimes(2);
|
|
917
1238
|
expect(funcSpy).toBeCalledTimes(1);
|
|
918
1239
|
case 2:
|
|
919
1240
|
case "end":
|
|
920
|
-
return
|
|
1241
|
+
return _context17.stop();
|
|
921
1242
|
}
|
|
922
|
-
},
|
|
1243
|
+
}, _callee17);
|
|
923
1244
|
})));
|
|
924
|
-
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1245
|
+
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
925
1246
|
var errorPayload, okPayload, scheduleKeepaliveSpy, postStatusSpy;
|
|
926
|
-
return _regenerator.default.wrap(function (
|
|
927
|
-
while (1) switch (
|
|
1247
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
1248
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
928
1249
|
case 0:
|
|
929
1250
|
errorPayload = {
|
|
930
1251
|
statusCode: 500,
|
|
@@ -942,28 +1263,63 @@ describe('State Machine handler tests', function () {
|
|
|
942
1263
|
call['handleCallEstablished']({});
|
|
943
1264
|
}
|
|
944
1265
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
945
|
-
|
|
1266
|
+
_context18.next = 1;
|
|
946
1267
|
return (0, _testUtil.flushPromises)(2);
|
|
947
1268
|
case 1:
|
|
948
1269
|
expect(postStatusSpy).toHaveBeenCalledTimes(1);
|
|
949
1270
|
|
|
950
1271
|
// Now advance by 1 second for the retry-after interval
|
|
951
1272
|
jest.advanceTimersByTime(1000);
|
|
952
|
-
|
|
1273
|
+
_context18.next = 2;
|
|
953
1274
|
return (0, _testUtil.flushPromises)(2);
|
|
954
1275
|
case 2:
|
|
955
1276
|
expect(postStatusSpy).toHaveBeenCalledTimes(2);
|
|
956
1277
|
expect(scheduleKeepaliveSpy).toHaveBeenCalledTimes(2);
|
|
957
1278
|
case 3:
|
|
958
1279
|
case "end":
|
|
959
|
-
return
|
|
1280
|
+
return _context18.stop();
|
|
960
1281
|
}
|
|
961
|
-
},
|
|
1282
|
+
}, _callee18);
|
|
962
1283
|
})));
|
|
963
|
-
it('
|
|
1284
|
+
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
1285
|
+
var firstTimer, secondTimer;
|
|
1286
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
1287
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1288
|
+
case 0:
|
|
1289
|
+
jest.spyOn(global, 'setInterval');
|
|
1290
|
+
jest.spyOn(global, 'clearInterval');
|
|
1291
|
+
|
|
1292
|
+
// Setup the first keepalive interval
|
|
1293
|
+
call['handleCallEstablished']({});
|
|
1294
|
+
|
|
1295
|
+
// At this point, scheduleCallKeepaliveInterval was called once
|
|
1296
|
+
// It should have called clearInterval once (at the start) and setInterval once
|
|
1297
|
+
expect(clearInterval).toHaveBeenCalledTimes(1);
|
|
1298
|
+
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
1299
|
+
firstTimer = call['sessionTimer'];
|
|
1300
|
+
expect(firstTimer).toBeDefined();
|
|
1301
|
+
|
|
1302
|
+
// Manually call scheduleCallKeepaliveInterval again to simulate a retry scenario
|
|
1303
|
+
call['scheduleCallKeepaliveInterval']();
|
|
1304
|
+
|
|
1305
|
+
// clearInterval should have been called again to clear the previous timer
|
|
1306
|
+
expect(clearInterval).toHaveBeenCalledTimes(2);
|
|
1307
|
+
// A new interval should have been created
|
|
1308
|
+
expect(setInterval).toHaveBeenCalledTimes(2);
|
|
1309
|
+
|
|
1310
|
+
// The sessionTimer should be different (new timer)
|
|
1311
|
+
secondTimer = call['sessionTimer'];
|
|
1312
|
+
expect(secondTimer).toBeDefined();
|
|
1313
|
+
case 1:
|
|
1314
|
+
case "end":
|
|
1315
|
+
return _context19.stop();
|
|
1316
|
+
}
|
|
1317
|
+
}, _callee19);
|
|
1318
|
+
})));
|
|
1319
|
+
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
964
1320
|
var errorPayload, warnSpy, postStatusSpy;
|
|
965
|
-
return _regenerator.default.wrap(function (
|
|
966
|
-
while (1) switch (
|
|
1321
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
1322
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
967
1323
|
case 0:
|
|
968
1324
|
errorPayload = {
|
|
969
1325
|
statusCode: 500,
|
|
@@ -982,25 +1338,25 @@ describe('State Machine handler tests', function () {
|
|
|
982
1338
|
|
|
983
1339
|
// Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
|
|
984
1340
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
985
|
-
|
|
1341
|
+
_context20.next = 1;
|
|
986
1342
|
return (0, _testUtil.flushPromises)(2);
|
|
987
1343
|
case 1:
|
|
988
1344
|
// Now advance by 1 second for each of the 4 retry attempts (retry-after: 1 second each)
|
|
989
1345
|
// Need to do this separately to allow state machine to process and create new intervals
|
|
990
1346
|
jest.advanceTimersByTime(1000);
|
|
991
|
-
|
|
1347
|
+
_context20.next = 2;
|
|
992
1348
|
return (0, _testUtil.flushPromises)(2);
|
|
993
1349
|
case 2:
|
|
994
1350
|
jest.advanceTimersByTime(1000);
|
|
995
|
-
|
|
1351
|
+
_context20.next = 3;
|
|
996
1352
|
return (0, _testUtil.flushPromises)(2);
|
|
997
1353
|
case 3:
|
|
998
1354
|
jest.advanceTimersByTime(1000);
|
|
999
|
-
|
|
1355
|
+
_context20.next = 4;
|
|
1000
1356
|
return (0, _testUtil.flushPromises)(2);
|
|
1001
1357
|
case 4:
|
|
1002
1358
|
jest.advanceTimersByTime(1000);
|
|
1003
|
-
|
|
1359
|
+
_context20.next = 5;
|
|
1004
1360
|
return (0, _testUtil.flushPromises)(2);
|
|
1005
1361
|
case 5:
|
|
1006
1362
|
// The error handler should detect we're at max retry count and stop
|
|
@@ -1012,14 +1368,14 @@ describe('State Machine handler tests', function () {
|
|
|
1012
1368
|
expect(call['callKeepaliveRetryCount']).toBe(4);
|
|
1013
1369
|
case 6:
|
|
1014
1370
|
case "end":
|
|
1015
|
-
return
|
|
1371
|
+
return _context20.stop();
|
|
1016
1372
|
}
|
|
1017
|
-
},
|
|
1373
|
+
}, _callee20);
|
|
1018
1374
|
})));
|
|
1019
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1375
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1020
1376
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
1021
|
-
return _regenerator.default.wrap(function (
|
|
1022
|
-
while (1) switch (
|
|
1377
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
1378
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1023
1379
|
case 0:
|
|
1024
1380
|
statusPayload = {
|
|
1025
1381
|
statusCode: 200,
|
|
@@ -1075,14 +1431,14 @@ describe('State Machine handler tests', function () {
|
|
|
1075
1431
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1076
1432
|
case 1:
|
|
1077
1433
|
case "end":
|
|
1078
|
-
return
|
|
1434
|
+
return _context21.stop();
|
|
1079
1435
|
}
|
|
1080
|
-
},
|
|
1436
|
+
}, _callee21);
|
|
1081
1437
|
})));
|
|
1082
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1438
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1083
1439
|
var statusPayload, dummyEvent;
|
|
1084
|
-
return _regenerator.default.wrap(function (
|
|
1085
|
-
while (1) switch (
|
|
1440
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
1441
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1086
1442
|
case 0:
|
|
1087
1443
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
1088
1444
|
statusPayload = {
|
|
@@ -1100,7 +1456,7 @@ describe('State Machine handler tests', function () {
|
|
|
1100
1456
|
webex.request.mockReturnValue(statusPayload);
|
|
1101
1457
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1102
1458
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
1103
|
-
|
|
1459
|
+
_context22.next = 1;
|
|
1104
1460
|
return call['handleOutgoingCallConnect']({
|
|
1105
1461
|
type: 'E_SEND_CALL_CONNECT'
|
|
1106
1462
|
});
|
|
@@ -1114,14 +1470,14 @@ describe('State Machine handler tests', function () {
|
|
|
1114
1470
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1115
1471
|
case 2:
|
|
1116
1472
|
case "end":
|
|
1117
|
-
return
|
|
1473
|
+
return _context22.stop();
|
|
1118
1474
|
}
|
|
1119
|
-
},
|
|
1475
|
+
}, _callee22);
|
|
1120
1476
|
})));
|
|
1121
|
-
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1477
|
+
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1122
1478
|
var callManager, statusPayload, call, dummyEvent, dummyOkEvent, emitSpy, startCallerIdSpy, mobiusProgressEvent;
|
|
1123
|
-
return _regenerator.default.wrap(function (
|
|
1124
|
-
while (1) switch (
|
|
1479
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
1480
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1125
1481
|
case 0:
|
|
1126
1482
|
callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
1127
1483
|
statusPayload = {
|
|
@@ -1215,14 +1571,14 @@ describe('State Machine handler tests', function () {
|
|
|
1215
1571
|
expect(call.earlyMedia).not.toBe(true);
|
|
1216
1572
|
case 1:
|
|
1217
1573
|
case "end":
|
|
1218
|
-
return
|
|
1574
|
+
return _context23.stop();
|
|
1219
1575
|
}
|
|
1220
|
-
},
|
|
1576
|
+
}, _callee23);
|
|
1221
1577
|
})));
|
|
1222
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1578
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1223
1579
|
var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
1224
|
-
return _regenerator.default.wrap(function (
|
|
1225
|
-
while (1) switch (
|
|
1580
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
1581
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1226
1582
|
case 0:
|
|
1227
1583
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1228
1584
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
@@ -1249,7 +1605,7 @@ describe('State Machine handler tests', function () {
|
|
|
1249
1605
|
webex.request.mockRejectedValueOnce({
|
|
1250
1606
|
statusCode: 403
|
|
1251
1607
|
}).mockResolvedValue(statusPayload);
|
|
1252
|
-
|
|
1608
|
+
_context24.next = 1;
|
|
1253
1609
|
return call['handleOutgoingCallConnect']({
|
|
1254
1610
|
type: 'E_SEND_CALL_CONNECT'
|
|
1255
1611
|
});
|
|
@@ -1260,14 +1616,14 @@ describe('State Machine handler tests', function () {
|
|
|
1260
1616
|
expect(errorSpy).toBeCalledTimes(1);
|
|
1261
1617
|
case 2:
|
|
1262
1618
|
case "end":
|
|
1263
|
-
return
|
|
1619
|
+
return _context24.stop();
|
|
1264
1620
|
}
|
|
1265
|
-
},
|
|
1621
|
+
}, _callee24);
|
|
1266
1622
|
})));
|
|
1267
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1623
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1268
1624
|
var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
|
|
1269
|
-
return _regenerator.default.wrap(function (
|
|
1270
|
-
while (1) switch (
|
|
1625
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
1626
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1271
1627
|
case 0:
|
|
1272
1628
|
statusPayload = {
|
|
1273
1629
|
statusCode: 200,
|
|
@@ -1343,14 +1699,14 @@ describe('State Machine handler tests', function () {
|
|
|
1343
1699
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1344
1700
|
case 1:
|
|
1345
1701
|
case "end":
|
|
1346
|
-
return
|
|
1702
|
+
return _context25.stop();
|
|
1347
1703
|
}
|
|
1348
|
-
},
|
|
1704
|
+
}, _callee25);
|
|
1349
1705
|
})));
|
|
1350
|
-
it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1706
|
+
it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1351
1707
|
var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
|
|
1352
|
-
return _regenerator.default.wrap(function (
|
|
1353
|
-
while (1) switch (
|
|
1708
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
1709
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1354
1710
|
case 0:
|
|
1355
1711
|
statusPayload = {
|
|
1356
1712
|
statusCode: 200,
|
|
@@ -1418,14 +1774,14 @@ describe('State Machine handler tests', function () {
|
|
|
1418
1774
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1419
1775
|
case 1:
|
|
1420
1776
|
case "end":
|
|
1421
|
-
return
|
|
1777
|
+
return _context26.stop();
|
|
1422
1778
|
}
|
|
1423
|
-
},
|
|
1779
|
+
}, _callee26);
|
|
1424
1780
|
})));
|
|
1425
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1781
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1426
1782
|
var statusPayload, dummyEvent;
|
|
1427
|
-
return _regenerator.default.wrap(function (
|
|
1428
|
-
while (1) switch (
|
|
1783
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
1784
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1429
1785
|
case 0:
|
|
1430
1786
|
statusPayload = {
|
|
1431
1787
|
statusCode: 200,
|
|
@@ -1464,14 +1820,14 @@ describe('State Machine handler tests', function () {
|
|
|
1464
1820
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1465
1821
|
case 1:
|
|
1466
1822
|
case "end":
|
|
1467
|
-
return
|
|
1823
|
+
return _context27.stop();
|
|
1468
1824
|
}
|
|
1469
|
-
},
|
|
1825
|
+
}, _callee27);
|
|
1470
1826
|
})));
|
|
1471
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1827
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1472
1828
|
var statusPayload, dummyEvent, errorSpy;
|
|
1473
|
-
return _regenerator.default.wrap(function (
|
|
1474
|
-
while (1) switch (
|
|
1829
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
1830
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1475
1831
|
case 0:
|
|
1476
1832
|
statusPayload = {
|
|
1477
1833
|
statusCode: 403,
|
|
@@ -1488,25 +1844,31 @@ describe('State Machine handler tests', function () {
|
|
|
1488
1844
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
1489
1845
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
1490
1846
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1491
|
-
|
|
1847
|
+
_context28.next = 1;
|
|
1492
1848
|
return (0, _testUtil.flushPromises)(3);
|
|
1493
1849
|
case 1:
|
|
1850
|
+
_context28.next = 2;
|
|
1851
|
+
return _promise.default.resolve();
|
|
1852
|
+
case 2:
|
|
1853
|
+
_context28.next = 3;
|
|
1854
|
+
return _promise.default.resolve();
|
|
1855
|
+
case 3:
|
|
1494
1856
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
1495
1857
|
expect(errorSpy).toHaveBeenCalled();
|
|
1496
1858
|
expect(uploadLogsSpy).toHaveBeenCalledWith({
|
|
1497
1859
|
correlationId: call.getCorrelationId(),
|
|
1498
1860
|
callId: call.getCallId()
|
|
1499
1861
|
});
|
|
1500
|
-
case
|
|
1862
|
+
case 4:
|
|
1501
1863
|
case "end":
|
|
1502
|
-
return
|
|
1864
|
+
return _context28.stop();
|
|
1503
1865
|
}
|
|
1504
|
-
},
|
|
1866
|
+
}, _callee28);
|
|
1505
1867
|
})));
|
|
1506
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1868
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1507
1869
|
var statusPayload, dummyEvent, warnSpy;
|
|
1508
|
-
return _regenerator.default.wrap(function (
|
|
1509
|
-
while (1) switch (
|
|
1870
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
1871
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1510
1872
|
case 0:
|
|
1511
1873
|
statusPayload = {
|
|
1512
1874
|
statusCode: 403,
|
|
@@ -1525,12 +1887,18 @@ describe('State Machine handler tests', function () {
|
|
|
1525
1887
|
webex.request.mockRejectedValue(statusPayload);
|
|
1526
1888
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1527
1889
|
jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
1528
|
-
|
|
1890
|
+
_context29.next = 1;
|
|
1529
1891
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1530
1892
|
case 1:
|
|
1531
|
-
|
|
1893
|
+
_context29.next = 2;
|
|
1532
1894
|
return (0, _testUtil.flushPromises)(2);
|
|
1533
1895
|
case 2:
|
|
1896
|
+
_context29.next = 3;
|
|
1897
|
+
return _promise.default.resolve();
|
|
1898
|
+
case 3:
|
|
1899
|
+
_context29.next = 4;
|
|
1900
|
+
return _promise.default.resolve();
|
|
1901
|
+
case 4:
|
|
1534
1902
|
expect(call.isConnected()).toBe(false);
|
|
1535
1903
|
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1536
1904
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
@@ -1542,16 +1910,16 @@ describe('State Machine handler tests', function () {
|
|
|
1542
1910
|
file: 'call',
|
|
1543
1911
|
method: 'handleRoapError'
|
|
1544
1912
|
});
|
|
1545
|
-
case
|
|
1913
|
+
case 5:
|
|
1546
1914
|
case "end":
|
|
1547
|
-
return
|
|
1915
|
+
return _context29.stop();
|
|
1548
1916
|
}
|
|
1549
|
-
},
|
|
1917
|
+
}, _callee29);
|
|
1550
1918
|
})));
|
|
1551
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1919
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1552
1920
|
var statusPayload, dummyEvent;
|
|
1553
|
-
return _regenerator.default.wrap(function (
|
|
1554
|
-
while (1) switch (
|
|
1921
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
1922
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1555
1923
|
case 0:
|
|
1556
1924
|
statusPayload = {
|
|
1557
1925
|
statusCode: 403,
|
|
@@ -1574,14 +1942,14 @@ describe('State Machine handler tests', function () {
|
|
|
1574
1942
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
1575
1943
|
case 1:
|
|
1576
1944
|
case "end":
|
|
1577
|
-
return
|
|
1945
|
+
return _context30.stop();
|
|
1578
1946
|
}
|
|
1579
|
-
},
|
|
1947
|
+
}, _callee30);
|
|
1580
1948
|
})));
|
|
1581
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1949
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1582
1950
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1583
|
-
return _regenerator.default.wrap(function (
|
|
1584
|
-
while (1) switch (
|
|
1951
|
+
return _regenerator.default.wrap(function (_context31) {
|
|
1952
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1585
1953
|
case 0:
|
|
1586
1954
|
statusPayload = {
|
|
1587
1955
|
statusCode: 503,
|
|
@@ -1603,7 +1971,7 @@ describe('State Machine handler tests', function () {
|
|
|
1603
1971
|
}
|
|
1604
1972
|
};
|
|
1605
1973
|
call['connected'] = true;
|
|
1606
|
-
|
|
1974
|
+
_context31.next = 1;
|
|
1607
1975
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1608
1976
|
case 1:
|
|
1609
1977
|
jest.advanceTimersByTime(1005);
|
|
@@ -1615,14 +1983,14 @@ describe('State Machine handler tests', function () {
|
|
|
1615
1983
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1616
1984
|
case 2:
|
|
1617
1985
|
case "end":
|
|
1618
|
-
return
|
|
1986
|
+
return _context31.stop();
|
|
1619
1987
|
}
|
|
1620
|
-
},
|
|
1988
|
+
}, _callee31);
|
|
1621
1989
|
})));
|
|
1622
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1990
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1623
1991
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1624
|
-
return _regenerator.default.wrap(function (
|
|
1625
|
-
while (1) switch (
|
|
1992
|
+
return _regenerator.default.wrap(function (_context32) {
|
|
1993
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1626
1994
|
case 0:
|
|
1627
1995
|
statusPayload = {
|
|
1628
1996
|
statusCode: 503,
|
|
@@ -1644,7 +2012,7 @@ describe('State Machine handler tests', function () {
|
|
|
1644
2012
|
}
|
|
1645
2013
|
};
|
|
1646
2014
|
call['connected'] = false;
|
|
1647
|
-
|
|
2015
|
+
_context32.next = 1;
|
|
1648
2016
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1649
2017
|
case 1:
|
|
1650
2018
|
jest.advanceTimersByTime(1005);
|
|
@@ -1655,14 +2023,14 @@ describe('State Machine handler tests', function () {
|
|
|
1655
2023
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1656
2024
|
case 2:
|
|
1657
2025
|
case "end":
|
|
1658
|
-
return
|
|
2026
|
+
return _context32.stop();
|
|
1659
2027
|
}
|
|
1660
|
-
},
|
|
2028
|
+
}, _callee32);
|
|
1661
2029
|
})));
|
|
1662
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2030
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1663
2031
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1664
|
-
return _regenerator.default.wrap(function (
|
|
1665
|
-
while (1) switch (
|
|
2032
|
+
return _regenerator.default.wrap(function (_context33) {
|
|
2033
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1666
2034
|
case 0:
|
|
1667
2035
|
statusPayload = {
|
|
1668
2036
|
statusCode: 503,
|
|
@@ -1684,7 +2052,7 @@ describe('State Machine handler tests', function () {
|
|
|
1684
2052
|
};
|
|
1685
2053
|
call['connected'] = true;
|
|
1686
2054
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
1687
|
-
|
|
2055
|
+
_context33.next = 1;
|
|
1688
2056
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1689
2057
|
case 1:
|
|
1690
2058
|
jest.advanceTimersByTime(1005);
|
|
@@ -1696,14 +2064,14 @@ describe('State Machine handler tests', function () {
|
|
|
1696
2064
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1697
2065
|
case 2:
|
|
1698
2066
|
case "end":
|
|
1699
|
-
return
|
|
2067
|
+
return _context33.stop();
|
|
1700
2068
|
}
|
|
1701
|
-
},
|
|
2069
|
+
}, _callee33);
|
|
1702
2070
|
})));
|
|
1703
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2071
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1704
2072
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1705
|
-
return _regenerator.default.wrap(function (
|
|
1706
|
-
while (1) switch (
|
|
2073
|
+
return _regenerator.default.wrap(function (_context34) {
|
|
2074
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1707
2075
|
case 0:
|
|
1708
2076
|
statusPayload = {
|
|
1709
2077
|
statusCode: 503,
|
|
@@ -1724,7 +2092,7 @@ describe('State Machine handler tests', function () {
|
|
|
1724
2092
|
}
|
|
1725
2093
|
};
|
|
1726
2094
|
call['connected'] = false;
|
|
1727
|
-
|
|
2095
|
+
_context34.next = 1;
|
|
1728
2096
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1729
2097
|
case 1:
|
|
1730
2098
|
jest.advanceTimersByTime(1005);
|
|
@@ -1736,14 +2104,14 @@ describe('State Machine handler tests', function () {
|
|
|
1736
2104
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1737
2105
|
case 2:
|
|
1738
2106
|
case "end":
|
|
1739
|
-
return
|
|
2107
|
+
return _context34.stop();
|
|
1740
2108
|
}
|
|
1741
|
-
},
|
|
2109
|
+
}, _callee34);
|
|
1742
2110
|
})));
|
|
1743
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2111
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
1744
2112
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1745
|
-
return _regenerator.default.wrap(function (
|
|
1746
|
-
while (1) switch (
|
|
2113
|
+
return _regenerator.default.wrap(function (_context35) {
|
|
2114
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1747
2115
|
case 0:
|
|
1748
2116
|
statusPayload = {
|
|
1749
2117
|
statusCode: 200,
|
|
@@ -1768,14 +2136,14 @@ describe('State Machine handler tests', function () {
|
|
|
1768
2136
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1769
2137
|
case 1:
|
|
1770
2138
|
case "end":
|
|
1771
|
-
return
|
|
2139
|
+
return _context35.stop();
|
|
1772
2140
|
}
|
|
1773
|
-
},
|
|
2141
|
+
}, _callee35);
|
|
1774
2142
|
})));
|
|
1775
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2143
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
1776
2144
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1777
|
-
return _regenerator.default.wrap(function (
|
|
1778
|
-
while (1) switch (
|
|
2145
|
+
return _regenerator.default.wrap(function (_context36) {
|
|
2146
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1779
2147
|
case 0:
|
|
1780
2148
|
statusPayload = {
|
|
1781
2149
|
statusCode: 503,
|
|
@@ -1797,7 +2165,7 @@ describe('State Machine handler tests', function () {
|
|
|
1797
2165
|
};
|
|
1798
2166
|
call['connected'] = true;
|
|
1799
2167
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1800
|
-
|
|
2168
|
+
_context36.next = 1;
|
|
1801
2169
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1802
2170
|
case 1:
|
|
1803
2171
|
jest.advanceTimersByTime(1005);
|
|
@@ -1809,14 +2177,14 @@ describe('State Machine handler tests', function () {
|
|
|
1809
2177
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1810
2178
|
case 2:
|
|
1811
2179
|
case "end":
|
|
1812
|
-
return
|
|
2180
|
+
return _context36.stop();
|
|
1813
2181
|
}
|
|
1814
|
-
},
|
|
2182
|
+
}, _callee36);
|
|
1815
2183
|
})));
|
|
1816
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2184
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
1817
2185
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1818
|
-
return _regenerator.default.wrap(function (
|
|
1819
|
-
while (1) switch (
|
|
2186
|
+
return _regenerator.default.wrap(function (_context37) {
|
|
2187
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1820
2188
|
case 0:
|
|
1821
2189
|
statusPayload = {
|
|
1822
2190
|
statusCode: 403,
|
|
@@ -1839,14 +2207,14 @@ describe('State Machine handler tests', function () {
|
|
|
1839
2207
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1840
2208
|
case 1:
|
|
1841
2209
|
case "end":
|
|
1842
|
-
return
|
|
2210
|
+
return _context37.stop();
|
|
1843
2211
|
}
|
|
1844
|
-
},
|
|
2212
|
+
}, _callee37);
|
|
1845
2213
|
})));
|
|
1846
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2214
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
1847
2215
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1848
|
-
return _regenerator.default.wrap(function (
|
|
1849
|
-
while (1) switch (
|
|
2216
|
+
return _regenerator.default.wrap(function (_context38) {
|
|
2217
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
1850
2218
|
case 0:
|
|
1851
2219
|
statusPayload = {
|
|
1852
2220
|
statusCode: 200,
|
|
@@ -1864,7 +2232,7 @@ describe('State Machine handler tests', function () {
|
|
|
1864
2232
|
}
|
|
1865
2233
|
};
|
|
1866
2234
|
call['connected'] = false;
|
|
1867
|
-
|
|
2235
|
+
_context38.next = 1;
|
|
1868
2236
|
return call['handleRoapError']({}, errorEvent);
|
|
1869
2237
|
case 1:
|
|
1870
2238
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -1880,14 +2248,14 @@ describe('State Machine handler tests', function () {
|
|
|
1880
2248
|
});
|
|
1881
2249
|
case 2:
|
|
1882
2250
|
case "end":
|
|
1883
|
-
return
|
|
2251
|
+
return _context38.stop();
|
|
1884
2252
|
}
|
|
1885
|
-
},
|
|
2253
|
+
}, _callee38);
|
|
1886
2254
|
})));
|
|
1887
|
-
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2255
|
+
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
1888
2256
|
var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
|
|
1889
|
-
return _regenerator.default.wrap(function (
|
|
1890
|
-
while (1) switch (
|
|
2257
|
+
return _regenerator.default.wrap(function (_context39) {
|
|
2258
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
1891
2259
|
case 0:
|
|
1892
2260
|
statusPayload = {
|
|
1893
2261
|
statusCode: 403,
|
|
@@ -1925,12 +2293,18 @@ describe('State Machine handler tests', function () {
|
|
|
1925
2293
|
messageType: 'ANSWER'
|
|
1926
2294
|
}
|
|
1927
2295
|
};
|
|
1928
|
-
|
|
2296
|
+
_context39.next = 1;
|
|
1929
2297
|
return call.sendMediaStateMachineEvt(answerEvent);
|
|
1930
2298
|
case 1:
|
|
1931
|
-
|
|
2299
|
+
_context39.next = 2;
|
|
1932
2300
|
return (0, _testUtil.flushPromises)(2);
|
|
1933
2301
|
case 2:
|
|
2302
|
+
_context39.next = 3;
|
|
2303
|
+
return _promise.default.resolve();
|
|
2304
|
+
case 3:
|
|
2305
|
+
_context39.next = 4;
|
|
2306
|
+
return _promise.default.resolve();
|
|
2307
|
+
case 4:
|
|
1934
2308
|
expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
|
|
1935
2309
|
expect(warnSpy).toHaveBeenCalledWith('Failed to send MediaAnswer request', {
|
|
1936
2310
|
file: 'call',
|
|
@@ -1944,16 +2318,16 @@ describe('State Machine handler tests', function () {
|
|
|
1944
2318
|
// Final state should be torn down and cleared for unconnected call
|
|
1945
2319
|
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1946
2320
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
1947
|
-
case
|
|
2321
|
+
case 5:
|
|
1948
2322
|
case "end":
|
|
1949
|
-
return
|
|
2323
|
+
return _context39.stop();
|
|
1950
2324
|
}
|
|
1951
|
-
},
|
|
2325
|
+
}, _callee39);
|
|
1952
2326
|
})));
|
|
1953
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2327
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
1954
2328
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1955
|
-
return _regenerator.default.wrap(function (
|
|
1956
|
-
while (1) switch (
|
|
2329
|
+
return _regenerator.default.wrap(function (_context40) {
|
|
2330
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
1957
2331
|
case 0:
|
|
1958
2332
|
statusPayload = {
|
|
1959
2333
|
statusCode: 200,
|
|
@@ -1986,7 +2360,7 @@ describe('State Machine handler tests', function () {
|
|
|
1986
2360
|
seq: 1,
|
|
1987
2361
|
messageType: 'ANSWER'
|
|
1988
2362
|
};
|
|
1989
|
-
|
|
2363
|
+
_context40.next = 1;
|
|
1990
2364
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1991
2365
|
case 1:
|
|
1992
2366
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2008,7 +2382,7 @@ describe('State Machine handler tests', function () {
|
|
|
2008
2382
|
seq: 2,
|
|
2009
2383
|
messageType: 'OFFER_REQUEST'
|
|
2010
2384
|
};
|
|
2011
|
-
|
|
2385
|
+
_context40.next = 2;
|
|
2012
2386
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2013
2387
|
case 2:
|
|
2014
2388
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2058,7 +2432,7 @@ describe('State Machine handler tests', function () {
|
|
|
2058
2432
|
};
|
|
2059
2433
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2060
2434
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2061
|
-
|
|
2435
|
+
_context40.next = 3;
|
|
2062
2436
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2063
2437
|
case 3:
|
|
2064
2438
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2067,7 +2441,7 @@ describe('State Machine handler tests', function () {
|
|
|
2067
2441
|
seq: 3,
|
|
2068
2442
|
messageType: 'ANSWER'
|
|
2069
2443
|
};
|
|
2070
|
-
|
|
2444
|
+
_context40.next = 4;
|
|
2071
2445
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2072
2446
|
case 4:
|
|
2073
2447
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2086,7 +2460,7 @@ describe('State Machine handler tests', function () {
|
|
|
2086
2460
|
messageType: 'OK'
|
|
2087
2461
|
}
|
|
2088
2462
|
};
|
|
2089
|
-
|
|
2463
|
+
_context40.next = 5;
|
|
2090
2464
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2091
2465
|
case 5:
|
|
2092
2466
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -2101,14 +2475,14 @@ describe('State Machine handler tests', function () {
|
|
|
2101
2475
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2102
2476
|
case 6:
|
|
2103
2477
|
case "end":
|
|
2104
|
-
return
|
|
2478
|
+
return _context40.stop();
|
|
2105
2479
|
}
|
|
2106
|
-
},
|
|
2480
|
+
}, _callee40);
|
|
2107
2481
|
})));
|
|
2108
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2482
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
|
|
2109
2483
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2110
|
-
return _regenerator.default.wrap(function (
|
|
2111
|
-
while (1) switch (
|
|
2484
|
+
return _regenerator.default.wrap(function (_context41) {
|
|
2485
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2112
2486
|
case 0:
|
|
2113
2487
|
mockStatusBody = {
|
|
2114
2488
|
device: {
|
|
@@ -2148,7 +2522,7 @@ describe('State Machine handler tests', function () {
|
|
|
2148
2522
|
seq: 1,
|
|
2149
2523
|
messageType: 'ANSWER'
|
|
2150
2524
|
};
|
|
2151
|
-
|
|
2525
|
+
_context41.next = 1;
|
|
2152
2526
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2153
2527
|
case 1:
|
|
2154
2528
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2170,7 +2544,7 @@ describe('State Machine handler tests', function () {
|
|
|
2170
2544
|
seq: 2,
|
|
2171
2545
|
messageType: 'OFFER_REQUEST'
|
|
2172
2546
|
};
|
|
2173
|
-
|
|
2547
|
+
_context41.next = 2;
|
|
2174
2548
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2175
2549
|
case 2:
|
|
2176
2550
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2220,7 +2594,7 @@ describe('State Machine handler tests', function () {
|
|
|
2220
2594
|
};
|
|
2221
2595
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2222
2596
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2223
|
-
|
|
2597
|
+
_context41.next = 3;
|
|
2224
2598
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2225
2599
|
case 3:
|
|
2226
2600
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2229,7 +2603,7 @@ describe('State Machine handler tests', function () {
|
|
|
2229
2603
|
seq: 3,
|
|
2230
2604
|
messageType: 'ANSWER'
|
|
2231
2605
|
};
|
|
2232
|
-
|
|
2606
|
+
_context41.next = 4;
|
|
2233
2607
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2234
2608
|
case 4:
|
|
2235
2609
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2246,7 +2620,7 @@ describe('State Machine handler tests', function () {
|
|
|
2246
2620
|
}
|
|
2247
2621
|
};
|
|
2248
2622
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
2249
|
-
|
|
2623
|
+
_context41.next = 5;
|
|
2250
2624
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2251
2625
|
case 5:
|
|
2252
2626
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -2262,14 +2636,14 @@ describe('State Machine handler tests', function () {
|
|
|
2262
2636
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2263
2637
|
case 6:
|
|
2264
2638
|
case "end":
|
|
2265
|
-
return
|
|
2639
|
+
return _context41.stop();
|
|
2266
2640
|
}
|
|
2267
|
-
},
|
|
2641
|
+
}, _callee41);
|
|
2268
2642
|
})));
|
|
2269
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2643
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
2270
2644
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
2271
|
-
return _regenerator.default.wrap(function (
|
|
2272
|
-
while (1) switch (
|
|
2645
|
+
return _regenerator.default.wrap(function (_context42) {
|
|
2646
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2273
2647
|
case 0:
|
|
2274
2648
|
statusPayload = {
|
|
2275
2649
|
statusCode: 200,
|
|
@@ -2330,20 +2704,20 @@ describe('State Machine handler tests', function () {
|
|
|
2330
2704
|
dummyEvent.data = undefined;
|
|
2331
2705
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2332
2706
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_HOLD');
|
|
2333
|
-
expect(infoSpy).
|
|
2707
|
+
expect(infoSpy).toHaveBeenCalledWith("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(call.getCorrelationId()), {
|
|
2334
2708
|
file: 'call',
|
|
2335
2709
|
method: 'handleCallHold'
|
|
2336
2710
|
});
|
|
2337
2711
|
case 1:
|
|
2338
2712
|
case "end":
|
|
2339
|
-
return
|
|
2713
|
+
return _context42.stop();
|
|
2340
2714
|
}
|
|
2341
|
-
},
|
|
2715
|
+
}, _callee42);
|
|
2342
2716
|
})));
|
|
2343
|
-
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2717
|
+
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
|
|
2344
2718
|
var emitSpy, deleteSpy;
|
|
2345
|
-
return _regenerator.default.wrap(function (
|
|
2346
|
-
while (1) switch (
|
|
2719
|
+
return _regenerator.default.wrap(function (_context43) {
|
|
2720
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2347
2721
|
case 0:
|
|
2348
2722
|
emitSpy = jest.spyOn(call, 'emit');
|
|
2349
2723
|
deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
|
|
@@ -2352,7 +2726,7 @@ describe('State Machine handler tests', function () {
|
|
|
2352
2726
|
call.sendCallStateMachineEvt({
|
|
2353
2727
|
type: 'E_RECV_CALL_DISCONNECT'
|
|
2354
2728
|
});
|
|
2355
|
-
|
|
2729
|
+
_context43.next = 1;
|
|
2356
2730
|
return (0, _testUtil.flushPromises)(1);
|
|
2357
2731
|
case 1:
|
|
2358
2732
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
@@ -2360,9 +2734,9 @@ describe('State Machine handler tests', function () {
|
|
|
2360
2734
|
expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
|
|
2361
2735
|
case 2:
|
|
2362
2736
|
case "end":
|
|
2363
|
-
return
|
|
2737
|
+
return _context43.stop();
|
|
2364
2738
|
}
|
|
2365
|
-
},
|
|
2739
|
+
}, _callee43);
|
|
2366
2740
|
})));
|
|
2367
2741
|
describe('Call event timers tests', function () {
|
|
2368
2742
|
var callManager;
|
|
@@ -2373,10 +2747,10 @@ describe('State Machine handler tests', function () {
|
|
|
2373
2747
|
afterEach(function () {
|
|
2374
2748
|
jest.clearAllTimers();
|
|
2375
2749
|
});
|
|
2376
|
-
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2750
|
+
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2377
2751
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2378
|
-
return _regenerator.default.wrap(function (
|
|
2379
|
-
while (1) switch (
|
|
2752
|
+
return _regenerator.default.wrap(function (_context44) {
|
|
2753
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2380
2754
|
case 0:
|
|
2381
2755
|
statusPayload = {
|
|
2382
2756
|
statusCode: 200,
|
|
@@ -2393,7 +2767,7 @@ describe('State Machine handler tests', function () {
|
|
|
2393
2767
|
webex.request.mockReturnValue(statusPayload);
|
|
2394
2768
|
|
|
2395
2769
|
// handleOutgoingCallSetup is asynchronous
|
|
2396
|
-
|
|
2770
|
+
_context44.next = 1;
|
|
2397
2771
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2398
2772
|
case 1:
|
|
2399
2773
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2436,14 +2810,14 @@ describe('State Machine handler tests', function () {
|
|
|
2436
2810
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2437
2811
|
case 2:
|
|
2438
2812
|
case "end":
|
|
2439
|
-
return
|
|
2813
|
+
return _context44.stop();
|
|
2440
2814
|
}
|
|
2441
|
-
},
|
|
2815
|
+
}, _callee44);
|
|
2442
2816
|
})));
|
|
2443
|
-
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2817
|
+
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
2444
2818
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2445
|
-
return _regenerator.default.wrap(function (
|
|
2446
|
-
while (1) switch (
|
|
2819
|
+
return _regenerator.default.wrap(function (_context45) {
|
|
2820
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2447
2821
|
case 0:
|
|
2448
2822
|
statusPayload = {
|
|
2449
2823
|
statusCode: 200,
|
|
@@ -2462,7 +2836,7 @@ describe('State Machine handler tests', function () {
|
|
|
2462
2836
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2463
2837
|
|
|
2464
2838
|
// handleOutgoingCallSetup is asynchronous
|
|
2465
|
-
|
|
2839
|
+
_context45.next = 1;
|
|
2466
2840
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2467
2841
|
case 1:
|
|
2468
2842
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2474,9 +2848,9 @@ describe('State Machine handler tests', function () {
|
|
|
2474
2848
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2475
2849
|
case 2:
|
|
2476
2850
|
case "end":
|
|
2477
|
-
return
|
|
2851
|
+
return _context45.stop();
|
|
2478
2852
|
}
|
|
2479
|
-
},
|
|
2853
|
+
}, _callee45);
|
|
2480
2854
|
})));
|
|
2481
2855
|
});
|
|
2482
2856
|
});
|
|
@@ -2495,6 +2869,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2495
2869
|
};
|
|
2496
2870
|
var call;
|
|
2497
2871
|
beforeEach(function () {
|
|
2872
|
+
_request.APIRequest.resetInstance();
|
|
2873
|
+
_request.APIRequest.getInstance({
|
|
2874
|
+
webex: webex,
|
|
2875
|
+
isMobiusSocketEnabled: false
|
|
2876
|
+
});
|
|
2498
2877
|
/* Since we are not actually testing from the start of a call , so it's good to set the below
|
|
2499
2878
|
* parameters manually
|
|
2500
2879
|
*/
|
|
@@ -2536,10 +2915,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2536
2915
|
beforeEach(function () {
|
|
2537
2916
|
call.removeAllListeners();
|
|
2538
2917
|
});
|
|
2539
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2918
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
|
|
2540
2919
|
var responsePayload, warnSpy, roapEvent;
|
|
2541
|
-
return _regenerator.default.wrap(function (
|
|
2542
|
-
while (1) switch (
|
|
2920
|
+
return _regenerator.default.wrap(function (_context47) {
|
|
2921
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2543
2922
|
case 0:
|
|
2544
2923
|
expect.assertions(7);
|
|
2545
2924
|
responsePayload = {
|
|
@@ -2552,25 +2931,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2552
2931
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2553
2932
|
call['held'] = false;
|
|
2554
2933
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2555
|
-
var
|
|
2556
|
-
return _regenerator.default.wrap(function (
|
|
2557
|
-
while (1) switch (
|
|
2934
|
+
var _ref56 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46(correlationId) {
|
|
2935
|
+
return _regenerator.default.wrap(function (_context46) {
|
|
2936
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2558
2937
|
case 0:
|
|
2559
2938
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2560
2939
|
case 1:
|
|
2561
2940
|
case "end":
|
|
2562
|
-
return
|
|
2941
|
+
return _context46.stop();
|
|
2563
2942
|
}
|
|
2564
|
-
},
|
|
2943
|
+
}, _callee46);
|
|
2565
2944
|
}));
|
|
2566
2945
|
return function (_x) {
|
|
2567
|
-
return
|
|
2946
|
+
return _ref56.apply(this, arguments);
|
|
2568
2947
|
};
|
|
2569
2948
|
}());
|
|
2570
|
-
|
|
2949
|
+
_context47.next = 1;
|
|
2571
2950
|
return call.doHoldResume();
|
|
2572
2951
|
case 1:
|
|
2573
|
-
|
|
2952
|
+
_context47.next = 2;
|
|
2574
2953
|
return (0, _testUtil.flushPromises)(2);
|
|
2575
2954
|
case 2:
|
|
2576
2955
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2586,11 +2965,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2586
2965
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2587
2966
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2588
2967
|
roapEvent.data.type = 'ANSWER';
|
|
2589
|
-
|
|
2968
|
+
_context47.next = 3;
|
|
2590
2969
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2591
2970
|
case 3:
|
|
2592
2971
|
roapEvent.data.type = 'OK';
|
|
2593
|
-
|
|
2972
|
+
_context47.next = 4;
|
|
2594
2973
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2595
2974
|
case 4:
|
|
2596
2975
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2605,14 +2984,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2605
2984
|
});
|
|
2606
2985
|
case 5:
|
|
2607
2986
|
case "end":
|
|
2608
|
-
return
|
|
2987
|
+
return _context47.stop();
|
|
2609
2988
|
}
|
|
2610
|
-
},
|
|
2989
|
+
}, _callee47);
|
|
2611
2990
|
})));
|
|
2612
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2991
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49() {
|
|
2613
2992
|
var responsePayload, warnSpy, roapEvent;
|
|
2614
|
-
return _regenerator.default.wrap(function (
|
|
2615
|
-
while (1) switch (
|
|
2993
|
+
return _regenerator.default.wrap(function (_context49) {
|
|
2994
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2616
2995
|
case 0:
|
|
2617
2996
|
expect.assertions(8);
|
|
2618
2997
|
responsePayload = {
|
|
@@ -2625,26 +3004,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2625
3004
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2626
3005
|
call['held'] = false;
|
|
2627
3006
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2628
|
-
var
|
|
2629
|
-
return _regenerator.default.wrap(function (
|
|
2630
|
-
while (1) switch (
|
|
3007
|
+
var _ref58 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48(correlationId) {
|
|
3008
|
+
return _regenerator.default.wrap(function (_context48) {
|
|
3009
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2631
3010
|
case 0:
|
|
2632
3011
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2633
3012
|
case 1:
|
|
2634
3013
|
case "end":
|
|
2635
|
-
return
|
|
3014
|
+
return _context48.stop();
|
|
2636
3015
|
}
|
|
2637
|
-
},
|
|
3016
|
+
}, _callee48);
|
|
2638
3017
|
}));
|
|
2639
3018
|
return function (_x2) {
|
|
2640
|
-
return
|
|
3019
|
+
return _ref58.apply(this, arguments);
|
|
2641
3020
|
};
|
|
2642
3021
|
}());
|
|
2643
3022
|
call.doHoldResume();
|
|
2644
|
-
|
|
3023
|
+
_context49.next = 1;
|
|
2645
3024
|
return _promise.default.resolve();
|
|
2646
3025
|
case 1:
|
|
2647
|
-
|
|
3026
|
+
_context49.next = 2;
|
|
2648
3027
|
return _promise.default.resolve();
|
|
2649
3028
|
case 2:
|
|
2650
3029
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2660,11 +3039,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2660
3039
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2661
3040
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2662
3041
|
roapEvent.data.type = 'ANSWER';
|
|
2663
|
-
|
|
3042
|
+
_context49.next = 3;
|
|
2664
3043
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2665
3044
|
case 3:
|
|
2666
3045
|
roapEvent.data.type = 'OK';
|
|
2667
|
-
|
|
3046
|
+
_context49.next = 4;
|
|
2668
3047
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2669
3048
|
case 4:
|
|
2670
3049
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2679,14 +3058,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2679
3058
|
});
|
|
2680
3059
|
case 5:
|
|
2681
3060
|
case "end":
|
|
2682
|
-
return
|
|
3061
|
+
return _context49.stop();
|
|
2683
3062
|
}
|
|
2684
|
-
},
|
|
3063
|
+
}, _callee49);
|
|
2685
3064
|
})));
|
|
2686
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3065
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
|
|
2687
3066
|
var responsePayload;
|
|
2688
|
-
return _regenerator.default.wrap(function (
|
|
2689
|
-
while (1) switch (
|
|
3067
|
+
return _regenerator.default.wrap(function (_context51) {
|
|
3068
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2690
3069
|
case 0:
|
|
2691
3070
|
expect.assertions(4);
|
|
2692
3071
|
responsePayload = {
|
|
@@ -2696,26 +3075,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2696
3075
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2697
3076
|
call['held'] = false;
|
|
2698
3077
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2699
|
-
var
|
|
2700
|
-
return _regenerator.default.wrap(function (
|
|
2701
|
-
while (1) switch (
|
|
3078
|
+
var _ref60 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50(errObj) {
|
|
3079
|
+
return _regenerator.default.wrap(function (_context50) {
|
|
3080
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2702
3081
|
case 0:
|
|
2703
3082
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2704
3083
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2705
3084
|
case 1:
|
|
2706
3085
|
case "end":
|
|
2707
|
-
return
|
|
3086
|
+
return _context50.stop();
|
|
2708
3087
|
}
|
|
2709
|
-
},
|
|
3088
|
+
}, _callee50);
|
|
2710
3089
|
}));
|
|
2711
3090
|
return function (_x3) {
|
|
2712
|
-
return
|
|
3091
|
+
return _ref60.apply(this, arguments);
|
|
2713
3092
|
};
|
|
2714
3093
|
}());
|
|
2715
|
-
|
|
3094
|
+
_context51.next = 1;
|
|
2716
3095
|
return call.doHoldResume();
|
|
2717
3096
|
case 1:
|
|
2718
|
-
|
|
3097
|
+
_context51.next = 2;
|
|
2719
3098
|
return (0, _testUtil.flushPromises)(2);
|
|
2720
3099
|
case 2:
|
|
2721
3100
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2725,14 +3104,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2725
3104
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2726
3105
|
case 3:
|
|
2727
3106
|
case "end":
|
|
2728
|
-
return
|
|
3107
|
+
return _context51.stop();
|
|
2729
3108
|
}
|
|
2730
|
-
},
|
|
3109
|
+
}, _callee51);
|
|
2731
3110
|
})));
|
|
2732
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3111
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
|
|
2733
3112
|
var responsePayload, rejectPayload, roapEvent;
|
|
2734
|
-
return _regenerator.default.wrap(function (
|
|
2735
|
-
while (1) switch (
|
|
3113
|
+
return _regenerator.default.wrap(function (_context53) {
|
|
3114
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2736
3115
|
case 0:
|
|
2737
3116
|
expect.assertions(5);
|
|
2738
3117
|
responsePayload = {
|
|
@@ -2746,24 +3125,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2746
3125
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2747
3126
|
call['held'] = false;
|
|
2748
3127
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2749
|
-
var
|
|
2750
|
-
return _regenerator.default.wrap(function (
|
|
2751
|
-
while (1) switch (
|
|
3128
|
+
var _ref62 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52(errObj) {
|
|
3129
|
+
return _regenerator.default.wrap(function (_context52) {
|
|
3130
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2752
3131
|
case 0:
|
|
2753
3132
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2754
3133
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2755
3134
|
case 1:
|
|
2756
3135
|
case "end":
|
|
2757
|
-
return
|
|
3136
|
+
return _context52.stop();
|
|
2758
3137
|
}
|
|
2759
|
-
},
|
|
3138
|
+
}, _callee52);
|
|
2760
3139
|
}));
|
|
2761
3140
|
return function (_x4) {
|
|
2762
|
-
return
|
|
3141
|
+
return _ref62.apply(this, arguments);
|
|
2763
3142
|
};
|
|
2764
3143
|
}());
|
|
2765
3144
|
call.doHoldResume();
|
|
2766
|
-
|
|
3145
|
+
_context53.next = 1;
|
|
2767
3146
|
return (0, _testUtil.flushPromises)(2);
|
|
2768
3147
|
case 1:
|
|
2769
3148
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2773,7 +3152,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2773
3152
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2774
3153
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2775
3154
|
roapEvent.data.type = 'ANSWER';
|
|
2776
|
-
|
|
3155
|
+
_context53.next = 2;
|
|
2777
3156
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2778
3157
|
case 2:
|
|
2779
3158
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2781,14 +3160,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2781
3160
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2782
3161
|
case 3:
|
|
2783
3162
|
case "end":
|
|
2784
|
-
return
|
|
3163
|
+
return _context53.stop();
|
|
2785
3164
|
}
|
|
2786
|
-
},
|
|
3165
|
+
}, _callee53);
|
|
2787
3166
|
})));
|
|
2788
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3167
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
|
|
2789
3168
|
var responsePayload, warnSpy, roapEvent;
|
|
2790
|
-
return _regenerator.default.wrap(function (
|
|
2791
|
-
while (1) switch (
|
|
3169
|
+
return _regenerator.default.wrap(function (_context54) {
|
|
3170
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2792
3171
|
case 0:
|
|
2793
3172
|
responsePayload = {
|
|
2794
3173
|
statusCode: 200,
|
|
@@ -2799,10 +3178,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2799
3178
|
jest.spyOn(global, 'clearTimeout');
|
|
2800
3179
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2801
3180
|
call['held'] = false;
|
|
2802
|
-
|
|
3181
|
+
_context54.next = 1;
|
|
2803
3182
|
return call.doHoldResume();
|
|
2804
3183
|
case 1:
|
|
2805
|
-
|
|
3184
|
+
_context54.next = 2;
|
|
2806
3185
|
return (0, _testUtil.flushPromises)(2);
|
|
2807
3186
|
case 2:
|
|
2808
3187
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2817,19 +3196,19 @@ describe('Supplementary Services tests', function () {
|
|
|
2817
3196
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2818
3197
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2819
3198
|
roapEvent.data.type = 'ANSWER';
|
|
2820
|
-
|
|
3199
|
+
_context54.next = 3;
|
|
2821
3200
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2822
3201
|
case 3:
|
|
2823
3202
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2824
3203
|
statusCode: 403
|
|
2825
3204
|
});
|
|
2826
3205
|
roapEvent.data.type = 'OK';
|
|
2827
|
-
|
|
3206
|
+
_context54.next = 4;
|
|
2828
3207
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2829
3208
|
case 4:
|
|
2830
3209
|
/* this is for coverage */
|
|
2831
3210
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2832
|
-
|
|
3211
|
+
_context54.next = 5;
|
|
2833
3212
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2834
3213
|
case 5:
|
|
2835
3214
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2841,14 +3220,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2841
3220
|
});
|
|
2842
3221
|
case 6:
|
|
2843
3222
|
case "end":
|
|
2844
|
-
return
|
|
3223
|
+
return _context54.stop();
|
|
2845
3224
|
}
|
|
2846
|
-
},
|
|
3225
|
+
}, _callee54);
|
|
2847
3226
|
})));
|
|
2848
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3227
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
2849
3228
|
var responsePayload, warnSpy, roapEvent;
|
|
2850
|
-
return _regenerator.default.wrap(function (
|
|
2851
|
-
while (1) switch (
|
|
3229
|
+
return _regenerator.default.wrap(function (_context55) {
|
|
3230
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2852
3231
|
case 0:
|
|
2853
3232
|
responsePayload = {
|
|
2854
3233
|
statusCode: 200,
|
|
@@ -2859,10 +3238,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2859
3238
|
jest.spyOn(global, 'clearTimeout');
|
|
2860
3239
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2861
3240
|
call['held'] = true;
|
|
2862
|
-
|
|
3241
|
+
_context55.next = 1;
|
|
2863
3242
|
return call.doHoldResume();
|
|
2864
3243
|
case 1:
|
|
2865
|
-
|
|
3244
|
+
_context55.next = 2;
|
|
2866
3245
|
return (0, _testUtil.flushPromises)(2);
|
|
2867
3246
|
case 2:
|
|
2868
3247
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2877,14 +3256,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2877
3256
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2878
3257
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2879
3258
|
roapEvent.data.type = 'ANSWER';
|
|
2880
|
-
|
|
3259
|
+
_context55.next = 3;
|
|
2881
3260
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2882
3261
|
case 3:
|
|
2883
3262
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2884
3263
|
statusCode: 403
|
|
2885
3264
|
});
|
|
2886
3265
|
roapEvent.data.type = 'OK';
|
|
2887
|
-
|
|
3266
|
+
_context55.next = 4;
|
|
2888
3267
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2889
3268
|
case 4:
|
|
2890
3269
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2896,14 +3275,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2896
3275
|
});
|
|
2897
3276
|
case 5:
|
|
2898
3277
|
case "end":
|
|
2899
|
-
return
|
|
3278
|
+
return _context55.stop();
|
|
2900
3279
|
}
|
|
2901
|
-
},
|
|
3280
|
+
}, _callee55);
|
|
2902
3281
|
})));
|
|
2903
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3282
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57() {
|
|
2904
3283
|
var responsePayload, roapEvent;
|
|
2905
|
-
return _regenerator.default.wrap(function (
|
|
2906
|
-
while (1) switch (
|
|
3284
|
+
return _regenerator.default.wrap(function (_context57) {
|
|
3285
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2907
3286
|
case 0:
|
|
2908
3287
|
expect.assertions(5);
|
|
2909
3288
|
responsePayload = {
|
|
@@ -2913,25 +3292,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2913
3292
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2914
3293
|
call['held'] = false;
|
|
2915
3294
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2916
|
-
var
|
|
2917
|
-
return _regenerator.default.wrap(function (
|
|
2918
|
-
while (1) switch (
|
|
3295
|
+
var _ref66 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56(errObj) {
|
|
3296
|
+
return _regenerator.default.wrap(function (_context56) {
|
|
3297
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2919
3298
|
case 0:
|
|
2920
3299
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2921
3300
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
2922
3301
|
case 1:
|
|
2923
3302
|
case "end":
|
|
2924
|
-
return
|
|
3303
|
+
return _context56.stop();
|
|
2925
3304
|
}
|
|
2926
|
-
},
|
|
3305
|
+
}, _callee56);
|
|
2927
3306
|
}));
|
|
2928
3307
|
return function (_x5) {
|
|
2929
|
-
return
|
|
3308
|
+
return _ref66.apply(this, arguments);
|
|
2930
3309
|
};
|
|
2931
3310
|
}());
|
|
2932
3311
|
jest.runAllTimers();
|
|
2933
3312
|
call.doHoldResume();
|
|
2934
|
-
|
|
3313
|
+
_context57.next = 1;
|
|
2935
3314
|
return (0, _testUtil.flushPromises)(2);
|
|
2936
3315
|
case 1:
|
|
2937
3316
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2944,11 +3323,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2944
3323
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2945
3324
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2946
3325
|
roapEvent.data.type = 'ANSWER';
|
|
2947
|
-
|
|
3326
|
+
_context57.next = 2;
|
|
2948
3327
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2949
3328
|
case 2:
|
|
2950
3329
|
roapEvent.data.type = 'OK';
|
|
2951
|
-
|
|
3330
|
+
_context57.next = 3;
|
|
2952
3331
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2953
3332
|
case 3:
|
|
2954
3333
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2960,14 +3339,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2960
3339
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2961
3340
|
case 4:
|
|
2962
3341
|
case "end":
|
|
2963
|
-
return
|
|
3342
|
+
return _context57.stop();
|
|
2964
3343
|
}
|
|
2965
|
-
},
|
|
3344
|
+
}, _callee57);
|
|
2966
3345
|
})));
|
|
2967
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3346
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59() {
|
|
2968
3347
|
var responsePayload, warnSpy, roapEvent;
|
|
2969
|
-
return _regenerator.default.wrap(function (
|
|
2970
|
-
while (1) switch (
|
|
3348
|
+
return _regenerator.default.wrap(function (_context59) {
|
|
3349
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
2971
3350
|
case 0:
|
|
2972
3351
|
expect.assertions(7);
|
|
2973
3352
|
responsePayload = {
|
|
@@ -2980,25 +3359,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2980
3359
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2981
3360
|
call['held'] = true;
|
|
2982
3361
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2983
|
-
var
|
|
2984
|
-
return _regenerator.default.wrap(function (
|
|
2985
|
-
while (1) switch (
|
|
3362
|
+
var _ref68 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58(correlationId) {
|
|
3363
|
+
return _regenerator.default.wrap(function (_context58) {
|
|
3364
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2986
3365
|
case 0:
|
|
2987
3366
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2988
3367
|
case 1:
|
|
2989
3368
|
case "end":
|
|
2990
|
-
return
|
|
3369
|
+
return _context58.stop();
|
|
2991
3370
|
}
|
|
2992
|
-
},
|
|
3371
|
+
}, _callee58);
|
|
2993
3372
|
}));
|
|
2994
3373
|
return function (_x6) {
|
|
2995
|
-
return
|
|
3374
|
+
return _ref68.apply(this, arguments);
|
|
2996
3375
|
};
|
|
2997
3376
|
}());
|
|
2998
|
-
|
|
3377
|
+
_context59.next = 1;
|
|
2999
3378
|
return call.doHoldResume();
|
|
3000
3379
|
case 1:
|
|
3001
|
-
|
|
3380
|
+
_context59.next = 2;
|
|
3002
3381
|
return (0, _testUtil.flushPromises)(2);
|
|
3003
3382
|
case 2:
|
|
3004
3383
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3014,11 +3393,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3014
3393
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3015
3394
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3016
3395
|
roapEvent.data.type = 'ANSWER';
|
|
3017
|
-
|
|
3396
|
+
_context59.next = 3;
|
|
3018
3397
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3019
3398
|
case 3:
|
|
3020
3399
|
roapEvent.data.type = 'OK';
|
|
3021
|
-
|
|
3400
|
+
_context59.next = 4;
|
|
3022
3401
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3023
3402
|
case 4:
|
|
3024
3403
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3033,14 +3412,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3033
3412
|
});
|
|
3034
3413
|
case 5:
|
|
3035
3414
|
case "end":
|
|
3036
|
-
return
|
|
3415
|
+
return _context59.stop();
|
|
3037
3416
|
}
|
|
3038
|
-
},
|
|
3417
|
+
}, _callee59);
|
|
3039
3418
|
})));
|
|
3040
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3419
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61() {
|
|
3041
3420
|
var responsePayload, warnSpy, roapEvent;
|
|
3042
|
-
return _regenerator.default.wrap(function (
|
|
3043
|
-
while (1) switch (
|
|
3421
|
+
return _regenerator.default.wrap(function (_context61) {
|
|
3422
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
3044
3423
|
case 0:
|
|
3045
3424
|
expect.assertions(7);
|
|
3046
3425
|
responsePayload = {
|
|
@@ -3053,26 +3432,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3053
3432
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3054
3433
|
call['held'] = true;
|
|
3055
3434
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3056
|
-
var
|
|
3057
|
-
return _regenerator.default.wrap(function (
|
|
3058
|
-
while (1) switch (
|
|
3435
|
+
var _ref70 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60(correlationId) {
|
|
3436
|
+
return _regenerator.default.wrap(function (_context60) {
|
|
3437
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
3059
3438
|
case 0:
|
|
3060
3439
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3061
3440
|
case 1:
|
|
3062
3441
|
case "end":
|
|
3063
|
-
return
|
|
3442
|
+
return _context60.stop();
|
|
3064
3443
|
}
|
|
3065
|
-
},
|
|
3444
|
+
}, _callee60);
|
|
3066
3445
|
}));
|
|
3067
3446
|
return function (_x7) {
|
|
3068
|
-
return
|
|
3447
|
+
return _ref70.apply(this, arguments);
|
|
3069
3448
|
};
|
|
3070
3449
|
}());
|
|
3071
3450
|
call.doHoldResume();
|
|
3072
|
-
|
|
3451
|
+
_context61.next = 1;
|
|
3073
3452
|
return _promise.default.resolve();
|
|
3074
3453
|
case 1:
|
|
3075
|
-
|
|
3454
|
+
_context61.next = 2;
|
|
3076
3455
|
return _promise.default.resolve();
|
|
3077
3456
|
case 2:
|
|
3078
3457
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -3088,11 +3467,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3088
3467
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3089
3468
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3090
3469
|
roapEvent.data.type = 'ANSWER';
|
|
3091
|
-
|
|
3470
|
+
_context61.next = 3;
|
|
3092
3471
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3093
3472
|
case 3:
|
|
3094
3473
|
roapEvent.data.type = 'OK';
|
|
3095
|
-
|
|
3474
|
+
_context61.next = 4;
|
|
3096
3475
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3097
3476
|
case 4:
|
|
3098
3477
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -3107,14 +3486,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3107
3486
|
});
|
|
3108
3487
|
case 5:
|
|
3109
3488
|
case "end":
|
|
3110
|
-
return
|
|
3489
|
+
return _context61.stop();
|
|
3111
3490
|
}
|
|
3112
|
-
},
|
|
3491
|
+
}, _callee61);
|
|
3113
3492
|
})));
|
|
3114
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3493
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
|
|
3115
3494
|
var responsePayload;
|
|
3116
|
-
return _regenerator.default.wrap(function (
|
|
3117
|
-
while (1) switch (
|
|
3495
|
+
return _regenerator.default.wrap(function (_context63) {
|
|
3496
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3118
3497
|
case 0:
|
|
3119
3498
|
expect.assertions(4);
|
|
3120
3499
|
responsePayload = {
|
|
@@ -3124,26 +3503,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3124
3503
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3125
3504
|
call['held'] = true;
|
|
3126
3505
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3127
|
-
var
|
|
3128
|
-
return _regenerator.default.wrap(function (
|
|
3129
|
-
while (1) switch (
|
|
3506
|
+
var _ref72 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(errObj) {
|
|
3507
|
+
return _regenerator.default.wrap(function (_context62) {
|
|
3508
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
3130
3509
|
case 0:
|
|
3131
3510
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3132
3511
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3133
3512
|
case 1:
|
|
3134
3513
|
case "end":
|
|
3135
|
-
return
|
|
3514
|
+
return _context62.stop();
|
|
3136
3515
|
}
|
|
3137
|
-
},
|
|
3516
|
+
}, _callee62);
|
|
3138
3517
|
}));
|
|
3139
3518
|
return function (_x8) {
|
|
3140
|
-
return
|
|
3519
|
+
return _ref72.apply(this, arguments);
|
|
3141
3520
|
};
|
|
3142
3521
|
}());
|
|
3143
|
-
|
|
3522
|
+
_context63.next = 1;
|
|
3144
3523
|
return call.doHoldResume();
|
|
3145
3524
|
case 1:
|
|
3146
|
-
|
|
3525
|
+
_context63.next = 2;
|
|
3147
3526
|
return (0, _testUtil.flushPromises)(2);
|
|
3148
3527
|
case 2:
|
|
3149
3528
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3154,14 +3533,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3154
3533
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3155
3534
|
case 3:
|
|
3156
3535
|
case "end":
|
|
3157
|
-
return
|
|
3536
|
+
return _context63.stop();
|
|
3158
3537
|
}
|
|
3159
|
-
},
|
|
3538
|
+
}, _callee63);
|
|
3160
3539
|
})));
|
|
3161
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3540
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65() {
|
|
3162
3541
|
var responsePayload, rejectPayload, roapEvent;
|
|
3163
|
-
return _regenerator.default.wrap(function (
|
|
3164
|
-
while (1) switch (
|
|
3542
|
+
return _regenerator.default.wrap(function (_context65) {
|
|
3543
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3165
3544
|
case 0:
|
|
3166
3545
|
expect.assertions(5);
|
|
3167
3546
|
responsePayload = {
|
|
@@ -3175,24 +3554,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3175
3554
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
3176
3555
|
call['held'] = true;
|
|
3177
3556
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3178
|
-
var
|
|
3179
|
-
return _regenerator.default.wrap(function (
|
|
3180
|
-
while (1) switch (
|
|
3557
|
+
var _ref74 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64(errObj) {
|
|
3558
|
+
return _regenerator.default.wrap(function (_context64) {
|
|
3559
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
3181
3560
|
case 0:
|
|
3182
3561
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3183
3562
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3184
3563
|
case 1:
|
|
3185
3564
|
case "end":
|
|
3186
|
-
return
|
|
3565
|
+
return _context64.stop();
|
|
3187
3566
|
}
|
|
3188
|
-
},
|
|
3567
|
+
}, _callee64);
|
|
3189
3568
|
}));
|
|
3190
3569
|
return function (_x9) {
|
|
3191
|
-
return
|
|
3570
|
+
return _ref74.apply(this, arguments);
|
|
3192
3571
|
};
|
|
3193
3572
|
}());
|
|
3194
3573
|
call.doHoldResume();
|
|
3195
|
-
|
|
3574
|
+
_context65.next = 1;
|
|
3196
3575
|
return (0, _testUtil.flushPromises)(2);
|
|
3197
3576
|
case 1:
|
|
3198
3577
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -3203,7 +3582,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3203
3582
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3204
3583
|
/* We are intentionally failing the ROAP ANSWER */
|
|
3205
3584
|
roapEvent.data.type = 'ANSWER';
|
|
3206
|
-
|
|
3585
|
+
_context65.next = 2;
|
|
3207
3586
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3208
3587
|
case 2:
|
|
3209
3588
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3211,14 +3590,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3211
3590
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3212
3591
|
case 3:
|
|
3213
3592
|
case "end":
|
|
3214
|
-
return
|
|
3593
|
+
return _context65.stop();
|
|
3215
3594
|
}
|
|
3216
|
-
},
|
|
3595
|
+
}, _callee65);
|
|
3217
3596
|
})));
|
|
3218
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3597
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67() {
|
|
3219
3598
|
var responsePayload, roapEvent;
|
|
3220
|
-
return _regenerator.default.wrap(function (
|
|
3221
|
-
while (1) switch (
|
|
3599
|
+
return _regenerator.default.wrap(function (_context67) {
|
|
3600
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3222
3601
|
case 0:
|
|
3223
3602
|
expect.assertions(5);
|
|
3224
3603
|
responsePayload = {
|
|
@@ -3228,24 +3607,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3228
3607
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
3229
3608
|
call['held'] = true;
|
|
3230
3609
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3231
|
-
var
|
|
3232
|
-
return _regenerator.default.wrap(function (
|
|
3233
|
-
while (1) switch (
|
|
3610
|
+
var _ref76 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66(errObj) {
|
|
3611
|
+
return _regenerator.default.wrap(function (_context66) {
|
|
3612
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3234
3613
|
case 0:
|
|
3235
3614
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3236
3615
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
3237
3616
|
case 1:
|
|
3238
3617
|
case "end":
|
|
3239
|
-
return
|
|
3618
|
+
return _context66.stop();
|
|
3240
3619
|
}
|
|
3241
|
-
},
|
|
3620
|
+
}, _callee66);
|
|
3242
3621
|
}));
|
|
3243
3622
|
return function (_x0) {
|
|
3244
|
-
return
|
|
3623
|
+
return _ref76.apply(this, arguments);
|
|
3245
3624
|
};
|
|
3246
3625
|
}());
|
|
3247
3626
|
call.doHoldResume();
|
|
3248
|
-
|
|
3627
|
+
_context67.next = 1;
|
|
3249
3628
|
return (0, _testUtil.flushPromises)(2);
|
|
3250
3629
|
case 1:
|
|
3251
3630
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -3258,11 +3637,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3258
3637
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3259
3638
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3260
3639
|
roapEvent.data.type = 'ANSWER';
|
|
3261
|
-
|
|
3640
|
+
_context67.next = 2;
|
|
3262
3641
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3263
3642
|
case 2:
|
|
3264
3643
|
roapEvent.data.type = 'OK';
|
|
3265
|
-
|
|
3644
|
+
_context67.next = 3;
|
|
3266
3645
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3267
3646
|
case 3:
|
|
3268
3647
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3272,9 +3651,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3272
3651
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3273
3652
|
case 4:
|
|
3274
3653
|
case "end":
|
|
3275
|
-
return
|
|
3654
|
+
return _context67.stop();
|
|
3276
3655
|
}
|
|
3277
|
-
},
|
|
3656
|
+
}, _callee67);
|
|
3278
3657
|
})));
|
|
3279
3658
|
});
|
|
3280
3659
|
describe('Call transfer tests', function () {
|
|
@@ -3307,10 +3686,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3307
3686
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
3308
3687
|
secondCall['held'] = false;
|
|
3309
3688
|
});
|
|
3310
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3689
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70() {
|
|
3311
3690
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3312
|
-
return _regenerator.default.wrap(function (
|
|
3313
|
-
while (1) switch (
|
|
3691
|
+
return _regenerator.default.wrap(function (_context70) {
|
|
3692
|
+
while (1) switch (_context70.prev = _context70.next) {
|
|
3314
3693
|
case 0:
|
|
3315
3694
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3316
3695
|
responsePayload = {
|
|
@@ -3322,41 +3701,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3322
3701
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3323
3702
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3324
3703
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3325
|
-
var
|
|
3326
|
-
return _regenerator.default.wrap(function (
|
|
3327
|
-
while (1) switch (
|
|
3704
|
+
var _ref78 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68(correlationId) {
|
|
3705
|
+
return _regenerator.default.wrap(function (_context68) {
|
|
3706
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
3328
3707
|
case 0:
|
|
3329
3708
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3330
3709
|
case 1:
|
|
3331
3710
|
case "end":
|
|
3332
|
-
return
|
|
3711
|
+
return _context68.stop();
|
|
3333
3712
|
}
|
|
3334
|
-
},
|
|
3713
|
+
}, _callee68);
|
|
3335
3714
|
}));
|
|
3336
3715
|
return function (_x1) {
|
|
3337
|
-
return
|
|
3716
|
+
return _ref78.apply(this, arguments);
|
|
3338
3717
|
};
|
|
3339
3718
|
}());
|
|
3340
3719
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3341
|
-
var
|
|
3342
|
-
return _regenerator.default.wrap(function (
|
|
3343
|
-
while (1) switch (
|
|
3720
|
+
var _ref79 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69(correlationId) {
|
|
3721
|
+
return _regenerator.default.wrap(function (_context69) {
|
|
3722
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
3344
3723
|
case 0:
|
|
3345
3724
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3346
3725
|
case 1:
|
|
3347
3726
|
case "end":
|
|
3348
|
-
return
|
|
3727
|
+
return _context69.stop();
|
|
3349
3728
|
}
|
|
3350
|
-
},
|
|
3729
|
+
}, _callee69);
|
|
3351
3730
|
}));
|
|
3352
3731
|
return function (_x10) {
|
|
3353
|
-
return
|
|
3732
|
+
return _ref79.apply(this, arguments);
|
|
3354
3733
|
};
|
|
3355
3734
|
}());
|
|
3356
|
-
|
|
3735
|
+
_context70.next = 1;
|
|
3357
3736
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3358
3737
|
case 1:
|
|
3359
|
-
|
|
3738
|
+
_context70.next = 2;
|
|
3360
3739
|
return (0, _testUtil.flushPromises)(2);
|
|
3361
3740
|
case 2:
|
|
3362
3741
|
expect(requestSpy).toBeCalled();
|
|
@@ -3379,14 +3758,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3379
3758
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3380
3759
|
case 3:
|
|
3381
3760
|
case "end":
|
|
3382
|
-
return
|
|
3761
|
+
return _context70.stop();
|
|
3383
3762
|
}
|
|
3384
|
-
},
|
|
3763
|
+
}, _callee70);
|
|
3385
3764
|
})));
|
|
3386
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3765
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
|
|
3387
3766
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3388
|
-
return _regenerator.default.wrap(function (
|
|
3389
|
-
while (1) switch (
|
|
3767
|
+
return _regenerator.default.wrap(function (_context72) {
|
|
3768
|
+
while (1) switch (_context72.prev = _context72.next) {
|
|
3390
3769
|
case 0:
|
|
3391
3770
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3392
3771
|
responsePayload = {
|
|
@@ -3398,25 +3777,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3398
3777
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3399
3778
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3400
3779
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3401
|
-
var
|
|
3402
|
-
return _regenerator.default.wrap(function (
|
|
3403
|
-
while (1) switch (
|
|
3780
|
+
var _ref81 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71(correlationId) {
|
|
3781
|
+
return _regenerator.default.wrap(function (_context71) {
|
|
3782
|
+
while (1) switch (_context71.prev = _context71.next) {
|
|
3404
3783
|
case 0:
|
|
3405
3784
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3406
3785
|
case 1:
|
|
3407
3786
|
case "end":
|
|
3408
|
-
return
|
|
3787
|
+
return _context71.stop();
|
|
3409
3788
|
}
|
|
3410
|
-
},
|
|
3789
|
+
}, _callee71);
|
|
3411
3790
|
}));
|
|
3412
3791
|
return function (_x11) {
|
|
3413
|
-
return
|
|
3792
|
+
return _ref81.apply(this, arguments);
|
|
3414
3793
|
};
|
|
3415
3794
|
}());
|
|
3416
|
-
|
|
3795
|
+
_context72.next = 1;
|
|
3417
3796
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3418
3797
|
case 1:
|
|
3419
|
-
|
|
3798
|
+
_context72.next = 2;
|
|
3420
3799
|
return (0, _testUtil.flushPromises)(2);
|
|
3421
3800
|
case 2:
|
|
3422
3801
|
expect(requestSpy).toBeCalled();
|
|
@@ -3435,14 +3814,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3435
3814
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3436
3815
|
case 3:
|
|
3437
3816
|
case "end":
|
|
3438
|
-
return
|
|
3817
|
+
return _context72.stop();
|
|
3439
3818
|
}
|
|
3440
|
-
},
|
|
3819
|
+
}, _callee72);
|
|
3441
3820
|
})));
|
|
3442
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3821
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
|
|
3443
3822
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3444
|
-
return _regenerator.default.wrap(function (
|
|
3445
|
-
while (1) switch (
|
|
3823
|
+
return _regenerator.default.wrap(function (_context73) {
|
|
3824
|
+
while (1) switch (_context73.prev = _context73.next) {
|
|
3446
3825
|
case 0:
|
|
3447
3826
|
responsePayload = {
|
|
3448
3827
|
statusCode: 403,
|
|
@@ -3453,10 +3832,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3453
3832
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3454
3833
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3455
3834
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3456
|
-
|
|
3835
|
+
_context73.next = 1;
|
|
3457
3836
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3458
3837
|
case 1:
|
|
3459
|
-
|
|
3838
|
+
_context73.next = 2;
|
|
3460
3839
|
return (0, _testUtil.flushPromises)(1);
|
|
3461
3840
|
case 2:
|
|
3462
3841
|
expect(requestSpy).toBeCalled();
|
|
@@ -3477,14 +3856,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3477
3856
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3478
3857
|
case 3:
|
|
3479
3858
|
case "end":
|
|
3480
|
-
return
|
|
3859
|
+
return _context73.stop();
|
|
3481
3860
|
}
|
|
3482
|
-
},
|
|
3861
|
+
}, _callee73);
|
|
3483
3862
|
})));
|
|
3484
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3863
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee74() {
|
|
3485
3864
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3486
|
-
return _regenerator.default.wrap(function (
|
|
3487
|
-
while (1) switch (
|
|
3865
|
+
return _regenerator.default.wrap(function (_context74) {
|
|
3866
|
+
while (1) switch (_context74.prev = _context74.next) {
|
|
3488
3867
|
case 0:
|
|
3489
3868
|
responsePayload = {
|
|
3490
3869
|
statusCode: 403,
|
|
@@ -3494,10 +3873,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3494
3873
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3495
3874
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3496
3875
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3497
|
-
|
|
3876
|
+
_context74.next = 1;
|
|
3498
3877
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3499
3878
|
case 1:
|
|
3500
|
-
|
|
3879
|
+
_context74.next = 2;
|
|
3501
3880
|
return (0, _testUtil.flushPromises)(2);
|
|
3502
3881
|
case 2:
|
|
3503
3882
|
expect(requestSpy).toBeCalled();
|
|
@@ -3518,18 +3897,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3518
3897
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3519
3898
|
case 3:
|
|
3520
3899
|
case "end":
|
|
3521
|
-
return
|
|
3900
|
+
return _context74.stop();
|
|
3522
3901
|
}
|
|
3523
|
-
},
|
|
3902
|
+
}, _callee74);
|
|
3524
3903
|
})));
|
|
3525
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3904
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee75() {
|
|
3526
3905
|
var requestSpy, warnSpy;
|
|
3527
|
-
return _regenerator.default.wrap(function (
|
|
3528
|
-
while (1) switch (
|
|
3906
|
+
return _regenerator.default.wrap(function (_context75) {
|
|
3907
|
+
while (1) switch (_context75.prev = _context75.next) {
|
|
3529
3908
|
case 0:
|
|
3530
3909
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3531
3910
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3532
|
-
|
|
3911
|
+
_context75.next = 1;
|
|
3533
3912
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3534
3913
|
case 1:
|
|
3535
3914
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3541,18 +3920,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3541
3920
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3542
3921
|
case 2:
|
|
3543
3922
|
case "end":
|
|
3544
|
-
return
|
|
3923
|
+
return _context75.stop();
|
|
3545
3924
|
}
|
|
3546
|
-
},
|
|
3925
|
+
}, _callee75);
|
|
3547
3926
|
})));
|
|
3548
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3927
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee76() {
|
|
3549
3928
|
var requestSpy, warnSpy;
|
|
3550
|
-
return _regenerator.default.wrap(function (
|
|
3551
|
-
while (1) switch (
|
|
3929
|
+
return _regenerator.default.wrap(function (_context76) {
|
|
3930
|
+
while (1) switch (_context76.prev = _context76.next) {
|
|
3552
3931
|
case 0:
|
|
3553
3932
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3554
3933
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3555
|
-
|
|
3934
|
+
_context76.next = 1;
|
|
3556
3935
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3557
3936
|
case 1:
|
|
3558
3937
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3564,9 +3943,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3564
3943
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3565
3944
|
case 2:
|
|
3566
3945
|
case "end":
|
|
3567
|
-
return
|
|
3946
|
+
return _context76.stop();
|
|
3568
3947
|
}
|
|
3569
|
-
},
|
|
3948
|
+
}, _callee76);
|
|
3570
3949
|
})));
|
|
3571
3950
|
});
|
|
3572
3951
|
});
|