@webex/calling 3.12.0-next.9 → 3.12.0-next.91
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/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 +456 -226
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +513 -154
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +634 -454
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +809 -451
- 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 +8 -1
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +62 -10
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +890 -497
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +649 -58
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js +26 -0
- 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/Errors/types.js +2 -0
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/types.js +38 -1
- 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 +212 -71
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +417 -181
- 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/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 +126 -10
- package/dist/module/CallingClient/calling/call.js +198 -66
- 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 +4 -2
- package/dist/module/CallingClient/registration/register.js +266 -64
- package/dist/module/CallingClient/registration/types.js +5 -1
- 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/Errors/types.js +2 -0
- package/dist/module/Events/types.js +23 -0
- 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 +85 -22
- 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/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 +8 -0
- 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 +8 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +27 -2
- 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 +4 -2
- 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/Errors/types.d.ts +2 -0
- package/dist/types/Errors/types.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +80 -6
- 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 +9 -4
- 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 +5 -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 +21 -5
- package/src/mobius-socket/socket/socket.shim.ts +22 -0
- package/src/mobius-socket/socket/socket.ts +14 -0
|
@@ -1,15 +1,21 @@
|
|
|
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
21
|
var _mediaHelpers = require("@webex/media-helpers");
|
|
@@ -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: {
|
|
@@ -487,7 +799,7 @@ 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 */
|
|
@@ -498,14 +810,32 @@ describe('Call Tests', function () {
|
|
|
498
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('
|
|
817
|
+
it('does not register effect listeners when the added effect cannot be resolved', function () {
|
|
818
|
+
var mockStream = {
|
|
819
|
+
outputStream: {
|
|
820
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
821
|
+
},
|
|
822
|
+
on: jest.fn(),
|
|
823
|
+
getEffectByKind: jest.fn().mockReturnValue(undefined)
|
|
824
|
+
};
|
|
825
|
+
var localAudioStream = mockStream;
|
|
826
|
+
var onStreamSpy = jest.spyOn(localAudioStream, 'on');
|
|
827
|
+
var onEffectSpy = jest.spyOn(mockEffect, 'on');
|
|
828
|
+
var call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
829
|
+
call.dial(localAudioStream);
|
|
830
|
+
expect(function () {
|
|
831
|
+
return onStreamSpy.mock.calls[1][1](undefined);
|
|
832
|
+
}).not.toThrow();
|
|
833
|
+
expect(onEffectSpy).not.toHaveBeenCalled();
|
|
834
|
+
});
|
|
835
|
+
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
506
836
|
var mockStream, localAudioStream, warnSpy, call;
|
|
507
|
-
return _regenerator.default.wrap(function (
|
|
508
|
-
while (1) switch (
|
|
837
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
838
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
509
839
|
case 0:
|
|
510
840
|
mockStream = {
|
|
511
841
|
outputStream: {
|
|
@@ -529,7 +859,7 @@ describe('Call Tests', function () {
|
|
|
529
859
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
530
860
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
531
861
|
call.answer(localAudioStream);
|
|
532
|
-
|
|
862
|
+
_context10.next = 1;
|
|
533
863
|
return (0, _Utils.waitForMsecs)(50);
|
|
534
864
|
case 1:
|
|
535
865
|
expect(warnSpy).toBeCalledTimes(2);
|
|
@@ -544,14 +874,14 @@ describe('Call Tests', function () {
|
|
|
544
874
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
545
875
|
case 2:
|
|
546
876
|
case "end":
|
|
547
|
-
return
|
|
877
|
+
return _context10.stop();
|
|
548
878
|
}
|
|
549
|
-
},
|
|
879
|
+
}, _callee10);
|
|
550
880
|
})));
|
|
551
|
-
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
881
|
+
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
552
882
|
var mockStream, localAudioStream, warnSpy, call;
|
|
553
|
-
return _regenerator.default.wrap(function (
|
|
554
|
-
while (1) switch (
|
|
883
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
884
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
555
885
|
case 0:
|
|
556
886
|
mockStream = {
|
|
557
887
|
outputStream: {
|
|
@@ -563,7 +893,7 @@ describe('Call Tests', function () {
|
|
|
563
893
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
564
894
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
565
895
|
call.dial(localAudioStream);
|
|
566
|
-
|
|
896
|
+
_context11.next = 1;
|
|
567
897
|
return (0, _Utils.waitForMsecs)(50);
|
|
568
898
|
case 1:
|
|
569
899
|
expect(warnSpy).toBeCalledTimes(1);
|
|
@@ -576,9 +906,9 @@ describe('Call Tests', function () {
|
|
|
576
906
|
expect(webex.request).not.toBeCalledOnceWith();
|
|
577
907
|
case 2:
|
|
578
908
|
case "end":
|
|
579
|
-
return
|
|
909
|
+
return _context11.stop();
|
|
580
910
|
}
|
|
581
|
-
},
|
|
911
|
+
}, _callee11);
|
|
582
912
|
})));
|
|
583
913
|
it('update media after call creation with valid stream', function () {
|
|
584
914
|
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
@@ -652,10 +982,10 @@ describe('Call Tests', function () {
|
|
|
652
982
|
method: 'dial'
|
|
653
983
|
});
|
|
654
984
|
});
|
|
655
|
-
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
985
|
+
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
656
986
|
var logSpy, callManager, mockStream, localAudioStream, call;
|
|
657
|
-
return _regenerator.default.wrap(function (
|
|
658
|
-
while (1) switch (
|
|
987
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
988
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
659
989
|
case 0:
|
|
660
990
|
logSpy = jest.spyOn(_Logger.default, 'info');
|
|
661
991
|
webex.request.mockReturnValue({
|
|
@@ -731,9 +1061,9 @@ describe('Call Tests', function () {
|
|
|
731
1061
|
expect(mockStream.setUserMuted).toBeCalledOnceWith(false);
|
|
732
1062
|
case 1:
|
|
733
1063
|
case "end":
|
|
734
|
-
return
|
|
1064
|
+
return _context12.stop();
|
|
735
1065
|
}
|
|
736
|
-
},
|
|
1066
|
+
}, _callee12);
|
|
737
1067
|
})));
|
|
738
1068
|
describe('Guest Calling Flow Tests', function () {
|
|
739
1069
|
var dummyEvent = {
|
|
@@ -741,10 +1071,10 @@ describe('Call Tests', function () {
|
|
|
741
1071
|
data: undefined
|
|
742
1072
|
};
|
|
743
1073
|
var call;
|
|
744
|
-
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1074
|
+
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
745
1075
|
var requestSpy, requestArgs;
|
|
746
|
-
return _regenerator.default.wrap(function (
|
|
747
|
-
while (1) switch (
|
|
1076
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
1077
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
748
1078
|
case 0:
|
|
749
1079
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
750
1080
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -757,14 +1087,14 @@ describe('Call Tests', function () {
|
|
|
757
1087
|
expect('callee' in requestArgs.body).toBe(true);
|
|
758
1088
|
case 1:
|
|
759
1089
|
case "end":
|
|
760
|
-
return
|
|
1090
|
+
return _context13.stop();
|
|
761
1091
|
}
|
|
762
|
-
},
|
|
1092
|
+
}, _callee13);
|
|
763
1093
|
})));
|
|
764
|
-
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1094
|
+
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
765
1095
|
var requestSpy, requestArgs;
|
|
766
|
-
return _regenerator.default.wrap(function (
|
|
767
|
-
while (1) switch (
|
|
1096
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
1097
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
768
1098
|
case 0:
|
|
769
1099
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
770
1100
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -777,9 +1107,9 @@ describe('Call Tests', function () {
|
|
|
777
1107
|
expect('callee' in requestArgs.body).toBe(false);
|
|
778
1108
|
case 1:
|
|
779
1109
|
case "end":
|
|
780
|
-
return
|
|
1110
|
+
return _context14.stop();
|
|
781
1111
|
}
|
|
782
|
-
},
|
|
1112
|
+
}, _callee14);
|
|
783
1113
|
})));
|
|
784
1114
|
});
|
|
785
1115
|
});
|
|
@@ -799,6 +1129,11 @@ describe('State Machine handler tests', function () {
|
|
|
799
1129
|
var call;
|
|
800
1130
|
var dtmfMock;
|
|
801
1131
|
beforeEach(function () {
|
|
1132
|
+
_request.APIRequest.resetInstance();
|
|
1133
|
+
_request.APIRequest.getInstance({
|
|
1134
|
+
webex: webex,
|
|
1135
|
+
isMobiusSocketEnabled: false
|
|
1136
|
+
});
|
|
802
1137
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
803
1138
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
804
1139
|
var dummy = 10;
|
|
@@ -812,10 +1147,10 @@ describe('State Machine handler tests', function () {
|
|
|
812
1147
|
|
|
813
1148
|
// afterEach(() => call.removeAllListeners());
|
|
814
1149
|
|
|
815
|
-
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1150
|
+
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
816
1151
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
817
|
-
return _regenerator.default.wrap(function (
|
|
818
|
-
while (1) switch (
|
|
1152
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
1153
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
819
1154
|
case 0:
|
|
820
1155
|
statusPayload = {
|
|
821
1156
|
statusCode: 200,
|
|
@@ -835,7 +1170,7 @@ describe('State Machine handler tests', function () {
|
|
|
835
1170
|
/* This is to flush all the promises from the Promise queue so that
|
|
836
1171
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
837
1172
|
*/
|
|
838
|
-
|
|
1173
|
+
_context15.next = 1;
|
|
839
1174
|
return (0, _testUtil.flushPromises)(3);
|
|
840
1175
|
case 1:
|
|
841
1176
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
@@ -851,14 +1186,14 @@ describe('State Machine handler tests', function () {
|
|
|
851
1186
|
});
|
|
852
1187
|
case 2:
|
|
853
1188
|
case "end":
|
|
854
|
-
return
|
|
1189
|
+
return _context15.stop();
|
|
855
1190
|
}
|
|
856
|
-
},
|
|
1191
|
+
}, _callee15);
|
|
857
1192
|
})));
|
|
858
|
-
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1193
|
+
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
859
1194
|
var statusPayload, emitSpy, funcSpy;
|
|
860
|
-
return _regenerator.default.wrap(function (
|
|
861
|
-
while (1) switch (
|
|
1195
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
1196
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
862
1197
|
case 0:
|
|
863
1198
|
expect.assertions(4);
|
|
864
1199
|
statusPayload = {
|
|
@@ -873,10 +1208,10 @@ describe('State Machine handler tests', function () {
|
|
|
873
1208
|
funcSpy = jest.spyOn(call, 'postStatus').mockRejectedValue(statusPayload);
|
|
874
1209
|
call['handleCallEstablished']({});
|
|
875
1210
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
876
|
-
|
|
1211
|
+
_context16.next = 1;
|
|
877
1212
|
return _promise.default.resolve();
|
|
878
1213
|
case 1:
|
|
879
|
-
|
|
1214
|
+
_context16.next = 2;
|
|
880
1215
|
return _promise.default.resolve();
|
|
881
1216
|
case 2:
|
|
882
1217
|
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
@@ -886,14 +1221,14 @@ describe('State Machine handler tests', function () {
|
|
|
886
1221
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
887
1222
|
case 3:
|
|
888
1223
|
case "end":
|
|
889
|
-
return
|
|
1224
|
+
return _context16.stop();
|
|
890
1225
|
}
|
|
891
|
-
},
|
|
1226
|
+
}, _callee16);
|
|
892
1227
|
})));
|
|
893
|
-
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1228
|
+
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
894
1229
|
var statusPayload, funcSpy;
|
|
895
|
-
return _regenerator.default.wrap(function (
|
|
896
|
-
while (1) switch (
|
|
1230
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
1231
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
897
1232
|
case 0:
|
|
898
1233
|
expect.assertions(4);
|
|
899
1234
|
statusPayload = {
|
|
@@ -912,7 +1247,7 @@ describe('State Machine handler tests', function () {
|
|
|
912
1247
|
/* This is to flush all the promises from the Promise queue so that
|
|
913
1248
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
914
1249
|
*/
|
|
915
|
-
|
|
1250
|
+
_context17.next = 1;
|
|
916
1251
|
return (0, _testUtil.flushPromises)(2);
|
|
917
1252
|
case 1:
|
|
918
1253
|
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
@@ -921,14 +1256,14 @@ describe('State Machine handler tests', function () {
|
|
|
921
1256
|
expect(funcSpy).toBeCalledTimes(1);
|
|
922
1257
|
case 2:
|
|
923
1258
|
case "end":
|
|
924
|
-
return
|
|
1259
|
+
return _context17.stop();
|
|
925
1260
|
}
|
|
926
|
-
},
|
|
1261
|
+
}, _callee17);
|
|
927
1262
|
})));
|
|
928
|
-
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1263
|
+
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
929
1264
|
var errorPayload, okPayload, scheduleKeepaliveSpy, postStatusSpy;
|
|
930
|
-
return _regenerator.default.wrap(function (
|
|
931
|
-
while (1) switch (
|
|
1265
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
1266
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
932
1267
|
case 0:
|
|
933
1268
|
errorPayload = {
|
|
934
1269
|
statusCode: 500,
|
|
@@ -946,28 +1281,28 @@ describe('State Machine handler tests', function () {
|
|
|
946
1281
|
call['handleCallEstablished']({});
|
|
947
1282
|
}
|
|
948
1283
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
949
|
-
|
|
1284
|
+
_context18.next = 1;
|
|
950
1285
|
return (0, _testUtil.flushPromises)(2);
|
|
951
1286
|
case 1:
|
|
952
1287
|
expect(postStatusSpy).toHaveBeenCalledTimes(1);
|
|
953
1288
|
|
|
954
1289
|
// Now advance by 1 second for the retry-after interval
|
|
955
1290
|
jest.advanceTimersByTime(1000);
|
|
956
|
-
|
|
1291
|
+
_context18.next = 2;
|
|
957
1292
|
return (0, _testUtil.flushPromises)(2);
|
|
958
1293
|
case 2:
|
|
959
1294
|
expect(postStatusSpy).toHaveBeenCalledTimes(2);
|
|
960
1295
|
expect(scheduleKeepaliveSpy).toHaveBeenCalledTimes(2);
|
|
961
1296
|
case 3:
|
|
962
1297
|
case "end":
|
|
963
|
-
return
|
|
1298
|
+
return _context18.stop();
|
|
964
1299
|
}
|
|
965
|
-
},
|
|
1300
|
+
}, _callee18);
|
|
966
1301
|
})));
|
|
967
|
-
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1302
|
+
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
968
1303
|
var firstTimer, secondTimer;
|
|
969
|
-
return _regenerator.default.wrap(function (
|
|
970
|
-
while (1) switch (
|
|
1304
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
1305
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
971
1306
|
case 0:
|
|
972
1307
|
jest.spyOn(global, 'setInterval');
|
|
973
1308
|
jest.spyOn(global, 'clearInterval');
|
|
@@ -995,14 +1330,14 @@ describe('State Machine handler tests', function () {
|
|
|
995
1330
|
expect(secondTimer).toBeDefined();
|
|
996
1331
|
case 1:
|
|
997
1332
|
case "end":
|
|
998
|
-
return
|
|
1333
|
+
return _context19.stop();
|
|
999
1334
|
}
|
|
1000
|
-
},
|
|
1335
|
+
}, _callee19);
|
|
1001
1336
|
})));
|
|
1002
|
-
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1337
|
+
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
1003
1338
|
var errorPayload, warnSpy, postStatusSpy;
|
|
1004
|
-
return _regenerator.default.wrap(function (
|
|
1005
|
-
while (1) switch (
|
|
1339
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
1340
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1006
1341
|
case 0:
|
|
1007
1342
|
errorPayload = {
|
|
1008
1343
|
statusCode: 500,
|
|
@@ -1021,25 +1356,25 @@ describe('State Machine handler tests', function () {
|
|
|
1021
1356
|
|
|
1022
1357
|
// Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
|
|
1023
1358
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
1024
|
-
|
|
1359
|
+
_context20.next = 1;
|
|
1025
1360
|
return (0, _testUtil.flushPromises)(2);
|
|
1026
1361
|
case 1:
|
|
1027
1362
|
// Now advance by 1 second for each of the 4 retry attempts (retry-after: 1 second each)
|
|
1028
1363
|
// Need to do this separately to allow state machine to process and create new intervals
|
|
1029
1364
|
jest.advanceTimersByTime(1000);
|
|
1030
|
-
|
|
1365
|
+
_context20.next = 2;
|
|
1031
1366
|
return (0, _testUtil.flushPromises)(2);
|
|
1032
1367
|
case 2:
|
|
1033
1368
|
jest.advanceTimersByTime(1000);
|
|
1034
|
-
|
|
1369
|
+
_context20.next = 3;
|
|
1035
1370
|
return (0, _testUtil.flushPromises)(2);
|
|
1036
1371
|
case 3:
|
|
1037
1372
|
jest.advanceTimersByTime(1000);
|
|
1038
|
-
|
|
1373
|
+
_context20.next = 4;
|
|
1039
1374
|
return (0, _testUtil.flushPromises)(2);
|
|
1040
1375
|
case 4:
|
|
1041
1376
|
jest.advanceTimersByTime(1000);
|
|
1042
|
-
|
|
1377
|
+
_context20.next = 5;
|
|
1043
1378
|
return (0, _testUtil.flushPromises)(2);
|
|
1044
1379
|
case 5:
|
|
1045
1380
|
// The error handler should detect we're at max retry count and stop
|
|
@@ -1051,14 +1386,14 @@ describe('State Machine handler tests', function () {
|
|
|
1051
1386
|
expect(call['callKeepaliveRetryCount']).toBe(4);
|
|
1052
1387
|
case 6:
|
|
1053
1388
|
case "end":
|
|
1054
|
-
return
|
|
1389
|
+
return _context20.stop();
|
|
1055
1390
|
}
|
|
1056
|
-
},
|
|
1391
|
+
}, _callee20);
|
|
1057
1392
|
})));
|
|
1058
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1393
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1059
1394
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
1060
|
-
return _regenerator.default.wrap(function (
|
|
1061
|
-
while (1) switch (
|
|
1395
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
1396
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1062
1397
|
case 0:
|
|
1063
1398
|
statusPayload = {
|
|
1064
1399
|
statusCode: 200,
|
|
@@ -1114,14 +1449,14 @@ describe('State Machine handler tests', function () {
|
|
|
1114
1449
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1115
1450
|
case 1:
|
|
1116
1451
|
case "end":
|
|
1117
|
-
return
|
|
1452
|
+
return _context21.stop();
|
|
1118
1453
|
}
|
|
1119
|
-
},
|
|
1454
|
+
}, _callee21);
|
|
1120
1455
|
})));
|
|
1121
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1456
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1122
1457
|
var statusPayload, dummyEvent;
|
|
1123
|
-
return _regenerator.default.wrap(function (
|
|
1124
|
-
while (1) switch (
|
|
1458
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
1459
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1125
1460
|
case 0:
|
|
1126
1461
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
1127
1462
|
statusPayload = {
|
|
@@ -1139,7 +1474,7 @@ describe('State Machine handler tests', function () {
|
|
|
1139
1474
|
webex.request.mockReturnValue(statusPayload);
|
|
1140
1475
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1141
1476
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
1142
|
-
|
|
1477
|
+
_context22.next = 1;
|
|
1143
1478
|
return call['handleOutgoingCallConnect']({
|
|
1144
1479
|
type: 'E_SEND_CALL_CONNECT'
|
|
1145
1480
|
});
|
|
@@ -1153,14 +1488,14 @@ describe('State Machine handler tests', function () {
|
|
|
1153
1488
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1154
1489
|
case 2:
|
|
1155
1490
|
case "end":
|
|
1156
|
-
return
|
|
1491
|
+
return _context22.stop();
|
|
1157
1492
|
}
|
|
1158
|
-
},
|
|
1493
|
+
}, _callee22);
|
|
1159
1494
|
})));
|
|
1160
|
-
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1495
|
+
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1161
1496
|
var callManager, statusPayload, call, dummyEvent, dummyOkEvent, emitSpy, startCallerIdSpy, mobiusProgressEvent;
|
|
1162
|
-
return _regenerator.default.wrap(function (
|
|
1163
|
-
while (1) switch (
|
|
1497
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
1498
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1164
1499
|
case 0:
|
|
1165
1500
|
callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
1166
1501
|
statusPayload = {
|
|
@@ -1254,14 +1589,14 @@ describe('State Machine handler tests', function () {
|
|
|
1254
1589
|
expect(call.earlyMedia).not.toBe(true);
|
|
1255
1590
|
case 1:
|
|
1256
1591
|
case "end":
|
|
1257
|
-
return
|
|
1592
|
+
return _context23.stop();
|
|
1258
1593
|
}
|
|
1259
|
-
},
|
|
1594
|
+
}, _callee23);
|
|
1260
1595
|
})));
|
|
1261
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1596
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1262
1597
|
var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
1263
|
-
return _regenerator.default.wrap(function (
|
|
1264
|
-
while (1) switch (
|
|
1598
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
1599
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1265
1600
|
case 0:
|
|
1266
1601
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1267
1602
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
@@ -1288,7 +1623,7 @@ describe('State Machine handler tests', function () {
|
|
|
1288
1623
|
webex.request.mockRejectedValueOnce({
|
|
1289
1624
|
statusCode: 403
|
|
1290
1625
|
}).mockResolvedValue(statusPayload);
|
|
1291
|
-
|
|
1626
|
+
_context24.next = 1;
|
|
1292
1627
|
return call['handleOutgoingCallConnect']({
|
|
1293
1628
|
type: 'E_SEND_CALL_CONNECT'
|
|
1294
1629
|
});
|
|
@@ -1299,14 +1634,14 @@ describe('State Machine handler tests', function () {
|
|
|
1299
1634
|
expect(errorSpy).toBeCalledTimes(1);
|
|
1300
1635
|
case 2:
|
|
1301
1636
|
case "end":
|
|
1302
|
-
return
|
|
1637
|
+
return _context24.stop();
|
|
1303
1638
|
}
|
|
1304
|
-
},
|
|
1639
|
+
}, _callee24);
|
|
1305
1640
|
})));
|
|
1306
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1641
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1307
1642
|
var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
|
|
1308
|
-
return _regenerator.default.wrap(function (
|
|
1309
|
-
while (1) switch (
|
|
1643
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
1644
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1310
1645
|
case 0:
|
|
1311
1646
|
statusPayload = {
|
|
1312
1647
|
statusCode: 200,
|
|
@@ -1382,14 +1717,14 @@ describe('State Machine handler tests', function () {
|
|
|
1382
1717
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1383
1718
|
case 1:
|
|
1384
1719
|
case "end":
|
|
1385
|
-
return
|
|
1720
|
+
return _context25.stop();
|
|
1386
1721
|
}
|
|
1387
|
-
},
|
|
1722
|
+
}, _callee25);
|
|
1388
1723
|
})));
|
|
1389
|
-
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
|
|
1724
|
+
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() {
|
|
1390
1725
|
var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
|
|
1391
|
-
return _regenerator.default.wrap(function (
|
|
1392
|
-
while (1) switch (
|
|
1726
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
1727
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1393
1728
|
case 0:
|
|
1394
1729
|
statusPayload = {
|
|
1395
1730
|
statusCode: 200,
|
|
@@ -1457,14 +1792,14 @@ describe('State Machine handler tests', function () {
|
|
|
1457
1792
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1458
1793
|
case 1:
|
|
1459
1794
|
case "end":
|
|
1460
|
-
return
|
|
1795
|
+
return _context26.stop();
|
|
1461
1796
|
}
|
|
1462
|
-
},
|
|
1797
|
+
}, _callee26);
|
|
1463
1798
|
})));
|
|
1464
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1799
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1465
1800
|
var statusPayload, dummyEvent;
|
|
1466
|
-
return _regenerator.default.wrap(function (
|
|
1467
|
-
while (1) switch (
|
|
1801
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
1802
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1468
1803
|
case 0:
|
|
1469
1804
|
statusPayload = {
|
|
1470
1805
|
statusCode: 200,
|
|
@@ -1503,14 +1838,14 @@ describe('State Machine handler tests', function () {
|
|
|
1503
1838
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1504
1839
|
case 1:
|
|
1505
1840
|
case "end":
|
|
1506
|
-
return
|
|
1841
|
+
return _context27.stop();
|
|
1507
1842
|
}
|
|
1508
|
-
},
|
|
1843
|
+
}, _callee27);
|
|
1509
1844
|
})));
|
|
1510
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1845
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1511
1846
|
var statusPayload, dummyEvent, errorSpy;
|
|
1512
|
-
return _regenerator.default.wrap(function (
|
|
1513
|
-
while (1) switch (
|
|
1847
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
1848
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1514
1849
|
case 0:
|
|
1515
1850
|
statusPayload = {
|
|
1516
1851
|
statusCode: 403,
|
|
@@ -1527,25 +1862,31 @@ describe('State Machine handler tests', function () {
|
|
|
1527
1862
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
1528
1863
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
1529
1864
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1530
|
-
|
|
1865
|
+
_context28.next = 1;
|
|
1531
1866
|
return (0, _testUtil.flushPromises)(3);
|
|
1532
1867
|
case 1:
|
|
1868
|
+
_context28.next = 2;
|
|
1869
|
+
return _promise.default.resolve();
|
|
1870
|
+
case 2:
|
|
1871
|
+
_context28.next = 3;
|
|
1872
|
+
return _promise.default.resolve();
|
|
1873
|
+
case 3:
|
|
1533
1874
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
1534
1875
|
expect(errorSpy).toHaveBeenCalled();
|
|
1535
1876
|
expect(uploadLogsSpy).toHaveBeenCalledWith({
|
|
1536
1877
|
correlationId: call.getCorrelationId(),
|
|
1537
1878
|
callId: call.getCallId()
|
|
1538
1879
|
});
|
|
1539
|
-
case
|
|
1880
|
+
case 4:
|
|
1540
1881
|
case "end":
|
|
1541
|
-
return
|
|
1882
|
+
return _context28.stop();
|
|
1542
1883
|
}
|
|
1543
|
-
},
|
|
1884
|
+
}, _callee28);
|
|
1544
1885
|
})));
|
|
1545
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1886
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1546
1887
|
var statusPayload, dummyEvent, warnSpy;
|
|
1547
|
-
return _regenerator.default.wrap(function (
|
|
1548
|
-
while (1) switch (
|
|
1888
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
1889
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1549
1890
|
case 0:
|
|
1550
1891
|
statusPayload = {
|
|
1551
1892
|
statusCode: 403,
|
|
@@ -1564,12 +1905,18 @@ describe('State Machine handler tests', function () {
|
|
|
1564
1905
|
webex.request.mockRejectedValue(statusPayload);
|
|
1565
1906
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1566
1907
|
jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
1567
|
-
|
|
1908
|
+
_context29.next = 1;
|
|
1568
1909
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1569
1910
|
case 1:
|
|
1570
|
-
|
|
1911
|
+
_context29.next = 2;
|
|
1571
1912
|
return (0, _testUtil.flushPromises)(2);
|
|
1572
1913
|
case 2:
|
|
1914
|
+
_context29.next = 3;
|
|
1915
|
+
return _promise.default.resolve();
|
|
1916
|
+
case 3:
|
|
1917
|
+
_context29.next = 4;
|
|
1918
|
+
return _promise.default.resolve();
|
|
1919
|
+
case 4:
|
|
1573
1920
|
expect(call.isConnected()).toBe(false);
|
|
1574
1921
|
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1575
1922
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
@@ -1581,16 +1928,16 @@ describe('State Machine handler tests', function () {
|
|
|
1581
1928
|
file: 'call',
|
|
1582
1929
|
method: 'handleRoapError'
|
|
1583
1930
|
});
|
|
1584
|
-
case
|
|
1931
|
+
case 5:
|
|
1585
1932
|
case "end":
|
|
1586
|
-
return
|
|
1933
|
+
return _context29.stop();
|
|
1587
1934
|
}
|
|
1588
|
-
},
|
|
1935
|
+
}, _callee29);
|
|
1589
1936
|
})));
|
|
1590
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1937
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1591
1938
|
var statusPayload, dummyEvent;
|
|
1592
|
-
return _regenerator.default.wrap(function (
|
|
1593
|
-
while (1) switch (
|
|
1939
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
1940
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1594
1941
|
case 0:
|
|
1595
1942
|
statusPayload = {
|
|
1596
1943
|
statusCode: 403,
|
|
@@ -1613,14 +1960,14 @@ describe('State Machine handler tests', function () {
|
|
|
1613
1960
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
1614
1961
|
case 1:
|
|
1615
1962
|
case "end":
|
|
1616
|
-
return
|
|
1963
|
+
return _context30.stop();
|
|
1617
1964
|
}
|
|
1618
|
-
},
|
|
1965
|
+
}, _callee30);
|
|
1619
1966
|
})));
|
|
1620
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1967
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1621
1968
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1622
|
-
return _regenerator.default.wrap(function (
|
|
1623
|
-
while (1) switch (
|
|
1969
|
+
return _regenerator.default.wrap(function (_context31) {
|
|
1970
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1624
1971
|
case 0:
|
|
1625
1972
|
statusPayload = {
|
|
1626
1973
|
statusCode: 503,
|
|
@@ -1642,7 +1989,7 @@ describe('State Machine handler tests', function () {
|
|
|
1642
1989
|
}
|
|
1643
1990
|
};
|
|
1644
1991
|
call['connected'] = true;
|
|
1645
|
-
|
|
1992
|
+
_context31.next = 1;
|
|
1646
1993
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1647
1994
|
case 1:
|
|
1648
1995
|
jest.advanceTimersByTime(1005);
|
|
@@ -1654,14 +2001,14 @@ describe('State Machine handler tests', function () {
|
|
|
1654
2001
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1655
2002
|
case 2:
|
|
1656
2003
|
case "end":
|
|
1657
|
-
return
|
|
2004
|
+
return _context31.stop();
|
|
1658
2005
|
}
|
|
1659
|
-
},
|
|
2006
|
+
}, _callee31);
|
|
1660
2007
|
})));
|
|
1661
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2008
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1662
2009
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1663
|
-
return _regenerator.default.wrap(function (
|
|
1664
|
-
while (1) switch (
|
|
2010
|
+
return _regenerator.default.wrap(function (_context32) {
|
|
2011
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1665
2012
|
case 0:
|
|
1666
2013
|
statusPayload = {
|
|
1667
2014
|
statusCode: 503,
|
|
@@ -1683,7 +2030,7 @@ describe('State Machine handler tests', function () {
|
|
|
1683
2030
|
}
|
|
1684
2031
|
};
|
|
1685
2032
|
call['connected'] = false;
|
|
1686
|
-
|
|
2033
|
+
_context32.next = 1;
|
|
1687
2034
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1688
2035
|
case 1:
|
|
1689
2036
|
jest.advanceTimersByTime(1005);
|
|
@@ -1694,14 +2041,14 @@ describe('State Machine handler tests', function () {
|
|
|
1694
2041
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1695
2042
|
case 2:
|
|
1696
2043
|
case "end":
|
|
1697
|
-
return
|
|
2044
|
+
return _context32.stop();
|
|
1698
2045
|
}
|
|
1699
|
-
},
|
|
2046
|
+
}, _callee32);
|
|
1700
2047
|
})));
|
|
1701
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2048
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1702
2049
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1703
|
-
return _regenerator.default.wrap(function (
|
|
1704
|
-
while (1) switch (
|
|
2050
|
+
return _regenerator.default.wrap(function (_context33) {
|
|
2051
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1705
2052
|
case 0:
|
|
1706
2053
|
statusPayload = {
|
|
1707
2054
|
statusCode: 503,
|
|
@@ -1723,7 +2070,7 @@ describe('State Machine handler tests', function () {
|
|
|
1723
2070
|
};
|
|
1724
2071
|
call['connected'] = true;
|
|
1725
2072
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
1726
|
-
|
|
2073
|
+
_context33.next = 1;
|
|
1727
2074
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1728
2075
|
case 1:
|
|
1729
2076
|
jest.advanceTimersByTime(1005);
|
|
@@ -1735,14 +2082,14 @@ describe('State Machine handler tests', function () {
|
|
|
1735
2082
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1736
2083
|
case 2:
|
|
1737
2084
|
case "end":
|
|
1738
|
-
return
|
|
2085
|
+
return _context33.stop();
|
|
1739
2086
|
}
|
|
1740
|
-
},
|
|
2087
|
+
}, _callee33);
|
|
1741
2088
|
})));
|
|
1742
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2089
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1743
2090
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1744
|
-
return _regenerator.default.wrap(function (
|
|
1745
|
-
while (1) switch (
|
|
2091
|
+
return _regenerator.default.wrap(function (_context34) {
|
|
2092
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1746
2093
|
case 0:
|
|
1747
2094
|
statusPayload = {
|
|
1748
2095
|
statusCode: 503,
|
|
@@ -1763,7 +2110,7 @@ describe('State Machine handler tests', function () {
|
|
|
1763
2110
|
}
|
|
1764
2111
|
};
|
|
1765
2112
|
call['connected'] = false;
|
|
1766
|
-
|
|
2113
|
+
_context34.next = 1;
|
|
1767
2114
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1768
2115
|
case 1:
|
|
1769
2116
|
jest.advanceTimersByTime(1005);
|
|
@@ -1775,14 +2122,14 @@ describe('State Machine handler tests', function () {
|
|
|
1775
2122
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1776
2123
|
case 2:
|
|
1777
2124
|
case "end":
|
|
1778
|
-
return
|
|
2125
|
+
return _context34.stop();
|
|
1779
2126
|
}
|
|
1780
|
-
},
|
|
2127
|
+
}, _callee34);
|
|
1781
2128
|
})));
|
|
1782
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2129
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
1783
2130
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1784
|
-
return _regenerator.default.wrap(function (
|
|
1785
|
-
while (1) switch (
|
|
2131
|
+
return _regenerator.default.wrap(function (_context35) {
|
|
2132
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1786
2133
|
case 0:
|
|
1787
2134
|
statusPayload = {
|
|
1788
2135
|
statusCode: 200,
|
|
@@ -1807,14 +2154,14 @@ describe('State Machine handler tests', function () {
|
|
|
1807
2154
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1808
2155
|
case 1:
|
|
1809
2156
|
case "end":
|
|
1810
|
-
return
|
|
2157
|
+
return _context35.stop();
|
|
1811
2158
|
}
|
|
1812
|
-
},
|
|
2159
|
+
}, _callee35);
|
|
1813
2160
|
})));
|
|
1814
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2161
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
1815
2162
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1816
|
-
return _regenerator.default.wrap(function (
|
|
1817
|
-
while (1) switch (
|
|
2163
|
+
return _regenerator.default.wrap(function (_context36) {
|
|
2164
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1818
2165
|
case 0:
|
|
1819
2166
|
statusPayload = {
|
|
1820
2167
|
statusCode: 503,
|
|
@@ -1836,7 +2183,7 @@ describe('State Machine handler tests', function () {
|
|
|
1836
2183
|
};
|
|
1837
2184
|
call['connected'] = true;
|
|
1838
2185
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1839
|
-
|
|
2186
|
+
_context36.next = 1;
|
|
1840
2187
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1841
2188
|
case 1:
|
|
1842
2189
|
jest.advanceTimersByTime(1005);
|
|
@@ -1848,14 +2195,14 @@ describe('State Machine handler tests', function () {
|
|
|
1848
2195
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1849
2196
|
case 2:
|
|
1850
2197
|
case "end":
|
|
1851
|
-
return
|
|
2198
|
+
return _context36.stop();
|
|
1852
2199
|
}
|
|
1853
|
-
},
|
|
2200
|
+
}, _callee36);
|
|
1854
2201
|
})));
|
|
1855
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2202
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
1856
2203
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1857
|
-
return _regenerator.default.wrap(function (
|
|
1858
|
-
while (1) switch (
|
|
2204
|
+
return _regenerator.default.wrap(function (_context37) {
|
|
2205
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1859
2206
|
case 0:
|
|
1860
2207
|
statusPayload = {
|
|
1861
2208
|
statusCode: 403,
|
|
@@ -1878,14 +2225,14 @@ describe('State Machine handler tests', function () {
|
|
|
1878
2225
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1879
2226
|
case 1:
|
|
1880
2227
|
case "end":
|
|
1881
|
-
return
|
|
2228
|
+
return _context37.stop();
|
|
1882
2229
|
}
|
|
1883
|
-
},
|
|
2230
|
+
}, _callee37);
|
|
1884
2231
|
})));
|
|
1885
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2232
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
1886
2233
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1887
|
-
return _regenerator.default.wrap(function (
|
|
1888
|
-
while (1) switch (
|
|
2234
|
+
return _regenerator.default.wrap(function (_context38) {
|
|
2235
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
1889
2236
|
case 0:
|
|
1890
2237
|
statusPayload = {
|
|
1891
2238
|
statusCode: 200,
|
|
@@ -1903,7 +2250,7 @@ describe('State Machine handler tests', function () {
|
|
|
1903
2250
|
}
|
|
1904
2251
|
};
|
|
1905
2252
|
call['connected'] = false;
|
|
1906
|
-
|
|
2253
|
+
_context38.next = 1;
|
|
1907
2254
|
return call['handleRoapError']({}, errorEvent);
|
|
1908
2255
|
case 1:
|
|
1909
2256
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -1919,14 +2266,14 @@ describe('State Machine handler tests', function () {
|
|
|
1919
2266
|
});
|
|
1920
2267
|
case 2:
|
|
1921
2268
|
case "end":
|
|
1922
|
-
return
|
|
2269
|
+
return _context38.stop();
|
|
1923
2270
|
}
|
|
1924
|
-
},
|
|
2271
|
+
}, _callee38);
|
|
1925
2272
|
})));
|
|
1926
|
-
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2273
|
+
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
1927
2274
|
var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
|
|
1928
|
-
return _regenerator.default.wrap(function (
|
|
1929
|
-
while (1) switch (
|
|
2275
|
+
return _regenerator.default.wrap(function (_context39) {
|
|
2276
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
1930
2277
|
case 0:
|
|
1931
2278
|
statusPayload = {
|
|
1932
2279
|
statusCode: 403,
|
|
@@ -1964,12 +2311,18 @@ describe('State Machine handler tests', function () {
|
|
|
1964
2311
|
messageType: 'ANSWER'
|
|
1965
2312
|
}
|
|
1966
2313
|
};
|
|
1967
|
-
|
|
2314
|
+
_context39.next = 1;
|
|
1968
2315
|
return call.sendMediaStateMachineEvt(answerEvent);
|
|
1969
2316
|
case 1:
|
|
1970
|
-
|
|
2317
|
+
_context39.next = 2;
|
|
1971
2318
|
return (0, _testUtil.flushPromises)(2);
|
|
1972
2319
|
case 2:
|
|
2320
|
+
_context39.next = 3;
|
|
2321
|
+
return _promise.default.resolve();
|
|
2322
|
+
case 3:
|
|
2323
|
+
_context39.next = 4;
|
|
2324
|
+
return _promise.default.resolve();
|
|
2325
|
+
case 4:
|
|
1973
2326
|
expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
|
|
1974
2327
|
expect(warnSpy).toHaveBeenCalledWith('Failed to send MediaAnswer request', {
|
|
1975
2328
|
file: 'call',
|
|
@@ -1983,16 +2336,16 @@ describe('State Machine handler tests', function () {
|
|
|
1983
2336
|
// Final state should be torn down and cleared for unconnected call
|
|
1984
2337
|
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1985
2338
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
1986
|
-
case
|
|
2339
|
+
case 5:
|
|
1987
2340
|
case "end":
|
|
1988
|
-
return
|
|
2341
|
+
return _context39.stop();
|
|
1989
2342
|
}
|
|
1990
|
-
},
|
|
2343
|
+
}, _callee39);
|
|
1991
2344
|
})));
|
|
1992
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2345
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
1993
2346
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1994
|
-
return _regenerator.default.wrap(function (
|
|
1995
|
-
while (1) switch (
|
|
2347
|
+
return _regenerator.default.wrap(function (_context40) {
|
|
2348
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
1996
2349
|
case 0:
|
|
1997
2350
|
statusPayload = {
|
|
1998
2351
|
statusCode: 200,
|
|
@@ -2025,7 +2378,7 @@ describe('State Machine handler tests', function () {
|
|
|
2025
2378
|
seq: 1,
|
|
2026
2379
|
messageType: 'ANSWER'
|
|
2027
2380
|
};
|
|
2028
|
-
|
|
2381
|
+
_context40.next = 1;
|
|
2029
2382
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2030
2383
|
case 1:
|
|
2031
2384
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2047,7 +2400,7 @@ describe('State Machine handler tests', function () {
|
|
|
2047
2400
|
seq: 2,
|
|
2048
2401
|
messageType: 'OFFER_REQUEST'
|
|
2049
2402
|
};
|
|
2050
|
-
|
|
2403
|
+
_context40.next = 2;
|
|
2051
2404
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2052
2405
|
case 2:
|
|
2053
2406
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2097,7 +2450,7 @@ describe('State Machine handler tests', function () {
|
|
|
2097
2450
|
};
|
|
2098
2451
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2099
2452
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2100
|
-
|
|
2453
|
+
_context40.next = 3;
|
|
2101
2454
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2102
2455
|
case 3:
|
|
2103
2456
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2106,7 +2459,7 @@ describe('State Machine handler tests', function () {
|
|
|
2106
2459
|
seq: 3,
|
|
2107
2460
|
messageType: 'ANSWER'
|
|
2108
2461
|
};
|
|
2109
|
-
|
|
2462
|
+
_context40.next = 4;
|
|
2110
2463
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2111
2464
|
case 4:
|
|
2112
2465
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2125,7 +2478,7 @@ describe('State Machine handler tests', function () {
|
|
|
2125
2478
|
messageType: 'OK'
|
|
2126
2479
|
}
|
|
2127
2480
|
};
|
|
2128
|
-
|
|
2481
|
+
_context40.next = 5;
|
|
2129
2482
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2130
2483
|
case 5:
|
|
2131
2484
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -2140,14 +2493,14 @@ describe('State Machine handler tests', function () {
|
|
|
2140
2493
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2141
2494
|
case 6:
|
|
2142
2495
|
case "end":
|
|
2143
|
-
return
|
|
2496
|
+
return _context40.stop();
|
|
2144
2497
|
}
|
|
2145
|
-
},
|
|
2498
|
+
}, _callee40);
|
|
2146
2499
|
})));
|
|
2147
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2500
|
+
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() {
|
|
2148
2501
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2149
|
-
return _regenerator.default.wrap(function (
|
|
2150
|
-
while (1) switch (
|
|
2502
|
+
return _regenerator.default.wrap(function (_context41) {
|
|
2503
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2151
2504
|
case 0:
|
|
2152
2505
|
mockStatusBody = {
|
|
2153
2506
|
device: {
|
|
@@ -2187,7 +2540,7 @@ describe('State Machine handler tests', function () {
|
|
|
2187
2540
|
seq: 1,
|
|
2188
2541
|
messageType: 'ANSWER'
|
|
2189
2542
|
};
|
|
2190
|
-
|
|
2543
|
+
_context41.next = 1;
|
|
2191
2544
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2192
2545
|
case 1:
|
|
2193
2546
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2209,7 +2562,7 @@ describe('State Machine handler tests', function () {
|
|
|
2209
2562
|
seq: 2,
|
|
2210
2563
|
messageType: 'OFFER_REQUEST'
|
|
2211
2564
|
};
|
|
2212
|
-
|
|
2565
|
+
_context41.next = 2;
|
|
2213
2566
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2214
2567
|
case 2:
|
|
2215
2568
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2259,7 +2612,7 @@ describe('State Machine handler tests', function () {
|
|
|
2259
2612
|
};
|
|
2260
2613
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2261
2614
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2262
|
-
|
|
2615
|
+
_context41.next = 3;
|
|
2263
2616
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2264
2617
|
case 3:
|
|
2265
2618
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2268,7 +2621,7 @@ describe('State Machine handler tests', function () {
|
|
|
2268
2621
|
seq: 3,
|
|
2269
2622
|
messageType: 'ANSWER'
|
|
2270
2623
|
};
|
|
2271
|
-
|
|
2624
|
+
_context41.next = 4;
|
|
2272
2625
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2273
2626
|
case 4:
|
|
2274
2627
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2285,7 +2638,7 @@ describe('State Machine handler tests', function () {
|
|
|
2285
2638
|
}
|
|
2286
2639
|
};
|
|
2287
2640
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
2288
|
-
|
|
2641
|
+
_context41.next = 5;
|
|
2289
2642
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2290
2643
|
case 5:
|
|
2291
2644
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -2301,14 +2654,14 @@ describe('State Machine handler tests', function () {
|
|
|
2301
2654
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2302
2655
|
case 6:
|
|
2303
2656
|
case "end":
|
|
2304
|
-
return
|
|
2657
|
+
return _context41.stop();
|
|
2305
2658
|
}
|
|
2306
|
-
},
|
|
2659
|
+
}, _callee41);
|
|
2307
2660
|
})));
|
|
2308
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2661
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
2309
2662
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
2310
|
-
return _regenerator.default.wrap(function (
|
|
2311
|
-
while (1) switch (
|
|
2663
|
+
return _regenerator.default.wrap(function (_context42) {
|
|
2664
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2312
2665
|
case 0:
|
|
2313
2666
|
statusPayload = {
|
|
2314
2667
|
statusCode: 200,
|
|
@@ -2369,20 +2722,20 @@ describe('State Machine handler tests', function () {
|
|
|
2369
2722
|
dummyEvent.data = undefined;
|
|
2370
2723
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2371
2724
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_HOLD');
|
|
2372
|
-
expect(infoSpy).
|
|
2725
|
+
expect(infoSpy).toHaveBeenCalledWith("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(call.getCorrelationId()), {
|
|
2373
2726
|
file: 'call',
|
|
2374
2727
|
method: 'handleCallHold'
|
|
2375
2728
|
});
|
|
2376
2729
|
case 1:
|
|
2377
2730
|
case "end":
|
|
2378
|
-
return
|
|
2731
|
+
return _context42.stop();
|
|
2379
2732
|
}
|
|
2380
|
-
},
|
|
2733
|
+
}, _callee42);
|
|
2381
2734
|
})));
|
|
2382
|
-
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2735
|
+
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
|
|
2383
2736
|
var emitSpy, deleteSpy;
|
|
2384
|
-
return _regenerator.default.wrap(function (
|
|
2385
|
-
while (1) switch (
|
|
2737
|
+
return _regenerator.default.wrap(function (_context43) {
|
|
2738
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2386
2739
|
case 0:
|
|
2387
2740
|
emitSpy = jest.spyOn(call, 'emit');
|
|
2388
2741
|
deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
|
|
@@ -2391,7 +2744,7 @@ describe('State Machine handler tests', function () {
|
|
|
2391
2744
|
call.sendCallStateMachineEvt({
|
|
2392
2745
|
type: 'E_RECV_CALL_DISCONNECT'
|
|
2393
2746
|
});
|
|
2394
|
-
|
|
2747
|
+
_context43.next = 1;
|
|
2395
2748
|
return (0, _testUtil.flushPromises)(1);
|
|
2396
2749
|
case 1:
|
|
2397
2750
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
@@ -2399,9 +2752,9 @@ describe('State Machine handler tests', function () {
|
|
|
2399
2752
|
expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
|
|
2400
2753
|
case 2:
|
|
2401
2754
|
case "end":
|
|
2402
|
-
return
|
|
2755
|
+
return _context43.stop();
|
|
2403
2756
|
}
|
|
2404
|
-
},
|
|
2757
|
+
}, _callee43);
|
|
2405
2758
|
})));
|
|
2406
2759
|
describe('Call event timers tests', function () {
|
|
2407
2760
|
var callManager;
|
|
@@ -2412,10 +2765,10 @@ describe('State Machine handler tests', function () {
|
|
|
2412
2765
|
afterEach(function () {
|
|
2413
2766
|
jest.clearAllTimers();
|
|
2414
2767
|
});
|
|
2415
|
-
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2768
|
+
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2416
2769
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2417
|
-
return _regenerator.default.wrap(function (
|
|
2418
|
-
while (1) switch (
|
|
2770
|
+
return _regenerator.default.wrap(function (_context44) {
|
|
2771
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2419
2772
|
case 0:
|
|
2420
2773
|
statusPayload = {
|
|
2421
2774
|
statusCode: 200,
|
|
@@ -2432,7 +2785,7 @@ describe('State Machine handler tests', function () {
|
|
|
2432
2785
|
webex.request.mockReturnValue(statusPayload);
|
|
2433
2786
|
|
|
2434
2787
|
// handleOutgoingCallSetup is asynchronous
|
|
2435
|
-
|
|
2788
|
+
_context44.next = 1;
|
|
2436
2789
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2437
2790
|
case 1:
|
|
2438
2791
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2475,14 +2828,14 @@ describe('State Machine handler tests', function () {
|
|
|
2475
2828
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2476
2829
|
case 2:
|
|
2477
2830
|
case "end":
|
|
2478
|
-
return
|
|
2831
|
+
return _context44.stop();
|
|
2479
2832
|
}
|
|
2480
|
-
},
|
|
2833
|
+
}, _callee44);
|
|
2481
2834
|
})));
|
|
2482
|
-
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2835
|
+
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
2483
2836
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2484
|
-
return _regenerator.default.wrap(function (
|
|
2485
|
-
while (1) switch (
|
|
2837
|
+
return _regenerator.default.wrap(function (_context45) {
|
|
2838
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2486
2839
|
case 0:
|
|
2487
2840
|
statusPayload = {
|
|
2488
2841
|
statusCode: 200,
|
|
@@ -2501,7 +2854,7 @@ describe('State Machine handler tests', function () {
|
|
|
2501
2854
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2502
2855
|
|
|
2503
2856
|
// handleOutgoingCallSetup is asynchronous
|
|
2504
|
-
|
|
2857
|
+
_context45.next = 1;
|
|
2505
2858
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2506
2859
|
case 1:
|
|
2507
2860
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2513,9 +2866,9 @@ describe('State Machine handler tests', function () {
|
|
|
2513
2866
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2514
2867
|
case 2:
|
|
2515
2868
|
case "end":
|
|
2516
|
-
return
|
|
2869
|
+
return _context45.stop();
|
|
2517
2870
|
}
|
|
2518
|
-
},
|
|
2871
|
+
}, _callee45);
|
|
2519
2872
|
})));
|
|
2520
2873
|
});
|
|
2521
2874
|
});
|
|
@@ -2534,6 +2887,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2534
2887
|
};
|
|
2535
2888
|
var call;
|
|
2536
2889
|
beforeEach(function () {
|
|
2890
|
+
_request.APIRequest.resetInstance();
|
|
2891
|
+
_request.APIRequest.getInstance({
|
|
2892
|
+
webex: webex,
|
|
2893
|
+
isMobiusSocketEnabled: false
|
|
2894
|
+
});
|
|
2537
2895
|
/* Since we are not actually testing from the start of a call , so it's good to set the below
|
|
2538
2896
|
* parameters manually
|
|
2539
2897
|
*/
|
|
@@ -2575,10 +2933,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2575
2933
|
beforeEach(function () {
|
|
2576
2934
|
call.removeAllListeners();
|
|
2577
2935
|
});
|
|
2578
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2936
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
|
|
2579
2937
|
var responsePayload, warnSpy, roapEvent;
|
|
2580
|
-
return _regenerator.default.wrap(function (
|
|
2581
|
-
while (1) switch (
|
|
2938
|
+
return _regenerator.default.wrap(function (_context47) {
|
|
2939
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2582
2940
|
case 0:
|
|
2583
2941
|
expect.assertions(7);
|
|
2584
2942
|
responsePayload = {
|
|
@@ -2591,25 +2949,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2591
2949
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2592
2950
|
call['held'] = false;
|
|
2593
2951
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2594
|
-
var
|
|
2595
|
-
return _regenerator.default.wrap(function (
|
|
2596
|
-
while (1) switch (
|
|
2952
|
+
var _ref56 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46(correlationId) {
|
|
2953
|
+
return _regenerator.default.wrap(function (_context46) {
|
|
2954
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2597
2955
|
case 0:
|
|
2598
2956
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2599
2957
|
case 1:
|
|
2600
2958
|
case "end":
|
|
2601
|
-
return
|
|
2959
|
+
return _context46.stop();
|
|
2602
2960
|
}
|
|
2603
|
-
},
|
|
2961
|
+
}, _callee46);
|
|
2604
2962
|
}));
|
|
2605
2963
|
return function (_x) {
|
|
2606
|
-
return
|
|
2964
|
+
return _ref56.apply(this, arguments);
|
|
2607
2965
|
};
|
|
2608
2966
|
}());
|
|
2609
|
-
|
|
2967
|
+
_context47.next = 1;
|
|
2610
2968
|
return call.doHoldResume();
|
|
2611
2969
|
case 1:
|
|
2612
|
-
|
|
2970
|
+
_context47.next = 2;
|
|
2613
2971
|
return (0, _testUtil.flushPromises)(2);
|
|
2614
2972
|
case 2:
|
|
2615
2973
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2625,11 +2983,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2625
2983
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2626
2984
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2627
2985
|
roapEvent.data.type = 'ANSWER';
|
|
2628
|
-
|
|
2986
|
+
_context47.next = 3;
|
|
2629
2987
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2630
2988
|
case 3:
|
|
2631
2989
|
roapEvent.data.type = 'OK';
|
|
2632
|
-
|
|
2990
|
+
_context47.next = 4;
|
|
2633
2991
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2634
2992
|
case 4:
|
|
2635
2993
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2644,14 +3002,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2644
3002
|
});
|
|
2645
3003
|
case 5:
|
|
2646
3004
|
case "end":
|
|
2647
|
-
return
|
|
3005
|
+
return _context47.stop();
|
|
2648
3006
|
}
|
|
2649
|
-
},
|
|
3007
|
+
}, _callee47);
|
|
2650
3008
|
})));
|
|
2651
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3009
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49() {
|
|
2652
3010
|
var responsePayload, warnSpy, roapEvent;
|
|
2653
|
-
return _regenerator.default.wrap(function (
|
|
2654
|
-
while (1) switch (
|
|
3011
|
+
return _regenerator.default.wrap(function (_context49) {
|
|
3012
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2655
3013
|
case 0:
|
|
2656
3014
|
expect.assertions(8);
|
|
2657
3015
|
responsePayload = {
|
|
@@ -2664,26 +3022,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2664
3022
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2665
3023
|
call['held'] = false;
|
|
2666
3024
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2667
|
-
var
|
|
2668
|
-
return _regenerator.default.wrap(function (
|
|
2669
|
-
while (1) switch (
|
|
3025
|
+
var _ref58 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48(correlationId) {
|
|
3026
|
+
return _regenerator.default.wrap(function (_context48) {
|
|
3027
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2670
3028
|
case 0:
|
|
2671
3029
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2672
3030
|
case 1:
|
|
2673
3031
|
case "end":
|
|
2674
|
-
return
|
|
3032
|
+
return _context48.stop();
|
|
2675
3033
|
}
|
|
2676
|
-
},
|
|
3034
|
+
}, _callee48);
|
|
2677
3035
|
}));
|
|
2678
3036
|
return function (_x2) {
|
|
2679
|
-
return
|
|
3037
|
+
return _ref58.apply(this, arguments);
|
|
2680
3038
|
};
|
|
2681
3039
|
}());
|
|
2682
3040
|
call.doHoldResume();
|
|
2683
|
-
|
|
3041
|
+
_context49.next = 1;
|
|
2684
3042
|
return _promise.default.resolve();
|
|
2685
3043
|
case 1:
|
|
2686
|
-
|
|
3044
|
+
_context49.next = 2;
|
|
2687
3045
|
return _promise.default.resolve();
|
|
2688
3046
|
case 2:
|
|
2689
3047
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2699,11 +3057,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2699
3057
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2700
3058
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2701
3059
|
roapEvent.data.type = 'ANSWER';
|
|
2702
|
-
|
|
3060
|
+
_context49.next = 3;
|
|
2703
3061
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2704
3062
|
case 3:
|
|
2705
3063
|
roapEvent.data.type = 'OK';
|
|
2706
|
-
|
|
3064
|
+
_context49.next = 4;
|
|
2707
3065
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2708
3066
|
case 4:
|
|
2709
3067
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2718,14 +3076,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2718
3076
|
});
|
|
2719
3077
|
case 5:
|
|
2720
3078
|
case "end":
|
|
2721
|
-
return
|
|
3079
|
+
return _context49.stop();
|
|
2722
3080
|
}
|
|
2723
|
-
},
|
|
3081
|
+
}, _callee49);
|
|
2724
3082
|
})));
|
|
2725
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3083
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
|
|
2726
3084
|
var responsePayload;
|
|
2727
|
-
return _regenerator.default.wrap(function (
|
|
2728
|
-
while (1) switch (
|
|
3085
|
+
return _regenerator.default.wrap(function (_context51) {
|
|
3086
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2729
3087
|
case 0:
|
|
2730
3088
|
expect.assertions(4);
|
|
2731
3089
|
responsePayload = {
|
|
@@ -2735,26 +3093,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2735
3093
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2736
3094
|
call['held'] = false;
|
|
2737
3095
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2738
|
-
var
|
|
2739
|
-
return _regenerator.default.wrap(function (
|
|
2740
|
-
while (1) switch (
|
|
3096
|
+
var _ref60 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50(errObj) {
|
|
3097
|
+
return _regenerator.default.wrap(function (_context50) {
|
|
3098
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2741
3099
|
case 0:
|
|
2742
3100
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2743
3101
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2744
3102
|
case 1:
|
|
2745
3103
|
case "end":
|
|
2746
|
-
return
|
|
3104
|
+
return _context50.stop();
|
|
2747
3105
|
}
|
|
2748
|
-
},
|
|
3106
|
+
}, _callee50);
|
|
2749
3107
|
}));
|
|
2750
3108
|
return function (_x3) {
|
|
2751
|
-
return
|
|
3109
|
+
return _ref60.apply(this, arguments);
|
|
2752
3110
|
};
|
|
2753
3111
|
}());
|
|
2754
|
-
|
|
3112
|
+
_context51.next = 1;
|
|
2755
3113
|
return call.doHoldResume();
|
|
2756
3114
|
case 1:
|
|
2757
|
-
|
|
3115
|
+
_context51.next = 2;
|
|
2758
3116
|
return (0, _testUtil.flushPromises)(2);
|
|
2759
3117
|
case 2:
|
|
2760
3118
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2764,14 +3122,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2764
3122
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2765
3123
|
case 3:
|
|
2766
3124
|
case "end":
|
|
2767
|
-
return
|
|
3125
|
+
return _context51.stop();
|
|
2768
3126
|
}
|
|
2769
|
-
},
|
|
3127
|
+
}, _callee51);
|
|
2770
3128
|
})));
|
|
2771
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3129
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
|
|
2772
3130
|
var responsePayload, rejectPayload, roapEvent;
|
|
2773
|
-
return _regenerator.default.wrap(function (
|
|
2774
|
-
while (1) switch (
|
|
3131
|
+
return _regenerator.default.wrap(function (_context53) {
|
|
3132
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2775
3133
|
case 0:
|
|
2776
3134
|
expect.assertions(5);
|
|
2777
3135
|
responsePayload = {
|
|
@@ -2785,24 +3143,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2785
3143
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2786
3144
|
call['held'] = false;
|
|
2787
3145
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2788
|
-
var
|
|
2789
|
-
return _regenerator.default.wrap(function (
|
|
2790
|
-
while (1) switch (
|
|
3146
|
+
var _ref62 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52(errObj) {
|
|
3147
|
+
return _regenerator.default.wrap(function (_context52) {
|
|
3148
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2791
3149
|
case 0:
|
|
2792
3150
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2793
3151
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2794
3152
|
case 1:
|
|
2795
3153
|
case "end":
|
|
2796
|
-
return
|
|
3154
|
+
return _context52.stop();
|
|
2797
3155
|
}
|
|
2798
|
-
},
|
|
3156
|
+
}, _callee52);
|
|
2799
3157
|
}));
|
|
2800
3158
|
return function (_x4) {
|
|
2801
|
-
return
|
|
3159
|
+
return _ref62.apply(this, arguments);
|
|
2802
3160
|
};
|
|
2803
3161
|
}());
|
|
2804
3162
|
call.doHoldResume();
|
|
2805
|
-
|
|
3163
|
+
_context53.next = 1;
|
|
2806
3164
|
return (0, _testUtil.flushPromises)(2);
|
|
2807
3165
|
case 1:
|
|
2808
3166
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2812,7 +3170,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2812
3170
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2813
3171
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2814
3172
|
roapEvent.data.type = 'ANSWER';
|
|
2815
|
-
|
|
3173
|
+
_context53.next = 2;
|
|
2816
3174
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2817
3175
|
case 2:
|
|
2818
3176
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2820,14 +3178,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2820
3178
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2821
3179
|
case 3:
|
|
2822
3180
|
case "end":
|
|
2823
|
-
return
|
|
3181
|
+
return _context53.stop();
|
|
2824
3182
|
}
|
|
2825
|
-
},
|
|
3183
|
+
}, _callee53);
|
|
2826
3184
|
})));
|
|
2827
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3185
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
|
|
2828
3186
|
var responsePayload, warnSpy, roapEvent;
|
|
2829
|
-
return _regenerator.default.wrap(function (
|
|
2830
|
-
while (1) switch (
|
|
3187
|
+
return _regenerator.default.wrap(function (_context54) {
|
|
3188
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2831
3189
|
case 0:
|
|
2832
3190
|
responsePayload = {
|
|
2833
3191
|
statusCode: 200,
|
|
@@ -2838,10 +3196,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2838
3196
|
jest.spyOn(global, 'clearTimeout');
|
|
2839
3197
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2840
3198
|
call['held'] = false;
|
|
2841
|
-
|
|
3199
|
+
_context54.next = 1;
|
|
2842
3200
|
return call.doHoldResume();
|
|
2843
3201
|
case 1:
|
|
2844
|
-
|
|
3202
|
+
_context54.next = 2;
|
|
2845
3203
|
return (0, _testUtil.flushPromises)(2);
|
|
2846
3204
|
case 2:
|
|
2847
3205
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2856,19 +3214,19 @@ describe('Supplementary Services tests', function () {
|
|
|
2856
3214
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2857
3215
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2858
3216
|
roapEvent.data.type = 'ANSWER';
|
|
2859
|
-
|
|
3217
|
+
_context54.next = 3;
|
|
2860
3218
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2861
3219
|
case 3:
|
|
2862
3220
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2863
3221
|
statusCode: 403
|
|
2864
3222
|
});
|
|
2865
3223
|
roapEvent.data.type = 'OK';
|
|
2866
|
-
|
|
3224
|
+
_context54.next = 4;
|
|
2867
3225
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2868
3226
|
case 4:
|
|
2869
3227
|
/* this is for coverage */
|
|
2870
3228
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2871
|
-
|
|
3229
|
+
_context54.next = 5;
|
|
2872
3230
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2873
3231
|
case 5:
|
|
2874
3232
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2880,14 +3238,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2880
3238
|
});
|
|
2881
3239
|
case 6:
|
|
2882
3240
|
case "end":
|
|
2883
|
-
return
|
|
3241
|
+
return _context54.stop();
|
|
2884
3242
|
}
|
|
2885
|
-
},
|
|
3243
|
+
}, _callee54);
|
|
2886
3244
|
})));
|
|
2887
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3245
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
2888
3246
|
var responsePayload, warnSpy, roapEvent;
|
|
2889
|
-
return _regenerator.default.wrap(function (
|
|
2890
|
-
while (1) switch (
|
|
3247
|
+
return _regenerator.default.wrap(function (_context55) {
|
|
3248
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2891
3249
|
case 0:
|
|
2892
3250
|
responsePayload = {
|
|
2893
3251
|
statusCode: 200,
|
|
@@ -2898,10 +3256,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2898
3256
|
jest.spyOn(global, 'clearTimeout');
|
|
2899
3257
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2900
3258
|
call['held'] = true;
|
|
2901
|
-
|
|
3259
|
+
_context55.next = 1;
|
|
2902
3260
|
return call.doHoldResume();
|
|
2903
3261
|
case 1:
|
|
2904
|
-
|
|
3262
|
+
_context55.next = 2;
|
|
2905
3263
|
return (0, _testUtil.flushPromises)(2);
|
|
2906
3264
|
case 2:
|
|
2907
3265
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2916,14 +3274,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2916
3274
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2917
3275
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2918
3276
|
roapEvent.data.type = 'ANSWER';
|
|
2919
|
-
|
|
3277
|
+
_context55.next = 3;
|
|
2920
3278
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2921
3279
|
case 3:
|
|
2922
3280
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2923
3281
|
statusCode: 403
|
|
2924
3282
|
});
|
|
2925
3283
|
roapEvent.data.type = 'OK';
|
|
2926
|
-
|
|
3284
|
+
_context55.next = 4;
|
|
2927
3285
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2928
3286
|
case 4:
|
|
2929
3287
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2935,14 +3293,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2935
3293
|
});
|
|
2936
3294
|
case 5:
|
|
2937
3295
|
case "end":
|
|
2938
|
-
return
|
|
3296
|
+
return _context55.stop();
|
|
2939
3297
|
}
|
|
2940
|
-
},
|
|
3298
|
+
}, _callee55);
|
|
2941
3299
|
})));
|
|
2942
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3300
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57() {
|
|
2943
3301
|
var responsePayload, roapEvent;
|
|
2944
|
-
return _regenerator.default.wrap(function (
|
|
2945
|
-
while (1) switch (
|
|
3302
|
+
return _regenerator.default.wrap(function (_context57) {
|
|
3303
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2946
3304
|
case 0:
|
|
2947
3305
|
expect.assertions(5);
|
|
2948
3306
|
responsePayload = {
|
|
@@ -2952,25 +3310,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2952
3310
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2953
3311
|
call['held'] = false;
|
|
2954
3312
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2955
|
-
var
|
|
2956
|
-
return _regenerator.default.wrap(function (
|
|
2957
|
-
while (1) switch (
|
|
3313
|
+
var _ref66 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56(errObj) {
|
|
3314
|
+
return _regenerator.default.wrap(function (_context56) {
|
|
3315
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2958
3316
|
case 0:
|
|
2959
3317
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2960
3318
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
2961
3319
|
case 1:
|
|
2962
3320
|
case "end":
|
|
2963
|
-
return
|
|
3321
|
+
return _context56.stop();
|
|
2964
3322
|
}
|
|
2965
|
-
},
|
|
3323
|
+
}, _callee56);
|
|
2966
3324
|
}));
|
|
2967
3325
|
return function (_x5) {
|
|
2968
|
-
return
|
|
3326
|
+
return _ref66.apply(this, arguments);
|
|
2969
3327
|
};
|
|
2970
3328
|
}());
|
|
2971
3329
|
jest.runAllTimers();
|
|
2972
3330
|
call.doHoldResume();
|
|
2973
|
-
|
|
3331
|
+
_context57.next = 1;
|
|
2974
3332
|
return (0, _testUtil.flushPromises)(2);
|
|
2975
3333
|
case 1:
|
|
2976
3334
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2983,11 +3341,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2983
3341
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2984
3342
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2985
3343
|
roapEvent.data.type = 'ANSWER';
|
|
2986
|
-
|
|
3344
|
+
_context57.next = 2;
|
|
2987
3345
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2988
3346
|
case 2:
|
|
2989
3347
|
roapEvent.data.type = 'OK';
|
|
2990
|
-
|
|
3348
|
+
_context57.next = 3;
|
|
2991
3349
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2992
3350
|
case 3:
|
|
2993
3351
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2999,14 +3357,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2999
3357
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3000
3358
|
case 4:
|
|
3001
3359
|
case "end":
|
|
3002
|
-
return
|
|
3360
|
+
return _context57.stop();
|
|
3003
3361
|
}
|
|
3004
|
-
},
|
|
3362
|
+
}, _callee57);
|
|
3005
3363
|
})));
|
|
3006
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3364
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59() {
|
|
3007
3365
|
var responsePayload, warnSpy, roapEvent;
|
|
3008
|
-
return _regenerator.default.wrap(function (
|
|
3009
|
-
while (1) switch (
|
|
3366
|
+
return _regenerator.default.wrap(function (_context59) {
|
|
3367
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
3010
3368
|
case 0:
|
|
3011
3369
|
expect.assertions(7);
|
|
3012
3370
|
responsePayload = {
|
|
@@ -3019,25 +3377,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3019
3377
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3020
3378
|
call['held'] = true;
|
|
3021
3379
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3022
|
-
var
|
|
3023
|
-
return _regenerator.default.wrap(function (
|
|
3024
|
-
while (1) switch (
|
|
3380
|
+
var _ref68 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58(correlationId) {
|
|
3381
|
+
return _regenerator.default.wrap(function (_context58) {
|
|
3382
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
3025
3383
|
case 0:
|
|
3026
3384
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3027
3385
|
case 1:
|
|
3028
3386
|
case "end":
|
|
3029
|
-
return
|
|
3387
|
+
return _context58.stop();
|
|
3030
3388
|
}
|
|
3031
|
-
},
|
|
3389
|
+
}, _callee58);
|
|
3032
3390
|
}));
|
|
3033
3391
|
return function (_x6) {
|
|
3034
|
-
return
|
|
3392
|
+
return _ref68.apply(this, arguments);
|
|
3035
3393
|
};
|
|
3036
3394
|
}());
|
|
3037
|
-
|
|
3395
|
+
_context59.next = 1;
|
|
3038
3396
|
return call.doHoldResume();
|
|
3039
3397
|
case 1:
|
|
3040
|
-
|
|
3398
|
+
_context59.next = 2;
|
|
3041
3399
|
return (0, _testUtil.flushPromises)(2);
|
|
3042
3400
|
case 2:
|
|
3043
3401
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3053,11 +3411,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3053
3411
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3054
3412
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3055
3413
|
roapEvent.data.type = 'ANSWER';
|
|
3056
|
-
|
|
3414
|
+
_context59.next = 3;
|
|
3057
3415
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3058
3416
|
case 3:
|
|
3059
3417
|
roapEvent.data.type = 'OK';
|
|
3060
|
-
|
|
3418
|
+
_context59.next = 4;
|
|
3061
3419
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3062
3420
|
case 4:
|
|
3063
3421
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3072,14 +3430,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3072
3430
|
});
|
|
3073
3431
|
case 5:
|
|
3074
3432
|
case "end":
|
|
3075
|
-
return
|
|
3433
|
+
return _context59.stop();
|
|
3076
3434
|
}
|
|
3077
|
-
},
|
|
3435
|
+
}, _callee59);
|
|
3078
3436
|
})));
|
|
3079
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3437
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61() {
|
|
3080
3438
|
var responsePayload, warnSpy, roapEvent;
|
|
3081
|
-
return _regenerator.default.wrap(function (
|
|
3082
|
-
while (1) switch (
|
|
3439
|
+
return _regenerator.default.wrap(function (_context61) {
|
|
3440
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
3083
3441
|
case 0:
|
|
3084
3442
|
expect.assertions(7);
|
|
3085
3443
|
responsePayload = {
|
|
@@ -3092,26 +3450,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3092
3450
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3093
3451
|
call['held'] = true;
|
|
3094
3452
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3095
|
-
var
|
|
3096
|
-
return _regenerator.default.wrap(function (
|
|
3097
|
-
while (1) switch (
|
|
3453
|
+
var _ref70 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60(correlationId) {
|
|
3454
|
+
return _regenerator.default.wrap(function (_context60) {
|
|
3455
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
3098
3456
|
case 0:
|
|
3099
3457
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3100
3458
|
case 1:
|
|
3101
3459
|
case "end":
|
|
3102
|
-
return
|
|
3460
|
+
return _context60.stop();
|
|
3103
3461
|
}
|
|
3104
|
-
},
|
|
3462
|
+
}, _callee60);
|
|
3105
3463
|
}));
|
|
3106
3464
|
return function (_x7) {
|
|
3107
|
-
return
|
|
3465
|
+
return _ref70.apply(this, arguments);
|
|
3108
3466
|
};
|
|
3109
3467
|
}());
|
|
3110
3468
|
call.doHoldResume();
|
|
3111
|
-
|
|
3469
|
+
_context61.next = 1;
|
|
3112
3470
|
return _promise.default.resolve();
|
|
3113
3471
|
case 1:
|
|
3114
|
-
|
|
3472
|
+
_context61.next = 2;
|
|
3115
3473
|
return _promise.default.resolve();
|
|
3116
3474
|
case 2:
|
|
3117
3475
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -3127,11 +3485,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3127
3485
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3128
3486
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3129
3487
|
roapEvent.data.type = 'ANSWER';
|
|
3130
|
-
|
|
3488
|
+
_context61.next = 3;
|
|
3131
3489
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3132
3490
|
case 3:
|
|
3133
3491
|
roapEvent.data.type = 'OK';
|
|
3134
|
-
|
|
3492
|
+
_context61.next = 4;
|
|
3135
3493
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3136
3494
|
case 4:
|
|
3137
3495
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -3146,14 +3504,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3146
3504
|
});
|
|
3147
3505
|
case 5:
|
|
3148
3506
|
case "end":
|
|
3149
|
-
return
|
|
3507
|
+
return _context61.stop();
|
|
3150
3508
|
}
|
|
3151
|
-
},
|
|
3509
|
+
}, _callee61);
|
|
3152
3510
|
})));
|
|
3153
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3511
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
|
|
3154
3512
|
var responsePayload;
|
|
3155
|
-
return _regenerator.default.wrap(function (
|
|
3156
|
-
while (1) switch (
|
|
3513
|
+
return _regenerator.default.wrap(function (_context63) {
|
|
3514
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3157
3515
|
case 0:
|
|
3158
3516
|
expect.assertions(4);
|
|
3159
3517
|
responsePayload = {
|
|
@@ -3163,26 +3521,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3163
3521
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3164
3522
|
call['held'] = true;
|
|
3165
3523
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3166
|
-
var
|
|
3167
|
-
return _regenerator.default.wrap(function (
|
|
3168
|
-
while (1) switch (
|
|
3524
|
+
var _ref72 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(errObj) {
|
|
3525
|
+
return _regenerator.default.wrap(function (_context62) {
|
|
3526
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
3169
3527
|
case 0:
|
|
3170
3528
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3171
3529
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3172
3530
|
case 1:
|
|
3173
3531
|
case "end":
|
|
3174
|
-
return
|
|
3532
|
+
return _context62.stop();
|
|
3175
3533
|
}
|
|
3176
|
-
},
|
|
3534
|
+
}, _callee62);
|
|
3177
3535
|
}));
|
|
3178
3536
|
return function (_x8) {
|
|
3179
|
-
return
|
|
3537
|
+
return _ref72.apply(this, arguments);
|
|
3180
3538
|
};
|
|
3181
3539
|
}());
|
|
3182
|
-
|
|
3540
|
+
_context63.next = 1;
|
|
3183
3541
|
return call.doHoldResume();
|
|
3184
3542
|
case 1:
|
|
3185
|
-
|
|
3543
|
+
_context63.next = 2;
|
|
3186
3544
|
return (0, _testUtil.flushPromises)(2);
|
|
3187
3545
|
case 2:
|
|
3188
3546
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3193,14 +3551,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3193
3551
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3194
3552
|
case 3:
|
|
3195
3553
|
case "end":
|
|
3196
|
-
return
|
|
3554
|
+
return _context63.stop();
|
|
3197
3555
|
}
|
|
3198
|
-
},
|
|
3556
|
+
}, _callee63);
|
|
3199
3557
|
})));
|
|
3200
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3558
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65() {
|
|
3201
3559
|
var responsePayload, rejectPayload, roapEvent;
|
|
3202
|
-
return _regenerator.default.wrap(function (
|
|
3203
|
-
while (1) switch (
|
|
3560
|
+
return _regenerator.default.wrap(function (_context65) {
|
|
3561
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3204
3562
|
case 0:
|
|
3205
3563
|
expect.assertions(5);
|
|
3206
3564
|
responsePayload = {
|
|
@@ -3214,24 +3572,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3214
3572
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
3215
3573
|
call['held'] = true;
|
|
3216
3574
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3217
|
-
var
|
|
3218
|
-
return _regenerator.default.wrap(function (
|
|
3219
|
-
while (1) switch (
|
|
3575
|
+
var _ref74 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64(errObj) {
|
|
3576
|
+
return _regenerator.default.wrap(function (_context64) {
|
|
3577
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
3220
3578
|
case 0:
|
|
3221
3579
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3222
3580
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3223
3581
|
case 1:
|
|
3224
3582
|
case "end":
|
|
3225
|
-
return
|
|
3583
|
+
return _context64.stop();
|
|
3226
3584
|
}
|
|
3227
|
-
},
|
|
3585
|
+
}, _callee64);
|
|
3228
3586
|
}));
|
|
3229
3587
|
return function (_x9) {
|
|
3230
|
-
return
|
|
3588
|
+
return _ref74.apply(this, arguments);
|
|
3231
3589
|
};
|
|
3232
3590
|
}());
|
|
3233
3591
|
call.doHoldResume();
|
|
3234
|
-
|
|
3592
|
+
_context65.next = 1;
|
|
3235
3593
|
return (0, _testUtil.flushPromises)(2);
|
|
3236
3594
|
case 1:
|
|
3237
3595
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -3242,7 +3600,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3242
3600
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3243
3601
|
/* We are intentionally failing the ROAP ANSWER */
|
|
3244
3602
|
roapEvent.data.type = 'ANSWER';
|
|
3245
|
-
|
|
3603
|
+
_context65.next = 2;
|
|
3246
3604
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3247
3605
|
case 2:
|
|
3248
3606
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3250,14 +3608,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3250
3608
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3251
3609
|
case 3:
|
|
3252
3610
|
case "end":
|
|
3253
|
-
return
|
|
3611
|
+
return _context65.stop();
|
|
3254
3612
|
}
|
|
3255
|
-
},
|
|
3613
|
+
}, _callee65);
|
|
3256
3614
|
})));
|
|
3257
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3615
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67() {
|
|
3258
3616
|
var responsePayload, roapEvent;
|
|
3259
|
-
return _regenerator.default.wrap(function (
|
|
3260
|
-
while (1) switch (
|
|
3617
|
+
return _regenerator.default.wrap(function (_context67) {
|
|
3618
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3261
3619
|
case 0:
|
|
3262
3620
|
expect.assertions(5);
|
|
3263
3621
|
responsePayload = {
|
|
@@ -3267,24 +3625,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3267
3625
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
3268
3626
|
call['held'] = true;
|
|
3269
3627
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3270
|
-
var
|
|
3271
|
-
return _regenerator.default.wrap(function (
|
|
3272
|
-
while (1) switch (
|
|
3628
|
+
var _ref76 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66(errObj) {
|
|
3629
|
+
return _regenerator.default.wrap(function (_context66) {
|
|
3630
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3273
3631
|
case 0:
|
|
3274
3632
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3275
3633
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
3276
3634
|
case 1:
|
|
3277
3635
|
case "end":
|
|
3278
|
-
return
|
|
3636
|
+
return _context66.stop();
|
|
3279
3637
|
}
|
|
3280
|
-
},
|
|
3638
|
+
}, _callee66);
|
|
3281
3639
|
}));
|
|
3282
3640
|
return function (_x0) {
|
|
3283
|
-
return
|
|
3641
|
+
return _ref76.apply(this, arguments);
|
|
3284
3642
|
};
|
|
3285
3643
|
}());
|
|
3286
3644
|
call.doHoldResume();
|
|
3287
|
-
|
|
3645
|
+
_context67.next = 1;
|
|
3288
3646
|
return (0, _testUtil.flushPromises)(2);
|
|
3289
3647
|
case 1:
|
|
3290
3648
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -3297,11 +3655,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3297
3655
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3298
3656
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3299
3657
|
roapEvent.data.type = 'ANSWER';
|
|
3300
|
-
|
|
3658
|
+
_context67.next = 2;
|
|
3301
3659
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3302
3660
|
case 2:
|
|
3303
3661
|
roapEvent.data.type = 'OK';
|
|
3304
|
-
|
|
3662
|
+
_context67.next = 3;
|
|
3305
3663
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3306
3664
|
case 3:
|
|
3307
3665
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3311,9 +3669,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3311
3669
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3312
3670
|
case 4:
|
|
3313
3671
|
case "end":
|
|
3314
|
-
return
|
|
3672
|
+
return _context67.stop();
|
|
3315
3673
|
}
|
|
3316
|
-
},
|
|
3674
|
+
}, _callee67);
|
|
3317
3675
|
})));
|
|
3318
3676
|
});
|
|
3319
3677
|
describe('Call transfer tests', function () {
|
|
@@ -3346,10 +3704,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3346
3704
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
3347
3705
|
secondCall['held'] = false;
|
|
3348
3706
|
});
|
|
3349
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3707
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70() {
|
|
3350
3708
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3351
|
-
return _regenerator.default.wrap(function (
|
|
3352
|
-
while (1) switch (
|
|
3709
|
+
return _regenerator.default.wrap(function (_context70) {
|
|
3710
|
+
while (1) switch (_context70.prev = _context70.next) {
|
|
3353
3711
|
case 0:
|
|
3354
3712
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3355
3713
|
responsePayload = {
|
|
@@ -3361,41 +3719,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3361
3719
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3362
3720
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3363
3721
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3364
|
-
var
|
|
3365
|
-
return _regenerator.default.wrap(function (
|
|
3366
|
-
while (1) switch (
|
|
3722
|
+
var _ref78 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68(correlationId) {
|
|
3723
|
+
return _regenerator.default.wrap(function (_context68) {
|
|
3724
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
3367
3725
|
case 0:
|
|
3368
3726
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3369
3727
|
case 1:
|
|
3370
3728
|
case "end":
|
|
3371
|
-
return
|
|
3729
|
+
return _context68.stop();
|
|
3372
3730
|
}
|
|
3373
|
-
},
|
|
3731
|
+
}, _callee68);
|
|
3374
3732
|
}));
|
|
3375
3733
|
return function (_x1) {
|
|
3376
|
-
return
|
|
3734
|
+
return _ref78.apply(this, arguments);
|
|
3377
3735
|
};
|
|
3378
3736
|
}());
|
|
3379
3737
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3380
|
-
var
|
|
3381
|
-
return _regenerator.default.wrap(function (
|
|
3382
|
-
while (1) switch (
|
|
3738
|
+
var _ref79 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69(correlationId) {
|
|
3739
|
+
return _regenerator.default.wrap(function (_context69) {
|
|
3740
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
3383
3741
|
case 0:
|
|
3384
3742
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3385
3743
|
case 1:
|
|
3386
3744
|
case "end":
|
|
3387
|
-
return
|
|
3745
|
+
return _context69.stop();
|
|
3388
3746
|
}
|
|
3389
|
-
},
|
|
3747
|
+
}, _callee69);
|
|
3390
3748
|
}));
|
|
3391
3749
|
return function (_x10) {
|
|
3392
|
-
return
|
|
3750
|
+
return _ref79.apply(this, arguments);
|
|
3393
3751
|
};
|
|
3394
3752
|
}());
|
|
3395
|
-
|
|
3753
|
+
_context70.next = 1;
|
|
3396
3754
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3397
3755
|
case 1:
|
|
3398
|
-
|
|
3756
|
+
_context70.next = 2;
|
|
3399
3757
|
return (0, _testUtil.flushPromises)(2);
|
|
3400
3758
|
case 2:
|
|
3401
3759
|
expect(requestSpy).toBeCalled();
|
|
@@ -3418,14 +3776,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3418
3776
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3419
3777
|
case 3:
|
|
3420
3778
|
case "end":
|
|
3421
|
-
return
|
|
3779
|
+
return _context70.stop();
|
|
3422
3780
|
}
|
|
3423
|
-
},
|
|
3781
|
+
}, _callee70);
|
|
3424
3782
|
})));
|
|
3425
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3783
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
|
|
3426
3784
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3427
|
-
return _regenerator.default.wrap(function (
|
|
3428
|
-
while (1) switch (
|
|
3785
|
+
return _regenerator.default.wrap(function (_context72) {
|
|
3786
|
+
while (1) switch (_context72.prev = _context72.next) {
|
|
3429
3787
|
case 0:
|
|
3430
3788
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3431
3789
|
responsePayload = {
|
|
@@ -3437,25 +3795,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3437
3795
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3438
3796
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3439
3797
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3440
|
-
var
|
|
3441
|
-
return _regenerator.default.wrap(function (
|
|
3442
|
-
while (1) switch (
|
|
3798
|
+
var _ref81 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71(correlationId) {
|
|
3799
|
+
return _regenerator.default.wrap(function (_context71) {
|
|
3800
|
+
while (1) switch (_context71.prev = _context71.next) {
|
|
3443
3801
|
case 0:
|
|
3444
3802
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3445
3803
|
case 1:
|
|
3446
3804
|
case "end":
|
|
3447
|
-
return
|
|
3805
|
+
return _context71.stop();
|
|
3448
3806
|
}
|
|
3449
|
-
},
|
|
3807
|
+
}, _callee71);
|
|
3450
3808
|
}));
|
|
3451
3809
|
return function (_x11) {
|
|
3452
|
-
return
|
|
3810
|
+
return _ref81.apply(this, arguments);
|
|
3453
3811
|
};
|
|
3454
3812
|
}());
|
|
3455
|
-
|
|
3813
|
+
_context72.next = 1;
|
|
3456
3814
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3457
3815
|
case 1:
|
|
3458
|
-
|
|
3816
|
+
_context72.next = 2;
|
|
3459
3817
|
return (0, _testUtil.flushPromises)(2);
|
|
3460
3818
|
case 2:
|
|
3461
3819
|
expect(requestSpy).toBeCalled();
|
|
@@ -3474,14 +3832,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3474
3832
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3475
3833
|
case 3:
|
|
3476
3834
|
case "end":
|
|
3477
|
-
return
|
|
3835
|
+
return _context72.stop();
|
|
3478
3836
|
}
|
|
3479
|
-
},
|
|
3837
|
+
}, _callee72);
|
|
3480
3838
|
})));
|
|
3481
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3839
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
|
|
3482
3840
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3483
|
-
return _regenerator.default.wrap(function (
|
|
3484
|
-
while (1) switch (
|
|
3841
|
+
return _regenerator.default.wrap(function (_context73) {
|
|
3842
|
+
while (1) switch (_context73.prev = _context73.next) {
|
|
3485
3843
|
case 0:
|
|
3486
3844
|
responsePayload = {
|
|
3487
3845
|
statusCode: 403,
|
|
@@ -3492,10 +3850,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3492
3850
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3493
3851
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3494
3852
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3495
|
-
|
|
3853
|
+
_context73.next = 1;
|
|
3496
3854
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3497
3855
|
case 1:
|
|
3498
|
-
|
|
3856
|
+
_context73.next = 2;
|
|
3499
3857
|
return (0, _testUtil.flushPromises)(1);
|
|
3500
3858
|
case 2:
|
|
3501
3859
|
expect(requestSpy).toBeCalled();
|
|
@@ -3516,14 +3874,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3516
3874
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3517
3875
|
case 3:
|
|
3518
3876
|
case "end":
|
|
3519
|
-
return
|
|
3877
|
+
return _context73.stop();
|
|
3520
3878
|
}
|
|
3521
|
-
},
|
|
3879
|
+
}, _callee73);
|
|
3522
3880
|
})));
|
|
3523
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3881
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee74() {
|
|
3524
3882
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3525
|
-
return _regenerator.default.wrap(function (
|
|
3526
|
-
while (1) switch (
|
|
3883
|
+
return _regenerator.default.wrap(function (_context74) {
|
|
3884
|
+
while (1) switch (_context74.prev = _context74.next) {
|
|
3527
3885
|
case 0:
|
|
3528
3886
|
responsePayload = {
|
|
3529
3887
|
statusCode: 403,
|
|
@@ -3533,10 +3891,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3533
3891
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3534
3892
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3535
3893
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3536
|
-
|
|
3894
|
+
_context74.next = 1;
|
|
3537
3895
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3538
3896
|
case 1:
|
|
3539
|
-
|
|
3897
|
+
_context74.next = 2;
|
|
3540
3898
|
return (0, _testUtil.flushPromises)(2);
|
|
3541
3899
|
case 2:
|
|
3542
3900
|
expect(requestSpy).toBeCalled();
|
|
@@ -3557,18 +3915,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3557
3915
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3558
3916
|
case 3:
|
|
3559
3917
|
case "end":
|
|
3560
|
-
return
|
|
3918
|
+
return _context74.stop();
|
|
3561
3919
|
}
|
|
3562
|
-
},
|
|
3920
|
+
}, _callee74);
|
|
3563
3921
|
})));
|
|
3564
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3922
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee75() {
|
|
3565
3923
|
var requestSpy, warnSpy;
|
|
3566
|
-
return _regenerator.default.wrap(function (
|
|
3567
|
-
while (1) switch (
|
|
3924
|
+
return _regenerator.default.wrap(function (_context75) {
|
|
3925
|
+
while (1) switch (_context75.prev = _context75.next) {
|
|
3568
3926
|
case 0:
|
|
3569
3927
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3570
3928
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3571
|
-
|
|
3929
|
+
_context75.next = 1;
|
|
3572
3930
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3573
3931
|
case 1:
|
|
3574
3932
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3580,18 +3938,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3580
3938
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3581
3939
|
case 2:
|
|
3582
3940
|
case "end":
|
|
3583
|
-
return
|
|
3941
|
+
return _context75.stop();
|
|
3584
3942
|
}
|
|
3585
|
-
},
|
|
3943
|
+
}, _callee75);
|
|
3586
3944
|
})));
|
|
3587
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3945
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee76() {
|
|
3588
3946
|
var requestSpy, warnSpy;
|
|
3589
|
-
return _regenerator.default.wrap(function (
|
|
3590
|
-
while (1) switch (
|
|
3947
|
+
return _regenerator.default.wrap(function (_context76) {
|
|
3948
|
+
while (1) switch (_context76.prev = _context76.next) {
|
|
3591
3949
|
case 0:
|
|
3592
3950
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3593
3951
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3594
|
-
|
|
3952
|
+
_context76.next = 1;
|
|
3595
3953
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3596
3954
|
case 1:
|
|
3597
3955
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3603,9 +3961,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3603
3961
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3604
3962
|
case 2:
|
|
3605
3963
|
case "end":
|
|
3606
|
-
return
|
|
3964
|
+
return _context76.stop();
|
|
3607
3965
|
}
|
|
3608
|
-
},
|
|
3966
|
+
}, _callee76);
|
|
3609
3967
|
})));
|
|
3610
3968
|
});
|
|
3611
3969
|
});
|